nx 23.0.0-beta.20 → 23.0.0-beta.21
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/src/command-line/migrate/agentic/prompts/generic-validation.js +3 -11
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +3 -11
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +5 -8
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +9 -0
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +43 -0
- package/dist/src/command-line/migrate/agentic/runner.js +3 -0
- package/dist/src/command-line/migrate/migrate-output.d.ts +70 -11
- package/dist/src/command-line/migrate/migrate-output.js +52 -35
- package/dist/src/command-line/migrate/migrate.js +83 -80
- package/dist/src/command-line/migrate/run-migration-process.js +9 -1
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/utils/git-utils.d.ts +1 -0
- package/dist/src/utils/git-utils.js +65 -0
- package/package.json +12 -12
|
Binary file
|
|
Binary file
|
|
@@ -40,6 +40,7 @@ export declare function parseVcsRemoteUrl(url: string): VcsRemoteInfo | null;
|
|
|
40
40
|
export declare function getVcsRemoteInfo(directory?: string): VcsRemoteInfo | null;
|
|
41
41
|
export declare function isGitRepository(directory?: string): boolean;
|
|
42
42
|
export declare function hasUncommittedChanges(directory?: string): boolean;
|
|
43
|
+
export declare function getUncommittedChangesSnapshot(directory?: string): string;
|
|
43
44
|
export declare function commitChanges(commitMessage: string, directory?: string): string | null;
|
|
44
45
|
/**
|
|
45
46
|
* Throws on git failure with the real stderr attached. Use this when the
|
|
@@ -6,10 +6,14 @@ exports.parseVcsRemoteUrl = parseVcsRemoteUrl;
|
|
|
6
6
|
exports.getVcsRemoteInfo = getVcsRemoteInfo;
|
|
7
7
|
exports.isGitRepository = isGitRepository;
|
|
8
8
|
exports.hasUncommittedChanges = hasUncommittedChanges;
|
|
9
|
+
exports.getUncommittedChangesSnapshot = getUncommittedChangesSnapshot;
|
|
9
10
|
exports.commitChanges = commitChanges;
|
|
10
11
|
exports.tryCommitChanges = tryCommitChanges;
|
|
11
12
|
exports.getLatestCommitSha = getLatestCommitSha;
|
|
13
|
+
const tslib_1 = require("tslib");
|
|
12
14
|
const child_process_1 = require("child_process");
|
|
15
|
+
const crypto = tslib_1.__importStar(require("crypto"));
|
|
16
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
13
17
|
const path_1 = require("path");
|
|
14
18
|
const logger_1 = require("./logger");
|
|
15
19
|
function execAsync(command, execOptions) {
|
|
@@ -286,6 +290,67 @@ function hasUncommittedChanges(directory) {
|
|
|
286
290
|
return false;
|
|
287
291
|
}
|
|
288
292
|
}
|
|
293
|
+
// Returns a content-sensitive sha1 snapshot of the working tree state for
|
|
294
|
+
// before/after comparison. Hashes three probes:
|
|
295
|
+
// 1. `git diff HEAD` with defensive flags — every byte of tracked-file
|
|
296
|
+
// changes. `--no-ext-diff` / `--no-textconv` neuter user/repo driver
|
|
297
|
+
// overrides so output is deterministic; `--binary` keeps binary
|
|
298
|
+
// edits from collapsing to "Binary files differ".
|
|
299
|
+
// 2. `git status --porcelain=v1 -uall` — untracked paths the diff
|
|
300
|
+
// omits. `-uall` expands untracked directories per-file.
|
|
301
|
+
// 3. Untracked file content bytes — so a same-path content edit on an
|
|
302
|
+
// already-untracked file does not collapse against the baseline.
|
|
303
|
+
//
|
|
304
|
+
// Each probe is wrapped independently with a failure sentinel so a
|
|
305
|
+
// single-sided git error (e.g. `git diff HEAD` on an initial-commit-less
|
|
306
|
+
// repo) cannot mask surviving signal from the others.
|
|
307
|
+
function getUncommittedChangesSnapshot(directory) {
|
|
308
|
+
const hasher = crypto.createHash('sha1');
|
|
309
|
+
const cwd = directory ?? process.cwd();
|
|
310
|
+
const execOpts = {
|
|
311
|
+
encoding: 'utf8',
|
|
312
|
+
cwd,
|
|
313
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
314
|
+
windowsHide: true,
|
|
315
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
316
|
+
};
|
|
317
|
+
let diffOutput;
|
|
318
|
+
try {
|
|
319
|
+
diffOutput = (0, child_process_1.execSync)('git diff HEAD --no-color --no-ext-diff --no-textconv --binary', execOpts);
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
diffOutput = '<diff-unavailable>';
|
|
323
|
+
}
|
|
324
|
+
hasher.update('diff:').update(diffOutput).update('\0');
|
|
325
|
+
let statusOutput;
|
|
326
|
+
try {
|
|
327
|
+
statusOutput = (0, child_process_1.execSync)('git status --porcelain=v1 -uall', execOpts);
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
statusOutput = '<status-unavailable>';
|
|
331
|
+
}
|
|
332
|
+
hasher.update('status:').update(statusOutput).update('\0');
|
|
333
|
+
let untrackedRaw;
|
|
334
|
+
try {
|
|
335
|
+
untrackedRaw = (0, child_process_1.execSync)('git ls-files --others --exclude-standard -z', execOpts);
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
untrackedRaw = '';
|
|
339
|
+
}
|
|
340
|
+
const untrackedPaths = untrackedRaw.split('\0').filter(Boolean).sort();
|
|
341
|
+
hasher.update('untracked:');
|
|
342
|
+
for (const p of untrackedPaths) {
|
|
343
|
+
hasher.update(p).update('\0');
|
|
344
|
+
try {
|
|
345
|
+
hasher.update(fs.readFileSync((0, path_1.join)(cwd, p)));
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
hasher.update('<file-unreadable>');
|
|
349
|
+
}
|
|
350
|
+
hasher.update('\0');
|
|
351
|
+
}
|
|
352
|
+
return hasher.digest('hex');
|
|
353
|
+
}
|
|
289
354
|
function commitChanges(commitMessage, directory) {
|
|
290
355
|
try {
|
|
291
356
|
(0, child_process_1.execSync)('git add -A', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"strip-bom": "3.0.0",
|
|
147
147
|
"supports-color": "7.2.0",
|
|
148
148
|
"tar-stream": "2.2.0",
|
|
149
|
-
"tmp": "0.2.
|
|
149
|
+
"tmp": "0.2.6",
|
|
150
150
|
"tsconfig-paths": "4.2.0",
|
|
151
151
|
"tslib": "2.8.1",
|
|
152
152
|
"util-deprecate": "1.0.2",
|
|
@@ -172,16 +172,16 @@
|
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
"optionalDependencies": {
|
|
175
|
-
"@nx/nx-darwin-arm64": "23.0.0-beta.
|
|
176
|
-
"@nx/nx-darwin-x64": "23.0.0-beta.
|
|
177
|
-
"@nx/nx-freebsd-x64": "23.0.0-beta.
|
|
178
|
-
"@nx/nx-linux-arm-gnueabihf": "23.0.0-beta.
|
|
179
|
-
"@nx/nx-linux-arm64-gnu": "23.0.0-beta.
|
|
180
|
-
"@nx/nx-linux-arm64-musl": "23.0.0-beta.
|
|
181
|
-
"@nx/nx-linux-x64-gnu": "23.0.0-beta.
|
|
182
|
-
"@nx/nx-linux-x64-musl": "23.0.0-beta.
|
|
183
|
-
"@nx/nx-win32-arm64-msvc": "23.0.0-beta.
|
|
184
|
-
"@nx/nx-win32-x64-msvc": "23.0.0-beta.
|
|
175
|
+
"@nx/nx-darwin-arm64": "23.0.0-beta.21",
|
|
176
|
+
"@nx/nx-darwin-x64": "23.0.0-beta.21",
|
|
177
|
+
"@nx/nx-freebsd-x64": "23.0.0-beta.21",
|
|
178
|
+
"@nx/nx-linux-arm-gnueabihf": "23.0.0-beta.21",
|
|
179
|
+
"@nx/nx-linux-arm64-gnu": "23.0.0-beta.21",
|
|
180
|
+
"@nx/nx-linux-arm64-musl": "23.0.0-beta.21",
|
|
181
|
+
"@nx/nx-linux-x64-gnu": "23.0.0-beta.21",
|
|
182
|
+
"@nx/nx-linux-x64-musl": "23.0.0-beta.21",
|
|
183
|
+
"@nx/nx-win32-arm64-msvc": "23.0.0-beta.21",
|
|
184
|
+
"@nx/nx-win32-x64-msvc": "23.0.0-beta.21"
|
|
185
185
|
},
|
|
186
186
|
"nx-migrations": {
|
|
187
187
|
"migrations": "./migrations.json",
|