Skip to content

Commit 0e76dd6

Browse files
authored
chore(pnpm): update package manager (#73)
1 parent 9b50645 commit 0e76dd6

11 files changed

+8823
-9075
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* eol=lf

.github/workflows/build.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,32 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [12.x]
12+
node-version: [16]
1313
os: [windows-latest, ubuntu-latest]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- name: Setup Git Config
17+
run: |
18+
git config --global core.autocrlf false
19+
git config --global core.eol lf
20+
git config --global user.email "[email protected]"
21+
git config --global user.name "gh-actions"
22+
- uses: actions/checkout@v3
23+
- uses: pnpm/[email protected]
24+
with:
25+
version: 6.32.3
26+
- uses: actions/setup-node@v2
1727
with:
18-
ref: ${{ github.event.pull_request.head.sha }}
28+
node-version: "16"
29+
cache: "pnpm"
30+
- run: pnpm i --frozen-lockfile
1931
- name: Use Node.js ${{ matrix.node-version }}
2032
uses: actions/setup-node@v1
2133
with:
2234
node-version: ${{ matrix.node-version }}
23-
2435
- name: Test & Build
2536
run: |
26-
yarn install --frozen-lockfile
27-
yarn build
28-
yarn test
37+
pnpm build
38+
pnpm test
2939
env:
3040
CI: true

.github/workflows/release.yml

+40-16
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,53 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- name: Setup Git Config
12+
run: |
13+
git config --global core.autocrlf false
14+
git config --global core.eol lf
15+
git config --global user.email "[email protected]"
16+
git config --global user.name "gh-actions"
17+
- uses: actions/checkout@v3
1218
with:
1319
ref: main
14-
- uses: actions/setup-node@v1
20+
- uses: pnpm/[email protected]
21+
with:
22+
version: 6.32.3
23+
- uses: actions/setup-node@v2
1524
with:
16-
node-version: "12.x"
25+
node-version: "16"
1726
registry-url: https://npm.pkg.github.com
1827
scope: "@Himenon"
28+
cache: "pnpm"
29+
- run: pnpm i --frozen-lockfile
1930
- run: |
20-
yarn install --frozen-lockfile
21-
yarn build
31+
pnpm build
2232
2333
release-github-registry:
2434
runs-on: ubuntu-latest
2535
steps:
26-
- uses: actions/checkout@v2
36+
- name: Setup Git Config
37+
run: |
38+
git config --global core.autocrlf false
39+
git config --global core.eol lf
40+
git config --global user.email "[email protected]"
41+
git config --global user.name "gh-actions"
42+
- uses: actions/checkout@v3
2743
with:
2844
ref: main
29-
- uses: actions/setup-node@v1
45+
- uses: pnpm/[email protected]
3046
with:
31-
node-version: "12.x"
47+
version: 6.32.3
48+
- uses: actions/setup-node@v2
49+
with:
50+
node-version: "16"
3251
registry-url: https://npm.pkg.github.com
3352
scope: "@Himenon"
53+
cache: "pnpm"
54+
- run: pnpm install
3455
- run: |
35-
yarn install --frozen-lockfile
36-
yarn build
37-
yarn --cwd ./lib release:github:registry
56+
pnpm build
57+
pnpm -C ./lib release:github:registry
3858
env:
3959
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4060
@@ -44,12 +64,16 @@ jobs:
4464
- uses: actions/checkout@v2
4565
with:
4666
ref: main
47-
- uses: actions/setup-node@v1
67+
- uses: pnpm/[email protected]
68+
with:
69+
version: 6.32.3
70+
- uses: actions/setup-node@v2
4871
with:
49-
node-version: "12.x"
72+
node-version: "16.x"
5073
registry-url: "https://registry.npmjs.org"
51-
- run: yarn install --frozen-lockfile
52-
- run: yarn build
53-
- run: yarn --cwd ./lib release:npm:registry
74+
cache: "pnpm"
75+
- run: pnpm install
76+
- run: pnpm build
77+
- run: pnpm -C ./lib release:npm:registry
5478
env:
5579
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/versionUp.yml

+16-8
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@ jobs:
99
if: github.event_name != 'pull_request'
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- name: Setup Git Config
13+
run: |
14+
git config --global core.autocrlf false
15+
git config --global core.eol lf
16+
git config --global user.email "[email protected]"
17+
git config --global user.name "gh-actions"
18+
- uses: actions/checkout@v3
1319
with:
14-
ref: ${{ github.event.pull_request.head.sha }}
15-
- uses: actions/setup-node@v1
20+
ref: main
21+
- uses: pnpm/[email protected]
1622
with:
17-
node-version: "12.x"
23+
version: 6.32.3
24+
- uses: actions/setup-node@v2
25+
with:
26+
node-version: "16.x"
27+
cache: "pnpm"
28+
- run: pnpm i --frozen-lockfile
1829
- name: Auto version update
1930
run: |
20-
git config --global user.email "[email protected]"
21-
git config --global user.name "gh-actions"
22-
yarn install --frozen-lockfile
23-
yarn lerna:version:up
31+
pnpm lerna:version:up

.npmrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
always-auth=true
22
engine-strict=true
3-
package-lock=false

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ git clone https://github.com/Himenon/openapi-typescript-code-generator.git
376376
cd openapi-typescript-code-generator
377377
yarn
378378
#### your change
379-
yarn build && yarn test
379+
pnpm build && pnpm test
380380
```
381381

382382
## Useful development tools

package.json

+19-21
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,24 @@
3838
"package.json"
3939
],
4040
"scripts": {
41-
"build": "yarn ts ./scripts/build.ts",
42-
"clean": "yarn ts ./scripts/clean.ts",
41+
"build": "pnpm ts ./scripts/build.ts",
42+
"clean": "pnpm ts ./scripts/clean.ts",
4343
"format:code": "prettier \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md,html}\" --write",
4444
"format:code:eslint": "eslint \"**/*.{ts,tsx}\" --fix",
4545
"format:yarn:lock": "yarn-deduplicate yarn.lock --strategy highest",
4646
"lerna:version:up": "lerna version --yes",
47-
"release:github:registry": "yarn publish --registry https://npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}",
48-
"release:npm:registry": "yarn publish",
49-
"test": "run-s test:depcruise test:jest test:code:gen test:snapshot",
50-
"test:code:gen": "yarn ts ./scripts/testCodeGen.ts",
47+
"release:github:registry": "pnpm publish --registry https://npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}",
48+
"release:npm:registry": "pnpm publish",
49+
"test": "run-p test:depcruise test:jest test:code:gen test:snapshot",
50+
"test:code:gen": "pnpm ts ./scripts/testCodeGen.ts",
5151
"test:depcruise": "depcruise --validate .dependency-cruiser.js src",
5252
"test:eslint": "eslint \"src/**/*.{ts,tsx}\"",
5353
"test:jest": "jest -c ./jest.config.js",
5454
"test:snapshot": "jest -c ./jest.snapshot.config.js",
5555
"ts": "ts-node -P tsconfig.build.json",
56-
"update:snapshot": "yarn test:snapshot --updateSnapshot",
57-
"validate": "yarn ts ./scripts/validate.ts",
58-
"watch": "yarn ts ./scripts/watch.ts"
59-
},
60-
"husky": {
61-
"hooks": {
62-
"pre-commit": "lint-staged",
63-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
64-
}
65-
},
66-
"config": {
67-
"commitizen": {
68-
"path": "cz-conventional-changelog"
69-
}
56+
"update:snapshot": "pnpm test:snapshot --updateSnapshot",
57+
"watch": "pnpm ts ./scripts/watch.ts",
58+
"validate": "pnpm ts ./scripts/validate.ts"
7059
},
7160
"resolutions": {
7261
"kind-of": "6.0.3",
@@ -98,7 +87,6 @@
9887
"eslint-plugin-import": "2.22.1",
9988
"execa": "5.0.0",
10089
"generate-changelog": "1.8.0",
101-
"husky": "4.3.7",
10290
"import-sort-style-module": "6.0.0",
10391
"jest": "26.6.3",
10492
"jest-cli": "26.6.3",
@@ -110,6 +98,7 @@
11098
"prettier-plugin-import-sort": "0.0.6",
11199
"read-pkg-up": "^7.0.1",
112100
"rimraf": "3.0.2",
101+
"simple-git-hooks": "^2.7.0",
113102
"sort-package-json": "1.49.0",
114103
"ts-jest": "26.5.4",
115104
"ts-node": "9.1.1",
@@ -119,6 +108,12 @@
119108
"peerDependencies": {
120109
"typescript": "4.2.3"
121110
},
111+
"engines": {
112+
"node": ">=16",
113+
"npm": "forbidden, use pnpm",
114+
"pnpm": ">=6",
115+
"yarn": "forbidden, use pnpm"
116+
},
122117
"publishConfig": {
123118
"access": "public"
124119
},
@@ -127,5 +122,8 @@
127122
"style": "module",
128123
"parser": "typescript"
129124
}
125+
},
126+
"simple-git-hooks": {
127+
"pre-commit": "pnpm lint-staged"
130128
}
131129
}

0 commit comments

Comments
 (0)