Skip to content

Commit 04c58a6

Browse files
authored
ci: move from yarn to pnpm (#990)
1 parent 4a01054 commit 04c58a6

19 files changed

+25553
-23632
lines changed

.clean-publish

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"packageManager": "yarn",
2+
"withoutPublush": true,
3+
"tempDir": "package",
34
"fields": ["tsd"]
45
}

.github/dependabot.yml

-7
This file was deleted.

.github/renovate.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"config:base",
4+
":preserveSemverRanges"
5+
]
6+
}

.github/workflows/checks.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,42 @@ jobs:
1313
steps:
1414
- name: Checkout the repository
1515
uses: actions/checkout@v2
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v2.0.1
18+
with:
19+
version: 6
20+
- name: Install Node.js
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 12
24+
cache: 'pnpm'
25+
- name: Install dependencies
26+
run: pnpm install
1627
- name: Check size
1728
uses: andresz1/size-limit-action@v1
1829
with:
1930
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
skip_step: install
2032
typings:
2133
runs-on: ubuntu-latest
2234
name: Checking typings
2335
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2436
steps:
2537
- name: Checkout the repository
2638
uses: actions/checkout@v2
39+
- name: Install pnpm
40+
uses: pnpm/action-setup@v2.0.1
41+
with:
42+
version: 6
2743
- name: Install Node.js
2844
uses: actions/setup-node@v2
2945
with:
3046
node-version: 12
47+
cache: 'pnpm'
3148
- name: Install dependencies
32-
uses: bahmutov/npm-install@v1
33-
with:
34-
install-command: yarn --frozen-lockfile --ignore-engines
49+
run: pnpm install
3550
- name: Prebuild
36-
run: yarn build
51+
run: pnpm build
3752
- name: Check typings
3853
if: success()
39-
run: yarn test:typings
54+
run: pnpm test:typings

.github/workflows/ci.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ jobs:
1010
steps:
1111
- name: Checkout the repository
1212
uses: actions/checkout@v2
13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v2.0.1
15+
with:
16+
version: 6
1317
- name: Install Node.js
1418
uses: actions/setup-node@v2
1519
with:
1620
node-version: 12
21+
cache: 'pnpm'
1722
- name: Install dependencies
18-
uses: bahmutov/npm-install@v1
19-
with:
20-
install-command: yarn --frozen-lockfile --ignore-engines
23+
run: pnpm install
2124
- name: Run tests
22-
run: yarn test
25+
run: pnpm test
2326
- name: Collect coverage
2427
uses: codecov/codecov-action@v2
2528
if: success()

.gitignore

+2-10
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,15 @@
44
node_modules
55

66
# builds
7-
build
7+
package
88
dist
9-
.rpt2_cache
109

1110
# misc
1211
.DS_Store
1312
.env
14-
.env.local
15-
.env.development.local
16-
.env.test.local
17-
.env.production.local
13+
.env.*
1814

1915
npm-debug.log*
20-
yarn-debug.log*
21-
yarn-error.log*
22-
23-
react-app-env.d.ts
2416

2517
# testing
2618
coverage

.simple-git-hooks.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"commit-msg": "yarn commitlint --edit \"$1\"",
3-
"pre-commit": "yarn nano-staged",
4-
"pre-push": "yarn test"
2+
"commit-msg": "pnpm commitlint --edit \"$1\"",
3+
"pre-commit": "pnpm nano-staged",
4+
"pre-push": "pnpm test"
55
}

.size-limit

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"path": "dist/index.modern.js",
15-
"limit": "1.5 KB",
15+
"limit": "1.6 KB",
1616
"webpack": false,
1717
"running": false
1818
},

netlify.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build.environment]
2+
NPM_FLAGS = "--version" # prevent Netlify npm install
3+
[build]
4+
publish = "website/build"
5+
command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm add -D ./website --store=node_modules/.pnpm-store && cd website && npx pnpm build"

package.json

+13-7
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,21 @@
2626
],
2727
"scripts": {
2828
"emitDeclarations": "tsc --skipLibCheck --emitDeclarationOnly",
29-
"build": "rollup -c & yarn emitDeclarations",
30-
"prepublishOnly": "yarn build",
29+
"build": "rollup -c & pnpm emitDeclarations",
30+
"prepublishOnly": "pnpm test && pnpm build && del ./package && clean-publish",
31+
"postpublish": "del ./package",
3132
"start:storybook": "start-storybook -p 6006 --ci",
3233
"test:lint": "eslint 'src/**/*.{ts,tsx}' 'stories/**/*.{ts,tsx}' 'sandboxes/**/*.{ts,tsx}' 'test/**/*.{ts,tsx}'",
3334
"test:unit": "jest -c jest.config.json",
34-
"test:build": "yarn build",
35+
"test:build": "pnpm build",
3536
"test:size": "size-limit",
3637
"test:typings": "tsd",
37-
"test": "yarn test:lint && yarn test:unit && yarn test:build",
38+
"test": "pnpm test:lint && pnpm test:unit && pnpm test:build",
3839
"format": "prettier --write src",
3940
"commit": "cz",
4041
"release": "standard-version",
41-
"cleanPublish": "yarn test && clean-publish",
4242
"updateGitHooks": "simple-git-hooks"
4343
},
44-
"dependencies": {},
4544
"peerDependencies": {
4645
"chart.js": "^3.5.0",
4746
"react": "^16.8.0 || ^17.0.0"
@@ -66,6 +65,7 @@
6665
"@types/faker": "^5.5.8",
6766
"@types/jest": "^27.0.2",
6867
"@types/lodash": "^4.14.150",
68+
"@types/node": "^17.0.8",
6969
"@types/react": "^17.0.28",
7070
"@types/react-dom": "^17.0.10",
7171
"@typescript-eslint/eslint-plugin": "^5.0.0",
@@ -76,6 +76,7 @@
7676
"clean-publish": "^3.4.1",
7777
"commitizen": "^4.2.4",
7878
"date-fns": "^2.25.0",
79+
"del": "^6.0.0",
7980
"eslint": "^7.32.0",
8081
"eslint-config-prettier": "^8.3.0",
8182
"eslint-config-standard": "^16.0.3",
@@ -86,6 +87,7 @@
8687
"eslint-plugin-promise": "^5.1.0",
8788
"eslint-plugin-react": "^7.17.0",
8889
"faker": "^5.5.3",
90+
"inquirer": "^8.2.0",
8991
"jest": "^27.2.5",
9092
"jest-canvas-mock": "^2.2.0",
9193
"nano-staged": "^0.5.0",
@@ -114,5 +116,9 @@
114116
},
115117
"files": [
116118
"dist"
117-
]
119+
],
120+
"publishConfig": {
121+
"directory": "package"
122+
},
123+
"readme": ""
118124
}

0 commit comments

Comments
 (0)