@nx/vitest 23.2.0-beta.6 → 23.2.0-beta.7
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/internal.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Semi-private surface for first-party Nx packages.
|
|
3
|
+
//
|
|
4
|
+
// External plugins should NOT import from here — this entry is curated for
|
|
5
|
+
// internal consumers and may change without semver protection. Mirrors
|
|
6
|
+
// `@nx/devkit/internal`.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.oxlintPlugins = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* The Oxlint plugins a Vitest-tested project needs. Declared here so the linter
|
|
11
|
+
* does not have to know what a test runner requires; `@nx/js`'s
|
|
12
|
+
* `addLintingToProject` reads it through `ensurePackage`.
|
|
13
|
+
*/
|
|
14
|
+
exports.oxlintPlugins = ['vitest'];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
export declare function ignoreVitestTempFiles(tree: Tree, projectRoot?: string | undefined): Promise<void>;
|
|
3
3
|
export declare function addVitestTempFilesToGitIgnore(tree: Tree): void;
|
|
4
|
-
export declare function isEslintInstalled(tree: Tree): boolean;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ignoreVitestTempFiles = ignoreVitestTempFiles;
|
|
4
4
|
exports.addVitestTempFilesToGitIgnore = addVitestTempFilesToGitIgnore;
|
|
5
|
-
exports.isEslintInstalled = isEslintInstalled;
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const versions_1 = require("./versions");
|
|
8
8
|
async function ignoreVitestTempFiles(tree, projectRoot) {
|
|
9
9
|
addVitestTempFilesToGitIgnore(tree);
|
|
@@ -20,7 +20,9 @@ function addVitestTempFilesToGitIgnore(tree) {
|
|
|
20
20
|
tree.write('.gitignore', gitIgnoreContents);
|
|
21
21
|
}
|
|
22
22
|
async function ignoreVitestTempFilesInEslintConfig(tree, projectRoot) {
|
|
23
|
-
|
|
23
|
+
// Checked before `ensurePackage` so an Oxlint workspace does not install
|
|
24
|
+
// `@nx/eslint` only for `isEslintConfigSupported` to send it straight back.
|
|
25
|
+
if (!(0, internal_1.detectLinters)(tree).includes('eslint')) {
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
(0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
|
|
@@ -45,15 +47,3 @@ async function ignoreVitestTempFilesInEslintConfig(tree, projectRoot) {
|
|
|
45
47
|
const directory = isUsingFlatConfig ? '' : (projectRoot ?? '');
|
|
46
48
|
addIgnoresToLintConfig(tree, directory, ['**/vitest.config.*.timestamp*']);
|
|
47
49
|
}
|
|
48
|
-
function isEslintInstalled(tree) {
|
|
49
|
-
try {
|
|
50
|
-
require('eslint');
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
catch { }
|
|
54
|
-
// it might not be installed yet, but it might be in the tree pending install
|
|
55
|
-
const { devDependencies, dependencies } = tree.exists('package.json')
|
|
56
|
-
? (0, devkit_1.readJson)(tree, 'package.json')
|
|
57
|
-
: {};
|
|
58
|
-
return !!devDependencies?.['eslint'] || !!dependencies?.['eslint'];
|
|
59
|
-
}
|
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.7",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
"generators": [
|
|
38
38
|
"dist/generators.d.ts"
|
|
39
39
|
],
|
|
40
|
+
"internal": [
|
|
41
|
+
"dist/internal.d.ts"
|
|
42
|
+
],
|
|
40
43
|
"executors": [
|
|
41
44
|
"dist/executors.d.ts"
|
|
42
45
|
]
|
|
@@ -57,6 +60,11 @@
|
|
|
57
60
|
"types": "./dist/generators.d.ts",
|
|
58
61
|
"default": "./dist/generators.js"
|
|
59
62
|
},
|
|
63
|
+
"./internal": {
|
|
64
|
+
"@nx/nx-source": "./internal.ts",
|
|
65
|
+
"types": "./dist/internal.d.ts",
|
|
66
|
+
"default": "./dist/internal.js"
|
|
67
|
+
},
|
|
60
68
|
"./executors": {
|
|
61
69
|
"@nx/nx-source": "./executors.ts",
|
|
62
70
|
"types": "./dist/executors.d.ts",
|
|
@@ -73,13 +81,13 @@
|
|
|
73
81
|
"tslib": "^2.3.0",
|
|
74
82
|
"semver": "^7.6.3",
|
|
75
83
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
76
|
-
"@nx/devkit": "23.2.0-beta.
|
|
77
|
-
"@nx/js": "23.2.0-beta.
|
|
84
|
+
"@nx/devkit": "23.2.0-beta.7",
|
|
85
|
+
"@nx/js": "23.2.0-beta.7"
|
|
78
86
|
},
|
|
79
87
|
"peerDependencies": {
|
|
80
88
|
"vitest": "^3.0.0 || ^4.0.0",
|
|
81
89
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
82
|
-
"@nx/eslint": "23.2.0-beta.
|
|
90
|
+
"@nx/eslint": "23.2.0-beta.7"
|
|
83
91
|
},
|
|
84
92
|
"peerDependenciesMeta": {
|
|
85
93
|
"@nx/eslint": {
|
|
@@ -93,6 +101,6 @@
|
|
|
93
101
|
}
|
|
94
102
|
},
|
|
95
103
|
"devDependencies": {
|
|
96
|
-
"nx": "23.2.0-beta.
|
|
104
|
+
"nx": "23.2.0-beta.7"
|
|
97
105
|
}
|
|
98
106
|
}
|