Skip to content

Commit f6b6006

Browse files
committed
chore: moving from yarn to pnpm
Signed-off-by: prisis <[email protected]>
1 parent 603251b commit f6b6006

13 files changed

+13922
-779
lines changed

.czrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"path": "cz-conventional-changelog"
3+
}
4+

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: prisis
1+
github: "prisis"

.github/semantic.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
titleOnly: true
44
types:
5-
- feat
6-
- fix
7-
- docs
8-
- dx
9-
- refactor
10-
- perf
11-
- test
12-
- workflow
13-
- build
14-
- ci
15-
- chore
16-
- types
17-
- wip
18-
- release
19-
- deps
5+
- "feat"
6+
- "fix"
7+
- "docs"
8+
- "dx"
9+
- "refactor"
10+
- "perf"
11+
- "test"
12+
- "workflow"
13+
- "build"
14+
- "ci"
15+
- "chore"
16+
- "types"
17+
- "wip"
18+
- "release"
19+
- "deps"

.github/workflows/markdown-lint.yml

+24-27
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on: # yamllint disable-line rule:truthy
1010
paths:
1111
- "**.md"
1212

13+
env:
14+
package: "@${{ github.repository }}"
15+
registry_url: "https://npm.pkg.github.com"
16+
scope: "${{ github.repository_owner }}"
17+
1318
jobs:
1419
text-lint:
1520
name: "Markdown lint"
@@ -26,38 +31,30 @@ jobs:
2631
GIT_AUTHOR_NAME: "GitHub Actions Shell"
2732
EMAIL: "github-actions[bot]@users.noreply.github.com"
2833

29-
- name: "Use Node.js 12.x"
34+
- name: "Use Node.js 16.x"
3035
uses: "actions/setup-node@v2"
3136
with:
32-
node-version: "12.x"
33-
34-
- name: "Configure Container"
35-
env:
36-
GIT_USER_EMAIL: "${{ secrets.GIT_USER_EMAIL }}"
37-
GIT_USER_USERNAME: "${{ secrets.GIT_USER_USERNAME }}"
38-
run: |
39-
EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
40-
NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
37+
node-version: "16.x"
38+
registry-url: "${{ env.registry_url }}"
39+
# Defaults to the user or organization that owns the workflow file
40+
scope: "@${{ env.scope }}"
4141

42-
git config --global user.email "${EMAIL}"
43-
git config --global user.name "${NAME}"
42+
- name: "Install pnpm"
43+
run: "curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6"
4444

45-
- name: "Get yarn cache directory path"
46-
id: "yarn-cache-dir-path"
47-
run: "echo '::set-output name=dir::$(yarn config get cacheFolder)'"
48-
49-
- uses: "actions/cache@v2"
50-
id: "yarn-cache" # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
45+
- name: "Cache .pnpm-store"
46+
uses: "actions/cache@v2"
47+
id: "pnpm-cache" # use this to check for `cache-hit` (`steps.pnpm-cache.outputs.cache-hit != 'true'`)
5148
with:
52-
path: "${{ steps.yarn-cache-dir-path.outputs.dir }}"
53-
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
54-
restore-keys: "${{ runner.os }}-yarn-"
55-
56-
- name: "update yarn to v3"
57-
run: "yarn set version 3.0.1"
49+
path: "~/.pnpm-store"
50+
key: "${{ runner.os }}-node16-${{ hashFiles('**/pnpm-lock.yaml') }}"
51+
restore-keys: |
52+
${{ runner.os }}-pnpm-
5853
59-
- name: "install"
60-
run: "yarn install --immutable"
54+
- name: "Install packages"
55+
run: "pnpm install --frozen-lockfile"
56+
env:
57+
NPM_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_NPM_PACKAGE_TOKEN }}"
6158

6259
- name: "lint"
63-
run: "yarn run lint:text"
60+
run: "pnpm run lint:text"

.github/workflows/semantic-release.yml

+47-88
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,43 @@ on: # yamllint disable-line rule:truthy
1414

1515
jobs:
1616
test:
17-
name: "tests"
17+
strategy:
18+
matrix:
19+
os: ["ubuntu-latest"]
20+
node_version: ["14", "16", "17"]
21+
include:
22+
- os: "macos-latest"
23+
node_version: "16"
24+
- os: "windows-latest"
25+
node_version: "16"
26+
fail-fast: false
1827

19-
runs-on: "ubuntu-latest"
28+
name: "Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
29+
30+
runs-on: "${{ matrix.os }}"
2031

2132
steps:
2233
- name: "Git checkout"
2334
uses: "actions/checkout@v2"
24-
with:
25-
fetch-depth: 0
26-
persist-credentials: false
2735
env:
2836
GIT_COMMITTER_NAME: "GitHub Actions Shell"
2937
GIT_AUTHOR_NAME: "GitHub Actions Shell"
3038
EMAIL: "github-actions[bot]@users.noreply.github.com"
3139

