Skip to content

Commit

Permalink
feat(vite): update to version 5 (nrwl#20341)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini authored Nov 21, 2023
1 parent a916794 commit 82b39d1
Show file tree
Hide file tree
Showing 17 changed files with 213 additions and 432 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
"url-loader": "^4.1.1",
"use-sync-external-store": "^1.2.0",
"verdaccio": "^5.0.4",
"vite": "^4.3.4",
"vite": "^5.0.0",
"webpack": "5.88.0",
"webpack-dev-server": "^4.9.3",
"webpack-merge": "^5.8.0",
Expand Down Expand Up @@ -351,7 +351,7 @@
"tailwind-merge": "^1.8.1",
"tailwindcss": "3.2.4",
"tslib": "^2.3.0",
"vitest": "^0.32.0",
"vitest": "^0.34.6",
"weak-napi": "^2.0.2"
},
"resolutions": {
Expand Down
9 changes: 9 additions & 0 deletions packages/cypress/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@
"alwaysAddToPackageJson": false
}
}
},
"17.2.0-beta.2": {
"version": "17.2.0-beta.2",
"packages": {
"vite": {
"version": "^5.0.0",
"alwaysAddToPackageJson": false
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/cypress/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const cypressViteDevServerVersion = '^2.2.1';
export const cypressVersion = '^13.0.0';
export const cypressWebpackVersion = '^2.0.0';
export const webpackHttpPluginVersion = '^5.5.0';
export const viteVersion = '~4.3.9';
export const viteVersion = '^5.0.0';
export const htmlWebpackPluginVersion = '^5.5.0';
9 changes: 9 additions & 0 deletions packages/jest/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@
"alwaysAddToPackageJson": false
}
}
},
"17.2.0": {
"version": "17.2.0-beta.2",
"packages": {
"@types/node": {
"version": "18.16.9",
"alwaysAddToPackageJson": false
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/jest/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const jestTypesVersion = '^29.4.0';
export const tsJestVersion = '^29.1.0';
export const tslibVersion = '^2.3.0';
export const swcJestVersion = '0.2.20';
export const typesNodeVersion = '16.11.7';
export const typesNodeVersion = '18.16.9';
export const tsNodeVersion = '10.9.1';
9 changes: 9 additions & 0 deletions packages/storybook/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@
}
},
"packageJsonUpdates": {
"17.2.0-beta.2": {
"version": "17.2.0-beta.2",
"packages": {
"vite": {
"version": "^5.0.0",
"alwaysAddToPackageJson": false
}
}
},
"17.1.0-beta.4": {
"version": "17.1.0-beta.4",
"packages": {
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export const tsLibVersion = '^2.3.0';

export const storybookVersion = '^7.5.3';
export const reactVersion = '^18.2.0';
export const viteVersion = '~4.3.9';
export const viteVersion = '^5.0.0';

export const coreJsVersion = '^3.6.5';
45 changes: 30 additions & 15 deletions packages/vite/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,36 @@
},
"packageJsonUpdates": {
"17.2.0": {
"vitest": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
},
"@vitest/coverage-v8": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
},
"@vitest/ui": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
},
"@vitest/coverage-istanbul": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
"version": "17.2.0-beta.2",
"packages": {
"vite": {
"version": "^5.0.0",
"alwaysAddToPackageJson": false
},
"@vitejs/plugin-react": {
"version": "^4.2.0",
"alwaysAddToPackageJson": false
},
"@vitejs/plugin-react-swc": {
"version": "^3.5.0",
"alwaysAddToPackageJson": false
},
"vitest": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
},
"@vitest/coverage-v8": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
},
"@vitest/ui": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
},
"@vitest/coverage-istanbul": {
"version": "~0.34.6",
"alwaysAddToPackageJson": false
}
}
},
"16.4.0-beta.7": {
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"tsconfig-paths": "^4.1.2"
},
"peerDependencies": {
"vite": "^4.3.4",
"vitest": ">=0.31.0 <1.0.0"
"vite": "^5.0.0",
"vitest": ">=0.34.6 <1.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ function closeServer(server?: PreviewServer): Promise<void> {
resolve();
} else {
const { httpServer } = server;
// closeAllConnections was added in Node v18.2.0
httpServer.closeAllConnections && httpServer.closeAllConnections();
if (httpServer['closeAllConnections']) {
// https://github.com/vitejs/vite/pull/14834
// closeAllConnections was added in Node v18.2.0
// typically is "as http.Server" but no reason
// to import http just for this
(httpServer as any).closeAllConnections();
}
httpServer.close(() => resolve());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ exports[`@nx/vite:init dependencies for package.json should add vite packages an
"@nx/vite": "0.0.1",
"@swc-node/register": "~1.6.7",
"@swc/core": "~1.3.85",
"@vitejs/plugin-react": "~4.0.0",
"@vitejs/plugin-react": "^4.2.0",
"@vitest/ui": "~0.34.6",
"existing": "1.0.0",
"prettier": "^2.6.2",
"typescript": "~5.2.2",
"vite": "~4.3.9",
"vite": "^5.0.0",
"vitest": "~0.34.6",
},
"name": "@proj/source",
Expand All @@ -34,7 +34,7 @@ exports[`@nx/vite:init dependencies for package.json should support --testEnviro
"@vitest/ui": "~0.34.6",
"prettier": "^2.6.2",
"typescript": "~5.2.2",
"vite": "~4.3.9",
"vite": "^5.0.0",
"vitest": "~0.34.6",
},
"name": "@proj/source",
Expand All @@ -53,7 +53,7 @@ exports[`@nx/vite:init dependencies for package.json should support --testEnviro
"happy-dom": "~9.20.3",
"prettier": "^2.6.2",
"typescript": "~5.2.2",
"vite": "~4.3.9",
"vite": "^5.0.0",
"vitest": "~0.34.6",
},
"name": "@proj/source",
Expand All @@ -72,7 +72,7 @@ exports[`@nx/vite:init dependencies for package.json should support --testEnviro
"jsdom": "~22.1.0",
"prettier": "^2.6.2",
"typescript": "~5.2.2",
"vite": "~4.3.9",
"vite": "^5.0.0",
"vitest": "~0.34.6",
},
"name": "@proj/source",
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const nxVersion = require('../../package.json').version;
export const viteVersion = '~4.3.9';
export const viteVersion = '^5.0.0';
export const vitestVersion = '~0.34.6';
export const vitePluginReactVersion = '~4.0.0';
export const vitePluginReactSwcVersion = '~3.3.2';
export const vitePluginReactVersion = '^4.2.0';
export const vitePluginReactSwcVersion = '^3.5.0';
export const jsdomVersion = '~22.1.0';
export const vitePluginDtsVersion = '~2.3.0';
export const happyDomVersion = '~9.20.3';
Expand Down
12 changes: 11 additions & 1 deletion packages/vue/migrations.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"generators": {},
"packageJsonUpdates": {}
"packageJsonUpdates": {
"17.2.0": {
"version": "17.2.0-beta.2",
"packages": {
"@vitejs/plugin-vue": {
"version": "^4.5.0",
"alwaysAddToPackageJson": false
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`init should add vue dependencies 1`] = `
"@nx/vue": "0.0.1",
"@swc-node/register": "~1.6.7",
"@swc/core": "~1.3.85",
"@vitejs/plugin-vue": "^4.3.1",
"@vitejs/plugin-vue": "^4.5.0",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"prettier": "^2.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ exports[`lib should add vue, vite and vitest to package.json 1`] = `
"@swc/core": "~1.3.85",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@vitejs/plugin-vue": "^4.3.1",
"@vitejs/plugin-vue": "^4.5.0",
"@vitest/coverage-v8": "~0.34.6",
"@vitest/ui": "~0.34.6",
"@vue/eslint-config-prettier": "7.1.0",
Expand All @@ -113,7 +113,7 @@ exports[`lib should add vue, vite and vitest to package.json 1`] = `
"jsdom": "~22.1.0",
"prettier": "^2.6.2",
"typescript": "~5.2.2",
"vite": "~4.3.9",
"vite": "^5.0.0",
"vitest": "~0.34.6",
"vue-tsc": "^1.8.8",
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const vueTsconfigVersion = '^0.4.0';

// test deps
export const vueTestUtilsVersion = '^2.4.1';
export const vitePluginVueVersion = '^4.3.1';
export const vitePluginVueVersion = '^4.5.0';

// linting deps
export const vueEslintConfigPrettierVersion = '7.1.0';
Expand Down
Loading

0 comments on commit 82b39d1

Please sign in to comment.