@nx/vitest 23.0.0-beta.7 → 23.0.0-beta.9
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/generators.json +5 -0
- package/package.json +5 -5
- package/src/executors/test/schema.json +1 -0
- package/src/executors/test/vitest.impl.d.ts.map +1 -1
- package/src/executors/test/vitest.impl.js +2 -0
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts +8 -0
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -0
- package/src/generators/convert-to-inferred/convert-to-inferred.js +24 -0
- package/src/generators/convert-to-inferred/lib/test-post-target-transformer.d.ts +6 -0
- package/src/generators/convert-to-inferred/lib/test-post-target-transformer.d.ts.map +1 -0
- package/src/generators/convert-to-inferred/lib/test-post-target-transformer.js +56 -0
- package/src/generators/convert-to-inferred/lib/utils.d.ts +2 -0
- package/src/generators/convert-to-inferred/lib/utils.d.ts.map +1 -0
- package/src/generators/convert-to-inferred/lib/utils.js +12 -0
- package/src/generators/convert-to-inferred/schema.json +19 -0
- package/src/utils/deprecation.d.ts +4 -0
- package/src/utils/deprecation.d.ts.map +1 -0
- package/src/utils/deprecation.js +19 -0
- package/src/utils/generator-utils.d.ts.map +1 -1
- package/src/utils/generator-utils.js +2 -0
package/generators.json
CHANGED
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"factory": "./src/generators/configuration/configuration",
|
|
14
14
|
"schema": "./src/generators/configuration/schema.json",
|
|
15
15
|
"description": "Add Vitest configuration to a project."
|
|
16
|
+
},
|
|
17
|
+
"convert-to-inferred": {
|
|
18
|
+
"factory": "./src/generators/convert-to-inferred/convert-to-inferred",
|
|
19
|
+
"schema": "./src/generators/convert-to-inferred/schema.json",
|
|
20
|
+
"description": "Convert a project to use the `@nx/vitest` inferred plugin."
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
23
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vitest",
|
|
3
3
|
"description": "The Nx Plugin for Vitest to enable fast unit testing with Vitest.",
|
|
4
|
-
"version": "23.0.0-beta.
|
|
4
|
+
"version": "23.0.0-beta.9",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"executors": "./executors.json",
|
|
53
53
|
"generators": "./generators.json",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@nx/devkit": "23.0.0-beta.
|
|
56
|
-
"@nx/js": "23.0.0-beta.
|
|
55
|
+
"@nx/devkit": "23.0.0-beta.9",
|
|
56
|
+
"@nx/js": "23.0.0-beta.9",
|
|
57
57
|
"tslib": "^2.3.0",
|
|
58
58
|
"semver": "^7.6.3",
|
|
59
59
|
"@phenomnomnominal/tsquery": "~6.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@nx/eslint": "23.0.0-beta.
|
|
62
|
+
"@nx/eslint": "23.0.0-beta.9",
|
|
63
63
|
"vitest": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0",
|
|
64
64
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
65
65
|
},
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"nx": "23.0.0-beta.
|
|
78
|
+
"nx": "23.0.0-beta.9"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"title": "Vitest executor",
|
|
6
6
|
"description": "Test using Vitest.",
|
|
7
7
|
"type": "object",
|
|
8
|
+
"x-deprecated": "The `@nx/vitest:test` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/vitest:convert-to-inferred` to migrate to the `@nx/vitest/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
8
9
|
"properties": {
|
|
9
10
|
"configFile": {
|
|
10
11
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/vitest/src/executors/test/vitest.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"vitest.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/vitest/src/executors/test/vitest.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAQjD,wBAAuB,cAAc,CACnC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,eAAe;;YAoEzB;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -7,7 +7,9 @@ const internal_1 = require("@nx/js/src/internal");
|
|
|
7
7
|
const nx_reporter_1 = require("./lib/nx-reporter");
|
|
8
8
|
const utils_1 = require("./lib/utils");
|
|
9
9
|
const executor_utils_1 = require("../../utils/executor-utils");
|
|
10
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
10
11
|
async function* vitestExecutor(options, context) {
|
|
12
|
+
(0, deprecation_1.warnVitestTestExecutorDeprecation)();
|
|
11
13
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
12
14
|
(0, internal_1.registerTsConfigPaths)((0, path_1.resolve)(devkit_1.workspaceRoot, projectRoot, 'tsconfig.json'));
|
|
13
15
|
process.env.VITE_CJS_IGNORE_WARNING = 'true';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
interface Schema {
|
|
3
|
+
project?: string;
|
|
4
|
+
skipFormat?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function convertToInferred(tree: Tree, options: Schema): Promise<void>;
|
|
7
|
+
export default convertToInferred;
|
|
8
|
+
//# sourceMappingURL=convert-to-inferred.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/vitest/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAQ7E,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBA2BlE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToInferred = convertToInferred;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const plugin_1 = require("../../plugins/plugin");
|
|
7
|
+
const test_post_target_transformer_1 = require("./lib/test-post-target-transformer");
|
|
8
|
+
async function convertToInferred(tree, options) {
|
|
9
|
+
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
10
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/vitest', plugin_1.createNodesV2, { testTargetName: 'test' }, [
|
|
11
|
+
{
|
|
12
|
+
executors: ['@nx/vitest:test'],
|
|
13
|
+
postTargetTransformer: test_post_target_transformer_1.testPostTargetTransformer,
|
|
14
|
+
targetPluginOptionMapper: (target) => ({ testTargetName: target }),
|
|
15
|
+
},
|
|
16
|
+
], options.project);
|
|
17
|
+
if (migratedProjects.size === 0) {
|
|
18
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
19
|
+
}
|
|
20
|
+
if (!options.skipFormat) {
|
|
21
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = convertToInferred;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TargetConfiguration, type Tree } from '@nx/devkit';
|
|
2
|
+
export declare function testPostTargetTransformer(target: TargetConfiguration, tree: Tree, projectDetails: {
|
|
3
|
+
projectName: string;
|
|
4
|
+
root: string;
|
|
5
|
+
}, inferredTargetConfiguration: TargetConfiguration): TargetConfiguration<any>;
|
|
6
|
+
//# sourceMappingURL=test-post-target-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vitest/src/generators/convert-to-inferred/lib/test-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAIjE,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,2BAA2B,EAAE,mBAAmB,4BA+CjD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testPostTargetTransformer = testPostTargetTransformer;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
function testPostTargetTransformer(target, tree, projectDetails, inferredTargetConfiguration) {
|
|
7
|
+
if (target.options) {
|
|
8
|
+
removePropertiesFromTargetOptions(target.options, projectDetails.root);
|
|
9
|
+
}
|
|
10
|
+
if (target.configurations) {
|
|
11
|
+
for (const configurationName in target.configurations) {
|
|
12
|
+
const configuration = target.configurations[configurationName];
|
|
13
|
+
removePropertiesFromTargetOptions(configuration, projectDetails.root);
|
|
14
|
+
}
|
|
15
|
+
if (Object.keys(target.configurations).length === 0) {
|
|
16
|
+
if ('defaultConfiguration' in target) {
|
|
17
|
+
delete target.defaultConfiguration;
|
|
18
|
+
}
|
|
19
|
+
delete target.configurations;
|
|
20
|
+
}
|
|
21
|
+
if ('defaultConfiguration' in target &&
|
|
22
|
+
!target.configurations[target.defaultConfiguration]) {
|
|
23
|
+
delete target.defaultConfiguration;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target.outputs) {
|
|
27
|
+
(0, internal_1.processTargetOutputs)(target, [{ newName: 'coverage.reportsDirectory', oldName: 'reportsDirectory' }], inferredTargetConfiguration, {
|
|
28
|
+
projectName: projectDetails.projectName,
|
|
29
|
+
projectRoot: projectDetails.root,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (target.inputs &&
|
|
33
|
+
target.inputs.every((i) => i === 'default' || i === '^production')) {
|
|
34
|
+
delete target.inputs;
|
|
35
|
+
}
|
|
36
|
+
return target;
|
|
37
|
+
}
|
|
38
|
+
function removePropertiesFromTargetOptions(targetOptions, projectRoot) {
|
|
39
|
+
if ('configFile' in targetOptions) {
|
|
40
|
+
targetOptions.config = (0, utils_1.toProjectRelativePath)(targetOptions.configFile, projectRoot);
|
|
41
|
+
delete targetOptions.configFile;
|
|
42
|
+
}
|
|
43
|
+
if ('reportsDirectory' in targetOptions) {
|
|
44
|
+
if (targetOptions.reportsDirectory.startsWith('../')) {
|
|
45
|
+
targetOptions.reportsDirectory = targetOptions.reportsDirectory.replace(/(\.\.\/)+/, '');
|
|
46
|
+
}
|
|
47
|
+
targetOptions['coverage.reportsDirectory'] = (0, utils_1.toProjectRelativePath)(targetOptions.reportsDirectory, projectRoot);
|
|
48
|
+
delete targetOptions.reportsDirectory;
|
|
49
|
+
}
|
|
50
|
+
if ('testFiles' in targetOptions) {
|
|
51
|
+
targetOptions.testNamePattern = `"/(${targetOptions.testFiles
|
|
52
|
+
.map((f) => f.replace('.', '\\.'))
|
|
53
|
+
.join('|')})/"`;
|
|
54
|
+
delete targetOptions.testFiles;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vitest/src/generators/convert-to-inferred/lib/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,MAAM,CAWR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toProjectRelativePath = toProjectRelativePath;
|
|
4
|
+
const posix_1 = require("path/posix");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
function toProjectRelativePath(path, projectRoot) {
|
|
7
|
+
if (projectRoot === '.') {
|
|
8
|
+
return path.startsWith('.') ? path : `./${path}`;
|
|
9
|
+
}
|
|
10
|
+
const relativePath = (0, posix_1.relative)((0, posix_1.resolve)(devkit_1.workspaceRoot, projectRoot), (0, posix_1.resolve)(devkit_1.workspaceRoot, path));
|
|
11
|
+
return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "NxVitestConvertToInferred",
|
|
4
|
+
"description": "Convert existing vitest project(s) using `@nx/vitest:test` executors to use the `@nx/vitest` inferred plugin. Defaults to migrating all projects. Pass '--project' to migrate only one target.",
|
|
5
|
+
"title": "Convert vitest project from executor to inferred plugin",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"project": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The project to convert from using the `@nx/vitest:test` executor to use the `@nx/vitest` inferred plugin.",
|
|
11
|
+
"x-priority": "important"
|
|
12
|
+
},
|
|
13
|
+
"skipFormat": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"description": "Whether to format files at the end of the migration.",
|
|
16
|
+
"default": false
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const VITEST_TEST_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/vitest:test` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/vitest:convert-to-inferred` to migrate to the `@nx/vitest/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
2
|
+
export declare function warnVitestTestExecutorDeprecation(): void;
|
|
3
|
+
export declare function warnVitestExecutorGenerating(): void;
|
|
4
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/vitest/src/utils/deprecation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wCAAwC,iQAC2M,CAAC;AAEjQ,wBAAgB,iCAAiC,IAAI,IAAI,CAExD;AAMD,wBAAgB,4BAA4B,IAAI,IAAI,CAInD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VITEST_TEST_EXECUTOR_DEPRECATION_MESSAGE = void 0;
|
|
4
|
+
exports.warnVitestTestExecutorDeprecation = warnVitestTestExecutorDeprecation;
|
|
5
|
+
exports.warnVitestExecutorGenerating = warnVitestExecutorGenerating;
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
// TODO(v24): Remove the @nx/vitest:test executor. The inferred plugin
|
|
8
|
+
// (@nx/vitest/plugin) and the convert-to-inferred generator stay supported.
|
|
9
|
+
exports.VITEST_TEST_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/vitest:test` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/vitest:convert-to-inferred` to migrate to the `@nx/vitest/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
10
|
+
function warnVitestTestExecutorDeprecation() {
|
|
11
|
+
devkit_1.logger.warn(exports.VITEST_TEST_EXECUTOR_DEPRECATION_MESSAGE);
|
|
12
|
+
}
|
|
13
|
+
// Fired when the @nx/vitest:configuration generator is about to generate a
|
|
14
|
+
// target that uses the deprecated executor — i.e. when @nx/vitest/plugin
|
|
15
|
+
// isn't registered in nx.json. Surfaces the deprecation at generation time
|
|
16
|
+
// rather than only when the user later runs the generated target.
|
|
17
|
+
function warnVitestExecutorGenerating() {
|
|
18
|
+
devkit_1.logger.warn('Generating a target that uses the deprecated `@nx/vitest:test` executor. This executor will be removed in Nx v24. Run `nx g @nx/vitest:convert-to-inferred` next to migrate this target to the `@nx/vitest/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/vitest/src/utils/generator-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,IAAI,EAGL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"generator-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/vitest/src/utils/generator-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,IAAI,EAGL,MAAM,YAAY,CAAC;AAOpB,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACnD,gBAAgB,EAAE,IAAI,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,GAAG,MAAM,CAAC;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC3B,WAAW,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,OAAO,QAuCnB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,GAAG,MAAM,CAAC;IAC3E,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gBAAgB,CAAC,EAAE,IAAI,GAAG,UAAU,GAAG,QAAQ,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,OAAO,EACnB,YAAY,GAAE;IACZ,4BAA4B,CAAC,EAAE,WAAW,CAAC;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CACrB,QA8MP"}
|
|
@@ -5,6 +5,7 @@ exports.createOrEditViteConfig = createOrEditViteConfig;
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
7
|
const vite_config_edit_utils_1 = require("./vite-config-edit-utils");
|
|
8
|
+
const deprecation_1 = require("./deprecation");
|
|
8
9
|
const versions_1 = require("./versions");
|
|
9
10
|
function addOrChangeTestTarget(tree, options, hasPlugin) {
|
|
10
11
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
@@ -25,6 +26,7 @@ function addOrChangeTestTarget(tree, options, hasPlugin) {
|
|
|
25
26
|
throw new Error(`Target "${target}" already exists in the project.`);
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
29
|
+
(0, deprecation_1.warnVitestExecutorGenerating)();
|
|
28
30
|
project.targets[target] = {
|
|
29
31
|
executor: '@nx/vitest:test',
|
|
30
32
|
outputs: ['{options.reportsDirectory}'],
|