Skip to content

Commit

Permalink
chore: grooming (reactchartjs#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen authored Feb 18, 2022
1 parent a7bd4e4 commit 99e7cab
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 52 deletions.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ on:
jobs:
size:
runs-on: ubuntu-latest
name: Checking size
if: "!contains(github.event.head_commit.message, '[ci skip]')"
env:
CI_JOB_NUMBER: 1
name: size-limit
steps:
- name: Checkout the repository
uses: actions/checkout@v2
Expand All @@ -22,17 +19,13 @@ jobs:
with:
node-version: 16
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Check size
uses: andresz1/size-limit-action@v1
uses: andresz1/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_step: install
typings:
runs-on: ubuntu-latest
name: Checking typings
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: typings
steps:
- name: Checkout the repository
uses: actions/checkout@v2
Expand All @@ -54,8 +47,7 @@ jobs:
run: pnpm test:typings
storybook:
runs-on: ubuntu-latest
name: Checking storybook
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: storybook
steps:
- name: Checkout the repository
uses: actions/checkout@v2
Expand All @@ -72,3 +64,11 @@ jobs:
run: pnpm install
- name: Check storybook
run: pnpm build:storybook
editorconfig:
runs-on: ubuntu-latest
name: editorconfig
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Check editorconfig
uses: editorconfig-checker/action-editorconfig-checker@v1
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: CI
on:
push:
pull_request:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
name: Running tests
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Tests
steps:
- name: Checkout the repository
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Commit
on:
push:
jobs:
conventional-commit:
commitlint:
runs-on: ubuntu-latest
name: Checking commit name
name: commitlint
steps:
- name: Checkout the repository
uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Publish Package
name: Release
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
name: Publish package
steps:
- name: Checkout the repository
uses: actions/checkout@v2
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

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

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.
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.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ Supports Chart.js v3 and v2.
Install this library with peer dependencies:

```bash
npm install --save react-chartjs-2 chart.js
pnpm add react-chartjs-2 chart.js
# or
yarn add react-chartjs-2 chart.js
# or
npm i react-chartjs-2 chart.js
```

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

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

# Docs
## Docs

- [Migration to v4](https://react-chartjs-2.js.org/docs/migration-to-v4)
- [Working with datasets](https://react-chartjs-2.js.org/docs/working-with-datasets)
Expand Down
33 changes: 15 additions & 18 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
{
"testEnvironment": "jsdom",
"testRegex": "test/.*\\.test\\.(jsx?|tsx?)$",
"testEnvironment": "jsdom",
"testRegex": "test/.*\\.test\\.(jsx?|tsx?)$",
"setupFilesAfterEnv": ["<rootDir>/test/setup.js"],
"transform": {
"^.+\\.(t|j)sx?$": ["@swc/jest", {
"module": {
"type": "commonjs"
},
"transform": {
"^.+\\.(t|j)sx?$": ["@swc/jest", {
"env": {
"targets": {
"node": 12
}
}
}]
},
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!**/node_modules/**"
],
"coverageReporters": [
"lcovonly",
"text"
]
}]
},
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!**/node_modules/**"
],
"coverageReporters": [
"lcovonly",
"text"
]
}
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
"bugs": {
"url": "https://github.com/reactchartjs/react-chartjs-2/issues"
},
"sideEffects": false,
"main": "./src/index.tsx",
"types": "./dist/index.d.ts",
"publishConfig": {
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"directory": "package"
},
"keywords": [
"chart",
"chart-js",
Expand All @@ -28,10 +20,21 @@
"react chart.js",
"react-chart.js"
],
"sideEffects": false,
"types": "./dist/index.d.ts",
"main": "./src/index.tsx",
"publishConfig": {
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"directory": "package"
},
"files": [
"dist"
],
"scripts": {
"prepublishOnly": "pnpm test && pnpm build && del ./package && clean-publish",
"postpublish": "del ./package",
"emitDeclarations": "tsc --skipLibCheck --emitDeclarationOnly",
"emitDeclarations": "tsc --emitDeclarationOnly",
"build": "rollup -c & pnpm emitDeclarations",
"start:storybook": "start-storybook -p 6006 --ci",
"build:storybook": "del ./storybook-static; NODE_ENV=production build-storybook",
Expand Down Expand Up @@ -121,8 +124,5 @@
}
}
},
"files": [
"dist"
],
"readme": ""
}
File renamed without changes.
2 changes: 1 addition & 1 deletion website/docs/faq/why-two.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ slug: /faq/why-two

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.

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.
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 comments on commit 99e7cab

Please sign in to comment.