nx 23.2.0-beta.4 → 23.2.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/dist/bin/nx.js +1 -0
- package/dist/src/command-line/affected/affected.js +1 -0
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +2 -2
- package/dist/src/command-line/init/init-v2.js +2 -2
- package/dist/src/command-line/migrate/agentic/definitions.js +2 -2
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +15 -19
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +19 -31
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +4 -6
- package/dist/src/command-line/migrate/agentic/handoff.js +9 -8
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +7 -12
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +7 -0
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +10 -0
- package/dist/src/command-line/migrate/agentic/select.d.ts +10 -2
- package/dist/src/command-line/migrate/agentic/select.js +10 -2
- package/dist/src/command-line/migrate/agentic/types.d.ts +17 -3
- package/dist/src/command-line/migrate/agentic/types.js +26 -0
- package/dist/src/command-line/migrate/command-object.d.ts +3 -0
- package/dist/src/command-line/migrate/command-object.js +6 -1
- package/dist/src/command-line/migrate/execute-migration.d.ts +14 -9
- package/dist/src/command-line/migrate/execute-migration.js +82 -18
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +7 -0
- package/dist/src/command-line/migrate/migrate-analytics.js +14 -0
- package/dist/src/command-line/migrate/migrate-commits.d.ts +32 -8
- package/dist/src/command-line/migrate/migrate-commits.js +77 -9
- package/dist/src/command-line/migrate/migrate-config.d.ts +11 -12
- package/dist/src/command-line/migrate/migrate-config.js +14 -14
- package/dist/src/command-line/migrate/migrate-output.d.ts +45 -7
- package/dist/src/command-line/migrate/migrate-output.js +52 -8
- package/dist/src/command-line/migrate/migrate-ui-api.d.ts +2 -1
- package/dist/src/command-line/migrate/migrate-ui-api.js +16 -7
- package/dist/src/command-line/migrate/migrate.d.ts +17 -68
- package/dist/src/command-line/migrate/migrate.js +411 -229
- package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
- package/dist/src/command-line/migrate/run/index.d.ts +2 -0
- package/dist/src/command-line/migrate/run/index.js +5 -0
- package/dist/src/command-line/migrate/run/util.d.ts +1 -0
- package/dist/src/command-line/migrate/run/util.js +16 -0
- package/dist/src/command-line/migrate/run/worker.d.ts +15 -0
- package/dist/src/command-line/migrate/run/worker.js +419 -0
- package/dist/src/command-line/migrate/run-migration-process.js +6 -5
- package/dist/src/command-line/migrate/sort-migrations.d.ts +16 -0
- package/dist/src/command-line/migrate/sort-migrations.js +32 -0
- package/dist/src/command-line/migrate/version-skew-guard.d.ts +58 -0
- package/dist/src/command-line/migrate/version-skew-guard.js +155 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.d.ts +2 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +16 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.d.ts +4 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.js +13 -0
- package/dist/src/command-line/nx-commands.js +26 -24
- package/dist/src/command-line/release/changelog.js +5 -0
- package/dist/src/command-line/release/utils/git.js +1 -1
- package/dist/src/command-line/release/utils/release-graph.d.ts +1 -0
- package/dist/src/command-line/release/utils/release-graph.js +15 -3
- package/dist/src/command-line/release/version/version-actions.d.ts +8 -0
- package/dist/src/command-line/release/version/version-actions.js +8 -0
- package/dist/src/command-line/release/version.js +9 -5
- package/dist/src/command-line/reset/reset.js +6 -1
- package/dist/src/command-line/run/run-one.js +1 -0
- package/dist/src/command-line/run-many/run-many.js +1 -0
- package/dist/src/config/misc-interfaces.d.ts +19 -7
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.d.ts +45 -1
- package/dist/src/daemon/client/client.js +128 -32
- package/dist/src/daemon/client/daemon-socket-messenger.js +4 -0
- package/dist/src/daemon/message-types/daemon-message.d.ts +32 -0
- package/dist/src/daemon/message-types/daemon-message.js +25 -0
- package/dist/src/daemon/server/latest-nx.js +5 -2
- package/dist/src/daemon/server/server.js +22 -0
- package/dist/src/daemon/server/shutdown-utils.d.ts +5 -0
- package/dist/src/daemon/server/shutdown-utils.js +11 -4
- package/dist/src/daemon/socket-utils.d.ts +1 -0
- package/dist/src/daemon/socket-utils.js +24 -3
- package/dist/src/daemon/tmp-dir.d.ts +43 -3
- package/dist/src/daemon/tmp-dir.js +437 -15
- package/dist/src/devkit-internals.d.ts +92 -3
- package/dist/src/devkit-internals.js +189 -5
- package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +5 -0
- package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +9 -2
- package/dist/src/generators/tree.d.ts +4 -2
- package/dist/src/native/index.d.ts +10 -0
- package/dist/src/native/index.js +71 -28
- package/dist/src/native/native-bindings.js +1 -0
- package/dist/src/native/native-file-cache-location.d.ts +17 -1
- package/dist/src/native/native-file-cache-location.js +86 -12
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/nx-cloud/utilities/get-cloud-options.js +5 -2
- package/dist/src/nx-cloud/utilities/onboarding.js +5 -2
- package/dist/src/nx-cloud/utilities/url-shorten.d.ts +1 -4
- package/dist/src/nx-cloud/utilities/url-shorten.js +9 -8
- package/dist/src/plugins/js/lock-file/project-graph-pruning.js +14 -8
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -0
- package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.js +2 -2
- package/dist/src/project-graph/affected/locators/project-glob-changes.js +5 -2
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +1 -0
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +18 -1
- package/dist/src/project-graph/plugins/isolation/messaging.d.ts +16 -3
- package/dist/src/project-graph/plugins/isolation/messaging.js +3 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +58 -8
- package/dist/src/project-graph/project-graph.js +20 -0
- package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +12 -0
- package/dist/src/tasks-runner/life-cycles/performance-report.js +62 -3
- package/dist/src/tasks-runner/run-command.js +4 -0
- package/dist/src/utils/assert-workspace-validity.js +7 -2
- package/dist/src/utils/child-process.d.ts +31 -1
- package/dist/src/utils/child-process.js +103 -0
- package/dist/src/utils/ignore.d.ts +128 -1
- package/dist/src/utils/ignore.js +182 -12
- package/dist/src/utils/nx-tmp-dir.d.ts +18 -0
- package/dist/src/utils/nx-tmp-dir.js +40 -0
- package/dist/src/utils/owned-private-dir.d.ts +132 -0
- package/dist/src/utils/owned-private-dir.js +323 -0
- package/dist/src/utils/shell-quoting.d.ts +15 -0
- package/dist/src/utils/shell-quoting.js +35 -0
- package/dist/src/utils/wait-for-socket-connection.d.ts +11 -0
- package/dist/src/utils/wait-for-socket-connection.js +14 -8
- package/package.json +12 -12
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.resetSgrAfterAgent = resetSgrAfterAgent;
|
|
4
4
|
exports.logMigrationBoundary = logMigrationBoundary;
|
|
5
5
|
exports.logAgenticSuccessOutcome = logAgenticSuccessOutcome;
|
|
6
|
+
exports.logWaivedAgenticStep = logWaivedAgenticStep;
|
|
6
7
|
exports.countLandedCommits = countLandedCommits;
|
|
8
|
+
exports.countWaivedAgenticSteps = countWaivedAgenticSteps;
|
|
9
|
+
exports.formatWaivedAgenticSteps = formatWaivedAgenticSteps;
|
|
7
10
|
exports.retainedMigrations = retainedMigrations;
|
|
8
11
|
exports.logFailureRecap = logFailureRecap;
|
|
9
12
|
exports.buildTallyBodyLine = buildTallyBodyLine;
|
|
@@ -14,13 +17,12 @@ const pc = tslib_1.__importStar(require("picocolors"));
|
|
|
14
17
|
const logger_1 = require("../../utils/logger");
|
|
15
18
|
const migration_shape_1 = require("./migration-shape");
|
|
16
19
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `→` start · `✓` success · `✗` failure · `↷` skipped · `ℹ` info · `─` boundary
|
|
20
|
+
* Pure presentation helpers for the migrate run phase (`--run-migrations` and
|
|
21
|
+
* the single-migration worker). Shared glyph vocabulary:
|
|
22
|
+
* `→` start, `✓` success, `✗` failure, `↷` skipped, `ℹ` info, `─` boundary
|
|
21
23
|
*
|
|
22
24
|
* Inputs are typed structurally (e.g. `{ name: string }[]`) so this module
|
|
23
|
-
* stays decoupled from
|
|
25
|
+
* stays decoupled from the migration executor in migrate.ts.
|
|
24
26
|
*/
|
|
25
27
|
/**
|
|
26
28
|
* Some agent TUIs (codex, opencode) don't fully reset their cursor / SGR state
|
|
@@ -49,6 +51,23 @@ function logAgenticSuccessOutcome(label, sha, summary) {
|
|
|
49
51
|
const shaPart = sha ? ` (${sha})` : '';
|
|
50
52
|
logger_1.logger.info(`${pc.green('✓')} ${label}${shaPart}: ${summary}`);
|
|
51
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Logs the skip line for a migration that waived its AI step through
|
|
56
|
+
* `skipAgentic`, plus a verbose note for any `agentContext` the waiver
|
|
57
|
+
* dropped. A hybrid waives its paired prompt; a generator-only migration
|
|
58
|
+
* waives the validation pass, so callers must reach here only once they know
|
|
59
|
+
* one was on the table. Under `inside-agent` only a hybrid can, so the
|
|
60
|
+
* hand-off dropped alongside is always a prompt's; a waived generator-only
|
|
61
|
+
* migration keeps its own. The note is author-facing, hence `--verbose`.
|
|
62
|
+
*/
|
|
63
|
+
function logWaivedAgenticStep(migration, agentContext) {
|
|
64
|
+
logger_1.logger.info(pc.dim((0, migration_shape_1.isHybridMigration)(migration)
|
|
65
|
+
? '↷ Prompt phase skipped. The migration reported nothing left for the AI step to do.'
|
|
66
|
+
: '↷ Validation skipped. The migration reported its changes need no AI review.'));
|
|
67
|
+
if (agentContext.length === 0)
|
|
68
|
+
return;
|
|
69
|
+
logger_1.logger.verbose(`${migration.package}: ${migration.name} returned skipAgentic: true alongside agentContext, which was dropped. agentContext exists to feed the AI step this migration waived.`);
|
|
70
|
+
}
|
|
52
71
|
/**
|
|
53
72
|
* Counts the migrations whose own commit actually landed — including the
|
|
54
73
|
* HEAD-resolve-race case (`commit: { kind: 'landed', sha: null }`). Used by
|
|
@@ -60,6 +79,22 @@ function logAgenticSuccessOutcome(label, sha, summary) {
|
|
|
60
79
|
function countLandedCommits(outcomes) {
|
|
61
80
|
return outcomes.filter((o) => o.commit.kind === 'landed').length;
|
|
62
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Counts the migrations that waived the AI step they would otherwise have
|
|
84
|
+
* run. Shared by the success tally and the failure recap so the two can't
|
|
85
|
+
* report different numbers.
|
|
86
|
+
*/
|
|
87
|
+
function countWaivedAgenticSteps(outcomes) {
|
|
88
|
+
return outcomes.filter((o) => o.status === 'completed' && o.waivedAgenticStep === true).length;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The recap phrase for waived AI steps. "not needed" rather than
|
|
92
|
+
* "skipped"/"deferred", which both recaps reserve for work the user still
|
|
93
|
+
* owes.
|
|
94
|
+
*/
|
|
95
|
+
function formatWaivedAgenticSteps(count) {
|
|
96
|
+
return `${count} AI step${count === 1 ? '' : 's'} not needed`;
|
|
97
|
+
}
|
|
63
98
|
/**
|
|
64
99
|
* Migrations whose own commit attempt failed and whose diff was never
|
|
65
100
|
* absorbed by a later commit. Surfaces what the user has to commit or
|
|
@@ -90,6 +125,7 @@ function logFailureRecap(opts) {
|
|
|
90
125
|
const appliedCount = outcomes.filter((o) => o.status === 'completed' &&
|
|
91
126
|
(o.kind === 'applied' || o.kind === 'no-changes')).length;
|
|
92
127
|
const deferredCount = outcomes.filter((o) => o.status === 'completed' && o.kind === 'deferred').length;
|
|
128
|
+
const waivedAgenticCount = countWaivedAgenticSteps(outcomes);
|
|
93
129
|
const notAttempted = totalMigrations - migrationIndex;
|
|
94
130
|
// Walk back to the most recent completed record whose work is anchored to
|
|
95
131
|
// a sha — either its own commit (`landed`), or a later commit that
|
|
@@ -146,6 +182,9 @@ function logFailureRecap(opts) {
|
|
|
146
182
|
if (deferredCount > 0) {
|
|
147
183
|
parts.push(`${deferredCount} deferred`);
|
|
148
184
|
}
|
|
185
|
+
if (waivedAgenticCount > 0) {
|
|
186
|
+
parts.push(formatWaivedAgenticSteps(waivedAgenticCount));
|
|
187
|
+
}
|
|
149
188
|
logger_1.logger.info(`${parts.join(', ')}. ${notAttempted} not attempted.`);
|
|
150
189
|
logger_1.logger.info(`See the per-migration log above for full details.`);
|
|
151
190
|
}
|
|
@@ -181,15 +220,17 @@ function logFailureRecap(opts) {
|
|
|
181
220
|
* emitting a misleading `0 prompt migrations skipped.` line.
|
|
182
221
|
*
|
|
183
222
|
* Rule (kept coherent across every scenario):
|
|
184
|
-
* - When at least one migration was applied: `<N> migrations applied, <K> commits created[, <D> prompt migrations <skipped|deferred>]`.
|
|
223
|
+
* - When at least one migration was applied: `<N> migrations applied, <K> commits created[, <D> prompt migrations <skipped|deferred>][, <W> AI steps not needed]`.
|
|
185
224
|
* The `<K> commits created` part stays even at 0 — it tells the reader work
|
|
186
225
|
* was applied but not committed (the J4/J8 information made explicit).
|
|
187
226
|
* - When zero migrations were applied but some prompt halves were
|
|
188
|
-
* skipped/deferred: `<D> prompt migrations <skipped|deferred>` only.
|
|
227
|
+
* skipped/deferred: `<D> prompt migrations <skipped|deferred>` only. Waiving
|
|
228
|
+
* never adds to `skippedPromptsCount`, so `appliedCount` is non-zero whenever
|
|
229
|
+
* `waivedAgenticStepsCount` is, and this branch can't be reached with one.
|
|
189
230
|
* - When zero of either: no body line.
|
|
190
231
|
*/
|
|
191
232
|
function buildTallyBodyLine(opts) {
|
|
192
|
-
const { appliedCount, committedShasCount, skippedPromptsCount, insideAgent } = opts;
|
|
233
|
+
const { appliedCount, committedShasCount, skippedPromptsCount, waivedAgenticStepsCount, insideAgent, } = opts;
|
|
193
234
|
const skipVerb = insideAgent ? 'deferred' : 'skipped';
|
|
194
235
|
if (appliedCount === 0) {
|
|
195
236
|
if (skippedPromptsCount === 0)
|
|
@@ -203,6 +244,9 @@ function buildTallyBodyLine(opts) {
|
|
|
203
244
|
if (skippedPromptsCount > 0) {
|
|
204
245
|
parts.push(`${skippedPromptsCount} prompt migration${skippedPromptsCount === 1 ? '' : 's'} ${skipVerb}`);
|
|
205
246
|
}
|
|
247
|
+
if (waivedAgenticStepsCount > 0) {
|
|
248
|
+
parts.push(formatWaivedAgenticSteps(waivedAgenticStepsCount));
|
|
249
|
+
}
|
|
206
250
|
return `${parts.join(', ')}.`;
|
|
207
251
|
}
|
|
208
252
|
/**
|
|
@@ -19,6 +19,7 @@ export type SuccessfulMigration = {
|
|
|
19
19
|
ref: string;
|
|
20
20
|
nextSteps?: string[];
|
|
21
21
|
acknowledgedPrompt?: boolean;
|
|
22
|
+
skipAgentic?: boolean;
|
|
22
23
|
};
|
|
23
24
|
export type FailedMigration = {
|
|
24
25
|
type: 'failed';
|
|
@@ -41,7 +42,7 @@ export declare function runSingleMigration(workspacePath: string, migration: Mig
|
|
|
41
42
|
}): Promise<void>;
|
|
42
43
|
export declare function getImplementationPath(workspacePath: string, migration: MigrationDetailsWithId): Promise<string>;
|
|
43
44
|
export declare function modifyMigrationsJsonMetadata(workspacePath: string, modify: (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata): void;
|
|
44
|
-
export declare function addSuccessfulMigration(id: string, fileChanges: Omit<FileChange, 'content'>[], ref: string, nextSteps: string[]): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;
|
|
45
|
+
export declare function addSuccessfulMigration(id: string, fileChanges: Omit<FileChange, 'content'>[], ref: string, nextSteps: string[], skipAgentic?: boolean): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;
|
|
45
46
|
export declare function updateRefForSuccessfulMigration(id: string, ref: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;
|
|
46
47
|
export declare function addFailedMigration(id: string, error: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => {
|
|
47
48
|
completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration | StoppedMigration>;
|
|
@@ -148,11 +148,15 @@ async function runSingleMigration(workspacePath, migration, configuration) {
|
|
|
148
148
|
if (result.type === 'error') {
|
|
149
149
|
throw new Error(result.message);
|
|
150
150
|
}
|
|
151
|
-
const { fileChanges, gitRefAfter, nextSteps } = result;
|
|
151
|
+
const { fileChanges, gitRefAfter, nextSteps, skipAgentic } = result;
|
|
152
152
|
modifyMigrationsJsonMetadata(workspacePath, addSuccessfulMigration(migration.id, fileChanges.map((change) => ({
|
|
153
153
|
path: change.path,
|
|
154
154
|
type: change.type,
|
|
155
|
-
})), gitRefAfter, nextSteps
|
|
155
|
+
})), gitRefAfter, nextSteps,
|
|
156
|
+
// Only a hybrid has a prompt phase to waive. A generator-only
|
|
157
|
+
// migration has no prompt affordance in the UI, so recording it there
|
|
158
|
+
// would mark a state the UI never shows.
|
|
159
|
+
skipAgentic === true && (0, migrate_1.isHybridMigration)(migration)));
|
|
156
160
|
if (gitRefBefore !== gitRefAfter) {
|
|
157
161
|
try {
|
|
158
162
|
(0, child_process_1.execSync)('git add migrations.json', {
|
|
@@ -225,17 +229,21 @@ function modifyMigrationsJsonMetadata(workspacePath, modify) {
|
|
|
225
229
|
migrationsJson['nx-console'] = modify(migrationsJson['nx-console']);
|
|
226
230
|
(0, fs_1.writeFileSync)(migrationsJsonPath, JSON.stringify(migrationsJson, null, 2));
|
|
227
231
|
}
|
|
228
|
-
function addSuccessfulMigration(id, fileChanges, ref, nextSteps) {
|
|
232
|
+
function addSuccessfulMigration(id, fileChanges, ref, nextSteps, skipAgentic = false) {
|
|
229
233
|
return (migrationsJsonMetadata) => {
|
|
230
234
|
const copied = { ...migrationsJsonMetadata };
|
|
231
235
|
if (!copied.completedMigrations) {
|
|
232
236
|
copied.completedMigrations = {};
|
|
233
237
|
}
|
|
234
|
-
// Carry
|
|
235
|
-
//
|
|
236
|
-
//
|
|
238
|
+
// A rerun re-records the same id. Carry an ack forward only off a record
|
|
239
|
+
// that carries no waiver: once a waiving run writes one it is
|
|
240
|
+
// byte-identical to a user's, so a rerun that owes the prompt again re-asks
|
|
241
|
+
// rather than trust it. Waiving sets the ack because nothing is owed.
|
|
237
242
|
const existing = copied.completedMigrations[id];
|
|
238
|
-
const acknowledgedPrompt =
|
|
243
|
+
const acknowledgedPrompt = skipAgentic ||
|
|
244
|
+
(existing?.type === 'successful' &&
|
|
245
|
+
existing.acknowledgedPrompt &&
|
|
246
|
+
!existing.skipAgentic);
|
|
239
247
|
copied.completedMigrations = {
|
|
240
248
|
...copied.completedMigrations,
|
|
241
249
|
[id]: {
|
|
@@ -245,6 +253,7 @@ function addSuccessfulMigration(id, fileChanges, ref, nextSteps) {
|
|
|
245
253
|
ref,
|
|
246
254
|
nextSteps,
|
|
247
255
|
...(acknowledgedPrompt && { acknowledgedPrompt: true }),
|
|
256
|
+
...(skipAgentic && { skipAgentic: true }),
|
|
248
257
|
},
|
|
249
258
|
};
|
|
250
259
|
return copied;
|
|
@@ -5,8 +5,9 @@ import { PackageManagerCommands } from '../../utils/package-manager';
|
|
|
5
5
|
import { type MigrateFetchStats, type MigrateMultiMajorChoice } from './migrate-analytics';
|
|
6
6
|
import { type MultiMajorMode } from './multi-major';
|
|
7
7
|
import type { AgenticArg } from './agentic/select';
|
|
8
|
+
import { MigrateArgs } from './command-object';
|
|
8
9
|
import type { ResolvedAgentic } from './agentic/types';
|
|
9
|
-
import { isHybridMigration, isPromptOnlyMigration } from './migration-shape';
|
|
10
|
+
import { isHybridMigration, isPromptOnlyMigration, type PlannedMigration } from './migration-shape';
|
|
10
11
|
import { filterDowngradedUpdates } from './update-filters';
|
|
11
12
|
import { normalizeVersion } from './version-utils';
|
|
12
13
|
export * from './execute-migration';
|
|
@@ -166,88 +167,37 @@ type RunMigrations = {
|
|
|
166
167
|
validate?: boolean;
|
|
167
168
|
interactive?: boolean;
|
|
168
169
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
type RunSingleMigration = {
|
|
171
|
+
type: 'runSingleMigration';
|
|
172
|
+
runMigration: string;
|
|
173
|
+
agentic: AgenticArg;
|
|
174
|
+
validate?: boolean;
|
|
175
|
+
interactive?: boolean;
|
|
176
|
+
};
|
|
177
|
+
export declare function parseMigrationsOptions(options: MigrateArgs, fetch?: MigratorOptions['fetch']): Promise<GenerateMigrations | RunMigrations | RunSingleMigration>;
|
|
172
178
|
export declare function createFetcher(pmc: PackageManagerCommands): ((pkg: string, version: string) => Promise<ResolvedMigrationConfiguration>) & {
|
|
173
179
|
stats?: MigrateFetchStats;
|
|
174
180
|
};
|
|
175
181
|
export { filterDowngradedUpdates };
|
|
176
182
|
export declare function generateMigrationsJsonAndUpdatePackageJson(root: string, opts: GenerateMigrations, fetch?: MigratorOptions['fetch']): Promise<void>;
|
|
177
|
-
type ExecutableMigration = {
|
|
178
|
-
package: string;
|
|
179
|
-
name: string;
|
|
180
|
-
description?: string;
|
|
181
|
-
version: string;
|
|
182
|
-
implementation?: string;
|
|
183
|
-
factory?: string;
|
|
184
|
-
prompt?: string;
|
|
185
|
-
documentation?: string;
|
|
186
|
-
};
|
|
187
183
|
export { isPromptOnlyMigration, isHybridMigration };
|
|
188
|
-
export declare function
|
|
189
|
-
export declare function
|
|
190
|
-
|
|
191
|
-
* Resolves the effective `--create-commits` state once the agentic flow has
|
|
192
|
-
* been resolved. The agent's outer prompt only embeds the impl-phase file list
|
|
193
|
-
* when per-migration commits isolate each migration's diff, so the diff-context
|
|
194
|
-
* flag returned here gates that section.
|
|
195
|
-
*/
|
|
196
|
-
export declare function resolveCreateCommits(args: {
|
|
197
|
-
createCommits: boolean | undefined;
|
|
198
|
-
agenticKind: ResolvedAgentic['kind'];
|
|
199
|
-
isGitRepo: boolean;
|
|
200
|
-
/**
|
|
201
|
-
* Whether `--commit-prefix` was given a non-default value. When commits
|
|
202
|
-
* end up disabled, the prefix has no effect — the warning copy below
|
|
203
|
-
* surfaces that so the user isn't silently misled.
|
|
204
|
-
*/
|
|
205
|
-
commitPrefixIsCustom?: boolean;
|
|
206
|
-
}): {
|
|
207
|
-
effective: boolean;
|
|
208
|
-
agenticHasDiffContext: boolean;
|
|
209
|
-
warning?: string;
|
|
210
|
-
error?: string;
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Confirms before creating per-migration commits while the user sits on the
|
|
214
|
-
* repository's default branch, so migrations don't silently commit there (most
|
|
215
|
-
* relevant since `--agentic` enables commits by default). Only the default
|
|
216
|
-
* branch triggers a prompt; a detached HEAD, a different branch, or an
|
|
217
|
-
* unresolved default branch all proceed untouched. Callers gate this on
|
|
218
|
-
* commits being effective and prompting being possible, so non-interactive
|
|
219
|
-
* runs (CI, `--no-interactive`) never reach here.
|
|
220
|
-
*/
|
|
221
|
-
export declare function confirmCommitsOnDefaultBranch(args: {
|
|
222
|
-
currentBranch: string | null;
|
|
223
|
-
defaultBranch: string | null;
|
|
224
|
-
}): Promise<boolean>;
|
|
225
|
-
/**
|
|
226
|
-
* Resolves whether the framework-owned generic-validation agent step should run
|
|
227
|
-
* after generator-only migrations.
|
|
228
|
-
*
|
|
229
|
-
* Default-on when the agentic flow resolved to `enabled`; silently ignored
|
|
230
|
-
* otherwise (no warning emitted) — `--validate` requires an active agent
|
|
231
|
-
* session by definition. An explicit `--no-validate` (`validate === false`)
|
|
232
|
-
* opts out even when agentic is enabled.
|
|
233
|
-
*/
|
|
234
|
-
export declare function resolveShouldRunValidation(args: {
|
|
235
|
-
validate: boolean | undefined;
|
|
236
|
-
agenticKind: ResolvedAgentic['kind'];
|
|
237
|
-
}): boolean;
|
|
238
|
-
export declare function executeMigrations(root: string, migrations: ExecutableMigration[], isVerbose: boolean, shouldCreateCommits: boolean, commitPrefix: string, shouldSkipInstall?: boolean, agentic?: ResolvedAgentic, agenticHasDiffContext?: boolean, shouldRunValidation?: boolean): Promise<{
|
|
239
|
-
migrationsWithNoChanges: ExecutableMigration[];
|
|
184
|
+
export declare function formatSkippedPromptsNextStep(skipped: PlannedMigration[]): string;
|
|
185
|
+
export declare function executeMigrations(root: string, migrations: PlannedMigration[], isVerbose: boolean, shouldCreateCommits: boolean, commitPrefix: string, shouldSkipInstall?: boolean, agentic?: ResolvedAgentic, agenticHasDiffContext?: boolean, shouldRunValidation?: boolean): Promise<{
|
|
186
|
+
migrationsWithNoChanges: PlannedMigration[];
|
|
240
187
|
skippedPromptsCount: number;
|
|
241
188
|
notRunMigrationsCount: number;
|
|
242
189
|
nextSteps: string[];
|
|
243
|
-
skippedPrompts:
|
|
190
|
+
skippedPrompts: PlannedMigration[];
|
|
244
191
|
migrationEmittedNextSteps: string[];
|
|
245
192
|
committedShasCount: number;
|
|
193
|
+
waivedAgenticStepsCount: number;
|
|
246
194
|
retainedAtSuccess: string[];
|
|
247
195
|
}>;
|
|
196
|
+
export declare function isSingleMigrationInvocation(args: Pick<MigrateArgs, 'runMigration'>): boolean;
|
|
248
197
|
export declare function migrate(root: string, args: {
|
|
249
198
|
[k: string]: any;
|
|
250
199
|
}, rawArgs: string[]): Promise<number>;
|
|
200
|
+
export declare function readLocalNxVersion(root: string): string | undefined;
|
|
251
201
|
export declare function runMigration(): Promise<number>;
|
|
252
202
|
/**
|
|
253
203
|
* Resolves a migration's collection once and derives everything the run loop
|
|
@@ -278,5 +228,4 @@ export declare function resolveMigrationForRun(root: string, migration: {
|
|
|
278
228
|
};
|
|
279
229
|
documentationPath?: string;
|
|
280
230
|
};
|
|
281
|
-
export declare function resolveDocumentationFileToWorkspacePath(root: string, migrationsDir: string, documentation: string): string | undefined;
|
|
282
231
|
export declare function nxCliPath(nxWorkspaceRoot?: string): Promise<string>;
|