Skip to content

chore!: update vite@5 and rollup@4 #4368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a86855a
chore: upgrade to rollup 4
Dunqing Oct 25, 2023
72dce68
chore: update dep
Dunqing Oct 25, 2023
3c6e4a5
chore: remove acorn, upgrade vite to beta
Dunqing Oct 26, 2023
bbb0f45
fix: type error
Dunqing Oct 26, 2023
2262b6d
chore: update license
Dunqing Oct 26, 2023
0456b53
chore: external rollup/parseAst
Dunqing Oct 26, 2023
29bf248
chore: configure type: module
Dunqing Oct 26, 2023
78a5347
chore: update needed type module
Dunqing Oct 26, 2023
423a7f2
chore: external acorn
Dunqing Oct 27, 2023
c682133
fix: mlly
Dunqing Oct 31, 2023
9731f1f
feat: store parseAst from plugin
Dunqing Oct 31, 2023
e418d61
fix: avoid re-assign
Dunqing Oct 31, 2023
b3ee1ef
perf: remove isValidNodeImport
Dunqing Oct 31, 2023
8c53f8c
perf: remove mlly
Dunqing Oct 31, 2023
518a6ea
feat: inline isValidNodeImport
Dunqing Nov 1, 2023
0838046
fix: lock
Dunqing Nov 1, 2023
10fe82a
fix: remove protocol
Dunqing Nov 1, 2023
4fe1e31
perf: fix
Dunqing Nov 1, 2023
c5223a5
feat: should externalize
Dunqing Nov 1, 2023
59fe569
feat: port findNearestPackageData, remove pkg-types
Dunqing Nov 1, 2023
774d3d3
fix: remove processed logic
Dunqing Nov 1, 2023
6ee7a99
chore: update deps
Dunqing Nov 2, 2023
b233bd4
chore: use parseAstAsync instead
Dunqing Nov 2, 2023
60eaa4b
fix: remove ParseStorePlugin
Dunqing Nov 2, 2023
e561708
chore: update version
Dunqing Nov 2, 2023
da18821
chore: add type: module, remove old examples
sheremet-va Nov 2, 2023
b677218
chore: update package.json
sheremet-va Nov 2, 2023
a2f9b4b
chore: change extensions
sheremet-va Nov 2, 2023
f9c946b
test: update coverage snapshot
sheremet-va Nov 2, 2023
e3e6803
chore: update vite requirements in docs and readnme
sheremet-va Nov 9, 2023
9d59478
chore: cleanup
sheremet-va Nov 9, 2023
075729a
chore: cleanup
sheremet-va Nov 9, 2023
60b128f
chore: remove puppeteer
sheremet-va Nov 9, 2023
56284cf
chore: remove PUPPETEER_VERSION
sheremet-va Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .github/actions/setup-and-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ runs:
const pattern = (name) => new RegExp(name + ':\\\s+specifier: [\\\s\\\w\\\.^]+version: (\\\d+\\\.\\\d+\\\.\\\d+)');
const cypressVersion = lockfile.match(pattern('cypress'))[1];
const playwrightVersion = lockfile.match(pattern('playwright'))[1];
const puppeteerVersion = lockfile.match(pattern('puppeteer'))[1];
console.log('CYPRESS_VERSION=' + cypressVersion);
console.log('PLAYWRIGHT_VERSION=' + playwrightVersion);
console.log('PUPPETEER_VERSION=' + puppeteerVersion);
"
)" >> $GITHUB_OUTPUT

Expand All @@ -44,8 +42,7 @@ runs:
shell: bash
if: |
contains(fromJSON('[null, "", "undefined"]'), steps.resolve-package-versions.outputs.CYPRESS_VERSION) ||
contains(fromJSON('[null, "", "undefined"]'), steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION) ||
contains(fromJSON('[null, "", "undefined"]'), steps.resolve-package-versions.outputs.PUPPETEER_VERSION)
contains(fromJSON('[null, "", "undefined"]'), steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION)
run: echo "Failed to resolve package versions. See log above." && exit 1

- name: Cache Cypress v${{ steps.resolve-package-versions.outputs.CYPRESS_VERSION }}
Expand All @@ -65,12 +62,3 @@ runs:
key: ${{ runner.os }}-playwright-${{ steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION }}
restore-keys: |
${{ runner.os }}-playwright-

- name: Cache Puppeteer v${{ steps.resolve-package-versions.outputs.PUPPETEER_VERSION }}
uses: actions/cache@v3
id: puppeteer-cache
with:
path: ${{ env.PUPPETEER_DOWNLOAD_PATH }}
key: ${{ runner.os }}-puppeteer-${{ steps.resolve-package-versions.outputs.PUPPETEER_VERSION }}
restore-keys: |
${{ runner.os }}-puppeteer-
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ env:
VITEST_SEGFAULT_RETRY: 3
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.cache/ms-playwright
CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/.cache/Cypress
PUPPETEER_DOWNLOAD_PATH: ${{ github.workspace }}/.cache/Puppeteer

