From 83a5fa13a51d8a1a67a46580a8c3548033eb2109 Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Sun, 17 Sep 2017 17:37:28 -0700 Subject: [PATCH] chore(yarn): replace npm with yarn --- .github/CONTRIBUTING.md | 36 ++++++++++++++++++---------------- .gitignore | 18 ++++++++--------- README.md | 8 ++++---- docs/app/Views/Usage.js | 6 +++--- examples/webpack1/.gitignore | 1 + examples/webpack1/package.json | 6 +++--- examples/webpack2/.gitignore | 1 + examples/webpack2/package.json | 6 +++--- package.json | 32 +++++++++++++++--------------- 9 files changed, 59 insertions(+), 55 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4ab9719fc6..f3294b3224 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -52,14 +52,16 @@ v6.2.1 ### Fork, Clone & Install -Start by [forking stardust][12] to your GitHub account. Then clone your fork and install dependencies: +Start by [forking Semantic UI React][12] to your GitHub account. Then clone your fork and install dependencies: ```sh git clone git@github.com:/Semantic-UI-React.git cd Semantic-UI-React -npm install +yarn ``` +>Note, we use `yarn` because `npm` has unfortunately become unreliable. Get it [here][16]. + Add our repo as a git remote so you can pull/rebase your fork with our latest updates: ``` @@ -72,25 +74,24 @@ Please follow the [Angular Git Commit Guidelines][8] format. ### Commands ->This list is not updated, you should run `npm run` to see all scripts. +>This list is not updated, you should run `yarn run` to see all scripts. ```sh -npm start // run doc site -npm run start:local-modules // run offline (slower builds) +yarn start // run doc site -npm test // test once -npm run test:watch // test on file change +yarn test // test once +yarn test:watch // test on file change -npm run build // build everything -npm run build:dist // build dist -npm run build:docs // build docs -npm run build:docs-toc // build toc for markdown files +yarn build // build everything +yarn build:dist // build dist +yarn build:docs // build docs +yarn build:docs-toc // build toc for markdown files -npm run deploy:docs // deploy gh-pages doc site +yarn deploy:docs // deploy gh-pages doc site -npm run lint // lint once -npm run lint:fix // lint and attempt to fix -npm run lint:watch // lint on file change +yarn lint // lint once +yarn lint:fix // lint and attempt to fix +yarn lint:watch // lint on file change ``` ## Workflow @@ -371,7 +372,7 @@ See [`src/factories`][13] for special methods to convert props values into React ## Testing -Run tests during development with `npm run test:watch` to re-run tests on file changes. +Run tests during development with `yarn test:watch` to re-run tests on file changes. ### Coverage @@ -494,7 +495,7 @@ Our docs are generated from doc block comments, `propTypes`, and hand written ex Developing against the doc site is a good way to try your component as you build it. Run the doc site with: ```sh -npm start +yarn start ``` ### Components @@ -571,3 +572,4 @@ Adding documentation for new components is a bit tedious. The best way to do th [13]: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/factories [14]: https://github.com/Semantic-Org/Semantic-UI-React/pull/335#issuecomment-238960895 [15]: https://github.com/Semantic-Org/Semantic-UI-React/issues/607 +[16]: https://yarnpkg.com/en/docs/getting-started diff --git a/.gitignore b/.gitignore index 964f8c52e7..b59358a20f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,13 @@ -npm-debug.log* -node_modules/ -bower_components/ -coverage/ -dist/ -docs/build/ -docs/app/docgenInfo.json -dll/ +*.log* +*.iml .DS_Store .idea/ +.yarn-cache/ -*.iml +coverage/ +dist/ +docs/app/docgenInfo.json +docs/build/ +dll/ +node_modules/ diff --git a/README.md b/README.md index 4aceaa4cde..7f1f4daf28 100644 --- a/README.md +++ b/README.md @@ -143,15 +143,15 @@ Any other issue labeled [`help wanted`][4] is ready for a PR. On the latest clean `master`: ```sh -npm run release:major -npm run release:minor -npm run release:patch +yarn release:major +yarn release:minor +yarn release:patch ``` Deploy the docs: ```sh -npm run deploy:docs +yarn deploy:docs ``` Update the changelog (requires [github_changelog_generator][15]): diff --git a/docs/app/Views/Usage.js b/docs/app/Views/Usage.js index c392ede89d..eda976524c 100644 --- a/docs/app/Views/Usage.js +++ b/docs/app/Views/Usage.js @@ -33,6 +33,7 @@ const Usage = () => ( The Semantic UI React package can be installed via NPM:

+
$ yarn add {pkg.name}
$ npm install {pkg.name} --save

