@nx/jest 19.0.7 → 19.0.8
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 +4 -4
- package/src/plugins/plugin.js +11 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/jest",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.8",
|
|
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": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@jest/reporters": "^29.4.1",
|
|
39
39
|
"@jest/test-result": "^29.4.1",
|
|
40
|
-
"@nx/devkit": "19.0.
|
|
41
|
-
"@nx/js": "19.0.
|
|
40
|
+
"@nx/devkit": "19.0.8",
|
|
41
|
+
"@nx/js": "19.0.8",
|
|
42
42
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
43
43
|
"chalk": "^4.1.0",
|
|
44
44
|
"identity-obj-proxy": "3.0.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"resolve.exports": "1.1.0",
|
|
50
50
|
"tslib": "^2.3.0",
|
|
51
51
|
"yargs-parser": "21.1.1",
|
|
52
|
-
"@nrwl/jest": "19.0.
|
|
52
|
+
"@nrwl/jest": "19.0.8"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
package/src/plugins/plugin.js
CHANGED
|
@@ -13,16 +13,19 @@ const package_json_workspaces_1 = require("nx/src/plugins/package-json-workspace
|
|
|
13
13
|
const globs_1 = require("nx/src/utils/globs");
|
|
14
14
|
const minimatch_1 = require("minimatch");
|
|
15
15
|
const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'jest.hash');
|
|
16
|
-
const targetsCache =
|
|
17
|
-
const calculatedTargets = {};
|
|
16
|
+
const targetsCache = readTargetsCache();
|
|
18
17
|
function readTargetsCache() {
|
|
19
|
-
return (0, devkit_1.readJsonFile)(cachePath);
|
|
18
|
+
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
20
19
|
}
|
|
21
|
-
function writeTargetsToCache(
|
|
22
|
-
|
|
20
|
+
function writeTargetsToCache() {
|
|
21
|
+
const cache = readTargetsCache();
|
|
22
|
+
(0, devkit_1.writeJsonFile)(cachePath, {
|
|
23
|
+
...cache,
|
|
24
|
+
...targetsCache,
|
|
25
|
+
});
|
|
23
26
|
}
|
|
24
27
|
const createDependencies = () => {
|
|
25
|
-
writeTargetsToCache(
|
|
28
|
+
writeTargetsToCache();
|
|
26
29
|
return [];
|
|
27
30
|
};
|
|
28
31
|
exports.createDependencies = createDependencies;
|
|
@@ -54,9 +57,8 @@ exports.createNodes = [
|
|
|
54
57
|
}
|
|
55
58
|
options = normalizeOptions(options);
|
|
56
59
|
const hash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
calculatedTargets[hash] = { targets, metadata };
|
|
60
|
+
targetsCache[hash] ??= await buildJestTargets(configFilePath, projectRoot, options, context);
|
|
61
|
+
const { targets, metadata } = targetsCache[hash];
|
|
60
62
|
return {
|
|
61
63
|
projects: {
|
|
62
64
|
[projectRoot]: {
|