@nx/vitest 23.2.0-beta.4 → 23.2.0-beta.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.
|
@@ -7,7 +7,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
7
7
|
const options_utils_1 = require("../../../utils/options-utils");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const executor_utils_1 = require("../../../utils/executor-utils");
|
|
10
|
-
const
|
|
10
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
11
11
|
async function getOptions(options, context, projectRoot) {
|
|
12
12
|
// Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.
|
|
13
13
|
const { loadConfigFromFile } = await (0, executor_utils_1.loadViteDynamicImport)();
|
|
@@ -57,7 +57,7 @@ async function getOptions(options, context, projectRoot) {
|
|
|
57
57
|
// `nx run-many`/`affected` don't hang. An explicit CLI --watch/--no-watch or a
|
|
58
58
|
// config `test.watch` still takes precedence.
|
|
59
59
|
const uiRequested = passThroughOptions.ui === true;
|
|
60
|
-
const watchForUi = uiRequested && !!process.stdin.isTTY && !(0,
|
|
60
|
+
const watchForUi = uiRequested && !!process.stdin.isTTY && !(0, internal_1.isCI)();
|
|
61
61
|
return {
|
|
62
62
|
watch: watch ??
|
|
63
63
|
resolved?.config?.['test']?.watch ??
|
|
@@ -8,10 +8,6 @@ const internal_2 = require("@nx/js/internal");
|
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
9
|
const promises_1 = require("node:fs/promises");
|
|
10
10
|
const node_path_1 = require("node:path");
|
|
11
|
-
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
12
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
13
|
-
const plugins_1 = require("nx/src/utils/plugins");
|
|
14
|
-
const workspace_context_1 = require("nx/src/utils/workspace-context");
|
|
15
11
|
const executor_utils_1 = require("../utils/executor-utils");
|
|
16
12
|
/**
|
|
17
13
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
@@ -25,9 +21,9 @@ exports.createNodes = [
|
|
|
25
21
|
vitestConfigGlob,
|
|
26
22
|
async (configFilePaths, options, context) => {
|
|
27
23
|
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
28
|
-
const optionsHash = (0,
|
|
24
|
+
const optionsHash = (0, internal_1.hashObject)(options);
|
|
29
25
|
const normalizedOptions = normalizeOptions(options);
|
|
30
|
-
const cachePath = (0, node_path_1.join)(
|
|
26
|
+
const cachePath = (0, node_path_1.join)(internal_1.workspaceDataDirectory, `vitest-${optionsHash}.hash`);
|
|
31
27
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
32
28
|
const { roots: projectRoots, configFiles: validConfigFiles } = configFilePaths.reduce((acc, configFile) => {
|
|
33
29
|
const potentialRoot = (0, node_path_1.dirname)(configFile);
|
|
@@ -144,7 +140,7 @@ async function buildVitestTargets(configFilePath, projectRoot, options, context,
|
|
|
144
140
|
const isTypecheckEnabled = !!viteBuildConfig.test?.typecheck?.enabled;
|
|
145
141
|
targets[options.testTargetName] = await testTarget(namedInputs, testOutputs, projectRoot, options.testMode, pmc, isTypecheckEnabled, tsconfigInputs);
|
|
146
142
|
if (options.ciTargetName) {
|
|
147
|
-
const groupName = options.ciGroupName ?? (0,
|
|
143
|
+
const groupName = options.ciGroupName ?? (0, internal_1.deriveGroupNameFromTarget)(options.ciTargetName);
|
|
148
144
|
const targetGroup = [];
|
|
149
145
|
const dependsOn = [];
|
|
150
146
|
metadata = {
|
|
@@ -479,7 +475,7 @@ async function globTestPathsRelativeToProjectRoot(test, workspaceRoot, projectRo
|
|
|
479
475
|
if (!include.some((pattern) => !isNegatedPattern(pattern))) {
|
|
480
476
|
return Promise.resolve([]);
|
|
481
477
|
}
|
|
482
|
-
return (0,
|
|
478
|
+
return (0, internal_1.globWithWorkspaceContext)(workspaceRoot, include.map(anchor),
|
|
483
479
|
// Vitest discards a negated `exclude` entry; forwarding it would turn the
|
|
484
480
|
// exclude set into an allowlist.
|
|
485
481
|
ignore.filter((pattern) => !isNegatedPattern(pattern)).map(anchor));
|
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.2.0-beta.
|
|
4
|
+
"version": "23.2.0-beta.5",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"tslib": "^2.3.0",
|
|
74
74
|
"semver": "^7.6.3",
|
|
75
75
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
76
|
-
"@nx/
|
|
77
|
-
"@nx/
|
|
76
|
+
"@nx/devkit": "23.2.0-beta.5",
|
|
77
|
+
"@nx/js": "23.2.0-beta.5"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"vitest": "^3.0.0 || ^4.0.0",
|
|
81
81
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
82
|
-
"@nx/eslint": "23.2.0-beta.
|
|
82
|
+
"@nx/eslint": "23.2.0-beta.5"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
85
85
|
"@nx/eslint": {
|
|
@@ -93,6 +93,6 @@
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"nx": "23.2.0-beta.
|
|
96
|
+
"nx": "23.2.0-beta.5"
|
|
97
97
|
}
|
|
98
98
|
}
|