This repository has been archived by the owner on Aug 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Migrate to yarn #4335
Merged
Merged
Migrate to yarn #4335
Changes from 17 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9dc208b
create yarn.lock using yarn import
485864f
update enforceVersions to use yarn
d08739f
update package.json to use yarn commands
0cb864b
update github actions to use yarn
2d3af33
update Talos to use yarn
5a85f13
update yeoman to use yarn
91bebbd
update docs to use yarn
ac129af
yarn import to generate yarn.lock and rm package-lock.json
d453b96
update lerna config
5d4267f
prevent npm installs. add doc on installing and using yarn
a70d37a
update shell scripts to use yarn
a2d88d1
update talos to use yarn
2494599
update readme.md
33c5e21
replace .npmrc with .yarnrc
089422c
use correct yarn flag --no-lockfile in lerna.json
a0105b5
fix preinstall script
f69057d
ignore console.log warning
a335bd9
remove `run` from yarn commands
3382082
fix package bumping script
f5b223d
Merge branch 'latest' into migrate-to-yarn
7b09314
Merge branch 'latest' into migrate-to-yarn
1db5299
Bump package versions
1764d24
Update changelogs
aeb8c63
use yarn in storybook preview action
01ce099
add yarn ci script to remove invalid transitive dependencies before n…
b89a06b
merge latest
4219f11
Merge branch 'latest' into migrate-to-yarn
31d0e9a
fix ci:packages script which uses lerne exec
43f54bd
fix ci:packages not installing packages
39f2e0f
fix bumpPackages unit test
94ca300
install all packages in storybook-preview GH action
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
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 |
---|---|---|
|
@@ -18,8 +18,8 @@ jobs: | |
|
||
- name: Install Node Modules and Build | ||
run: | | ||
npm run ci:packages | ||
npm run build:storybook | ||
yarn run ci:packages | ||
yarn run build:storybook | ||
git config --global user.name "simorgh-bbc" | ||
git config --global user.email "[email protected]" | ||
|
||
|
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 |
---|---|---|
|
@@ -22,10 +22,10 @@ jobs: | |
scope: '@bbc' | ||
|
||
- name: Install Node Modules | ||
run: npm run ci:packages | ||
run: yarn run ci:packages | ||
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. It's small and doesn't make much different but I think with yarn you can also remove the Not crucial to this work though. 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. Removed |
||
|
||
- name: Publish to NPM | ||
run: npm run publish | ||
run: yarn run publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
version=1.22.10 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,44 +42,52 @@ NB there is further documentation colocated with relevant packages and code. The | |
git clone [email protected]:bbc/psammead.git | ||
``` | ||
|
||
#### Install Yarn | ||
|
||
The Psammead project uses Yarn for package management. It is recommended to install Yarn through the npm package manager, which comes bundled with Node.js when you install it on your system. To install Yarn, run this command: | ||
|
||
``` | ||
npm install --global yarn | ||
``` | ||
|
||
### :hammer: Setup Local Environment | ||
|
||
``` | ||
cd psammead && npm run install:packages | ||
cd psammead && yarn run install:packages | ||
``` | ||
|
||
N.B. When merging branches, the `npm run install:packages` command should be favoured over `npm install`. [More details available here](https://github.com/bbc/psammead/pull/264). | ||
N.B. When merging branches, the `yarn run install:packages` command should be favoured over `yarn install`. [More details available here](https://github.com/bbc/psammead/pull/264). | ||
|
||
### :runner: Run tests | ||
|
||
Install dependencies locked to `package-lock.json`: | ||
Install dependencies locked to `yarn.lock`: | ||
|
||
``` | ||
npm run ci:packages | ||
yarn run ci:packages | ||
``` | ||
|
||
(NB: You can't reliably run the jest tests when the packages are linked locally, as they may have been linked across breaking changes. Running `npm run ci:packages` resets all links. To update snapshots within unit tests, run `npm run test:unit -- -u`.) | ||
(NB: You can't reliably run the jest tests when the packages are linked locally, as they may have been linked across breaking changes. Running `yarn run ci:packages` resets all links. To update snapshots within unit tests, run `yarn run test:unit -- -u`.) | ||
|
||
Run the component tests: | ||
|
||
``` | ||
npm test | ||
yarn test | ||
``` | ||
|
||
This runs Jest across any packages matching this glob pattern: `packages/components/**/*.test.jsx`. It also runs each package's `npm test` command if it is defined | ||
This runs Jest across any packages matching this glob pattern: `packages/components/**/*.test.jsx`. It also runs each package's `yarn test` command if it is defined | ||
|
||
### :runner: Run Storybook | ||
|
||
``` | ||
npm run storybook | ||
yarn run storybook | ||
``` | ||
|
||
NB, we've defined global styles (normalize, box-sizing, Reith font) in the [Storybook config](https://github.com/bbc/psammead/blob/latest/.storybook/config.js) so that components render as expected. | ||
|
||
### :construction_worker: Build Packages/Components | ||
|
||
``` | ||
npm run build | ||
yarn run build | ||
``` | ||
|
||
### :computer: Developing with Psammead | ||
|
@@ -158,7 +166,7 @@ The access value is [restricted by NPM](https://docs.npmjs.com/misc/config#acces | |
The Psammead Storybook is hosted on GitHub pages at http://bbc.github.io/psammead. It is currently deployed via a local script that builds Storybook to the `gh-pages` git branch which is used by GitHub pages. | ||
|
||
``` | ||
npm run deploy-storybook | ||
yarn run deploy-storybook | ||
``` | ||
|
||
NB, this automatically pushes to the 'gh-pages' branch, which deploys to the live GitHub pages site. Please only run this script on the `latest` branch. | ||
|
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
{ | ||
"npmClient": "yarn", | ||
"command": { | ||
"bootstrap": { | ||
"npmClientArgs": ["--no-package-lock"] | ||
"npmClientArgs": ["--no-lockfile"] | ||
} | ||
}, | ||
"packages": [ | ||
"packages/*/*" | ||
], | ||
"packages": ["packages/*/*"], | ||
"version": "independent" | ||
} |
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.
Looks like the SetupNode GH action comes preinstalled with yarn! Nice 👍