@nx/vitest 22.6.3 → 22.6.5
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/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": "22.6.
|
|
4
|
+
"version": "22.6.5",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"executors": "./executors.json",
|
|
53
53
|
"generators": "./generators.json",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@nx/devkit": "22.6.
|
|
56
|
-
"@nx/js": "22.6.
|
|
55
|
+
"@nx/devkit": "22.6.5",
|
|
56
|
+
"@nx/js": "22.6.5",
|
|
57
57
|
"tslib": "^2.3.0",
|
|
58
58
|
"semver": "^7.6.3",
|
|
59
59
|
"@phenomnomnominal/tsquery": "~6.1.4"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"nx": "22.6.
|
|
74
|
+
"nx": "22.6.5"
|
|
75
75
|
},
|
|
76
76
|
"types": "./src/index.d.ts"
|
|
77
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vitest/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vitest/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EASd,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CAC5B;AAoBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,mBAAmB,CAmF1D,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -11,7 +11,6 @@ const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
|
11
11
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
12
12
|
const plugins_1 = require("nx/src/utils/plugins");
|
|
13
13
|
const executor_utils_1 = require("../utils/executor-utils");
|
|
14
|
-
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
15
14
|
function readTargetsCache(cachePath) {
|
|
16
15
|
return process.env.NX_CACHE_PROJECT_GRAPH !== 'false' && (0, node_fs_1.existsSync)(cachePath)
|
|
17
16
|
? (0, devkit_1.readJsonFile)(cachePath)
|
|
@@ -31,6 +30,7 @@ const vitestConfigGlob = '**/{vite,vitest}.config.{js,ts,mjs,mts,cjs,cts}';
|
|
|
31
30
|
exports.createNodes = [
|
|
32
31
|
vitestConfigGlob,
|
|
33
32
|
async (configFilePaths, options, context) => {
|
|
33
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
34
34
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
35
35
|
const normalizedOptions = normalizeOptions(options);
|
|
36
36
|
const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `vitest-${optionsHash}.hash`);
|
|
@@ -57,7 +57,7 @@ exports.createNodes = [
|
|
|
57
57
|
// for different config files.
|
|
58
58
|
const hash = hashes[idx] + configFile;
|
|
59
59
|
const { projectType, metadata, targets } = (targetsCache[hash] ??=
|
|
60
|
-
await buildVitestTargets(configFile, projectRoot, normalizedOptions, context));
|
|
60
|
+
await buildVitestTargets(configFile, projectRoot, normalizedOptions, context, pmc));
|
|
61
61
|
const project = {
|
|
62
62
|
root: projectRoot,
|
|
63
63
|
targets,
|
|
@@ -77,7 +77,7 @@ exports.createNodes = [
|
|
|
77
77
|
},
|
|
78
78
|
];
|
|
79
79
|
exports.createNodesV2 = exports.createNodes;
|
|
80
|
-
async function buildVitestTargets(configFilePath, projectRoot, options, context) {
|
|
80
|
+
async function buildVitestTargets(configFilePath, projectRoot, options, context, pmc) {
|
|
81
81
|
const absoluteConfigFilePath = (0, devkit_1.joinPathFragments)(context.workspaceRoot, configFilePath);
|
|
82
82
|
// Workaround for the `build$3 is not a function` error that we sometimes see in agents.
|
|
83
83
|
// This should be removed later once we address the issue properly
|
|
@@ -132,7 +132,7 @@ async function buildVitestTargets(configFilePath, projectRoot, options, context)
|
|
|
132
132
|
const targets = {};
|
|
133
133
|
// if file is vitest.config or vite.config has definition for test, create targets for test and/or atomized tests
|
|
134
134
|
if (configFilePath.includes('vitest.config') || hasTest) {
|
|
135
|
-
targets[options.testTargetName] = await testTarget(namedInputs, testOutputs, projectRoot, options.testMode);
|
|
135
|
+
targets[options.testTargetName] = await testTarget(namedInputs, testOutputs, projectRoot, options.testMode, pmc);
|
|
136
136
|
if (options.ciTargetName) {
|
|
137
137
|
const groupName = options.ciGroupName ?? (0, plugins_1.deriveGroupNameFromTarget)(options.ciTargetName);
|
|
138
138
|
const targetGroup = [];
|
|
@@ -207,7 +207,7 @@ async function buildVitestTargets(configFilePath, projectRoot, options, context)
|
|
|
207
207
|
}
|
|
208
208
|
return { targets, metadata, projectType: 'library' };
|
|
209
209
|
}
|
|
210
|
-
async function testTarget(namedInputs, outputs, projectRoot, testMode = 'watch') {
|
|
210
|
+
async function testTarget(namedInputs, outputs, projectRoot, testMode = 'watch', pmc) {
|
|
211
211
|
const command = testMode === 'run' ? 'vitest run' : 'vitest';
|
|
212
212
|
return {
|
|
213
213
|
command,
|
|
@@ -261,10 +261,10 @@ function normalizeOutputPath(outputPath, projectRoot, workspaceRoot, path) {
|
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
263
|
if (outputPath.startsWith('..')) {
|
|
264
|
-
return (0,
|
|
264
|
+
return (0, devkit_1.joinPathFragments)('{workspaceRoot}', projectRoot, outputPath);
|
|
265
265
|
}
|
|
266
266
|
else {
|
|
267
|
-
return (0,
|
|
267
|
+
return (0, devkit_1.joinPathFragments)('{projectRoot}', outputPath);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}
|
|
@@ -296,5 +296,5 @@ async function getTestPathsRelativeToProjectRoot(projectRoot, workspaceRoot) {
|
|
|
296
296
|
const relevantTestSpecifications = await vitest.getRelevantTestSpecifications();
|
|
297
297
|
return relevantTestSpecifications
|
|
298
298
|
.filter((ts) => fullProjectRoot === '.' ? true : ts.moduleId.startsWith(fullProjectRoot))
|
|
299
|
-
.map((ts) => (0, node_path_1.relative)(projectRoot, ts.moduleId));
|
|
299
|
+
.map((ts) => (0, devkit_1.normalizePath)((0, node_path_1.relative)(projectRoot, ts.moduleId)));
|
|
300
300
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ export declare const viteVersion = "^8.0.0";
|
|
|
3
3
|
export declare const viteV7Version = "^7.0.0";
|
|
4
4
|
export declare const viteV6Version = "^6.0.0";
|
|
5
5
|
export declare const viteV5Version = "^5.0.0";
|
|
6
|
-
export declare const vitestV4Version = "~4.0
|
|
6
|
+
export declare const vitestV4Version = "~4.1.0";
|
|
7
7
|
export declare const vitestV3Version = "^3.0.0";
|
|
8
8
|
export declare const vitestV2Version = "^2.1.8";
|
|
9
|
-
export declare const vitestVersion = "~4.0
|
|
9
|
+
export declare const vitestVersion = "~4.1.0";
|
|
10
10
|
export declare const vitePluginReactVersion = "^6.0.0";
|
|
11
11
|
export declare const vitePluginReactV4Version = "^4.2.0";
|
|
12
|
-
export declare const vitePluginReactSwcVersion = "^3.
|
|
12
|
+
export declare const vitePluginReactSwcVersion = "^4.3.0";
|
|
13
13
|
export declare const jsdomVersion = "^27.1.0";
|
|
14
14
|
export declare const vitePluginDtsVersion = "~4.5.0";
|
|
15
15
|
export declare const ajvVersion = "^8.0.0";
|
|
@@ -17,12 +17,12 @@ export declare const happyDomVersion = "~9.20.3";
|
|
|
17
17
|
export declare const edgeRuntimeVmVersion = "~3.0.2";
|
|
18
18
|
export declare const jitiVersion = "2.4.2";
|
|
19
19
|
export declare const analogVitestAngular = "~2.1.2";
|
|
20
|
-
export declare const vitestV4CoverageV8Version = "~4.
|
|
20
|
+
export declare const vitestV4CoverageV8Version = "~4.1.0";
|
|
21
21
|
export declare const vitestV3CoverageV8Version = "^3.0.5";
|
|
22
22
|
export declare const vitestV2CoverageV8Version = "^2.1.8";
|
|
23
|
-
export declare const vitestCoverageV8Version = "~4.
|
|
24
|
-
export declare const vitestV4CoverageIstanbulVersion = "~4.
|
|
23
|
+
export declare const vitestCoverageV8Version = "~4.1.0";
|
|
24
|
+
export declare const vitestV4CoverageIstanbulVersion = "~4.1.0";
|
|
25
25
|
export declare const vitestV3CoverageIstanbulVersion = "^3.0.5";
|
|
26
26
|
export declare const vitestV2CoverageIstanbulVersion = "^2.1.8";
|
|
27
|
-
export declare const vitestCoverageIstanbulVersion = "~4.
|
|
27
|
+
export declare const vitestCoverageIstanbulVersion = "~4.1.0";
|
|
28
28
|
//# sourceMappingURL=versions.d.ts.map
|
package/src/utils/versions.js
CHANGED
|
@@ -6,13 +6,13 @@ exports.viteVersion = '^8.0.0';
|
|
|
6
6
|
exports.viteV7Version = '^7.0.0';
|
|
7
7
|
exports.viteV6Version = '^6.0.0';
|
|
8
8
|
exports.viteV5Version = '^5.0.0';
|
|
9
|
-
exports.vitestV4Version = '~4.0
|
|
9
|
+
exports.vitestV4Version = '~4.1.0';
|
|
10
10
|
exports.vitestV3Version = '^3.0.0';
|
|
11
11
|
exports.vitestV2Version = '^2.1.8';
|
|
12
12
|
exports.vitestVersion = exports.vitestV4Version;
|
|
13
13
|
exports.vitePluginReactVersion = '^6.0.0';
|
|
14
14
|
exports.vitePluginReactV4Version = '^4.2.0';
|
|
15
|
-
exports.vitePluginReactSwcVersion = '^3.
|
|
15
|
+
exports.vitePluginReactSwcVersion = '^4.3.0';
|
|
16
16
|
exports.jsdomVersion = '^27.1.0';
|
|
17
17
|
exports.vitePluginDtsVersion = '~4.5.0';
|
|
18
18
|
exports.ajvVersion = '^8.0.0';
|
|
@@ -21,11 +21,11 @@ exports.edgeRuntimeVmVersion = '~3.0.2';
|
|
|
21
21
|
exports.jitiVersion = '2.4.2';
|
|
22
22
|
exports.analogVitestAngular = '~2.1.2';
|
|
23
23
|
// Coverage providers
|
|
24
|
-
exports.vitestV4CoverageV8Version = '~4.
|
|
24
|
+
exports.vitestV4CoverageV8Version = '~4.1.0';
|
|
25
25
|
exports.vitestV3CoverageV8Version = '^3.0.5';
|
|
26
26
|
exports.vitestV2CoverageV8Version = '^2.1.8';
|
|
27
27
|
exports.vitestCoverageV8Version = exports.vitestV4CoverageV8Version;
|
|
28
|
-
exports.vitestV4CoverageIstanbulVersion = '~4.
|
|
28
|
+
exports.vitestV4CoverageIstanbulVersion = '~4.1.0';
|
|
29
29
|
exports.vitestV3CoverageIstanbulVersion = '^3.0.5';
|
|
30
30
|
exports.vitestV2CoverageIstanbulVersion = '^2.1.8';
|
|
31
31
|
exports.vitestCoverageIstanbulVersion = exports.vitestV4CoverageIstanbulVersion;
|