Skip to content

Commit 99774cd

Browse files
committed
chore: migrate to yarn v2 (#655)
1 parent e15a8d1 commit 99774cd

File tree

10 files changed

+12255
-9089
lines changed

10 files changed

+12255
-9089
lines changed

.github/workflows/lint.yml

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ jobs:
1919
- uses: actions/checkout@v2
2020
with:
2121
fetch-depth: 0
22+
- name: Get yarn cache
23+
id: yarn-cache
24+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
25+
- uses: actions/cache@v2
26+
with:
27+
path: ${{ steps.yarn-cache.outputs.dir }}
28+
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
ubuntu-latest-node-12.x-yarn-
2231
- uses: actions/[email protected]
2332
with:
2433
node-version: 12.x

.github/workflows/nodejs.yml

+20
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v2
27+
- name: Get yarn cache
28+
id: yarn-cache
29+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
30+
- uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.yarn-cache.outputs.dir }}
33+
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
ubuntu-latest-node-12.x-yarn-
2736
- name: Use Node.js ${{ matrix.node-version }}
2837
uses: actions/[email protected]
2938
with:
@@ -53,6 +62,17 @@ jobs:
5362

5463
steps:
5564
- uses: actions/checkout@v2
65+
- name: Get yarn cache
66+
id: yarn-cache
67+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
68+
- uses: actions/cache@v2
69+
with:
70+
path: ${{ steps.yarn-cache.outputs.dir }}
71+
key:
72+
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{
73+
hashFiles('**/yarn.lock') }}
74+
restore-keys: |
75+
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
5676
- uses: actions/[email protected]
5777
with:
5878
node-version: 12.x

.github/workflows/release.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13+
- name: Get yarn cache
14+
id: yarn-cache
15+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
16+
- uses: actions/cache@v2
17+
with:
18+
path: ${{ steps.yarn-cache.outputs.dir }}
19+
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
20+
restore-keys: |
21+
ubuntu-latest-node-12.x-yarn-
1322
- uses: actions/[email protected]
1423
with:
15-
node-version: '12.x'
24+
node-version: 12.x
1625
- name: install
1726
run: yarn
1827
- name: run prettier

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ node_modules/
33
coverage/
44
lib/
55
*.log
6+
.yarn/*
7+
!.yarn/releases
8+
!.yarn/plugins
9+
!.yarn/sdks
10+
!.yarn/versions
11+
.pnp.*

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

+38
Large diffs are not rendered by default.

.yarn/releases/yarn-sources.cjs

+55
Large diffs are not rendered by default.

.yarnrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
lastUpdateCheck 1576854265612
6+
yarn-path ".yarn/releases/yarn-sources.cjs"

.yarnrc.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
enableGlobalCache: true
2+
3+
nodeLinker: node-modules
4+
5+
plugins:
6+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
7+
spec: '@yarnpkg/plugin-interactive-tools'
8+
9+
yarnPath: .yarn/releases/yarn-sources.cjs

package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
"lib/"
2121
],
2222
"scripts": {
23-
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files",
24-
"postbuild": "rimraf lib/__tests__ lib/**/__tests__",
23+
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files && rimraf lib/__tests__ 'lib/**/__tests__'",
2524
"lint": "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts",
26-
"prepack": "yarn build",
27-
"prettier:check": "prettier --check docs/**/*.md README.md .github/** package.json tsconfig.json src/globals.json",
28-
"prettier:write": "prettier --write docs/**/*.md README.md .github/** package.json tsconfig.json src/globals.json",
25+
"prepack": "rimraf lib && yarn build",
26+
"prettier:check": "prettier --check 'docs/**/*.md' README.md '.github/**' package.json tsconfig.json src/globals.json .yarnrc.yml",
27+
"prettier:write": "prettier --write 'docs/**/*.md' README.md '.github/**' package.json tsconfig.json src/globals.json .yarnrc.yml",
2928
"test": "jest",
3029
"tools:regenerate-docs": "ts-node -T tools/regenerate-docs",
3130
"typecheck": "tsc -p ."
@@ -43,7 +42,7 @@
4342
},
4443
"lint-staged": {
4544
"*.{js,ts}": "eslint --fix",
46-
"*.{md,json}": "prettier --write"
45+
"*.{md,json,yml}": "prettier --write"
4746
},
4847
"prettier": {
4948
"arrowParens": "avoid",

0 commit comments

Comments
 (0)