@nx/jest 17.3.0-beta.5 → 17.3.0-beta.6
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/jest",
|
|
3
|
-
"version": "17.3.0-beta.
|
|
3
|
+
"version": "17.3.0-beta.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.",
|
|
6
6
|
"repository": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"jest-config": "^29.4.1",
|
|
43
43
|
"jest-resolve": "^29.4.1",
|
|
44
44
|
"jest-util": "^29.4.1",
|
|
45
|
-
"minimatch": "
|
|
45
|
+
"minimatch": "9.0.3",
|
|
46
46
|
"resolve.exports": "1.1.0",
|
|
47
47
|
"tslib": "^2.3.0",
|
|
48
|
-
"@nx/devkit": "17.3.0-beta.
|
|
49
|
-
"@nx/js": "17.3.0-beta.
|
|
50
|
-
"@nrwl/jest": "17.3.0-beta.
|
|
48
|
+
"@nx/devkit": "17.3.0-beta.6",
|
|
49
|
+
"@nx/js": "17.3.0-beta.6",
|
|
50
|
+
"@nrwl/jest": "17.3.0-beta.6"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
@@ -61,11 +61,11 @@ function addJestTargetDefaults(tree) {
|
|
|
61
61
|
};
|
|
62
62
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
63
63
|
}
|
|
64
|
-
function updateDependencies(tree) {
|
|
64
|
+
function updateDependencies(tree, options) {
|
|
65
65
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
66
66
|
'@nx/jest': versions_1.nxVersion,
|
|
67
67
|
jest: versions_1.jestVersion,
|
|
68
|
-
});
|
|
68
|
+
}, undefined, options.keepExistingVersions);
|
|
69
69
|
}
|
|
70
70
|
async function jestInitGenerator(tree, options) {
|
|
71
71
|
if (!tree.exists('jest.preset.js')) {
|
|
@@ -80,7 +80,7 @@ async function jestInitGenerator(tree, options) {
|
|
|
80
80
|
const tasks = [];
|
|
81
81
|
if (!options.skipPackageJson) {
|
|
82
82
|
tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nx/jest'], []));
|
|
83
|
-
tasks.push(updateDependencies(tree));
|
|
83
|
+
tasks.push(updateDependencies(tree, options));
|
|
84
84
|
}
|
|
85
85
|
if (!options.skipFormat) {
|
|
86
86
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
"default": false,
|
|
18
18
|
"description": "Do not add dependencies to `package.json`.",
|
|
19
19
|
"x-priority": "internal"
|
|
20
|
+
},
|
|
21
|
+
"keepExistingVersions": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"x-priority": "internal",
|
|
24
|
+
"description": "Keep existing dependencies versions",
|
|
25
|
+
"default": false
|
|
20
26
|
}
|
|
21
27
|
},
|
|
22
28
|
"required": []
|
package/src/plugins/plugin.js
CHANGED
|
@@ -11,7 +11,7 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
|
11
11
|
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
12
12
|
const package_json_workspaces_1 = require("nx/plugins/package-json-workspaces");
|
|
13
13
|
const globs_1 = require("nx/src/utils/globs");
|
|
14
|
-
const
|
|
14
|
+
const minimatch_1 = require("minimatch");
|
|
15
15
|
const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'jest.hash');
|
|
16
16
|
const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
|
|
17
17
|
const calculatedTargets = {};
|
|
@@ -40,7 +40,7 @@ exports.createNodes = [
|
|
|
40
40
|
else if (!siblingFiles.includes('project.json') &&
|
|
41
41
|
siblingFiles.includes('package.json')) {
|
|
42
42
|
const path = (0, devkit_1.joinPathFragments)(projectRoot, 'package.json');
|
|
43
|
-
const isPackageJsonProject = minimatch(path, packageManagerWorkspacesGlob);
|
|
43
|
+
const isPackageJsonProject = (0, minimatch_1.minimatch)(path, packageManagerWorkspacesGlob);
|
|
44
44
|
if (!isPackageJsonProject) {
|
|
45
45
|
return {};
|
|
46
46
|
}
|