Skip to content

Commit 6680e60

Browse files
ako-vmammadataei
andauthored
feat: add support for vite v6 (#104)
Co-authored-by: Mohammad Ataei <[email protected]>
1 parent fc839cd commit 6680e60

File tree

10 files changed

+4725
-3763
lines changed

10 files changed

+4725
-3763
lines changed

.eslintrc.js

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

.github/workflows/check.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: pnpm/action-setup@v2
16-
with:
17-
version: 8
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v4
1816

19-
- uses: actions/setup-node@v3
17+
- uses: actions/setup-node@v4
2018
with:
21-
node-version: 16.x
19+
node-version: 22.x
2220
cache: 'pnpm'
2321

2422
- name: Install dependencies
@@ -31,14 +29,12 @@ jobs:
3129
runs-on: ubuntu-latest
3230

3331
steps:
34-
- uses: actions/checkout@v3
35-
- uses: pnpm/action-setup@v2
36-
with:
37-
version: 8
32+
- uses: actions/checkout@v4
33+
- uses: pnpm/action-setup@v4
3834

39-
- uses: actions/setup-node@v3
35+
- uses: actions/setup-node@v4
4036
with:
41-
node-version: 16.x
37+
node-version: 22.x
4238
cache: 'pnpm'
4339

4440
- name: Install dependencies
@@ -51,15 +47,14 @@ jobs:
5147
runs-on: ubuntu-latest
5248

5349
steps:
54-
- uses: actions/checkout@v3
55-
- uses: pnpm/action-setup@v2
50+
- uses: actions/checkout@v4
51+
- uses: pnpm/action-setup@v4
5652
with:
57-
version: 8
5853
run_install: false
5954

60-
- uses: actions/setup-node@v3
55+
- uses: actions/setup-node@v4
6156
with:
62-
node-version: 16.x
57+
node-version: 22.x
6358

6459
- name: Get pnpm store directory
6560
id: pnpm-cache

.github/workflows/release-please.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@ jobs:
1515
release-type: node
1616
package-name: cypress-vite
1717

18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
if: ${{ steps.release.outputs.release_created }}
2020

21-
- uses: pnpm/action-setup@v2
21+
- uses: pnpm/action-setup@v4
2222
with:
23-
version: 8
2423
run_install: false
2524
if: ${{ steps.release.outputs.release_created }}
2625

27-
- uses: actions/setup-node@v3
26+
- uses: actions/setup-node@v4
2827
with:
29-
node-version: 18.x
28+
node-version: 22.x
3029
if: ${{ steps.release.outputs.release_created }}
3130

3231
- name: Set pnpm publishing config

eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import tseslint from '@typescript-eslint/eslint-plugin'
2+
import tsparser from '@typescript-eslint/parser'
3+
import prettier from 'eslint-config-prettier'
4+
5+
export default [
6+
{
7+
ignores: ['node_modules/**', 'coverage/**', 'dist/**'],
8+
},
9+
{
10+
files: ['**/*.{js,ts,tsx}'],
11+
languageOptions: {
12+
parser: tsparser,
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
},
16+
},
17+
plugins: {
18+
'@typescript-eslint': tseslint,
19+
},
20+
rules: {
21+
...tseslint.configs['recommended'].rules,
22+
...prettier.rules,
23+
},
24+
},
25+
]

example/cypress.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { resolve } from 'path'
1+
import { fileURLToPath } from 'url'
2+
import { resolve, dirname } from 'path'
23
import { defineConfig } from 'cypress'
34
import vitePreprocessor from 'cypress-vite'
45

