-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn workspaces #1810
Merged
Merged
Yarn workspaces #1810
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4d10a55
Introduce yarn workspaces
Hypnosphi adb20c6
Add export PATH
Hypnosphi dc0bd90
Merge remote-tracking branch 'upstream/release/3.3' into yarn-workspaces
Hypnosphi 2486947
update lockfile
Hypnosphi b4d9ee0
add BASH_ENV
Hypnosphi d22f209
add BASH_ENV
Hypnosphi cd7472a
CI: Temporarily disable all steps but lint
Hypnosphi 51363c2
Enable all the steps back, extract environment into defaults
Hypnosphi 78a42a8
Use --cwd flag for bootstrapping docs
Hypnosphi 2308e98
Use yarn scripts where possible, omitting extra `--` because now we can
Hypnosphi fee27b5
Update documentation
Hypnosphi 6d37521
Fix lerna.json
Hypnosphi d846b0c
Merge branch 'release/3.3' into yarn-workspaces
Hypnosphi 5d8e07e
CI: Remove "Install root dependencies" phase where possible, as it's …
Hypnosphi 75b0076
Merge branch 'release/3.3' into yarn-workspaces
Hypnosphi 181878d
CI: use yarn nightly in docs task
Hypnosphi cc9ab25
Merge branch 'release/3.3' into yarn-workspaces
Hypnosphi 5382fcb
IMPROVE yarn workspaces setup
ndelangen 8df6f4d
CHANGE package.json.engines
ndelangen fe9ee4e
CI: use latest yarn instead of nightly. Cache all the dependencies to…
Hypnosphi 38011e8
CI: bring back install phase, as it's needed for bootstrap script
Hypnosphi f343861
bootstrap: use `yarn install` directly
Hypnosphi f3046d5
CI: bootstrap --core isn't needed for react-native examples, `npm pac…
Hypnosphi 824bbd6
Replace the deprecated `prepublish` script with `prepare`
Hypnosphi 11298bf
Revert "CI: bootstrap --core isn't needed for react-native examples, …
Hypnosphi 088c5f8
Merge branch 'release/3.3' into yarn-workspaces
Hypnosphi bd31e8b
Merge remote-tracking branch 'upstream/release/3.3' into yarn-workspaces
Hypnosphi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,48 +2,38 @@ defaults: &defaults | |
working_directory: /tmp/storybook | ||
docker: | ||
- image: node:8 | ||
environment: | ||
BASH_ENV: ~/.bashrc | ||
|
||
version: 2 | ||
dependencies: | ||
pre: | ||
- yarn global add npm | ||
jobs: | ||
validate: | ||
<<: *defaults | ||
steps: | ||
- run: | ||
name: "Checking Versions" | ||
command: | | ||
node --version | ||
npm --version | ||
yarn --version | ||
build: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- root-dependencies-{{ checksum "package.json" }} | ||
- root-dependencies- | ||
- dependencies-{{ checksum "yarn.lock" }} | ||
- dependencies- | ||
- run: | ||
name: "Install latest yarn version" | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s | ||
- run: | ||
name: "Install root dependencies" | ||
name: "Install dependencies" | ||
command: | | ||
yarn install | ||
- save_cache: | ||
key: root-dependencies-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
- restore_cache: | ||
keys: | ||
- package-dependencies-{{ checksum "package.json" }} | ||
- package-dependencies- | ||
- run: | ||
name: "Bootstrapping" | ||
command: | | ||
yarn bootstrap -- --all | ||
yarn bootstrap --core --docs --reactnative --reactnativeapp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was wrong with |
||
- save_cache: | ||
key: package-dependencies-{{ checksum "package.json" }} | ||
key: dependencies-{{ checksum "yarn.lock" }} | ||
paths: | ||
- node_modules | ||
- app/**/node_modules | ||
- docs/**/node_modules | ||
- examples/**/node_modules | ||
|
@@ -54,70 +44,82 @@ jobs: | |
- checkout | ||
- restore_cache: | ||
keys: | ||
- root-dependencies-{{ checksum "package.json" }} | ||
- root-dependencies- | ||
- dependencies-{{ checksum "yarn.lock" }} | ||
- dependencies- | ||
- run: | ||
name: "Install latest yarn version" | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s | ||
- run: | ||
name: "Install root dependencies" | ||
name: "Install dependencies" | ||
command: | | ||
yarn install | ||
- run: | ||
name: "Bootstrapping" | ||
command: | | ||
yarn bootstrap -- --core | ||
yarn bootstrap --core | ||
- run: | ||
name: "Build react kitchen-sink" | ||
command: | | ||
cd examples/cra-kitchen-sink | ||
yarn build-storybook | ||
yarn storybook -- --smoke-test | ||
yarn storybook --smoke-test | ||
- run: | ||
name: "Build vue kitchen-sink" | ||
command: | | ||
cd examples/vue-kitchen-sink | ||
yarn build-storybook | ||
yarn storybook -- --smoke-test | ||
yarn storybook --smoke-test | ||
example-react-native: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- root-dependencies-{{ checksum "package.json" }} | ||
- root-dependencies- | ||
- dependencies-{{ checksum "yarn.lock" }} | ||
- dependencies- | ||
- run: | ||
name: "Install root dependencies" | ||
name: "Install latest yarn version" | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s | ||
- run: | ||
name: "Install dependencies" | ||
command: | | ||
yarn install | ||
- run: | ||
name: "Bootstrapping packages" | ||
command: | | ||
yarn bootstrap -- --core --reactnative --reactnativeapp | ||
yarn bootstrap --core --reactnative --reactnativeapp | ||
- run: | ||
name: "Running React-Native example" | ||
command: | | ||
cd examples/react-native-vanilla | ||
yarn storybook -- --smoke-test | ||
yarn storybook --smoke-test | ||
- run: | ||
name: "Running React-Native-App example" | ||
command: | | ||
cd examples/crna-kitchen-sink | ||
yarn storybook -- --smoke-test | ||
yarn storybook --smoke-test | ||
docs: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- root-dependencies-{{ checksum "package.json" }} | ||
- root-dependencies- | ||
- dependencies-{{ checksum "yarn.lock" }} | ||
- dependencies- | ||
- run: | ||
name: "Install root dependencies" | ||
name: "Install latest yarn version" | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s | ||
- run: | ||
name: "Install dependencies" | ||
command: | | ||
yarn install | ||
- run: | ||
name: "Bootstrapping" | ||
command: | | ||
yarn bootstrap -- --docs | ||
yarn bootstrap --docs | ||
- run: | ||
name: "Running docs" | ||
command: | | ||
|
@@ -128,10 +130,14 @@ jobs: | |
- checkout | ||
- restore_cache: | ||
keys: | ||
- root-dependencies-{{ checksum "package.json" }} | ||
- root-dependencies- | ||
- dependencies-{{ checksum "yarn.lock" }} | ||
- dependencies- | ||
- run: | ||
name: "Install latest yarn version" | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s | ||
- run: | ||
name: "Install root dependencies" | ||
name: "Install dependencies" | ||
command: | | ||
yarn install | ||
- run: | ||
|
@@ -144,20 +150,24 @@ jobs: | |
- checkout | ||
- restore_cache: | ||
keys: | ||
- root-dependencies-{{ checksum "package.json" }} | ||
- root-dependencies- | ||
- dependencies-{{ checksum "yarn.lock" }} | ||
- dependencies- | ||
- run: | ||
name: "Install latest yarn version" | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s | ||
- run: | ||
name: "Install root dependencies" | ||
name: "Install dependencies" | ||
command: | | ||
yarn install | ||
- run: | ||
name: "Bootstrapping" | ||
command: | | ||
yarn bootstrap -- --core --reactnative | ||
yarn bootstrap --core --reactnative | ||
- run: | ||
name: "Unit testing" | ||
command: | | ||
yarn test -- --all --coverage --runInBand | ||
yarn test --all --coverage --runInBand | ||
yarn coverage | ||
deploy: | ||
<<: *defaults | ||
|
@@ -170,7 +180,6 @@ workflows: | |
version: 2 | ||
build_accept_deploy: | ||
jobs: | ||
- validate | ||
- build | ||
- example-kitchen-sinks | ||
- example-react-native | ||
|
@@ -182,4 +191,4 @@ workflows: | |
# requires: | ||
# - lint | ||
# - unit-test | ||
# - docs | ||
# - docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ Thanks for your interest in improving Storybook! We are a community-driven proje | |
|
||
Please review this document to help to streamline the process and save everyone's precious time. | ||
|
||
This guide assumes you're using `yarn` as package manager. You may have some success using `npm` as well, but there are chances you'll get wrong versions of root dependencies in that case (we only commit `yarn.lock` to the repo). | ||
This repo uses yarn workspaces, so you should `[email protected]` or higher as package manager. See [installation guide](<>). | ||
|
||
## Issues | ||
|
||
|
@@ -35,7 +35,7 @@ The bootstrap command will ask which sections of the codebase you want to bootst | |
|
||
You can also pick directly from CLI: | ||
|
||
yarn bootstrap -- --core | ||
yarn bootstrap --core | ||
|
||
#### 2a. Run unit tests | ||
|
||
|
@@ -52,7 +52,7 @@ _Note that in order to run the tests fro ReactNative, you must have bootstrapped | |
You can also pick suites from CLI: | ||
|
||
```sh | ||
yarn test -- --core | ||
yarn test --core | ||
``` | ||
|
||
In order to run ALL unit tests, you must have bootstrapped the react-native | ||
|
@@ -224,7 +224,7 @@ git status | |
|
||
# clean out extra files & build all the packages | ||
# WARNING: destructive if you have extra files lying around! | ||
yarn bootstrap -- --reset --all | ||
yarn bootstrap --reset --all | ||
``` | ||
|
||
From here there are different procedures for prerelease (e.g. alpha/beta/rc) and proper release. | ||
|
@@ -235,7 +235,7 @@ From here there are different procedures for prerelease (e.g. alpha/beta/rc) and | |
|
||
```sh | ||
# publish and tag the release | ||
yarn run publish -- --concurrency 1 --npm-tag=alpha | ||
yarn run publish --concurrency 1 --npm-tag=alpha | ||
|
||
# push the tags | ||
git push --tags | ||
|
@@ -245,7 +245,7 @@ git push --tags | |
|
||
```sh | ||
# publish but don't commit to git | ||
yarn publish -- --concurrency 1 --skip-git | ||
yarn run publish --concurrency 1 --skip-git | ||
|
||
# Update `CHANGELOG.md` | ||
# - Edit PR titles/labels on github until output is good | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"author": "Muhammed Thanish <[email protected]>", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepublish": "node ../../scripts/prepublish.js" | ||
"prepare": "node ../../scripts/prepare.js" | ||
}, | ||
"dependencies": { | ||
"global": "^4.3.2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn version won't print the correct version anymore, This script isn't providing value really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe comment it instead? To reenable once docker image gets updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh, it's really not useful the info is in the logs anyway.