jobs:
lint:
Expand Down
1 change: 0 additions & 1 deletion .tazerc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"exclude": [
"vue",
"puppeteer",
"pretty-format"
],
"packageMode": {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Next generation testing framework powered by Vite.
- Out-of-box TypeScript / JSX support
- Filtering, timeouts, concurrent for suite and tests

> Vitest requires Vite >=v3.0.0 and Node >=v14.18
> Vitest requires Vite >=v5.0.0 and Node >=v18.00


```ts
Expand Down
2 changes: 1 addition & 1 deletion bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@babel/preset-typescript": "^7.22.5",
"@happy-dom/jest-environment": "^9.20.3",
"@types/benchmark": "^2.1.2",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/test-utils": "^2.4.0",
"@vue/vue3-jest": "^29.2.4",
"babel-jest": "^29.5.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can try Vitest online on [StackBlitz](https://vitest.new). It runs Vitest di
:::

:::tip
Vitest requires Vite >=v3.0.0 and Node >=v14.18
Vitest requires Vite >=v5.0.0 and Node >=v18.00
:::

It is recommended that you install a copy of `vitest` in your `package.json`, using one of the methods listed above. However, if you would prefer to run `vitest` directly, you can use `npx vitest` (the `npx` command comes with npm and Node.js).
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"https-localhost": "^4.7.1",
"unocss": "^0.53.4",
"unplugin-vue-components": "^0.25.2",
"vite": "^4.5.0",
"vite": "^5.0.0-beta.15",
"vite-plugin-pwa": "^0.16.6",
"vitepress": "^1.0.0-rc.24",
"workbox-window": "^7.0.0"
Expand Down
3 changes: 0 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
| `nextjs` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/nextjs) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/nextjs?initialPath=__vitest__/) |
| `playwright` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/playwright) | |
| `preact-testing-lib` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/preact-testing-lib) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/preact-testing-lib?initialPath=__vitest__/) |
| `puppeteer` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/puppeteer) | |
| `react-enzyme` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/react-enzyme) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/react-enzyme?initialPath=__vitest__/) |
| `react-mui` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/react-mui) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/react-mui?initialPath=__vitest__/) |
| `react-storybook` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/react-storybook) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/react-storybook?initialPath=__vitest__/) |
| `react-testing-lib-msw` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/react-testing-lib-msw) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/react-testing-lib-msw?initialPath=__vitest__/) |
Expand All @@ -24,4 +22,3 @@
| `vitesse` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/vitesse) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/vitesse?initialPath=__vitest__/) |
| `vue-jsx` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/vue-jsx) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/vue-jsx?initialPath=__vitest__/) |
| `vue` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/vue) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/vue?initialPath=__vitest__/) |
| `vue2` | [GitHub](https://github.com/vitest-dev/vitest/tree/main/examples/vue2) | [Play Online](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/vue2?initialPath=__vitest__/) |
3 changes: 2 additions & 1 deletion examples/graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@vitest/example-graphql",
"type": "module",
"private": true,
"files": [
"dist",
Expand All @@ -12,7 +13,7 @@
"test:ui": "vitest --ui"
},
"dependencies": {
"@rollup/plugin-graphql": "^1.1.0",
"@rollup/plugin-graphql": "^2.0.4",
"graphql": "^16.5.0"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions examples/mocks/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@vitest/example-mocks",
"type": "module",
"private": true,
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/mocks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "esnext",
"module": "NodeNext",
"target": "esnext",
"moduleResolution": "nodenext",
"types": ["vitest/globals"]
Expand Down
1 change: 1 addition & 0 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@vitest/example-nextjs",
"type": "module",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions examples/playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@vitest/example-playwright",
"type": "module",
"private": true,
"scripts": {
"build": "vite build",
Expand Down
3 changes: 2 additions & 1 deletion examples/preact-testing-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@vitest/example-preact-testing-lib",
"type": "module",
"private": true,
"scripts": {
"build": "tsc && vite build",
Expand All @@ -16,7 +17,7 @@
"react-router-dom": "^6.3.0"
},
"devDependencies": {
"@preact/preset-vite": "^2.5.0",
"@preact/preset-vite": "^2.6.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/preact": "^3.2.3",
"@vitest/ui": "latest",
Expand Down
4 changes: 2 additions & 2 deletions examples/preact-testing-lib/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"module": "Node16",
"moduleResolution": "Node16",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
Expand Down
13 changes: 0 additions & 13 deletions examples/puppeteer/index.html

This file was deleted.

19 changes: 0 additions & 19 deletions examples/puppeteer/package.json

This file was deleted.

15 changes: 0 additions & 15 deletions examples/puppeteer/src/index.ts

This file was deleted.

39 changes: 0 additions & 39 deletions examples/puppeteer/test/basic.test.ts

This file was deleted.

5 changes: 0 additions & 5 deletions examples/puppeteer/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions examples/puppeteer/vitest.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/react-enzyme/components/Button.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions examples/react-enzyme/package.json

This file was deleted.

29 changes: 0 additions & 29 deletions examples/react-enzyme/test/Button.test.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions examples/react-enzyme/tsconfig.json

This file was deleted.

12 changes: 0 additions & 12 deletions examples/react-enzyme/vite.config.ts

This file was deleted.

4 changes: 0 additions & 4 deletions examples/react-enzyme/vitest.setup.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/react-mui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@vitest/example-mui",
"type": "module",
"private": true,
"license": "MIT",
"main": "index.js",
Expand All @@ -22,9 +23,10 @@
"swr": "^1.3.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.2.3",
"@types/react": "^18.2.34",
"@vitest/ui": "latest",
"date-fns": "^2.28.0",
"jsdom": "latest",
Expand Down
Loading