Skip to content

Commit 98fa420

Browse files
committed
chore: move to Yarn 2 🧶
1 parent 8a40dbd commit 98fa420

File tree

20 files changed

+48900
-35417
lines changed

20 files changed

+48900
-35417
lines changed

.circleci/config.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,18 @@ jobs:
8484
- restore_cache:
8585
name: Restore Yarn cache
8686
keys:
87-
- build-yarn-cache-v4--{{ checksum "yarn.lock" }}
87+
- build-yarn-2-cache-v1--{{ checksum "yarn.lock" }}
8888
- run:
8989
name: Install dependencies
90-
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
90+
command: yarn install --immutable
9191
- run:
9292
name: Bootstrap
9393
command: yarn bootstrap --core
9494
- save_cache:
9595
name: Save Yarn cache
96-
key: build-yarn-cache-v4--{{ checksum "yarn.lock" }}
96+
key: build-yarn-2-cache-v1--{{ checksum "yarn.lock" }}
9797
paths:
98-
- ~/.cache/yarn
98+
- ~/.yarn/berry/cache
9999
- persist_to_workspace:
100100
root: .
101101
paths:
@@ -195,16 +195,16 @@ jobs:
195195
command: yarn wait-on http://localhost:6000
196196
- run:
197197
name: set registry
198-
command: yarn config set registry http://localhost:6000/
198+
command: yarn config set npmRegistryServer http://localhost:6000/
199199
- run:
200200
name: test local registry
201-
command: yarn info @storybook/core
201+
command: yarn npm info @storybook/core
202202
- run:
203203
name: Install Cypress binary
204204
command: yarn cypress install
205205
- run:
206206
name: run e2e tests
207-
command: yarn test:e2e-framework --skip preact
207+
command: yarn test:e2e-framework --clean --skip preact
208208
- store_artifacts:
209209
path: /tmp/storybook/cypress
210210
destination: cypress
@@ -237,10 +237,10 @@ jobs:
237237
command: yarn wait-on http://localhost:6000
238238
- run:
239239
name: Set registry
240-
command: yarn config set registry http://localhost:6000/
240+
command: yarn config set npmRegistryServer http://localhost:6000/
241241
- run:
242242
name: Test local registry
243-
command: yarn info @storybook/core
243+
command: yarn npm info @storybook/core
244244
- run:
245245
name: Install Cypress binary
246246
command: yarn cypress install
@@ -269,10 +269,10 @@ jobs:
269269
command: yarn wait-on http://localhost:6000
270270
- run:
271271
name: Set registry
272-
command: yarn config set registry http://localhost:6000/
272+
command: yarn config set npmRegistryServer http://localhost:6000/
273273
- run:
274274
name: Test local registry
275-
command: yarn info @storybook/core
275+
command: yarn npm info @storybook/core
276276
- run:
277277
name: Install Cypress binary
278278
command: yarn cypress install
@@ -301,10 +301,10 @@ jobs:
301301
command: yarn wait-on http://localhost:6000
302302
- run:
303303
name: set registry
304-
command: yarn config set registry http://localhost:6000/
304+
command: yarn config set npmRegistryServer http://localhost:6000/
305305
- run:
306306
name: test local registry
307-
command: yarn info @storybook/core
307+
command: yarn npm info @storybook/core
308308
- run:
309309
name: Install Cypress binary
310310
command: yarn cypress install
@@ -414,7 +414,7 @@ jobs:
414414
clone_options: '--depth 1 --verbose'
415415
- run:
416416
name: Install dependencies
417-
command: yarn bootstrap --install
417+
command: yarn install --immutable
418418
- run:
419419
name: Trigger build
420420
command: ./scripts/build-frontpage.js