6+
const __filename = fileURLToPath(import.meta.url)
7+
const __dirname = dirname(__filename)
8+
59
export default defineConfig({
610
e2e: {
711
baseUrl: 'http://localhost:5173/',

example/package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "example",
33
"private": true,
44
"version": "0.0.0",
5+
"type": "module",
56
"scripts": {
67
"dev": "vite",
78
"cypress": "start-server-and-test dev http://localhost:5173 'cypress open'",
@@ -11,26 +12,26 @@
1112
"preview": "vite preview"
1213
},
1314
"dependencies": {
14-
"react": "^18.2.0",
15-
"react-dom": "^18.2.0",
15+
"react": "^18.3.1",
16+
"react-dom": "^18.3.1",
1617
"react-feather": "^2.0.10",
17-
"uuid": "^9.0.1"
18+
"uuid": "^10.0.0"
1819
},
1920
"devDependencies": {
20-
"@ngneat/falso": "^7.1.1",
21-
"@testing-library/cypress": "^10.0.1",
22-
"@types/react": "^18.2.38",
23-
"@types/react-dom": "^18.2.16",
24-
"@types/uuid": "^9.0.7",
25-
"@vitejs/plugin-react": "^4.2.0",
21+
"@ngneat/falso": "^7.2.0",
22+
"@testing-library/cypress": "^10.0.2",
23+
"@types/react": "^18.3.16",
24+
"@types/react-dom": "^18.3.5",
25+
"@types/uuid": "^10.0.0",
26+
"@vitejs/plugin-react": "^4.3.4",
2627
"autoprefixer": "^10.4.16",
27-
"cypress": "^13.5.1",
28+
"cypress": "^13.17.0",
2829
"cypress-vite": "workspace:latest",
29-
"postcss": "^8.4.31",
30-
"start-server-and-test": "^2.0.3",
31-
"tailwindcss": "^3.3.5",
32-
"typescript": "^5.3.2",
33-
"vite": "^5.0.2",
34-
"vite-tsconfig-paths": "^4.2.1"
30+
"postcss": "^8.4.49",
31+
"start-server-and-test": "^2.0.9",
32+
"tailwindcss": "^3.4.16",
33+
"typescript": "^5.7.2",
34+
"vite": "^6.0.3",
35+
"vite-tsconfig-paths": "^5.1.4"
3536
}
3637
}

example/postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-env node */
22

3-
module.exports = {
3+
export default {
44
plugins: {
55
tailwindcss: {},
66
autoprefixer: {},

example/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env node */
22
/** @type {import('tailwindcss').Config} */
33

4-
module.exports = {
4+
export default {
55
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
66
theme: {
77
extend: {},

package.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"types": "dist/index.d.ts",
2323
"exports": {
2424
".": {
25-
"require": "./dist/index.cjs",
25+
"types": "./dist/index.d.ts",
2626
"import": "./dist/index.mjs",
27-
"types": "./dist/index.d.ts"
27+
"require": "./dist/index.cjs"
2828
}
2929
},
3030
"files": [
@@ -35,7 +35,7 @@
3535
"example": "pnpm --filter example",
3636
"test": "pnpm --filter example test",
3737
"format": "prettier --write . && pnpm lint --fix",
38-
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
38+
"lint": "eslint .",
3939
"prepare": "husky install",
4040
"pre-commit": "lint-staged"
4141
},
@@ -44,27 +44,28 @@
4444
"*.{js,jsx,ts,tsx,md,html,css}": "prettier --write"
4545
},
4646
"peerDependencies": {
47-
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
47+
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"
4848
},
4949
"devDependencies": {
50-
"@commitlint/cli": "^18.4.3",
51-
"@commitlint/config-conventional": "^18.4.3",
50+
"@commitlint/cli": "^19.6.0",
51+
"@commitlint/config-conventional": "^19.6.0",
5252
"@types/debug": "^4.1.12",
53-
"@types/node": "^20.9.3",
54-
"@typescript-eslint/eslint-plugin": "^6.12.0",
55-
"@typescript-eslint/parser": "^6.12.0",
56-
"cypress": "^13.5.1",
57-
"eslint": "^8.54.0",
58-
"eslint-config-prettier": "^9.0.0",
59-
"husky": "^8.0.3",
60-
"lint-staged": "^15.1.0",
61-
"prettier": "^3.1.0",
62-
"typescript": "^5.3.2",
63-
"unbuild": "^2.0.0",
64-
"vite": "^5.0.2"
53+
"@types/node": "^22.10.2",
54+
"@typescript-eslint/eslint-plugin": "^8.18.2",
55+
"@typescript-eslint/parser": "^8.18.2",
56+
"cypress": "^13.17.0",
57+
"eslint": "^9.17.0",
58+
"eslint-config-prettier": "^9.1.0",
59+
"husky": "^9.1.7",
60+
"lint-staged": "^15.2.11",
61+
"prettier": "^3.4.2",
62+
"typescript": "^5.7.2",
63+
"unbuild": "^3.0.0",
64+
"vite": "^6.0.3"
6565
},
6666
"dependencies": {
6767
"chokidar": "^3.5.3",
6868
"debug": "^4.3.4"
69-
}
69+
},
70+
"packageManager": "[email protected]"
7071
}

0 commit comments

Comments
 (0)