@nx/js 19.1.0-beta.3 → 19.1.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.
- package/package.json +4 -4
- package/src/plugins/typescript/plugin.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "19.1.0-beta.
|
|
3
|
+
"version": "19.1.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"semver": "^7.5.3",
|
|
59
59
|
"source-map-support": "0.5.19",
|
|
60
60
|
"tslib": "^2.3.0",
|
|
61
|
-
"@nx/devkit": "19.1.0-beta.
|
|
62
|
-
"@nx/workspace": "19.1.0-beta.
|
|
63
|
-
"@nrwl/js": "19.1.0-beta.
|
|
61
|
+
"@nx/devkit": "19.1.0-beta.5",
|
|
62
|
+
"@nx/workspace": "19.1.0-beta.5",
|
|
63
|
+
"@nrwl/js": "19.1.0-beta.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^5.0.4"
|
|
@@ -12,16 +12,19 @@ const lock_file_1 = require("nx/src/plugins/js/lock-file/lock-file");
|
|
|
12
12
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
13
13
|
const ts_config_1 = require("../../utils/typescript/ts-config");
|
|
14
14
|
const cachePath = (0, node_path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'tsc.hash');
|
|
15
|
-
const targetsCache =
|
|
16
|
-
const calculatedTargets = {};
|
|
15
|
+
const targetsCache = readTargetsCache();
|
|
17
16
|
function readTargetsCache() {
|
|
18
|
-
return (0, devkit_1.readJsonFile)(cachePath);
|
|
17
|
+
return (0, node_fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
19
18
|
}
|
|
20
|
-
function writeTargetsToCache(
|
|
21
|
-
|
|
19
|
+
function writeTargetsToCache() {
|
|
20
|
+
const oldCache = readTargetsCache();
|
|
21
|
+
(0, devkit_1.writeJsonFile)(cachePath, {
|
|
22
|
+
...oldCache,
|
|
23
|
+
...targetsCache,
|
|
24
|
+
});
|
|
22
25
|
}
|
|
23
26
|
const createDependencies = () => {
|
|
24
|
-
writeTargetsToCache(
|
|
27
|
+
writeTargetsToCache();
|
|
25
28
|
return [];
|
|
26
29
|
};
|
|
27
30
|
exports.createDependencies = createDependencies;
|
|
@@ -46,15 +49,12 @@ exports.createNodes = [
|
|
|
46
49
|
const nodeHash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, pluginOptions, context, [(0, lock_file_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
|
|
47
50
|
// The hash is calculated at the node/project level, so we add the config file path to avoid conflicts when caching
|
|
48
51
|
const cacheKey = `${nodeHash}_${configFilePath}`;
|
|
49
|
-
|
|
50
|
-
? targetsCache[cacheKey]
|
|
51
|
-
: buildTscTargets(fullConfigPath, projectRoot, pluginOptions, context);
|
|
52
|
-
calculatedTargets[cacheKey] = targets;
|
|
52
|
+
targetsCache[cacheKey] ??= buildTscTargets(fullConfigPath, projectRoot, pluginOptions, context);
|
|
53
53
|
return {
|
|
54
54
|
projects: {
|
|
55
55
|
[projectRoot]: {
|
|
56
56
|
projectType: 'library',
|
|
57
|
-
targets,
|
|
57
|
+
targets: targetsCache[cacheKey],
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
};
|