@nx/vite 22.7.0-pr.35019.f500fd7 → 22.7.0-rc.0

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.
Files changed (38) hide show
  1. package/package.json +10 -11
  2. package/plugins/nx-tsconfig-paths.plugin.d.ts.map +1 -1
  3. package/plugins/nx-tsconfig-paths.plugin.js +3 -2
  4. package/src/executors/build/build.impl.d.ts.map +1 -1
  5. package/src/executors/build/build.impl.js +6 -2
  6. package/src/executors/build/schema.json +75 -75
  7. package/src/executors/dev-server/schema.json +36 -36
  8. package/src/executors/preview-server/schema.json +40 -40
  9. package/src/executors/test/schema.json +33 -33
  10. package/src/generators/configuration/schema.d.ts +1 -0
  11. package/src/generators/configuration/schema.json +62 -62
  12. package/src/generators/convert-to-inferred/schema.json +16 -16
  13. package/src/generators/init/lib/utils.d.ts.map +1 -1
  14. package/src/generators/init/lib/utils.js +51 -9
  15. package/src/generators/init/schema.d.ts +1 -0
  16. package/src/generators/init/schema.json +54 -47
  17. package/src/generators/setup-paths-plugin/schema.json +11 -11
  18. package/src/generators/vitest/schema.json +62 -62
  19. package/src/plugins/plugin.d.ts.map +1 -1
  20. package/src/plugins/plugin.js +113 -17
  21. package/src/utils/ensure-dependencies.d.ts.map +1 -1
  22. package/src/utils/ensure-dependencies.js +9 -1
  23. package/src/utils/version-utils.d.ts +2 -0
  24. package/src/utils/version-utils.d.ts.map +1 -1
  25. package/src/utils/version-utils.js +22 -0
  26. package/src/utils/versions.d.ts +11 -9
  27. package/src/utils/versions.d.ts.map +1 -1
  28. package/src/utils/versions.js +9 -7
  29. package/project.json +0 -52
  30. package/src/utils/test-files/angular-project.config.json +0 -89
  31. package/src/utils/test-files/react-lib-non-buildable-jest.json +0 -22
  32. package/src/utils/test-files/react-lib-non-buildable-vitest.json +0 -22
  33. package/src/utils/test-files/react-mixed-project.config.json +0 -47
  34. package/src/utils/test-files/react-vite-project.config.json +0 -54
  35. package/src/utils/test-files/unknown-project.config.json +0 -69
  36. package/src/utils/test-utils.d.ts +0 -10
  37. package/src/utils/test-utils.d.ts.map +0 -1
  38. package/src/utils/test-utils.js +0 -564
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vite",
3
- "version": "22.7.0-pr.35019.f500fd7",
3
+ "version": "22.7.0-rc.0",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for building and testing applications using Vite",
6
6
  "repository": {
@@ -16,7 +16,8 @@
16
16
  "Front-end"
17
17
  ],
18
18
  "main": "./index.js",
19
- "typings": "./index.d.ts",
19
+ "type": "commonjs",
20
+ "types": "./index.d.ts",
20
21
  "author": "Victor Savkin",
21
22
  "license": "MIT",
22
23
  "bugs": {
@@ -30,22 +31,22 @@
30
31
  "migrations": "./migrations.json"
31
32
  },
32
33
  "dependencies": {
33
- "@nx/devkit": "22.7.0-pr.35019.f500fd7",
34
+ "@nx/devkit": "22.7.0-rc.0",
34
35
  "@phenomnomnominal/tsquery": "~6.1.4",
35
36
  "enquirer": "~2.3.6",
36
- "@nx/js": "22.7.0-pr.35019.f500fd7",
37
- "@nx/vitest": "22.7.0-pr.35019.f500fd7",
38
- "picomatch": "4.0.2",
37
+ "@nx/js": "22.7.0-rc.0",
38
+ "@nx/vitest": "22.7.0-rc.0",
39
+ "picomatch": "4.0.4",
39
40
  "tsconfig-paths": "^4.1.2",
40
41
  "semver": "^7.6.3",
41
42
  "tslib": "^2.3.0",
42
43
  "ajv": "^8.0.0"
43
44
  },
44
45
  "devDependencies": {
45
- "nx": "22.7.0-pr.35019.f500fd7"
46
+ "nx": "22.7.0-rc.0"
46
47
  },
47
48
  "peerDependencies": {
48
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
49
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
49
50
  "vitest": "^1.3.1 || ^2.0.0 || ^3.0.0 || ^4.0.0"
50
51
  },
