nx 23.0.0-beta.7 → 23.0.0-beta.9
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/bin/nx.d.ts +1 -0
- package/dist/bin/nx.js +2 -0
- package/dist/src/ai/clone-ai-config-repo.js +20 -3
- package/dist/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
- package/dist/src/command-line/release/config/use-legacy-versioning.js +8 -0
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/daemon/server/start.d.ts +1 -1
- package/dist/src/daemon/server/start.js +2 -0
- package/dist/src/native/index.d.ts +17 -0
- package/dist/src/native/native-bindings.js +1 -0
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +2 -0
- package/dist/src/tasks-runner/run-command.js +8 -1
- package/dist/src/tasks-runner/task-env.d.ts +1 -1
- package/dist/src/tasks-runner/task-env.js +6 -1
- package/dist/src/tasks-runner/task-orchestrator.d.ts +10 -1
- package/dist/src/tasks-runner/task-orchestrator.js +55 -4
- package/dist/src/utils/compile-cache.d.ts +24 -0
- package/dist/src/utils/compile-cache.js +49 -0
- package/dist/src/utils/enable-compile-cache.d.ts +1 -0
- package/dist/src/utils/enable-compile-cache.js +7 -0
- package/dist/src/utils/nx-key.d.ts +0 -1
- package/dist/src/utils/nx-key.js +20 -23
- package/dist/src/utils/perf-logging.js +1 -0
- package/package.json +15 -15
package/dist/bin/nx.d.ts
CHANGED
package/dist/bin/nx.js
CHANGED
|
@@ -8,6 +8,8 @@ if (process.env.FORCE_COLOR === '0') {
|
|
|
8
8
|
process.env.NO_COLOR = '1';
|
|
9
9
|
delete process.env.FORCE_COLOR;
|
|
10
10
|
}
|
|
11
|
+
// Must be the first import — see enable-compile-cache.ts.
|
|
12
|
+
require("../src/utils/enable-compile-cache");
|
|
11
13
|
const find_workspace_root_1 = require("../src/utils/find-workspace-root");
|
|
12
14
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
13
15
|
const output_1 = require("../src/utils/output");
|
|
@@ -125,14 +125,31 @@ function cleanupOldCaches(currentCommitHash) {
|
|
|
125
125
|
function getAiConfigRepoPath() {
|
|
126
126
|
// 1. Get latest commit hash (first 10 chars)
|
|
127
127
|
const commitHash = getLatestCommitHash();
|
|
128
|
-
// 2.
|
|
128
|
+
// 2. Reuse cached version if it still has content (macOS may have
|
|
129
|
+
// swept its files but left the directory tree).
|
|
129
130
|
const cachedPath = (0, path_1.join)(CACHE_DIR, commitHash);
|
|
130
|
-
if ((
|
|
131
|
+
if (hasRootFile(cachedPath)) {
|
|
131
132
|
return cachedPath;
|
|
132
133
|
}
|
|
133
|
-
// 3.
|
|
134
|
+
// 3. Wipe any empty skeleton, then clone fresh
|
|
135
|
+
if ((0, fs_1.existsSync)(cachedPath)) {
|
|
136
|
+
(0, fs_1.rmSync)(cachedPath, { recursive: true, force: true });
|
|
137
|
+
}
|
|
134
138
|
cloneRepo(cachedPath);
|
|
135
139
|
// 4. Clean up old cached versions
|
|
136
140
|
cleanupOldCaches(commitHash);
|
|
137
141
|
return cachedPath;
|
|
138
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The repo always has at least one regular file at its root (e.g. README).
|
|
145
|
+
* If everything at the root is a directory, the cache was swept by macOS
|
|
146
|
+
* tmp cleanup and we should re-clone.
|
|
147
|
+
*/
|
|
148
|
+
function hasRootFile(dir) {
|
|
149
|
+
try {
|
|
150
|
+
return (0, fs_1.readdirSync)(dir, { withFileTypes: true }).some((e) => e.isFile());
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shouldUseLegacyVersioning = shouldUseLegacyVersioning;
|
|
4
|
+
// TODO(v23): remove — kept only so `@nx/js@21`'s library generator can load via `ensurePackage`.
|
|
5
|
+
/** @deprecated Compat shim for `@nx/js@21`. */
|
|
6
|
+
function shouldUseLegacyVersioning(releaseConfig) {
|
|
7
|
+
return releaseConfig?.version?.useLegacyVersioning ?? false;
|
|
8
|
+
}
|