.github/workflows/tests-unit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515
uses: actions/cache@v2
1616
with:
1717
path: node_modules
18-
key: build-v2-${{ hashFiles('**/yarn.lock') }}
18+
key: yarn-2-cache-v1-${{ hashFiles('**/yarn.lock') }}
1919
- name: install, bootstrap
2020
run: |
21+
yarn install --immutable
2122
yarn bootstrap --core
2223
- name: test
2324
run: |

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,11 @@ examples/ember-cli/ember-output
3333
tsconfig.tsbuildinfo
3434
lib/core-server/prebuilt
3535
examples/angular-cli/addon-jest.testresults.json
36+
37+
# Yarn stuff
38+
/.yarn/*
39+
!/.yarn/releases
40+
!/.yarn/plugins
41+
!/.yarn/sdks
42+
!/.yarn/versions
43+
/.pnp.*

.yarn/releases/yarn-2.4.1.cjs

Lines changed: 55 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
compressionLevel: 0
2+
3+
enableGlobalCache: true
4+
5+
nodeLinker: node-modules
6+
7+
npmRegistryServer: "https://registry.yarnpkg.com"
8+
9+
unsafeHttpWhitelist:
10+
- localhost
11+
12+
yarnPath: .yarn/releases/yarn-2.4.1.cjs

addons/docs/src/frameworks/angular/angular-properties.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const runCompodoc = (inputPath: string) => {
1616
// FIXME: for now, this requires a tsconfig.json for each test case. Tried generating
1717
// one dynamically in tmpDir, but compodoc doesn't handle absolute paths properly
1818
// (and screwed around with relative paths as well, but couldn't get it working)
19-
spawnSync('compodoc', ['-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
19+
spawnSync('yarn', ['compodoc', '-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
2020
stdio: 'inherit',
2121
});
2222
const output = fs.readFileSync(`${tmpDir}/documentation.json`, 'utf8');

addons/docs/src/frameworks/web-components/web-components-properties.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const inputRegExp = /^input\..*$/;
1111
const runWebComponentsAnalyzer = (inputPath: string) => {
1212
const { name: tmpDir, removeCallback } = tmp.dirSync();
1313
const customElementsFile = `${tmpDir}/custom-elements.json`;
14-
spawnSync('wca', ['analyze', inputPath, '--outFile', customElementsFile], {
14+
spawnSync('yarn', ['wca', 'analyze', inputPath, '--outFile', customElementsFile], {
1515
stdio: 'inherit',
1616
});
1717
const output = fs.readFileSync(customElementsFile, 'utf8');

examples/angular-cli/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
"license": "MIT",
66
"scripts": {
77
"build": "ng build",
8-
"prebuild-storybook": "yarn storybook:prebuild",
9-
"build-storybook": "build-storybook -s src/assets",
8+
"build-storybook": "yarn storybook-prebuild && build-storybook -s src/assets",
109
"docs:json": "compodoc -p ./tsconfig.json -e json -d .",
1110
"e2e": "ng e2e",
1211
"ng": "ng",
1312
"start": "ng serve",
14-
"storybook": "yarn storybook:prebuild && start-storybook -p 9008 -s src/assets",
15-
"storybook:prebuild": "yarn test:generate-output && yarn docs:json",
13+
"storybook": "yarn storybook-prebuild && start-storybook -p 9008 -s src/assets",
14+
"storybook-prebuild": "yarn test:generate-output && yarn docs:json",
1615
"test": "jest",
1716
"test:coverage": "jest --coverage",
1817
"test:generate-output": "jest --json --config=jest.addon-config.js --outputFile=addon-jest.testresults.json || true",

examples/ember-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"private": true,
55
"scripts": {
66
"build": "ember build --output-path ember-output",
7-
"prebuild-storybook": "yarn build && shx cp -r public/* ember-output",
8-
"build-storybook": "build-storybook -s ember-output",
7+
"build-storybook": "yarn storybook-prebuild && build-storybook -s ember-output",
98
"dev": "ember serve",
109
"storybook": "yarn build && start-storybook -p 9009 -s ember-output",
10+
"storybook-prebuild": "yarn build && shx cp -r public/* ember-output",
1111
"storybook:dev": "yarn dev & start-storybook -p 9009 -s ember-output"
1212
},
1313
"dependencies": {

lib/builder-webpack5/src/preview/iframe-webpack.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ export default async ({
228228
mangle: false,
229229
keep_fnames: true,
230230
},
231-
}),
231+
// It looks like the types from `@types/terser-webpack-plugin` are not matching the latest version of
232+
// Webpack yet
233+
}) as any,
232234
]
233235
: [],
234236
},

0 commit comments

Comments
 (0)