Skip to content

Commit 04c58a6

Browse files
authoredJan 13, 2022
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
}

‎pnpm-lock.yaml

+14,742
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎website/.gitignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010

1111
# Misc
1212
.DS_Store
13-
.env.local
14-
.env.development.local
15-
.env.test.local
16-
.env.production.local
13+
.env.*
1714

1815
npm-debug.log*
19-
yarn-debug.log*
20-
yarn-error.log*

‎website/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
55
### Installation
66

77
```
8-
$ yarn
8+
$ pnpm install
99
```
1010

1111
### Local Development
1212

1313
```
14-
$ yarn start
14+
$ pnpm start
1515
```
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

1919
### Build
2020

2121
```
22-
$ yarn build
22+
$ pnpm build
2323
```
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2626

2727
### Deployment
2828

2929
```
30-
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true pnpm deploy
3131
```
3232

3333
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

‎website/docs/chartjs-v2.md

-36
This file was deleted.

‎website/docs/chartjs-v2.mdx

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
slug: /docs/chartjs-v2
3+
description: Using react-chartjs-2 with Chart.js v2
4+
---
5+
6+
import Tabs from '@theme/Tabs';
7+
import TabItem from '@theme/TabItem';
8+
9+
# Using with Chart.js v2
10+
11+
If your app needs [Chart.js v2](https://www.chartjs.org/docs/2.9.4/), please use a [compatible version](https://www.npmjs.com/package/react-chartjs-2/v/2.11.2) of this library:
12+
13+
<Tabs>
14+
<TabItem value="yarn" default>
15+
16+
```bash
17+
yarn add chart.js@^2.9.4 react-chartjs-2@^2.11.2
18+
```
19+
20+
</TabItem>
21+
<TabItem value="pnpm">
22+
23+
```bash
24+
pnpm add chart.js@^2.9.4 react-chartjs-2@^2.11.2
25+
```
26+
27+
</TabItem>
28+
<TabItem value="npm">
29+
30+
```bash
31+
npm install --save chart.js@^2.9.4 react-chartjs-2@^2.11.2
32+
```
33+
34+
</TabItem>
35+
</Tabs>
36+
37+
Also, please consider upgrading your app to [Chart.js v3](#upgrading-to-chartjs-v3).
38+
39+
## Upgrading to Chart.js v3
40+
41+
First, upgrade packages. You'll need to install Chart.js v3 and the latest version of this library:
42+
43+
<Tabs>
44+
<TabItem value="yarn" default>
45+
46+
```bash
47+
yarn add chart.js@^3.6.0 react-chartjs-2@latest
48+
```
49+
50+
</TabItem>
51+
<TabItem value="pnpm">
52+
53+
```bash
54+
pnpm add chart.js@^3.6.0 react-chartjs-2@latest
55+
```
56+
57+
</TabItem>
58+
<TabItem value="npm">
59+
60+
```bash
61+
npm install --save chart.js@^3.6.0 react-chartjs-2@latest
62+
```
63+
64+
</TabItem>
65+
</Tabs>
66+
67+
Then, please follow the [this guide](/docs/migration-to-v4).

‎website/docs/index.mdx

+24-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ slug: /
33
description: React components for Chart.js
44
---
55

6+
import Tabs from '@theme/Tabs';
7+
import TabItem from '@theme/TabItem';
68
import Logo from '@site/static/img/logo.svg';
79

810
# react-chartjs-2
@@ -21,15 +23,29 @@ Supports Chart.js v3 (read below) and Chart.js v2 (see [this guide](/docs/chartj
2123

2224
Install this library with peer dependencies:
2325

24-
```bash
25-
yarn add chart.js react-chartjs-2
26-
```
26+
<Tabs>
27+
<TabItem value="yarn" default>
2728

28-
or
29+
```bash
30+
yarn add chart.js react-chartjs-2
31+
```
2932

30-
```bash
31-
npm install --save chart.js react-chartjs-2
32-
```
33+
</TabItem>
34+
<TabItem value="pnpm">
35+
36+
```bash
37+
pnpm add chart.js react-chartjs-2
38+
```
39+
40+
</TabItem>
41+
<TabItem value="npm">
42+
43+
```bash
44+
npm install --save chart.js react-chartjs-2
45+
```
46+
47+
</TabItem>
48+
</Tabs>
3349

3450
Then, import and use individual components:
3551

@@ -55,4 +71,4 @@ Please check "[Chart.js Example with Dynamic Dataset](https://cube.dev/blog/char
5571

5672
Need help? Ask your question on [Slack](https://slack.cube.dev/?ref=eco-react-chartjs) or [Stack Overflow](https://stackoverflow.com/questions/tagged/react-chartjs-2).
5773

58-
If you've encountered an issue, please [file it on GitHub](https://github.com/reactchartjs/react-chartjs-2/issues).
74+
If you've encountered an issue, please [file it on GitHub](https://github.com/reactchartjs/react-chartjs-2/issues).

‎website/pnpm-lock.yaml

+10,656
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎website/yarn.lock

-9,800
This file was deleted.

‎yarn.lock

-13,740
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.