Skip to content

Commit 99e7cab

Browse files
authored
chore: grooming (#1019)
1 parent a7bd4e4 commit 99e7cab

13 files changed

+55
-52
lines changed

.commitlintrc .commitlintrc.json

File renamed without changes.

.eslintrc .eslintrc.json

File renamed without changes.

.github/workflows/checks.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ on:
66
jobs:
77
size:
88
runs-on: ubuntu-latest
9-
name: Checking size
10-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
11-
env:
12-
CI_JOB_NUMBER: 1
9+
name: size-limit
1310
steps:
1411
- name: Checkout the repository
1512
uses: actions/checkout@v2
@@ -22,17 +19,13 @@ jobs:
2219
with:
2320
node-version: 16
2421
cache: 'pnpm'
25-
- name: Install dependencies
26-
run: pnpm install
2722
- name: Check size
28-
uses: andresz1/size-limit-action@v1
23+
uses: andresz1/size-limit-action@master
2924
with:
3025
github_token: ${{ secrets.GITHUB_TOKEN }}
31-
skip_step: install
3226
typings:
3327
runs-on: ubuntu-latest
34-
name: Checking typings
35-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
28+
name: typings
3629
steps:
3730
- name: Checkout the repository
3831
uses: actions/checkout@v2
@@ -54,8 +47,7 @@ jobs:
5447
run: pnpm test:typings
5548
storybook:
5649
runs-on: ubuntu-latest
57-
name: Checking storybook
58-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
50+
name: storybook
5951
steps:
6052
- name: Checkout the repository
6153
uses: actions/checkout@v2
@@ -72,3 +64,11 @@ jobs:
7264
run: pnpm install
7365
- name: Check storybook
7466
run: pnpm build:storybook
67+
editorconfig:
68+
runs-on: ubuntu-latest
69+
name: editorconfig
70+
steps:
71+
- name: Checkout the repository
72+
uses: actions/checkout@v2
73+
- name: Check editorconfig
74+
uses: editorconfig-checker/action-editorconfig-checker@v1

.github/workflows/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: CI
22
on:
3-
push:
43
pull_request:
4+
push:
5+
branches:
6+
- master
57
jobs:
68
test:
79
runs-on: ubuntu-latest
8-
name: Running tests
9-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
10+
name: Tests
1011
steps:
1112
- name: Checkout the repository
1213
uses: actions/checkout@v2

.github/workflows/commit.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Commit
22
on:
33
push:
44
jobs:
5-
conventional-commit:
5+
commitlint:
66
runs-on: ubuntu-latest
7-
name: Checking commit name
7+
name: commitlint
88
steps:
99
- name: Checkout the repository
1010
uses: actions/checkout@v2

.github/workflows/publish.yml .github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Publish Package
1+
name: Release
22
on:
33
release:
44
types: [created]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
name: Publish package
89
steps:
910
- name: Checkout the repository
1011
uses: actions/checkout@v2

.size-limit .size-limit.json

File renamed without changes.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
44

55
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ Supports Chart.js v3 and v2.
4343
Install this library with peer dependencies:
4444

4545
```bash
46-
npm install --save react-chartjs-2 chart.js
46+
pnpm add react-chartjs-2 chart.js
47+
# or
48+
yarn add react-chartjs-2 chart.js
49+
# or
50+
npm i react-chartjs-2 chart.js
4751
```
4852

4953
We recommend using `chart.js@^3.0.0`.
@@ -58,7 +62,7 @@ import { Doughnut } from 'react-chartjs-2';
5862

5963
Need an API to fetch data? Consider [Cube](https://cube.dev/?ref=eco-react-chartjs), an open-source API for data apps.
6064

61-
# Docs
65+
## Docs
6266

6367
- [Migration to v4](https://react-chartjs-2.js.org/docs/migration-to-v4)
6468
- [Working with datasets](https://react-chartjs-2.js.org/docs/working-with-datasets)

jest.config.json

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
{
2-
"testEnvironment": "jsdom",
3-
"testRegex": "test/.*\\.test\\.(jsx?|tsx?)$",
2+
"testEnvironment": "jsdom",
3+
"testRegex": "test/.*\\.test\\.(jsx?|tsx?)$",
44
"setupFilesAfterEnv": ["<rootDir>/test/setup.js"],
5-
"transform": {
6-
"^.+\\.(t|j)sx?$": ["@swc/jest", {
7-
"module": {
8-
"type": "commonjs"
9-
},
5+
"transform": {
6+
"^.+\\.(t|j)sx?$": ["@swc/jest", {
107
"env": {
118
"targets": {
129
"node": 12
1310
}
1411
}
15-
}]
16-
},
17-
"collectCoverage": true,
18-
"collectCoverageFrom": [
19-
"src/**/*.{js,jsx,ts,tsx}",
20-
"!**/node_modules/**"
21-
],
22-
"coverageReporters": [
23-
"lcovonly",
24-
"text"
25-
]
12+
}]
13+
},
14+
"collectCoverage": true,
15+
"collectCoverageFrom": [
16+
"src/**/*.{js,jsx,ts,tsx}",
17+
"!**/node_modules/**"
18+
],
19+
"coverageReporters": [
20+
"lcovonly",
21+
"text"
22+
]
2623
}

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212
"bugs": {
1313
"url": "https://github.com/reactchartjs/react-chartjs-2/issues"
1414
},
15-
"sideEffects": false,
16-
"main": "./src/index.tsx",
17-
"types": "./dist/index.d.ts",
18-
"publishConfig": {
19-
"main": "./dist/index.cjs",
20-
"module": "./dist/index.js",
21-
"directory": "package"
22-
},
2315
"keywords": [
2416
"chart",
2517
"chart-js",
@@ -28,10 +20,21 @@
2820
"react chart.js",
2921
"react-chart.js"
3022
],
23+
"sideEffects": false,
24+
"types": "./dist/index.d.ts",
25+
"main": "./src/index.tsx",
26+
"publishConfig": {
27+
"main": "./dist/index.cjs",
28+
"module": "./dist/index.js",
29+
"directory": "package"
30+
},
31+
"files": [
32+
"dist"
33+
],
3134
"scripts": {
3235
"prepublishOnly": "pnpm test && pnpm build && del ./package && clean-publish",
3336
"postpublish": "del ./package",
34-
"emitDeclarations": "tsc --skipLibCheck --emitDeclarationOnly",
37+
"emitDeclarations": "tsc --emitDeclarationOnly",
3538
"build": "rollup -c & pnpm emitDeclarations",
3639
"start:storybook": "start-storybook -p 6006 --ci",
3740
"build:storybook": "del ./storybook-static; NODE_ENV=production build-storybook",
@@ -121,8 +124,5 @@
121124
}
122125
}
123126
},
124-
"files": [
125-
"dist"
126-
],
127127
"readme": ""
128128
}

test/.eslintrc test/.eslintrc.json

File renamed without changes.

website/docs/faq/why-two.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ slug: /faq/why-two
66

77
Initially, this library was [created in 2016](https://github.com/reactchartjs/react-chartjs-2/commit/d8cbcb7dc050d749771c6bb1347e22ec63bdddf9#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R3) as a wrapper for Chart.js v2.
88

9-
Later, it was updated to support [Chart.js v3](https://www.chartjs.org/docs/latest/getting-started/v3-migration.html) — a huge yet backwards-incompatible release with new features and performance improvements. However, the name persisted.
9+
Later, it was updated to support [Chart.js v3](https://www.chartjs.org/docs/latest/getting-started/v3-migration.html) — a huge yet backwards-incompatible release with new features and performance improvements. However, the name persisted.

0 commit comments

Comments
 (0)