@@ -131,9 +132,8 @@ const Usage = () => ( provided here.

-
-          $ npm install semantic-ui --save-dev
-        
+
$ yarn add semantic-ui --dev
+
$ npm install semantic-ui --save-dev

After building the project with Gulp, you'll need to include the minified CSS file diff --git a/examples/webpack1/.gitignore b/examples/webpack1/.gitignore index c2658d7d1b..bebc926b38 100644 --- a/examples/webpack1/.gitignore +++ b/examples/webpack1/.gitignore @@ -1 +1,2 @@ +.yarn-cache/ node_modules/ diff --git a/examples/webpack1/package.json b/examples/webpack1/package.json index 7c14578887..970c311055 100644 --- a/examples/webpack1/package.json +++ b/examples/webpack1/package.json @@ -4,10 +4,10 @@ "description": "Get started with Semantic UI React and Webpack 1", "main": "index.js", "scripts": { - "analyze": "cross-env ANALYZE_ENV=true npm run build", - "analyze:production": "cross-env ANALYZE_ENV=true npm run build:production", + "analyze": "cross-env ANALYZE_ENV=true yarn build", + "analyze:production": "cross-env ANALYZE_ENV=true yarn build:production", "build": "webpack", - "build:production": "cross-env NODE_ENV=production npm run build" + "build:production": "cross-env NODE_ENV=production yarn build" }, "author": "Alexander Fedyashov ", "license": "MIT", diff --git a/examples/webpack2/.gitignore b/examples/webpack2/.gitignore index c2658d7d1b..bebc926b38 100644 --- a/examples/webpack2/.gitignore +++ b/examples/webpack2/.gitignore @@ -1 +1,2 @@ +.yarn-cache/ node_modules/ diff --git a/examples/webpack2/package.json b/examples/webpack2/package.json index 7fc298dafc..3afdc3dbd1 100644 --- a/examples/webpack2/package.json +++ b/examples/webpack2/package.json @@ -4,10 +4,10 @@ "description": "Get started with Semantic UI React and Webpack 2", "main": "index.js", "scripts": { - "analyze": "cross-env ANALYZE_ENV=true npm run build", - "analyze:production": "cross-env ANALYZE_ENV=true npm run build:production", + "analyze": "cross-env ANALYZE_ENV=true yarn build", + "analyze:production": "cross-env ANALYZE_ENV=true yarn build:production", "build": "webpack", - "build:production": "cross-env NODE_ENV=production npm run build" + "build:production": "cross-env NODE_ENV=production yarn build" }, "author": "Alexander Fedyashov ", "license": "MIT", diff --git a/package.json b/package.json index 5127b8b13e..481480ac1c 100644 --- a/package.json +++ b/package.json @@ -12,36 +12,36 @@ ], "scripts": { "docs": "gulp docs", - "build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:docs", + "build": "yarn build:commonjs && yarn build:es && yarn build:umd && yarn build:docs", "prebuild:commonjs": "rimraf dist/commonjs", - "build:commonjs": "cross-env NODE_ENV=build babel src -d dist/commonjs && npm run tsd", + "build:commonjs": "cross-env NODE_ENV=build babel src -d dist/commonjs && yarn tsd", "prebuild:es": "rimraf dist/es", "build:es": "cross-env NODE_ENV=build-es babel src -d dist/es", - "prebuild:docs": "npm run build:docs-toc", + "prebuild:docs": "yarn build:docs-toc", "build:dll": "gulp dll", "build:docs": "gulp build:docs", "build:umd": "cross-env NODE_ENV=build gulp umd", "build:docs-toc": "doctoc ./.github/CONTRIBUTING.md --github --maxlevel 4", "build:docs-cname": "echo react.semantic-ui.com > docs/build/CNAME", - "predeploy:docs": "cross-env NODE_ENV=production npm run build:docs && npm run build:docs-cname", + "predeploy:docs": "cross-env NODE_ENV=production yarn build:docs && yarn build:docs-cname", "deploy:docs": "gh-pages -d docs/build -m 'deploy docs [ci skip]'", "lint": "cross-env NODE_ENV=production eslint .", - "lint:fix": "npm run lint -- --fix", - "prerelease": "npm run lint -s && npm run tsd:lint -s && npm test -s && cross-env NODE_ENV=production npm run build", - "postrelease": "NODE_ENV=production npm run deploy:docs", - "release:major": "npm run prerelease && ta-script npm/release.sh major", - "release:minor": "npm run prerelease && ta-script npm/release.sh minor", - "release:patch": "npm run prerelease && ta-script npm/release.sh patch", - "prestart": "npm run satisfied -s -- --fix", - "start": "npm run docs", + "lint:fix": "yarn lint -- --fix", + "prerelease": "yarn lint && yarn tsd:lint && npm test && cross-env NODE_ENV=production yarn build", + "postrelease": "NODE_ENV=production yarn deploy:docs", + "release:major": "yarn prerelease && ta-script npm/release.sh major", + "release:minor": "yarn prerelease && ta-script npm/release.sh minor", + "release:patch": "yarn prerelease && ta-script npm/release.sh patch", + "prestart": "yarn satisfied -- --fix yarn", + "start": "yarn docs", "satisfied": "satisfied --skip-invalid", - "pretest": "npm run satisfied -s && npm run build:dll", + "pretest": "yarn satisfied && yarn build:dll", "test": "cross-env NODE_ENV=test node -r babel-register ./node_modules/karma/bin/karma start karma.conf.babel.js", - "test:watch": "npm run test --silent -- --no-single-run", + "test:watch": "yarn test -- --no-single-run", "tsd": "gulp tsd", "tsd:lint": "tslint './index.d.ts' './src/**/*.d.ts' './test/typings.d.ts'", - "tsd:lint:fix": "npm run -s tsd:lint -- --fix", - "tsd:test": "npm run tsd && tsc -p ./" + "tsd:lint:fix": "yarn tsd:lint -- --fix", + "tsd:test": "yarn tsd && tsc -p ./" }, "repository": { "type": "git",