Skip to content

Commit

Permalink
chore: move to Yarn 2 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetanmaisse committed Feb 16, 2021
1 parent f1a1bf9 commit 0ca580c
Show file tree
Hide file tree
Showing 21 changed files with 47,471 additions and 34,615 deletions.
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ jobs:
- restore_cache:
name: Restore Yarn cache
keys:
- build-yarn-cache-v4--{{ checksum "yarn.lock" }}
- build-yarn-2-cache-v1--{{ checksum "yarn.lock" }}
- run:
name: Install dependencies
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
command: yarn install --immutable
- run:
name: Bootstrap
command: yarn bootstrap --core
- save_cache:
name: Save Yarn cache
key: build-yarn-cache-v4--{{ checksum "yarn.lock" }}
key: build-yarn-2-cache-v1--{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- ~/.yarn/berry/cache
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -195,16 +195,16 @@ jobs:
command: yarn wait-on http://localhost:6000
- run:
name: set registry
command: yarn config set registry http://localhost:6000/
command: yarn config set npmRegistryServer http://localhost:6000/
- run:
name: test local registry
command: yarn info @storybook/core
command: yarn npm info @storybook/core
- run:
name: Install Cypress binary
command: yarn cypress install
- run:
name: run e2e tests
command: yarn test:e2e-framework --skip preact
command: yarn test:e2e-framework --clean --skip preact
- store_artifacts:
path: /tmp/storybook/cypress
destination: cypress
Expand Down Expand Up @@ -237,10 +237,10 @@ jobs:
command: yarn wait-on http://localhost:6000
- run:
name: Set registry
command: yarn config set registry http://localhost:6000/
command: yarn config set npmRegistryServer http://localhost:6000/
- run:
name: Test local registry
command: yarn info @storybook/core
command: yarn npm info @storybook/core
- run:
name: Install Cypress binary
command: yarn cypress install
Expand Down Expand Up @@ -269,10 +269,10 @@ jobs:
command: yarn wait-on http://localhost:6000
- run:
name: Set registry
command: yarn config set registry http://localhost:6000/
command: yarn config set npmRegistryServer http://localhost:6000/
- run:
name: Test local registry
command: yarn info @storybook/core
command: yarn npm info @storybook/core
- run:
name: Install Cypress binary
command: yarn cypress install
Expand Down Expand Up @@ -301,10 +301,10 @@ jobs:
command: yarn wait-on http://localhost:6000
- run:
name: set registry
command: yarn config set registry http://localhost:6000/
command: yarn config set npmRegistryServer http://localhost:6000/
- run:
name: test local registry
command: yarn info @storybook/core
command: yarn npm info @storybook/core
- run:
name: Install Cypress binary
command: yarn cypress install
Expand Down Expand Up @@ -414,7 +414,7 @@ jobs:
clone_options: '--depth 1 --verbose'
- run:
name: Install dependencies
command: yarn bootstrap --install
command: yarn install --immutable
- run:
name: Trigger build
command: ./scripts/build-frontpage.js
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
uses: actions/cache@v2
with:
path: node_modules
key: build-v2-${{ hashFiles('**/yarn.lock') }}
key: yarn-2-cache-v1-${{ hashFiles('**/yarn.lock') }}
- name: install, bootstrap
run: |
yarn install --immutable
yarn bootstrap --core
- name: test
run: |
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ examples/ember-cli/ember-output
.verdaccio-cache
tsconfig.tsbuildinfo
examples/angular-cli/addon-jest.testresults.json

# Yarn stuff
/.yarn/*
!/.yarn/releases
!/.yarn/plugins
!/.yarn/sdks
!/.yarn/versions
/.pnp.*
55 changes: 55 additions & 0 deletions .yarn/releases/yarn-berry.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
yarnPath: .yarn/releases/yarn-berry.cjs
nodeLinker: node-modules

enableGlobalCache: true
compressionLevel: 0

npmRegistryServer: "https://registry.yarnpkg.com"
unsafeHttpWhitelist:
- localhost

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const runCompodoc = (inputPath: string) => {
// FIXME: for now, this requires a tsconfig.json for each test case. Tried generating
// one dynamically in tmpDir, but compodoc doesn't handle absolute paths properly
// (and screwed around with relative paths as well, but couldn't get it working)
spawnSync('compodoc', ['-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
spawnSync('yarn', ['compodoc', '-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
stdio: 'inherit',
});
const output = fs.readFileSync(`${tmpDir}/documentation.json`, 'utf8');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const inputRegExp = /^input\..*$/;
const runWebComponentsAnalyzer = (inputPath: string) => {
const { name: tmpDir, removeCallback } = tmp.dirSync();
const customElementsFile = `${tmpDir}/custom-elements.json`;
spawnSync('wca', ['analyze', inputPath, '--outFile', customElementsFile], {
spawnSync('yarn', ['wca', 'analyze', inputPath, '--outFile', customElementsFile], {
stdio: 'inherit',
});
const output = fs.readFileSync(customElementsFile, 'utf8');
Expand Down
7 changes: 3 additions & 4 deletions examples/angular-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"license": "MIT",
"scripts": {
"build": "ng build",
"prebuild-storybook": "yarn storybook:prebuild",
"build-storybook": "build-storybook -s src/assets",
"build-storybook": "yarn storybook-prebuild && build-storybook -s src/assets",
"docs:json": "compodoc -p ./tsconfig.json -e json -d .",
"e2e": "ng e2e",
"ng": "ng",
"start": "ng serve",
"storybook": "yarn storybook:prebuild && start-storybook -p 9008 -s src/assets",
"storybook:prebuild": "yarn test:generate-output && yarn docs:json",
"storybook": "yarn storybook-prebuild && start-storybook -p 9008 -s src/assets",
"storybook-prebuild": "yarn test:generate-output && yarn docs:json",
"test": "jest",
"test:coverage": "jest --coverage",
"test:generate-output": "jest --json --config=jest.addon-config.js --outputFile=addon-jest.testresults.json || true",
Expand Down
2 changes: 1 addition & 1 deletion examples/ember-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "ember build --output-path ember-output",
"prebuild-storybook": "yarn build && shx cp -r public/* ember-output",
"build-storybook": "build-storybook -s ember-output",
"build-storybook": "yarn prebuild-storybook && build-storybook -s ember-output",
"dev": "ember serve",
"storybook": "yarn build && start-storybook -p 9009 -s ember-output",
"storybook:dev": "yarn dev & start-storybook -p 9009 -s ember-output"
Expand Down
4 changes: 1 addition & 3 deletions lib/cli-sb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"directory": "lib/cli"
},
"license": "MIT",
"bin": {
"sb": "./index.js"
},
"bin": "./index.js",
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
Expand Down
4 changes: 2 additions & 2 deletions lib/core/src/server/__snapshots__/manager-dev
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
"NODE_MODULES/@babel/plugin-transform-template-literals/lib/index.js",
Expand Down Expand Up @@ -144,7 +144,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
],
Expand Down
4 changes: 2 additions & 2 deletions lib/core/src/server/__snapshots__/manager-prod
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
"NODE_MODULES/@babel/plugin-transform-template-literals/lib/index.js",
Expand Down Expand Up @@ -144,7 +144,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
],
Expand Down
8 changes: 4 additions & 4 deletions lib/core/src/server/__snapshots__/preview-dev
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
Array [
Expand Down Expand Up @@ -170,7 +170,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
],
Expand Down Expand Up @@ -295,7 +295,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
Array [
Expand Down Expand Up @@ -414,7 +414,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
Array [
Expand Down
8 changes: 4 additions & 4 deletions lib/core/src/server/__snapshots__/preview-prod
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
Array [
Expand Down Expand Up @@ -169,7 +169,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
],
Expand Down Expand Up @@ -294,7 +294,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
Array [
Expand Down Expand Up @@ -413,7 +413,7 @@ Object {
Object {
"absoluteImports": "NODE_MODULES/core-js/index.js",
"method": "usage-global",
"version": "3.8.2",
"version": "3.8.3",
},
],
Array [
Expand Down
1 change: 0 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[build.environment]
NODE_VERSION = "10"
YARN_VERSION = "1.22.10"
YARN_FLAGS = "--version"
DOTENV_DISPLAY_WARNING = "none"
STORYBOOK_EXAMPLE_APP ="true"
[[headers]]
Expand Down
60 changes: 60 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,70 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
"@babel/runtime": "^7.12.5",
"@compodoc/compodoc": "^1.1.11",
"@emotion/snapshot-serializer": "^0.8.2",
"@nicolo-ribaudo/chokidar-2": "^2.1.8",
"@storybook/addon-a11y": "workspace:*",
"@storybook/addon-actions": "workspace:*",
"@storybook/addon-backgrounds": "workspace:*",
"@storybook/addon-controls": "workspace:*",
"@storybook/addon-cssresources": "workspace:*",
"@storybook/addon-decorator": "workspace:*",
"@storybook/addon-design-assets": "workspace:*",
"@storybook/addon-docs": "workspace:*",
"@storybook/addon-essentials": "workspace:*",
"@storybook/addon-events": "workspace:*",
"@storybook/addon-google-analytics": "workspace:*",
"@storybook/addon-graphql": "workspace:*",
"@storybook/addon-jest": "workspace:*",
"@storybook/addon-knobs": "workspace:*",
"@storybook/addon-links": "workspace:*",
"@storybook/addon-parameter": "workspace:*",
"@storybook/addon-preview-wrapper": "workspace:*",
"@storybook/addon-queryparams": "workspace:*",
"@storybook/addon-roundtrip": "workspace:*",
"@storybook/addon-storyshots": "workspace:*",
"@storybook/addon-storyshots-puppeteer": "workspace:*",
"@storybook/addon-storysource": "workspace:*",
"@storybook/addon-toolbars": "workspace:*",
"@storybook/addon-viewport": "workspace:*",
"@storybook/addons": "workspace:*",
"@storybook/angular": "workspace:*",
"@storybook/api": "workspace:*",
"@storybook/aurelia": "workspace:*",
"@storybook/channel-postmessage": "workspace:*",
"@storybook/channel-websocket": "workspace:*",
"@storybook/channels": "workspace:*",
"@storybook/cli": "workspace:*",
"@storybook/client-api": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/codemod": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/core": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/ember": "workspace:*",
"@storybook/eslint-config-storybook": "^2.4.0",
"@storybook/html": "workspace:*",
"@storybook/linter-config": "^2.5.0",
"@storybook/marionette": "workspace:*",
"@storybook/marko": "workspace:*",
"@storybook/mithril": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@storybook/postinstall": "workspace:*",
"@storybook/preact": "workspace:*",
"@storybook/rax": "workspace:*",
"@storybook/react": "workspace:*",
"@storybook/riot": "workspace:*",
"@storybook/root": "workspace:*",
"@storybook/router": "workspace:*",
"@storybook/semver": "^7.3.2",
"@storybook/server": "workspace:*",
"@storybook/source-loader": "workspace:*",
"@storybook/svelte": "workspace:*",
"@storybook/theming": "workspace:*",
"@storybook/ui": "workspace:*",
"@storybook/vue": "workspace:*",
"@storybook/web-components": "workspace:*",
"@testing-library/dom": "^7.29.4",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^10.4.9",
Expand Down Expand Up @@ -209,6 +268,7 @@
"ts-node": "^8.10.2",
"typescript": "^3.9.7",
"wait-on": "^5.2.1",
"web-component-analyzer": "^1.1.6",
"webpack": "^4.46.0",
"window-size": "^1.1.1"
},
Expand Down
4 changes: 1 addition & 3 deletions scripts/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ function run() {
defaultValue: false,
option: '--install',
command: () => {
const command = process.env.CI
? `yarn install --frozen-lockfile --cache-folder ~/.cache/yarn --network-concurrency ${maxConcurrentTasks}`
: `yarn install --ignore-optional --network-concurrency ${maxConcurrentTasks}`;
const command = process.env.CI ? `yarn install --immutable` : `yarn install`;
spawn(command);
},
order: 1,
Expand Down
Loading

0 comments on commit 0ca580c

Please sign in to comment.