32-
- name: "Configure Container"
33-
env:
34-
GIT_USER_EMAIL: "${{ secrets.GIT_USER_EMAIL }}"
35-
GIT_USER_USERNAME: "${{ secrets.GIT_USER_USERNAME }}"
36-
run: |
37-
EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
38-
NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
39-
40-
git config --global user.email "${EMAIL}"
41-
git config --global user.name "${NAME}"
42-
43-
- name: "Use Node.js 12.x"
44-
uses: "actions/setup-node@v2"
40+
- uses: "pnpm/[email protected]"
4541
with:
46-
node-version: "12.x"
47-
48-
- name: "Get yarn cache directory path"
49-
id: "yarn-cache-dir-path"
50-
run: "echo \"::set-output name=dir::$(yarn config get cacheFolder)\""
42+
version: 6
5143

52-
- uses: "actions/cache@v2"
53-
id: "yarn-cache" # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
44+
- name: "Set node version to ${{ matrix.node_version }}"
45+
uses: "actions/setup-node@v2"
5446
with:
55-
path: "${{ steps.yarn-cache-dir-path.outputs.dir }}"
56-
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
57-
restore-keys: |
58-
${{ runner.os }}-yarn-
59-
60-
- name: "update yarn to v3"
61-
run: "yarn set version 3.0.1"
47+
node-version: "${{ matrix.node_version }}"
48+
cache: "pnpm"
6249

63-
- name: "install"
64-
run: "yarn install --immutable"
50+
- name: "Install packages"
51+
run: "pnpm install --frozen-lockfile"
52+
env:
53+
NPM_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_NPM_PACKAGE_TOKEN }}"
6554

6655
- name: "test and coverage"
6756
run: "yarn run test:coverage"
@@ -73,7 +62,7 @@ jobs:
7362
run: "yarn run test:babel"
7463

7564
semantic-release:
76-
name: "semantic release"
65+
name: "Semantic Release"
7766

7867
runs-on: "ubuntu-latest"
7968

@@ -90,53 +79,34 @@ jobs:
9079
GIT_AUTHOR_NAME: "GitHub Actions Shell"
9180
EMAIL: "github-actions[bot]@users.noreply.github.com"
9281

93-
- name: "Configure Container"
94-
env:
95-
GIT_USER_EMAIL: "${{ secrets.GIT_USER_EMAIL }}"
96-
GIT_USER_USERNAME: "${{ secrets.GIT_USER_USERNAME }}"
97-
run: |
98-
EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
99-
NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
100-
101-
git config --global user.email "${EMAIL}"
102-
git config --global user.name "${NAME}"
103-
104-
- name: "Use Node.js 12.x"
105-
uses: "actions/setup-node@v2"
82+
- uses: "pnpm/[email protected]"
10683
with:
107-
node-version: "12.x"
84+
version: 6
10885

109-
- name: "Get yarn cache directory path"
110-
id: "yarn-cache-dir-path"
111-
run: "echo \"::set-output name=dir::$(yarn config get cacheFolder)\""
112-
113-
- uses: "actions/cache@v2"
114-
id: "yarn-cache" # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
86+
- name: "Use Node.js 14.x"
87+
uses: "actions/setup-node@v2"
11588
with:
116-
path: "${{ steps.yarn-cache-dir-path.outputs.dir }}"
117-
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
118-
restore-keys: |
119-
${{ runner.os }}-yarn-
120-
121-
- name: "update yarn to v3"
122-
run: "yarn set version 3.0.1"
89+
node-version: "14.x"
90+
cache: "pnpm"
12391

124-
- name: "install"
125-
run: "yarn install --immutable"
92+
- name: "Install packages"
93+
run: "pnpm install --frozen-lockfile"
94+
env:
95+
NPM_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_NPM_PACKAGE_TOKEN }}"
12696

12797
- name: "Semantic Release"
12898
if: "success()"
12999
env:
130100
GITHUB_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}"
131-
NPM_TOKEN: "${{ secrets.NPM_AUTH_TOKEN }}"
101+
NPM_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_NPM_PACKAGE_TOKEN }}"
132102
GIT_AUTHOR_NAME: "github-actions-shell"
133103
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
134104
GIT_COMMITTER_NAME: "github-actions-shell"
135105
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
136-
run: "yarn run multi-semantic-release"
106+
run: "pnpm multi-semantic-release"
137107

138-
yarn-lock-update:
139-
name: "yarn.lock update"
108+
pnpm-lock-update:
109+
name: "pnpm-lock.yaml update"
140110

141111
runs-on: "ubuntu-latest"
142112

@@ -154,34 +124,23 @@ jobs:
154124
GIT_AUTHOR_NAME: "GitHub Actions Shell"
155125
EMAIL: "github-actions[bot]@users.noreply.github.com"
156126

