Skip to content

Commit e39e128

Browse files
authored
Upgrade Vite and related dependencies (#733)
* Upgrade Vite and related dependencies Updated Vite, @vitejs/plugin-react, vite-plugin-dts, and vitest to latest versions in package.json. Added Node.js engine requirement. Updated Vite build config with new target and external mapping for react/jsx-runtime. * Update GitHub Actions to latest versions and Node 22 Upgraded actions/checkout to v4 and actions/setup-node to v4 in deployment workflow. Updated Node.js version from 20.x to 22.x for both unit-tests and build jobs. * Update Chromatic to v13.3.4 and use latest GitHub Action Bumped Chromatic dependency to version 13.3.4 in package.json and yarn.lock. Updated the deployment workflow to use chromaui/action@latest for publishing to Chromatic. * Set fetch-depth to 0 in deployment workflow Configures the checkout action to fetch the full git history, which is required for Chromatic to determine baseline commits during deployment. * Remove @radix-ui/rect from yarn.lock
1 parent d7a4b08 commit e39e128

File tree

4 files changed

+1010
-334
lines changed

4 files changed

+1010
-334
lines changed

.github/workflows/deployment.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
unit-tests:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '20.x'
17+
node-version: '22.x'
1818
- name: Enable Corepack
1919
run: corepack enable
2020
- name: Install dependencies
@@ -33,17 +33,19 @@ jobs:
3333
runs-on: ubuntu-latest
3434
# Job steps
3535
steps:
36-
- uses: actions/checkout@v1
37-
- uses: actions/setup-node@v3
36+
- uses: actions/checkout@v4
3837
with:
39-
node-version: '20.x'
38+
fetch-depth: 0 # Required for Chromatic to determine baseline commits
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: '22.x'
4042
- name: Enable Corepack
4143
run: corepack enable
4244
- name: Install dependencies
4345
run: yarn install --immutable
4446
# 👇 Adds Chromatic as a step in the workflow
4547
- name: Publish to Chromatic
46-
uses: chromaui/action@v1
48+
uses: chromaui/action@latest
4749
# Chromatic GitHub Action options
4850
with:
4951
# 👇 Chromatic projectToken, refer to the manage page to obtain it.

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@
9595
"@types/styled-components": "^5.1.34",
9696
"@typescript-eslint/eslint-plugin": "^8",
9797
"@typescript-eslint/parser": "^8",
98-
"@vitejs/plugin-react": "^4.2.1",
98+
"@vitejs/plugin-react": "^5.1.2",
9999
"babel-plugin-styled-components": "^2.1.4",
100-
"chromatic": "^13.3.3",
100+
"chromatic": "^13.3.4",
101101
"date-fns": "4.1.0",
102102
"dayjs": "1.11.13",
103103
"eslint": "^9",
@@ -118,9 +118,9 @@
118118
"ts-node": "^10.9.1",
119119
"typescript": "^5.5.3",
120120
"typescript-eslint": "^8",
121-
"vite": "^5.2.11",
122-
"vite-plugin-dts": "^3.9.1",
123-
"vitest": "^2.0.3",
121+
"vite": "^7.3.0",
122+
"vite-plugin-dts": "^4.3.0",
123+
"vitest": "^2.1.8",
124124
"watch": "^1.0.2"
125125
},
126126
"peerDependencies": {
@@ -133,5 +133,8 @@
133133
"@types/react": "18.3.2",
134134
"@types/react-dom": "18.3.0"
135135
},
136-
"packageManager": "[email protected]"
136+
"packageManager": "[email protected]",
137+
"engines": {
138+
"node": ">=22.12.0"
139+
}
137140
}

vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if (!isBundledBuild) {
2424
}
2525

2626
const buildOptions: BuildOptions = {
27+
target: 'baseline-widely-available',
2728
emptyOutDir: false,
2829
minify: false,
2930
lib: {
@@ -42,6 +43,7 @@ const buildOptions: BuildOptions = {
4243
react: "React",
4344
"styled-components": "styled",
4445
"react-dom": "ReactDOM",
46+
"react/jsx-runtime": "jsxRuntime",
4547
},
4648
},
4749
},

0 commit comments

Comments
 (0)