Skip to content

Commit

Permalink
refactor(package): Migrate from npm to Yarn (#289)
Browse files Browse the repository at this point in the history
* refactor(package): Migrate from npm to Yarn (#289)

Use https://github.com/imsnif/synp to generate yarn.lock from
package-lock.json. Fix node_modules paths. Update Travis config
and project docs to use Yarn.

Fix #215

* Address review comments

* Update README

* Update README on adding dependency via npm

* Update npm references & improve Travis config
  • Loading branch information
vojtechszocs authored and priley86 committed Apr 12, 2018
1 parent dd9ff71 commit 332aace
Show file tree
Hide file tree
Showing 9 changed files with 11,177 additions and 21,139 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
node_modules
npm-debug.log
dist
.out
.DS_Store
coverage

# package managers
yarn-error.log

# IDEs and editors
/.idea
.project
Expand Down
15 changes: 4 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: node_js
sudo: required
cache:
directories:
- node_modules
cache: yarn
env:
global:
- ENCRYPTION_LABEL: "b601314e09dc"
Expand All @@ -12,16 +10,11 @@ env:
- TRIGGER_REPO_BRANCH: "master"
notifications:
email: false
node_js:
- '8'
- '6'
before_script:
- npm prune
script:
- npm run test
- npm run coveralls
- yarn test
- yarn coveralls
after_success:
- npm run travis-deploy-once "npm run semantic-release"
- yarn travis-deploy-once "yarn semantic-release"
- ./release.sh
branches:
except:
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ when possible and accept [props](https://facebook.github.io/react/docs/component
* Provide a [jest snapshot test](https://facebook.github.io/jest/docs/snapshot-testing.html) to ensure your UI markup does not change unexpectedly.
* Ensure the component's rendered design and Storybook stories meet [PatternFly design standard](https://github.com/patternfly/patternfly-design).
**Note:** If your component does not yet have PatternFly design documentation, the PatternFly React design team will first confirm that the pattern passes the [PatternFly Decision Tree](https://github.com/patternfly/patternfly-design/blob/master/resources/decision-tree/PatternflyDecisionTree.pdf) and then start the process for generating design documentation.
* Ensure the code is properly formatted and there are no linting errors. PatternFly React uses custom eslint configuration based on [Javascript Standard Style](https://standardjs.com/) and [Prettier](https://github.com/prettier/prettier) for code formatting. You can automatically format your code with `npm run prettier` and run the project's linter with `npm run lint`.
* Ensure the code is properly formatted and there are no linting errors. PatternFly React uses custom eslint configuration based on [Javascript Standard Style](https://standardjs.com/) and [Prettier](https://github.com/prettier/prettier) for code formatting. You can automatically format your code with `yarn prettier` and run the project's linter with `yarn lint`.

### Code Consistency

Expand Down Expand Up @@ -178,11 +178,11 @@ Adhering to the following process is the best way to get your work included in t
3. Develop your component. After development is complete, ensure tests and lint standards pass.

```text
$ npm run test
$ yarn test
```
Ensure no lint errors are introduced in `npm-debug.log` after running this command.
Ensure no lint errors are introduced in `yarn-error.log` after running this command.

4. Add a commit using `npm run commit`:
4. Add a commit using `yarn commit`:

This project uses [`semantic-release`](https://npmjs.com/package/semantic-release) to do automatic releases and generate a changelog based on the commit history. So we follow [a convention][3] for commit messages. Please follow this convention for your commit messages.

Expand All @@ -192,7 +192,7 @@ Once you are ready to commit the changes, please use the below commands:

```text
$ git add <files to be committed>
$ npm run commit
$ yarn commit
```
... and follow the instruction of the interactive prompt.

Expand All @@ -216,8 +216,8 @@ Use `git rebase` (not `git merge`) to sync your work from time to time. Ensure a
Lastly, you'll want to export Storybook in your fork and note the Storybook url generated.

```text
$ npm run storybook:build
$ npm run storybook:deploy
$ yarn storybook:build
$ yarn storybook:deploy
```

8. Create a Pull Request
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ This project will provide a set of React UI components for the [PatternFly proje

## Getting Started

First, add `patternfly-react` dependency to your project. If you use Yarn:

```
yarn add patternfly-react
```

Alternatively, if you use npm:

```
npm install --save patternfly-react
```
Expand Down Expand Up @@ -41,30 +49,30 @@ This project uses [React Storybook](https://storybook.js.org/) to test and demo
How to use Storybook locally:

```
npm i
npm start
yarn install
yarn start
```

How to deploy storybook to github pages in your fork:

```
npm run storybook:build
npm run storybook:deploy
yarn storybook:build
yarn storybook:deploy
```

To deploy Storybook to a remote other than `origin`, pass a `--remote` flag to `npm run storybook:deploy`.
To deploy Storybook to a remote other than `origin`, pass a `--remote` flag to `yarn storybook:deploy`.
For example, to deploy to your `upstream` remote:

```
npm run storybook:deploy -- --remote=upstream
yarn storybook:deploy --remote=upstream
```

To deploy Storybook to a target branch and serve with rawgit instead of gh-pages, pass `--branch` flag to `npm run storybook:deploy`. This will create a new branch to serve your Storybook (and will be useful if you have multiple open pull requests).
To deploy Storybook to a target branch and serve with rawgit instead of gh-pages, pass `--branch` flag to `yarn storybook:deploy`. This will create a new branch to serve your Storybook (and will be useful if you have multiple open pull requests).

For example, say you have `feature-branch`, you can deploy the storybook to a rawgit branch with:

```
npm run storybook:deploy -- --branch=feature-branch-storybook
yarn storybook:deploy --branch=feature-branch-storybook
```

## Meeting Notes
Expand Down
Loading

0 comments on commit 332aace

Please sign in to comment.