Skip to content

Commit c1249b8

Browse files
authored
ci: update Node.js, pnpm and workflows (#1355)
* chore: update Node.js to 26 and pnpm to 12 pnpm 12 reads build script approvals from allowBuilds instead of onlyBuiltDependencies. * ci: align workflows with the Trigen baseline Every job takes Node.js from .tool-versions and pnpm 12, actions are pinned to release commits, which renovate keeps current, and the token of a run only reads unless a job needs more. Tests run as separate types, lint and unit jobs; checks add package.json linting; commitlint runs from the repository; the release job is ready for npm trusted publishing. * chore: measure size with the small-lib preset The big-lib preset runs the bundle in headless Chrome, which no longer works; the small-lib preset measures what a consumer ships, for the whole package and for single components, with limits pinned on a 50 B step. * chore: fix package.json lint errors The description ends with a period and the homepage, now the documentation website, follows the license. * chore: replace the Stack Overflow link with a question template The react-chartjs-2 tag on Stack Overflow gets no new questions since 2025. The bug report now points to the StackBlitz sandbox. * chore: add funding links npm fund and the Sponsor button of the repository point to Ko-fi, as in the other repositories of the maintainer. * chore: send questions to GitHub Discussions Questions go to the Q&A category of Discussions instead of issues, so they stay apart from bug reports and an answer can be marked.
1 parent 859802f commit c1249b8

19 files changed

Lines changed: 485 additions & 1625 deletions

‎.github/FUNDING.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ko_fi: dangreen

‎.github/ISSUE_TEMPLATE/bug-report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ body:
3030
label: Reproduction
3131
description: |
3232
Please provide issue reproduction.
33-
You can give a link to a repository with the reproduction or make a fork of [this sandbox](https://codesandbox.io/s/github/reactchartjs/react-chartjs-2/tree/master/sandboxes/chart/ref) and reproduce the issue there.
33+
You can give a link to a repository with the reproduction or make a fork of [this sandbox](https://stackblitz.com/github/reactchartjs/react-chartjs-2/tree/master/sandboxes/chart/ref) and reproduce the issue there.
3434
validations:
3535
required: true
3636

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
21
blank_issues_enabled: false
32
contact_links:
43
- name: 🤔 Have a Question?
5-
url: https://stackoverflow.com/questions/tagged/react-chartjs-2
6-
about: Feel free to ask questions on Stack Overflow.
4+
url: https://github.com/reactchartjs/react-chartjs-2/discussions/categories/q-a
5+
about: Check the FAQ at https://react-chartjs-2.js.org/faq/ first, then ask in GitHub Discussions.
76
- name: 📊 Have a Problem With Chart.js?
87
url: https://github.com/chartjs/Chart.js/issues
98
about: react-chartjs-2 is just the wrapper around Chart.js, so if you are experiencing an issue with charts rendering, please create a related issue in Chart.js repository.

‎.github/renovate.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": [
3-
"config:base",
4-
":preserveSemverRanges"
3+
"config:recommended",
4+
":preserveSemverRanges",
5+
"helpers:pinGitHubActionDigests"
56
]
67
}

‎.github/workflows/checks.yml‎

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,95 +3,98 @@ on:
33
pull_request:
44
branches:
55
- master
6+
# The token of a run only reads: code that a pull request runs cannot push or start a release with it
7+
permissions:
8+
contents: read
69
jobs:
710
size:
811
runs-on: ubuntu-latest
912
name: size-limit
1013
steps:
1114
- name: Checkout the repository
12-
uses: actions/checkout@v5
15+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1316
- name: Install pnpm
14-
uses: pnpm/action-setup@v4
17+
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
1518
with:
16-
version: 10
19+
version: 12
1720
- name: Install Node.js
18-
uses: actions/setup-node@v6
21+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
1922
with:
20-
node-version: 22
23+
node-version-file: .tool-versions
2124
cache: 'pnpm'
25+
- name: Install dependencies
26+
run: pnpm install
27+
- name: Build package
28+
run: pnpm build
2229
- name: Check size
23-
uses: andresz1/size-limit-action@master
24-
with:
25-
github_token: ${{ secrets.GITHUB_TOKEN }}
26-
typings:
30+
run: pnpm test:size
31+
editorconfig:
32+
runs-on: ubuntu-latest
33+
name: editorconfig
34+
steps:
35+
- name: Checkout the repository
36+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37+
- name: Install editorconfig-checker
38+
uses: editorconfig-checker/action-editorconfig-checker@51f63319f592f97930c73d9c46184d20bd206393 # v3.0.0
39+
- name: Check editorconfig
40+
run: editorconfig-checker
41+
package-json:
2742
runs-on: ubuntu-latest
28-
name: typings
43+
name: package.json
2944
steps:
3045
- name: Checkout the repository
31-
uses: actions/checkout@v5
46+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3247
- name: Install pnpm
33-
uses: pnpm/action-setup@v4
48+
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
3449
with:
35-
version: 10
50+
version: 12
3651
- name: Install Node.js
37-
uses: actions/setup-node@v6
52+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
3853
with:
39-
node-version: 22
54+
node-version-file: .tool-versions
4055
cache: 'pnpm'
41-
- name: Install dependencies
42-
run: pnpm install
43-
- name: Prebuild
44-
run: pnpm build
45-
- name: Check typings
46-
if: success()
47-
run: pnpm test:typings
56+
# The sandboxes and the website are private apps, not published packages
57+
- name: Check package.json files
58+
run: pnpm --package=@trigen/lint-package-json dlx lint-package-json --ignore sandboxes --ignore website
4859
storybook:
4960
runs-on: ubuntu-latest
5061
name: storybook
5162
steps:
5263
- name: Checkout the repository
53-
uses: actions/checkout@v5
64+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5465
- name: Install pnpm
55-
uses: pnpm/action-setup@v4
66+
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
5667
with:
57-
version: 10
68+
version: 12
5869
- name: Install Node.js
59-
uses: actions/setup-node@v6
70+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
6071
with:
61-
node-version: 22
72+
node-version-file: .tool-versions
6273
cache: 'pnpm'
6374
- name: Install dependencies
6475
run: pnpm install
65-
- name: Check storybook
76+
- name: Build storybook
6677
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@v5
73-
- name: Check editorconfig
74-
uses: editorconfig-checker/action-editorconfig-checker@main
7578
website:
7679
runs-on: ubuntu-latest
7780
name: website
7881
steps:
7982
- name: Checkout the repository
80-
uses: actions/checkout@v5
83+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8184
- name: Install pnpm
82-
uses: pnpm/action-setup@v4
85+
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
8386
with:
84-
version: 10
87+
version: 12
8588
- name: Install Node.js
86-
uses: actions/setup-node@v6
89+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
8790
with:
88-
node-version: 22
91+
node-version-file: .tool-versions
8992
cache: 'pnpm'
9093
- name: Install dependencies
9194
run: pnpm install
9295
- name: Install website dependencies
9396
run: pnpm install
9497
working-directory: ./website
95-
- name: Check website
98+
- name: Build website
9699
run: pnpm build
97100
working-directory: ./website

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎.github/workflows/commit.yml‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
name: Commit
22
on:
33
push:
4+
# The token of a run only reads: code that a commit runs cannot push or start a release with it
5+
permissions:
6+
contents: read
47
jobs:
58
commitlint:
69
runs-on: ubuntu-latest
710
name: commitlint
811
steps:
912
- name: Checkout the repository
10-
uses: actions/checkout@v5
13+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1114
with:
1215
fetch-depth: 0
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
18+
with:
19+
version: 12
20+
- name: Install Node.js
21+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
22+
with:
23+
node-version-file: .tool-versions
24+
cache: 'pnpm'
25+
- name: Install dependencies
26+
run: pnpm install
1327
- name: Run commitlint
14-
uses: wagoid/commitlint-github-action@v6
28+
run: pnpm commitlint --from=HEAD~1

‎.github/workflows/release.yml‎

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
name: Release
22
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: Force specific version
7+
type: string
8+
as:
9+
description: Release type
10+
type: choice
11+
options:
12+
- ''
13+
- major
14+
- minor
15+
- patch
16+
- prerelease
17+
prerelease:
18+
description: Pre-release identifier (e.g. alpha, beta)
19+
type: string
320
issue_comment:
421
types: [created, deleted]
522
push:
@@ -9,15 +26,17 @@ jobs:
926
check:
1027
runs-on: ubuntu-latest
1128
name: Context check
29+
permissions:
30+
contents: read
1231
outputs:
1332
continue: ${{ steps.check.outputs.continue }}
1433
workflow: ${{ steps.check.outputs.workflow }}
1534
steps:
1635
- name: Checkout the repository
17-
uses: actions/checkout@v5
36+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1837
- name: Context check
1938
id: check
20-
uses: trigensoftware/simple-release-action@latest
39+
uses: trigensoftware/simple-release-action@d6c798a10c91ad1e1c2376b4867c2ddfd94d9978 # v3.0.0
2140
with:
2241
workflow: check
2342
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -26,36 +45,47 @@ jobs:
2645
name: Pull request
2746
needs: check
2847
if: needs.check.outputs.workflow == 'pull-request'
48+
# The release branch is pushed and the release pull request is created or updated
49+
permissions:
50+
contents: write
51+
pull-requests: write
2952
steps:
3053
- name: Checkout the repository
31-
uses: actions/checkout@v5
54+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3255
- name: Create or update pull request
33-
uses: trigensoftware/simple-release-action@latest
56+
uses: trigensoftware/simple-release-action@d6c798a10c91ad1e1c2376b4867c2ddfd94d9978 # v3.0.0
3457
with:
3558
workflow: pull-request
3659
github-token: ${{ secrets.GITHUB_TOKEN }}
60+
bump-version: ${{ inputs.version }}
61+
bump-as: ${{ inputs.as }}
62+
bump-prerelease: ${{ inputs.prerelease }}
3763
release:
3864
runs-on: ubuntu-latest
3965
name: Release
4066
needs: check
4167
if: needs.check.outputs.workflow == 'release'
68+
# The tag and the GitHub release are created; id-token lets npm trusted publishing replace the token once it is set up
69+
permissions:
70+
contents: write
71+
id-token: write
4272
steps:
4373
- name: Checkout the repository
44-
uses: actions/checkout@v5
74+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4575
- name: Install pnpm
46-
uses: pnpm/action-setup@v4
76+
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
4777
with:
48-
version: 10
78+
version: 12
4979
- name: Install Node.js
50-
uses: actions/setup-node@v6
80+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
5181
with:
52-
node-version: 22
82+
node-version-file: .tool-versions
5383
cache: 'pnpm'
5484
registry-url: 'https://registry.npmjs.org'
5585
- name: Install dependencies
5686
run: pnpm install
5787
- name: Release
58-
uses: trigensoftware/simple-release-action@latest
88+
uses: trigensoftware/simple-release-action@d6c798a10c91ad1e1c2376b4867c2ddfd94d9978 # v3.0.0
5989
with:
6090
workflow: release
6191
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)