51
52
  "publishConfig": {
@@ -68,7 +69,5 @@
68
69
  "./plugins/nx-copy-assets.plugin": "./plugins/nx-copy-assets.plugin.js",
69
70
  "./plugins/nx-tsconfig-paths.plugin": "./plugins/nx-tsconfig-paths.plugin.js",
70
71
  "./plugins/rollup-replace-files.plugin": "./plugins/rollup-replace-files.plugin.js"
71
- },
72
- "types": "./index.d.ts",
73
- "type": "commonjs"
72
+ }
74
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nx-tsconfig-paths.plugin.d.ts","sourceRoot":"","sources":["../../../../packages/vite/plugins/nx-tsconfig-paths.plugin.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,MAAM,WAAW,oBAAoB;IACnC;;;;QAII;IACJ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;QAKI;IACJ,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IACnC;;;QAGI;IACJ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GA4KzD,MAAM,CA0EZ"}
1
+ {"version":3,"file":"nx-tsconfig-paths.plugin.d.ts","sourceRoot":"","sources":["../../../../packages/vite/plugins/nx-tsconfig-paths.plugin.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,MAAM,WAAW,oBAAoB;IACnC;;;;QAII;IACJ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;QAKI;IACJ,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IACnC;;;QAGI;IACJ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GA4KzD,MAAM,CA0EZ"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nxViteTsPaths = nxViteTsPaths;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
6
+ const ts_config_1 = require("@nx/js/src/utils/typescript/ts-config");
6
7
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
7
8
  const node_fs_1 = require("node:fs");
8
9
  const node_path_1 = require("node:path");
@@ -84,13 +85,13 @@ function nxViteTsPaths(options = {}) {
84
85
  throw new Error(`Failed loading tsconfig at ${foundTsConfigPath}`);
85
86
  }
86
87
  tsConfigPathsEsm = parsed;
87
- matchTsPathEsm = (0, tsconfig_paths_1.createMatchPath)(parsed.absoluteBaseUrl, parsed.paths, options.mainFields);
88
+ matchTsPathEsm = (0, tsconfig_paths_1.createMatchPath)((0, ts_config_1.resolvePathsBaseUrl)(foundTsConfigPath), parsed.paths, options.mainFields);
88
89
  const rootLevelTsConfig = getTsConfig((0, node_path_1.join)(devkit_1.workspaceRoot, 'tsconfig.base.json'));
89
90
  const rootLevelParsed = (0, tsconfig_paths_1.loadConfig)(rootLevelTsConfig);
90
91
  logIt('fallback parsed tsconfig: ', rootLevelParsed);
91
92
  if (rootLevelParsed.resultType === 'success') {
92
93
  tsConfigPathsFallback = rootLevelParsed;
93
- matchTsPathFallback = (0, tsconfig_paths_1.createMatchPath)(rootLevelParsed.absoluteBaseUrl, rootLevelParsed.paths, ['main', 'module']);
94
+ matchTsPathFallback = (0, tsconfig_paths_1.createMatchPath)((0, ts_config_1.resolvePathsBaseUrl)(rootLevelTsConfig), rootLevelParsed.paths, ['main', 'module']);
94
95
  }
95
96
  },
96
97
  resolveId(importPath) {
@@ -1 +1 @@
1
- {"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/vite/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAMhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAqBpD,wBAAuB,iBAAiB,CACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,wBAAwB,EACvD,OAAO,EAAE,eAAe;aA+EgB,OAAO;cAAY,MAAM;aAgIlE;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC;IAET,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC,CAsDD;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/vite/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAMhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAqBpD,wBAAuB,iBAAiB,CACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,wBAAwB,EACvD,OAAO,EAAE,eAAe;aA+EgB,OAAO;cAAY,MAAM;aAmIlE;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC;IAET,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC,CAuDD;AAED,eAAe,iBAAiB,CAAC"}
@@ -90,8 +90,11 @@ async function* viteBuildExecutor(options, context) {
90
90
  };
91
91
  let iterables = [];
92
92
  for (const env of Object.values(builder.environments)) {
93
- // This is needed to overwrite the resolve build config with executor options in Vite 6
94
- if (env.config?.build) {
93
+ // Overwrite the resolved build config with executor options (e.g. outDir).
94
+ // Skip when using the builder API (Vite 8+) as the builder already
95
+ // resolves environment configs correctly and overwriting would clobber
96
+ // environment-specific options like rollupOptions/rolldownOptions.
97
+ if (env.config?.build && !options.useEnvironmentsApi) {
95
98
  env.config.build = {
96
99
  ...env.config.build,
97
100
  ...buildConfig.build,
@@ -203,6 +206,7 @@ async function getBuildExtraArgs(options) {
203
206
  'minify',
204
207
  'terserOptions',
205
208
  'rollupOptions',
209
+ 'rolldownOptions',
206
210
  'commonjsOptions',
207
211
  'dynamicImportVarsOptions',
208
212
  'write',
@@ -1,81 +1,81 @@
1
1
  {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "title": "Vite Prod Builder",
5
- "cli": "nx",
6
- "description": "Builds a Vite application for production.",
7
- "type": "object",
8
- "presets": [
9
- {
10
- "name": "Default minimum setup",
11
- "keys": []
12
- }
13
- ],
14
- "properties": {
15
- "outputPath": {
16
- "type": "string",
17
- "description": "The output path of the generated files.",
18
- "x-completion-type": "directory",
19
- "x-priority": "important"
20
- },
21
- "buildLibsFromSource": {
22
- "type": "boolean",
23
- "description": "Read buildable libraries from source instead of building them separately.",
24
- "default": true
25
- },
26
- "skipTypeCheck": {
27
- "type": "boolean",
28
- "description": "Skip type-checking via TypeScript. Skipping type-checking speeds up the build but type errors are not caught.",
29
- "default": false
30
- },
31
- "tsConfig": {
32
- "type": "string",
33
- "description": "The path to custom tsconfig file for type-checking when skipTypeCheck is false. Required when tsconfig file is not at the projectRoot level.",
34
- "x-completion-type": "file",
35
- "x-completion-glob": "tsconfig.*.json"
36
- },
37
- "configFile": {
38
- "type": "string",
39
- "description": "The name of the Vite configuration file.",
40
- "x-completion-type": "file",
41
- "x-completion-glob": "vite.config.@(js|ts)"
42
- },
43
- "watch": {
44
- "description": "Enable re-building when files change.",
45
- "oneOf": [
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
4
+ "title": "Vite Prod Builder",
5
+ "cli": "nx",
6
+ "description": "Builds a Vite application for production.",
7
+ "type": "object",
8
+ "presets": [
46
9
  {
47
- "type": "boolean"
10
+ "name": "Default minimum setup",
11
+ "keys": []
12
+ }
13
+ ],
14
+ "properties": {
15
+ "outputPath": {
16
+ "type": "string",
17
+ "description": "The output path of the generated files.",
18
+ "x-completion-type": "directory",
19
+ "x-priority": "important"
48
20
  },
49
- {
50
- "type": "object"
21
+ "buildLibsFromSource": {
22
+ "type": "boolean",
23
+ "description": "Read buildable libraries from source instead of building them separately.",
24
+ "default": true
25
+ },
26
+ "skipTypeCheck": {
27
+ "type": "boolean",
28
+ "description": "Skip type-checking via TypeScript. Skipping type-checking speeds up the build but type errors are not caught.",
29
+ "default": false
30
+ },
31
+ "tsConfig": {
32
+ "type": "string",
33
+ "description": "The path to custom tsconfig file for type-checking when skipTypeCheck is false. Required when tsconfig file is not at the projectRoot level.",
34
+ "x-completion-type": "file",
35
+ "x-completion-glob": "tsconfig.*.json"
36
+ },
37
+ "configFile": {
38
+ "type": "string",
39
+ "description": "The name of the Vite configuration file.",
40
+ "x-completion-type": "file",
41
+ "x-completion-glob": "vite.config.@(js|ts)"
42
+ },
43
+ "watch": {
44
+ "description": "Enable re-building when files change.",
45
+ "oneOf": [
46
+ {
47
+ "type": "boolean"
48
+ },
49
+ {
50
+ "type": "object"
51
+ }
52
+ ],
53
+ "default": false
54
+ },
55
+ "generatePackageJson": {
56
+ "description": "Generate a package.json for the build output.",
57
+ "type": "boolean"
58
+ },
59
+ "includeDevDependenciesInPackageJson": {
60
+ "description": "Include devDependencies in the generated package.json.",
61
+ "type": "boolean"
62
+ },
63
+ "skipOverrides": {
64
+ "type": "boolean",
65
+ "description": "Do not add a `overrides` and `resolutions` entries to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
66
+ },
67
+ "skipPackageManager": {
68
+ "type": "boolean",
69
+ "description": "Do not add a `packageManager` entry to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
70
+ },
71
+ "useEnvironmentsApi": {
72
+ "alias": "app",
73
+ "type": "boolean",
74
+ "description": "Use the new Environments API for building multiple environments at once. Only works with Vite 6.0.0 or higher.",
75
+ "default": false
51
76
  }
52
- ],
53
- "default": false
54
- },
55
- "generatePackageJson": {
56
- "description": "Generate a package.json for the build output.",
57
- "type": "boolean"
58
- },
59
- "includeDevDependenciesInPackageJson": {
60
- "description": "Include devDependencies in the generated package.json.",
61
- "type": "boolean"
62
- },
63
- "skipOverrides": {
64
- "type": "boolean",
65
- "description": "Do not add a `overrides` and `resolutions` entries to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
66
- },
67
- "skipPackageManager": {
68
- "type": "boolean",
69
- "description": "Do not add a `packageManager` entry to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
70
77
  },
71
- "useEnvironmentsApi": {
72
- "alias": "app",
73
- "type": "boolean",
74
- "description": "Use the new Environments API for building multiple environments at once. Only works with Vite 6.0.0 or higher.",
75
- "default": false
76
- }
77
- },
78
- "definitions": {},
79
- "required": [],
80
- "examplesFile": "../../../docs/build-examples.md"
78
+ "definitions": {},
79
+ "required": [],
80
+ "examplesFile": "../../../docs/build-examples.md"
81
81
  }
@@ -1,39 +1,39 @@
1
1
  {
2
- "version": 2,
3
- "continuous": true,
4
- "outputCapture": "direct-nodejs",
5
- "title": "Vite Dev Server",
6
- "cli": "nx",
7
- "description": "Starts a dev server using Vite.",
8
- "type": "object",
9
- "presets": [
10
- {
11
- "name": "Default minimum setup",
12
- "keys": ["buildTarget"]
2
+ "version": 2,
3
+ "continuous": true,
4
+ "outputCapture": "direct-nodejs",
5
+ "title": "Vite Dev Server",
6
+ "cli": "nx",
7
+ "description": "Starts a dev server using Vite.",
8
+ "type": "object",
9
+ "presets": [
10
+ {
11
+ "name": "Default minimum setup",
12
+ "keys": ["buildTarget"]
13
+ },
14
+ {
15
+ "name": "Using a Different Port",
16
+ "keys": ["buildTarget", "port"]
17
+ }
18
+ ],
19
+ "properties": {
20
+ "buildTarget": {
21
+ "type": "string",
22
+ "description": "Target which builds the application. Only used to retrieve the configuration as the dev-server does not build the code.",
23
+ "x-priority": "important"
24
+ },
25
+ "buildLibsFromSource": {
26
+ "type": "boolean",
27
+ "description": "Read buildable libraries from source instead of building them separately.",
28
+ "default": true
29
+ },
30
+ "proxyConfig": {
31
+ "type": "string",
32
+ "description": "Path to the proxy configuration file.",
33
+ "x-completion-type": "file"
34
+ }
13
35
  },
14
- {
15
- "name": "Using a Different Port",
16
- "keys": ["buildTarget", "port"]
17
- }
18
- ],
19
- "properties": {
20
- "buildTarget": {
21
- "type": "string",
22
- "description": "Target which builds the application. Only used to retrieve the configuration as the dev-server does not build the code.",
23
- "x-priority": "important"
24
- },
25
- "buildLibsFromSource": {
26
- "type": "boolean",
27
- "description": "Read buildable libraries from source instead of building them separately.",
28
- "default": true
29
- },
30
- "proxyConfig": {
31
- "type": "string",
32
- "description": "Path to the proxy configuration file.",
33
- "x-completion-type": "file"
34
- }
35
- },
36
- "definitions": {},
37
- "required": ["buildTarget"],
38
- "examplesFile": "../../../docs/dev-server-examples.md"
36
+ "definitions": {},
37
+ "required": ["buildTarget"],
38
+ "examplesFile": "../../../docs/dev-server-examples.md"
39
39
  }
@@ -1,43 +1,43 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "cli": "nx",
5
- "title": "Vite Preview Server",
6
- "description": "Preview Server for Vite.",
7
- "continuous": true,
8
- "type": "object",
9
- "presets": [
10
- {
11
- "name": "Default minimum setup",
12
- "keys": ["buildTarget"]
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "cli": "nx",
5
+ "title": "Vite Preview Server",
6
+ "description": "Preview Server for Vite.",
7
+ "continuous": true,
8
+ "type": "object",
9
+ "presets": [
10
+ {
11
+ "name": "Default minimum setup",
12
+ "keys": ["buildTarget"]
13
+ },
14
+ {
15
+ "name": "Using a Different Port",
16
+ "keys": ["buildTarget", "port"]
17
+ }
18
+ ],
19
+ "properties": {
20
+ "buildTarget": {
21
+ "type": "string",
22
+ "description": "Target which builds the application."
23
+ },
24
+ "proxyConfig": {
25
+ "type": "string",
26
+ "description": "Path to the proxy configuration file.",
27
+ "x-completion-type": "file"
28
+ },
29
+ "staticFilePath": {
30
+ "type": "string",
31
+ "description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath",
32
+ "x-completion-type": "directory"
33
+ },
34
+ "watch": {
35
+ "type": "boolean",
36
+ "description": "Enable re-building when files change. If not specified, watch mode will be enabled by default.",
37
+ "default": true
38
+ }
13
39
  },
14
- {
15
- "name": "Using a Different Port",
16
- "keys": ["buildTarget", "port"]
17
- }
18
- ],
19
- "properties": {
20
- "buildTarget": {
21
- "type": "string",
22
- "description": "Target which builds the application."
23
- },
24
- "proxyConfig": {
25
- "type": "string",
26
- "description": "Path to the proxy configuration file.",
27
- "x-completion-type": "file"
28
- },
29
- "staticFilePath": {
30
- "type": "string",
31
- "description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath",
32
- "x-completion-type": "directory"
33
- },
34
- "watch": {
35
- "type": "boolean",
36
- "description": "Enable re-building when files change. If not specified, watch mode will be enabled by default.",
37
- "default": true
38
- }
39
- },
40
- "definitions": {},
41
- "required": ["buildTarget"],
42
- "examplesFile": "../../../docs/preview-server-examples.md"
40
+ "definitions": {},
41
+ "required": ["buildTarget"],
42
+ "examplesFile": "../../../docs/preview-server-examples.md"
43
43
  }
@@ -1,36 +1,36 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "cli": "nx",
5
- "title": "Vitest executor",
6
- "description": "Test using Vitest.",
7
- "type": "object",
8
- "properties": {
9
- "configFile": {
10
- "type": "string",
11
- "description": "The path to the local vitest config, relative to the workspace root.",
12
- "x-completion-type": "file",
13
- "x-completion-glob": "@(vitest|vite).config@(.js|.ts)",
14
- "aliases": ["config"]
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "cli": "nx",
5
+ "title": "Vitest executor",
6
+ "description": "Test using Vitest.",
7
+ "type": "object",
8
+ "properties": {
9
+ "configFile": {
10
+ "type": "string",
11
+ "description": "The path to the local vitest config, relative to the workspace root.",
12
+ "x-completion-type": "file",
13
+ "x-completion-glob": "@(vitest|vite).config@(.js|.ts)",
14
+ "aliases": ["config"]
15
+ },
16
+ "reportsDirectory": {
17
+ "type": "string",
18
+ "description": "Directory to write coverage report to."
19
+ },
20
+ "mode": {
21
+ "type": "string",
22
+ "description": "Mode for Vite."
23
+ },
24
+ "testFiles": {
25
+ "aliases": ["testFile"],
26
+ "type": "array",
27
+ "items": { "type": "string" }
28
+ },
29
+ "watch": {
30
+ "description": "Watch files for changes and rerun tests related to changed files.",
31
+ "type": "boolean"
32
+ }
15
33
  },
16
- "reportsDirectory": {
17
- "type": "string",
18
- "description": "Directory to write coverage report to."
19
- },
20
- "mode": {
21
- "type": "string",
22
- "description": "Mode for Vite."
23
- },
24
- "testFiles": {
25
- "aliases": ["testFile"],
26
- "type": "array",
27
- "items": { "type": "string" }
28
- },
29
- "watch": {
30
- "description": "Watch files for changes and rerun tests related to changed files.",
31
- "type": "boolean"
32
- }
33
- },
34
- "required": [],
35
- "examplesFile": "../../../docs/test-examples.md"
34
+ "required": [],
35
+ "examplesFile": "../../../docs/test-examples.md"
36
36
  }
@@ -13,4 +13,5 @@ export interface ViteConfigurationGeneratorSchema {
13
13
  addPlugin?: boolean;
14
14
  projectType?: 'application' | 'library';
15
15
  previewPort?: number;
16
+ useViteV7?: boolean;
16
17
  }
@@ -1,65 +1,65 @@
1
1
  {
2
- "cli": "nx",
3
- "title": "Configure a project to use Vite.",
4
- "description": "Configure a project to use Vite.",
5
- "$id": "configure-vite-project",
6
- "type": "object",
7
- "properties": {
8
- "project": {
9
- "type": "string",
10
- "description": "The name of the project.",
11
- "$default": {
12
- "$source": "argv",
13
- "index": 0
14
- },
15
- "aliases": ["name", "projectName"],
16
- "x-dropdown": "project",
17
- "x-prompt": "What is the name of the project to set up Vite for?"
2
+ "cli": "nx",
3
+ "title": "Configure a project to use Vite.",
4
+ "description": "Configure a project to use Vite.",
5
+ "$id": "configure-vite-project",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The name of the project.",
11
+ "$default": {
12
+ "$source": "argv",
13
+ "index": 0
14
+ },
15
+ "aliases": ["name", "projectName"],
16
+ "x-dropdown": "project",
17
+ "x-prompt": "What is the name of the project to set up Vite for?"
18
+ },
19
+ "includeLib": {
20
+ "type": "boolean",
21
+ "description": "Add a library build option and skip the server option.",
22
+ "hidden": true
23
+ },
24
+ "includeVitest": {
25
+ "type": "boolean",
26
+ "description": "Use vitest for the test suite."
27
+ },
28
+ "uiFramework": {
29
+ "type": "string",
30
+ "description": "UI Framework to use for Vite.",
31
+ "enum": ["react", "none"],
32
+ "default": "none",
33
+ "x-prompt": "What UI framework plugin should Vite use?"
34
+ },
35
+ "compiler": {
36
+ "type": "string",
37
+ "description": "Compiler to use for Vite when UI Framework is React.",
38
+ "enum": ["babel", "swc"],
39
+ "default": "babel"
40
+ },
41
+ "newProject": {
42
+ "type": "boolean",
43
+ "description": "Is this a new project?",
44
+ "default": false,
45
+ "hidden": true
46
+ },
47
+ "skipFormat": {
48
+ "description": "Skip formatting files.",
49
+ "type": "boolean",
50
+ "default": false,
51
+ "x-priority": "internal"
52
+ },
53
+ "testEnvironment": {
54
+ "description": "The vitest environment to use. See https://vitest.dev/config/#environment.",
55
+ "type": "string",
56
+ "enum": ["node", "jsdom", "happy-dom", "edge-runtime"],
57
+ "default": "jsdom"
58
+ },
59
+ "port": {
60
+ "type": "number",
61
+ "description": "The port to use for the development server"
62
+ }
18
63
  },
19
- "includeLib": {
20
- "type": "boolean",
21
- "description": "Add a library build option and skip the server option.",
22
- "hidden": true
23
- },
24
- "includeVitest": {
25
- "type": "boolean",
26
- "description": "Use vitest for the test suite."
27
- },
28
- "uiFramework": {
29
- "type": "string",
30
- "description": "UI Framework to use for Vite.",
31
- "enum": ["react", "none"],
32
- "default": "none",
33
- "x-prompt": "What UI framework plugin should Vite use?"
34
- },
35
- "compiler": {
36
- "type": "string",
37
- "description": "Compiler to use for Vite when UI Framework is React.",
38
- "enum": ["babel", "swc"],
39
- "default": "babel"
40
- },
41
- "newProject": {
42
- "type": "boolean",
43
- "description": "Is this a new project?",
44
- "default": false,
45
- "hidden": true
46
- },
47
- "skipFormat": {
48
- "description": "Skip formatting files.",
49
- "type": "boolean",
50
- "default": false,
51
- "x-priority": "internal"
52
- },
53
- "testEnvironment": {
54
- "description": "The vitest environment to use. See https://vitest.dev/config/#environment.",
55
- "type": "string",
56
- "enum": ["node", "jsdom", "happy-dom", "edge-runtime"],
57
- "default": "jsdom"
58
- },
59
- "port": {
60
- "type": "number",
61
- "description": "The port to use for the development server"
62
- }
63
- },
64
- "examplesFile": "../../../docs/configuration-examples.md"
64
+ "examplesFile": "../../../docs/configuration-examples.md"
65
65
  }