@nx/vite 23.0.0-beta.21 → 23.0.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/nx-copy-assets.plugin.d.ts +6 -0
- package/dist/plugins/nx-copy-assets.plugin.js +8 -0
- package/dist/plugins/nx-tsconfig-paths.plugin.d.ts +7 -0
- package/dist/plugins/nx-tsconfig-paths.plugin.js +9 -0
- package/dist/src/generators/configuration/configuration.js +2 -0
- package/dist/src/generators/convert-to-inferred/convert-to-inferred.js +2 -0
- package/dist/src/generators/init/init.js +2 -0
- package/dist/src/generators/init/lib/utils.js +1 -1
- package/dist/src/generators/init/schema.json +1 -1
- package/dist/src/generators/setup-paths-plugin/setup-paths-plugin.js +2 -0
- package/dist/src/migrations/update-23-0-0/ai-instructions-for-vitest-3.md +604 -0
- package/dist/src/migrations/update-23-0-0/ai-instructions-for-vitest-4.md +817 -0
- package/dist/src/migrations/update-23-0-0/lib/ast-edits.d.ts +26 -0
- package/dist/src/migrations/update-23-0-0/lib/ast-edits.js +49 -0
- package/dist/src/migrations/update-23-0-0/lib/ci-files.d.ts +3 -0
- package/dist/src/migrations/update-23-0-0/lib/ci-files.js +30 -0
- package/dist/src/migrations/update-23-0-0/lib/vitest-config-files.d.ts +5 -0
- package/dist/src/migrations/update-23-0-0/lib/vitest-config-files.js +34 -0
- package/dist/src/migrations/update-23-0-0/migrate-to-vitest-3.d.ts +10 -0
- package/dist/src/migrations/update-23-0-0/migrate-to-vitest-3.js +335 -0
- package/dist/src/migrations/update-23-0-0/migrate-to-vitest-4.d.ts +17 -0
- package/dist/src/migrations/update-23-0-0/migrate-to-vitest-4.js +726 -0
- package/dist/src/plugins/plugin.d.ts +3 -3
- package/dist/src/utils/assert-supported-vite-version.d.ts +2 -0
- package/dist/src/utils/assert-supported-vite-version.js +8 -0
- package/dist/src/utils/deprecation.d.ts +4 -0
- package/dist/src/utils/deprecation.js +26 -1
- package/dist/src/utils/ensure-dependencies.js +1 -1
- package/dist/src/utils/generator-utils.js +2 -0
- package/dist/src/utils/versions.d.ts +1 -0
- package/dist/src/utils/versions.js +7 -1
- package/migrations.json +116 -9
- package/package.json +6 -6
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
import { AssetGlob } from '@nx/js/internal';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Will be removed in Nx v24. Use Vite's native `publicDir` option
|
|
5
|
+
* for static assets, or the `vite-plugin-static-copy` package for anything
|
|
6
|
+
* that needs glob-based copying. See
|
|
7
|
+
* https://nx.dev/docs/technologies/build-tools/vite/configure-vite for details.
|
|
8
|
+
*/
|
|
3
9
|
export declare function nxCopyAssetsPlugin(_assets: (string | AssetGlob)[]): Plugin;
|
|
@@ -4,7 +4,15 @@ exports.nxCopyAssetsPlugin = nxCopyAssetsPlugin;
|
|
|
4
4
|
const node_path_1 = require("node:path");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/js/internal");
|
|
7
|
+
const deprecation_1 = require("../src/utils/deprecation");
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Will be removed in Nx v24. Use Vite's native `publicDir` option
|
|
10
|
+
* for static assets, or the `vite-plugin-static-copy` package for anything
|
|
11
|
+
* that needs glob-based copying. See
|
|
12
|
+
* https://nx.dev/docs/technologies/build-tools/vite/configure-vite for details.
|
|
13
|
+
*/
|
|
7
14
|
function nxCopyAssetsPlugin(_assets) {
|
|
15
|
+
(0, deprecation_1.warnNxCopyAssetsPluginDeprecation)();
|
|
8
16
|
let config;
|
|
9
17
|
let handler;
|
|
10
18
|
let dispose;
|
|
@@ -25,4 +25,11 @@ export interface nxViteTsPathsOptions {
|
|
|
25
25
|
*/
|
|
26
26
|
buildLibsFromSource?: boolean;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Will be removed in Nx v24. Replace with `tsconfigPaths()` from
|
|
30
|
+
* the `vite-tsconfig-paths` package. The inferred `@nx/vite/plugin` already
|
|
31
|
+
* ensures projects extend the workspace base tsconfig, so the community
|
|
32
|
+
* plugin handles monorepo path resolution end-to-end. See
|
|
33
|
+
* https://nx.dev/docs/technologies/build-tools/vite/configure-vite for details.
|
|
34
|
+
*/
|
|
28
35
|
export declare function nxViteTsPaths(options?: nxViteTsPathsOptions): Plugin;
|
|
@@ -7,10 +7,19 @@ const js_1 = require("@nx/js");
|
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
9
|
const tsconfig_paths_1 = require("tsconfig-paths");
|
|
10
|
+
const deprecation_1 = require("../src/utils/deprecation");
|
|
10
11
|
const nx_tsconfig_paths_find_file_1 = require("../src/utils/nx-tsconfig-paths-find-file");
|
|
11
12
|
const options_utils_1 = require("../src/utils/options-utils");
|
|
12
13
|
const nx_vite_build_coordination_plugin_1 = require("./nx-vite-build-coordination.plugin");
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Will be removed in Nx v24. Replace with `tsconfigPaths()` from
|
|
16
|
+
* the `vite-tsconfig-paths` package. The inferred `@nx/vite/plugin` already
|
|
17
|
+
* ensures projects extend the workspace base tsconfig, so the community
|
|
18
|
+
* plugin handles monorepo path resolution end-to-end. See
|
|
19
|
+
* https://nx.dev/docs/technologies/build-tools/vite/configure-vite for details.
|
|
20
|
+
*/
|
|
13
21
|
function nxViteTsPaths(options = {}) {
|
|
22
|
+
(0, deprecation_1.warnNxViteTsPathsDeprecation)();
|
|
14
23
|
let foundTsConfigPath;
|
|
15
24
|
let matchTsPathEsm;
|
|
16
25
|
let matchTsPathFallback;
|
|
@@ -8,6 +8,7 @@ const js_1 = require("@nx/js");
|
|
|
8
8
|
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
const posix_1 = require("node:path/posix");
|
|
10
10
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
11
|
+
const assert_supported_vite_version_1 = require("../../utils/assert-supported-vite-version");
|
|
11
12
|
const deprecation_1 = require("../../utils/deprecation");
|
|
12
13
|
const generator_utils_1 = require("../../utils/generator-utils");
|
|
13
14
|
const versions_1 = require("../../utils/versions");
|
|
@@ -20,6 +21,7 @@ function viteConfigurationGenerator(host, schema) {
|
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
async function viteConfigurationGeneratorInternal(tree, schema) {
|
|
24
|
+
(0, assert_supported_vite_version_1.assertSupportedViteVersion)(tree);
|
|
23
25
|
const tasks = [];
|
|
24
26
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, schema.project);
|
|
25
27
|
const { targets, root: projectRoot } = projectConfig;
|
|
@@ -7,7 +7,9 @@ const plugin_1 = require("../../plugins/plugin");
|
|
|
7
7
|
const build_post_target_transformer_1 = require("./lib/build-post-target-transformer");
|
|
8
8
|
const serve_post_target_transformer_1 = require("./lib/serve-post-target-transformer");
|
|
9
9
|
const preview_post_target_transformer_1 = require("./lib/preview-post-target-transformer");
|
|
10
|
+
const assert_supported_vite_version_1 = require("../../utils/assert-supported-vite-version");
|
|
10
11
|
async function convertToInferred(tree, options) {
|
|
12
|
+
(0, assert_supported_vite_version_1.assertSupportedViteVersion)(tree);
|
|
11
13
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
12
14
|
const migrationLogs = new internal_1.AggregatedLog();
|
|
13
15
|
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/vite/plugin', plugin_1.createNodesV2, {
|
|
@@ -9,6 +9,7 @@ const setup_paths_plugin_1 = require("../setup-paths-plugin/setup-paths-plugin")
|
|
|
9
9
|
const plugin_1 = require("../../plugins/plugin");
|
|
10
10
|
const utils_1 = require("./lib/utils");
|
|
11
11
|
const ignore_vite_temp_files_1 = require("../../utils/ignore-vite-temp-files");
|
|
12
|
+
const assert_supported_vite_version_1 = require("../../utils/assert-supported-vite-version");
|
|
12
13
|
function updateNxJsonSettings(tree) {
|
|
13
14
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
14
15
|
const productionFileSet = nxJson.namedInputs?.production;
|
|
@@ -22,6 +23,7 @@ function initGenerator(tree, schema) {
|
|
|
22
23
|
return initGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
23
24
|
}
|
|
24
25
|
async function initGeneratorInternal(tree, schema) {
|
|
26
|
+
(0, assert_supported_vite_version_1.assertSupportedViteVersion)(tree);
|
|
25
27
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
26
28
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
27
29
|
nxJson.useInferencePlugins !== false;
|
|
@@ -57,7 +57,7 @@ async function checkDependenciesInstalled(host, schema) {
|
|
|
57
57
|
'@nx/web': versions_1.nxVersion,
|
|
58
58
|
vite: viteVersionToInstall,
|
|
59
59
|
jiti: versions_1.jitiVersion,
|
|
60
|
-
}, undefined, schema.keepExistingVersions);
|
|
60
|
+
}, undefined, schema.keepExistingVersions ?? true);
|
|
61
61
|
}
|
|
62
62
|
function moveToDevDependencies(tree) {
|
|
63
63
|
let wasUpdated = false;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupPathsPlugin = setupPathsPlugin;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const assert_supported_vite_version_1 = require("../../utils/assert-supported-vite-version");
|
|
5
6
|
async function setupPathsPlugin(tree, schema) {
|
|
7
|
+
(0, assert_supported_vite_version_1.assertSupportedViteVersion)(tree);
|
|
6
8
|
const files = await (0, devkit_1.globAsync)(tree, [
|
|
7
9
|
'**/vite.config.{js,ts,mjs,mts,cjs,cts}',
|
|
8
10
|
]);
|