157-
- name: "Configure Container"
158-
env:
159-
GIT_USER_EMAIL: "${{ secrets.GIT_USER_EMAIL }}"
160-
GIT_USER_USERNAME: "${{ secrets.GIT_USER_USERNAME }}"
161-
run: |
162-
EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
163-
NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
164-
165-
git config --global user.email "${EMAIL}"
166-
git config --global user.name "${NAME}"
127+
- uses: "pnpm/[email protected]"
128+
with:
129+
version: 6
167130

168-
- name: "Use Node.js 12.x"
131+
- name: "Use Node.js 14.x"
169132
uses: "actions/setup-node@v2"
170133
with:
171-
node-version: "^12.6.8"
172-
173-
- name: "update yarn to v3"
174-
run: "yarn set version 3.0.1"
134+
node-version: "14.x"
135+
registry-url: "${{ env.registry_url }}"
175136

176-
- name: "Update yarn.lock"
177-
run: "yarn --mode=update-lockfile"
178-
env:
179-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
137+
- name: "Update pnpm lock"
138+
run: "pnpm install --no-frozen-lockfile"
180139

181140
- name: "Commit modified files"
182141
uses: "stefanzweifel/[email protected]"
183142
with:
184-
commit_message: "chore: updated yarn.lock"
143+
commit_message: "chore: updated pnpm-lock.yaml"
185144
commit_author: "prisis <[email protected]>"
186145
commit_user_email: "[email protected]"
187146
commit_user_name: "prisis"

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
echo --------------------------------------------
1010
echo Starting Git hook: commit-msg
1111

12-
yarn commitlint --config ./commitlint.config.cjs --edit $1 || exit $?
12+
npx --no -- commitlint --config ./commitlint.config.cjs --edit $1 || exit $?
1313

1414
echo Finished Git hook: commit-msg
1515
echo --------------------------------------------

.husky/pre-commit

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
echo --------------------------------------------
1010
echo Starting Git hook: pre-commit
1111

12-
yarn run lint:staged
12+
npx --no -- lint-staged
1313

14-
yarn run sort-package-json
14+
npx --no -- sort-package-json
1515

1616
echo Finished Git hook: pre-commit
1717
echo --------------------------------------------

.lintstagedrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"**/*.{js,jsx,tsx,ts}": [
3+
"prettier --config=.prettierrc.cjs --write",
4+
"cross-env NO_LOGS=true eslint -c ./.eslintrc.cjs --fix"
5+
],
6+
"*.{json,yml,yaml,less,css,scss,sass}": [
7+
"prettier --config=.prettierrc.cjs --write"
8+
],
9+
"*.{md,mdx}": [
10+
"prettier --config=.prettierrc.cjs --write",
11+
"cross-env NO_LOGS=true eslint -c ./.eslintrc.cjs --fix"
12+
],
13+
"{packages,support}/**/*.{js,jsx,tsx,ts}": [
14+
"prettier --config=.prettierrc.cjs --write",
15+
"cross-env NO_LOGS=true eslint -c ./.eslintrc.cjs --fix"
16+
]
17+
}

.yamllint.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ ignore: |
77
node_modules/
88
.yarnrc.yml
99
.yarn/
10+
.pnpm-lock.yaml
11+
.pnpm-workspaces.yaml
12+
*lock.yaml
13+
*workspace.yaml
1014
1115
rules:
1216
braces:

.yarn/releases/yarn-3.0.1.cjs

-631
This file was deleted.

package.json

+3-14
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,7 @@
2929
"test:coverage": "jest --config=./jest.config.cjs --coverageDirectory=./coverage --coverage",
3030
"test:stylelint": "stylelint --formatter verbose --config packages/stylelint-config/index.cjs ./packages/stylelint-config/__tests__/css/**/*.css",
3131
"test:babel": "babel --config-file=./packages/babel-preset/index.cjs ./packages/babel-preset/fixture/test.ts --out-file=./packages/babel-preset/fixture/test.js",
32-
"test:all": "yarn test && yarn test:stylelint && yarn test:babel"
33-
},
34-
"lint-staged": {
35-
"*.{js,jsx,less,md,json}": [
36-
"prettier --config=./.prettierrc.cjs --write"
37-
]
38-
},
39-
"config": {
40-
"commitizen": {
41-
"path": "./node_modules/cz-conventional-changelog"
42-
}
32+
"test:all": "pnpm test && pnpm test:stylelint && pnpm test:babel"
4333
},
4434
"dependencies": {
4535
"@babel/cli": "^7.16.8",
@@ -78,7 +68,6 @@
7868
},
7969
"devDependencies": {
8070
"@types/jest": "27.4.0",
81-
"@types/node": "16.11.21"
82-
},
83-
"packageManager": "[email protected]"
71+
"@types/node": "16.11.17"
72+
}
8473
}

0 commit comments

Comments
 (0)