nx 24.0.0-beta.1 → 24.0.0-beta.3
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/post-install.js +5 -3
- package/dist/src/adapter/ngcli-adapter.js +1 -2
- package/dist/src/command-line/add/add.d.ts +2 -0
- package/dist/src/command-line/add/add.js +23 -5
- package/dist/src/command-line/affected/affected.js +2 -2
- package/dist/src/command-line/graph/graph.js +2 -1
- package/dist/src/command-line/init/implementation/add-nx-to-nest.js +21 -62
- package/dist/src/command-line/migrate/agentic/definitions.d.ts +1 -3
- package/dist/src/command-line/migrate/agentic/definitions.js +5 -97
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +7 -45
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +9 -51
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +1 -43
- package/dist/src/command-line/migrate/agentic/handoff.js +3 -119
- package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +0 -21
- package/dist/src/command-line/migrate/agentic/instruction-files.js +6 -27
- package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +19 -1
- package/dist/src/command-line/migrate/agentic/master/run-master-session.js +88 -49
- package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +1 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.js +13 -12
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +2 -2
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +2 -2
- package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +1 -12
- package/dist/src/command-line/migrate/agentic/prompts/fragments.js +8 -17
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +0 -15
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +3 -100
- package/dist/src/command-line/migrate/agentic/select.d.ts +12 -6
- package/dist/src/command-line/migrate/agentic/select.js +38 -8
- package/dist/src/command-line/migrate/agentic/types.d.ts +9 -68
- package/dist/src/command-line/migrate/agentic/types.js +6 -8
- package/dist/src/command-line/migrate/command-object.js +6 -10
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +18 -1
- package/dist/src/command-line/migrate/migrate-analytics.js +38 -0
- package/dist/src/command-line/migrate/migrate-commits.d.ts +9 -10
- package/dist/src/command-line/migrate/migrate-commits.js +25 -18
- package/dist/src/command-line/migrate/migrate-config.d.ts +6 -6
- package/dist/src/command-line/migrate/migrate-config.js +12 -6
- package/dist/src/command-line/migrate/migrate-output.d.ts +1 -6
- package/dist/src/command-line/migrate/migrate-output.js +1 -10
- package/dist/src/command-line/migrate/migrate.d.ts +3 -30
- package/dist/src/command-line/migrate/migrate.js +153 -232
- package/dist/src/command-line/migrate/run/agent-output.d.ts +1 -0
- package/dist/src/command-line/migrate/run/agent-output.js +4 -0
- package/dist/src/command-line/migrate/run/broker.js +1 -1
- package/dist/src/command-line/migrate/run/existing-run-report.d.ts +1 -1
- package/dist/src/command-line/migrate/run/existing-run-report.js +7 -5
- package/dist/src/command-line/migrate/run/give-up.d.ts +4 -3
- package/dist/src/command-line/migrate/run/give-up.js +8 -5
- package/dist/src/command-line/migrate/run/index.d.ts +4 -3
- package/dist/src/command-line/migrate/run/index.js +9 -1
- package/dist/src/command-line/migrate/run/issues.js +7 -2
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +61 -4
- package/dist/src/command-line/migrate/run/orchestrator.js +307 -108
- package/dist/src/command-line/migrate/run/run-state.d.ts +17 -1
- package/dist/src/command-line/migrate/run/run-state.js +41 -2
- package/dist/src/command-line/migrate/run/runbook.d.ts +1 -0
- package/dist/src/command-line/migrate/run/runbook.js +99 -21
- package/dist/src/command-line/migrate/run/state-lock.d.ts +29 -4
- package/dist/src/command-line/migrate/run/state-lock.js +102 -10
- package/dist/src/command-line/migrate/run/util.d.ts +4 -2
- package/dist/src/command-line/migrate/run/util.js +23 -2
- package/dist/src/command-line/migrate/run/worker.d.ts +1 -1
- package/dist/src/command-line/migrate/run/worker.js +252 -250
- package/dist/src/command-line/migrate/sort-migrations.d.ts +1 -7
- package/dist/src/command-line/migrate/sort-migrations.js +1 -12
- package/dist/src/command-line/release/changelog.js +9 -6
- package/dist/src/command-line/release/config/config.d.ts +1 -0
- package/dist/src/command-line/release/config/config.js +48 -9
- package/dist/src/command-line/release/release.js +2 -2
- package/dist/src/command-line/release/utils/git.js +8 -7
- package/dist/src/command-line/release/utils/interpolate-release-config.d.ts +6 -0
- package/dist/src/command-line/release/utils/interpolate-release-config.js +39 -0
- package/dist/src/command-line/release/utils/release-graph.d.ts +5 -0
- package/dist/src/command-line/release/utils/release-graph.js +1 -0
- package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +2 -2
- package/dist/src/command-line/release/utils/shared.js +10 -10
- package/dist/src/command-line/release/utils/version-plan-utils.d.ts +3 -12
- package/dist/src/command-line/release/utils/version-plan-utils.js +33 -55
- package/dist/src/command-line/release/version/version-actions.js +2 -1
- package/dist/src/command-line/release/version.js +5 -2
- package/dist/src/command-line/show/projects.js +5 -3
- package/dist/src/command-line/yargs-utils/shared-options.js +1 -1
- package/dist/src/config/nx-json.d.ts +21 -9
- package/dist/src/config/workspace-json-project-json.d.ts +24 -9
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/devkit-exports.d.ts +4 -0
- package/dist/src/devkit-exports.js +6 -1
- package/dist/src/devkit-internals.d.ts +1 -1
- package/dist/src/devkit-internals.js +4 -3
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -2
- package/dist/src/executors/run-commands/run-commands.impl.js +20 -10
- package/dist/src/executors/run-commands/running-tasks.d.ts +12 -3
- package/dist/src/executors/run-commands/running-tasks.js +22 -18
- package/dist/src/hasher/check-task-files.js +1 -4
- package/dist/src/hasher/task-hasher.d.ts +2 -0
- package/dist/src/hasher/task-hasher.js +4 -1
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +1 -2
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +6 -11
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +2 -2
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.js +15 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.md +30 -0
- package/dist/src/migrations/update-24-0-0/move-custom-hashers-to-inputs.md +7 -6
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.d.ts +3 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.js +130 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.md +62 -0
- package/dist/src/native/index.d.ts +35 -6
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -3
- package/dist/src/plugins/js/lock-file/pruned-output.d.ts +2 -2
- package/dist/src/plugins/js/lock-file/pruned-output.js +4 -4
- package/dist/src/project-graph/affected/affected-tasks.d.ts +6 -5
- package/dist/src/project-graph/affected/affected-tasks.js +16 -6
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +1 -1
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +12 -133
- package/dist/src/project-graph/utils/project-configuration-utils.js +2 -2
- package/dist/src/project-graph/utils/retrieve-workspace-files.js +27 -6
- package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
- package/dist/src/tasks-runner/readiness/probes.js +30 -1
- package/dist/src/tasks-runner/readiness/ready-when.d.ts +31 -10
- package/dist/src/tasks-runner/readiness/ready-when.js +178 -41
- package/dist/src/tasks-runner/run-command.js +2 -2
- package/dist/src/tasks-runner/running-tasks/batch-process.js +6 -0
- package/dist/src/tasks-runner/task-orchestrator.d.ts +14 -6
- package/dist/src/tasks-runner/task-orchestrator.js +202 -97
- package/dist/src/tasks-runner/tasks-runner.d.ts +1 -1
- package/dist/src/tasks-runner/tokens.d.ts +54 -0
- package/dist/src/tasks-runner/tokens.js +161 -0
- package/dist/src/tasks-runner/utils.d.ts +15 -1
- package/dist/src/tasks-runner/utils.js +79 -33
- package/dist/src/utils/acknowledge-build-scripts.d.ts +34 -1
- package/dist/src/utils/acknowledge-build-scripts.js +171 -32
- package/dist/src/utils/long-running-target.d.ts +1 -3
- package/dist/src/utils/long-running-target.js +1 -3
- package/dist/src/utils/plugins/core-plugins.js +4 -0
- package/migrations.json +13 -6
- package/package.json +12 -11
- package/schemas/nx-schema.json +45 -15
- package/schemas/project-schema.json +30 -9
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +0 -56
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +0 -67
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +0 -49
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +0 -53
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +0 -26
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +0 -27
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +0 -70
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +0 -113
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +0 -68
- package/dist/src/command-line/migrate/agentic/run-step.js +0 -148
- package/dist/src/command-line/migrate/agentic/runner.d.ts +0 -21
- package/dist/src/command-line/migrate/agentic/runner.js +0 -262
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +0 -9
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +0 -18
|
@@ -20,22 +20,38 @@ const deferred_output_1 = require("./deferred-output");
|
|
|
20
20
|
// ignore rule that normally hides it goes missing mid-run (a checkout, a
|
|
21
21
|
// .gitignore edit, or the migration's own changes).
|
|
22
22
|
const MIGRATE_COMMIT_EXCLUDES = [types_1.MIGRATE_RUNS_RELATIVE_DIR];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const AGENT_SESSION_NO_INPUT = "Commits in this session cannot ask for input, such as a signing passphrase or a hook's prompt";
|
|
24
|
+
function commitFailureGuidance(recovery, inAgentSession) {
|
|
25
|
+
switch (recovery) {
|
|
26
|
+
case 'later-step':
|
|
27
|
+
// Without the session half, the agent continues as the absorb guidance
|
|
28
|
+
// says, and a cause that fails every commit leaves the run uncommitted.
|
|
29
|
+
return `Any uncommitted changes will be included in the next successful commit, which will reference this migration; if they remain uncommitted, the end-of-run output will list this migration so you can commit or revert them manually.${inAgentSession
|
|
30
|
+
? ` ${AGENT_SESSION_NO_INPUT}, so later commits may fail the same way until the cause is fixed. Before the next step, tell the user what failed and ask whether to fix the cause first or to continue as is. Either way nx tries every later commit, and the first one that lands includes these changes.`
|
|
31
|
+
: ''}`;
|
|
32
|
+
case 'manual':
|
|
33
|
+
return `Commit or revert any remaining uncommitted changes manually.${inAgentSession
|
|
34
|
+
? ` ${AGENT_SESSION_NO_INPUT}. Tell the user what failed.`
|
|
35
|
+
: ''}`;
|
|
36
|
+
default: {
|
|
37
|
+
const unhandled = recovery;
|
|
38
|
+
throw new Error(`Unhandled commit failure recovery: ${unhandled}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
26
42
|
/**
|
|
27
43
|
* `pendingMigrations` are listed in the commit body so a `git log -p` reader
|
|
28
44
|
* can see which earlier migrations' diffs this commit absorbed (their own
|
|
29
45
|
* commits failed and `git add -A` picked their working-tree state up too).
|
|
30
46
|
*
|
|
31
|
-
*
|
|
32
|
-
* behavior
|
|
33
|
-
*
|
|
47
|
+
* `recovery` picks the failure guidance: the default describes the classic
|
|
48
|
+
* loop's absorb-and-recap behavior, and a caller with no later migration step
|
|
49
|
+
* (a `--run-migration` run) passes 'manual'.
|
|
34
50
|
*
|
|
35
51
|
* A `sink` collects the output for a caller sharing the terminal with an
|
|
36
52
|
* agent, and the commit then runs without the terminal.
|
|
37
53
|
*/
|
|
38
|
-
async function commitMigrationIfRequested(root, migration, shouldCreateCommits, commitPrefix, installDepsIfChanged, pendingMigrations = [],
|
|
54
|
+
async function commitMigrationIfRequested(root, migration, shouldCreateCommits, commitPrefix, installDepsIfChanged, pendingMigrations = [], recovery = 'later-step', sink) {
|
|
39
55
|
if (!shouldCreateCommits)
|
|
40
56
|
return { status: 'disabled' };
|
|
41
57
|
const out = sink ?? deferred_output_1.terminalOutput;
|
|
@@ -59,7 +75,7 @@ async function commitMigrationIfRequested(root, migration, shouldCreateCommits,
|
|
|
59
75
|
}
|
|
60
76
|
catch (err) {
|
|
61
77
|
const reason = err instanceof Error ? err.message : String(err);
|
|
62
|
-
out.line('red', `The commit for ${migration.name} failed:\n${reason}\nCheck \`git status\` and \`git log\`; the commit may have landed despite this error. ${
|
|
78
|
+
out.line('red', `The commit for ${migration.name} failed:\n${reason}\nCheck \`git status\` and \`git log\`; the commit may have landed despite this error. ${commitFailureGuidance(recovery, sink !== undefined)}`);
|
|
63
79
|
return { status: 'failed', reason };
|
|
64
80
|
}
|
|
65
81
|
}
|
|
@@ -120,11 +136,6 @@ function commitCheckpointBeforeMigrations(root, commitPrefix) {
|
|
|
120
136
|
});
|
|
121
137
|
}
|
|
122
138
|
}
|
|
123
|
-
/**
|
|
124
|
-
* `agenticHasDiffContext` gates the agent prompt: without per-migration commits
|
|
125
|
-
* to isolate a migration's diff, the prompt embeds a file list instead of
|
|
126
|
-
* pointing at git.
|
|
127
|
-
*/
|
|
128
139
|
function resolveCreateCommits(args) {
|
|
129
140
|
const { createCommits, mode, isGitRepo, commitPrefixIsCustom } = args;
|
|
130
141
|
// The orchestrator forces the agentic defaults without the `--agentic` flag,
|
|
@@ -134,7 +145,6 @@ function resolveCreateCommits(args) {
|
|
|
134
145
|
if (createCommits === true && !isGitRepo) {
|
|
135
146
|
return {
|
|
136
147
|
effective: false,
|
|
137
|
-
agenticHasDiffContext: false,
|
|
138
148
|
error: '`--create-commits` requires a git repository. Run `git init` first, or omit the flag.',
|
|
139
149
|
};
|
|
140
150
|
}
|
|
@@ -142,7 +152,6 @@ function resolveCreateCommits(args) {
|
|
|
142
152
|
if (createCommits === false) {
|
|
143
153
|
return {
|
|
144
154
|
effective: false,
|
|
145
|
-
agenticHasDiffContext: false,
|
|
146
155
|
warning: (orchestrated
|
|
147
156
|
? "--no-create-commits was passed, but orchestrated migrate runs create per-migration commits by default. Without them, the agent can't isolate the current migration's changes from earlier migrations in this run. Drop --no-create-commits for accurate per-migration review."
|
|
148
157
|
: "--no-create-commits was passed alongside --agentic. Without per-migration commits, the agent can't isolate the current migration's changes from earlier migrations in this run. Drop --no-create-commits for accurate per-migration review.") +
|
|
@@ -156,7 +165,6 @@ function resolveCreateCommits(args) {
|
|
|
156
165
|
if (!isGitRepo) {
|
|
157
166
|
return {
|
|
158
167
|
effective: false,
|
|
159
|
-
agenticHasDiffContext: false,
|
|
160
168
|
warning: (orchestrated
|
|
161
169
|
? 'Orchestrated migrate runs create per-migration commits by default, but the workspace is not a git repository. Continuing without commits, so the agent will not receive per-file diff context. Run `git init` to enable.'
|
|
162
170
|
: '`--agentic` enables per-migration commits by default, but the workspace is not a git repository. Continuing without commits, so the agent will not receive per-file diff context. Run `git init` to enable.') +
|
|
@@ -165,11 +173,10 @@ function resolveCreateCommits(args) {
|
|
|
165
173
|
: ''),
|
|
166
174
|
};
|
|
167
175
|
}
|
|
168
|
-
return { effective: true
|
|
176
|
+
return { effective: true };
|
|
169
177
|
}
|
|
170
178
|
return {
|
|
171
179
|
effective: createCommits === true,
|
|
172
|
-
agenticHasDiffContext: false,
|
|
173
180
|
warning: commitPrefixIsCustom && createCommits !== true
|
|
174
181
|
? 'A custom migrate commit prefix is configured, but commits are not enabled for this run, so it has no effect. Set `migrate.createCommits` to `true` (or pass `--create-commits`) to create a commit per migration.'
|
|
175
182
|
: undefined,
|
|
@@ -9,12 +9,12 @@ import { type MigrateArgs } from './command-object';
|
|
|
9
9
|
* config value never trips the mutually-exclusive-flag guards in
|
|
10
10
|
* `parseMigrationsOptions`: `include` and `multiMajorMode` in the generate
|
|
11
11
|
* phase only; `createCommits` / `commitPrefix` and `agentic` / `validate` when
|
|
12
|
-
* running the whole migrations file or a standalone single migration
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* running the whole migrations file or a standalone single migration, and
|
|
13
|
+
* `finalValidation` for the whole file only. A `--run-id` reconcile or
|
|
14
|
+
* recorded worker takes none of them: a recorded run takes its commit config
|
|
15
|
+
* from run.json and is driven by the outer agent. A `--run-migrations
|
|
16
|
+
* --run-id` continue takes `agentic` only, to select the agent of the new
|
|
17
|
+
* session. A `--start-fresh` starts a new run and takes all five.
|
|
18
18
|
*
|
|
19
19
|
* `include` is carried as `includeFromConfig` so it is never mistaken for an
|
|
20
20
|
* explicit `--include`: `resolveInclude` applies it only when the resolved
|
|
@@ -14,12 +14,12 @@ const MULTI_MAJOR_MODE_ENV = 'NX_MULTI_MAJOR_MODE';
|
|
|
14
14
|
* config value never trips the mutually-exclusive-flag guards in
|
|
15
15
|
* `parseMigrationsOptions`: `include` and `multiMajorMode` in the generate
|
|
16
16
|
* phase only; `createCommits` / `commitPrefix` and `agentic` / `validate` when
|
|
17
|
-
* running the whole migrations file or a standalone single migration
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* running the whole migrations file or a standalone single migration, and
|
|
18
|
+
* `finalValidation` for the whole file only. A `--run-id` reconcile or
|
|
19
|
+
* recorded worker takes none of them: a recorded run takes its commit config
|
|
20
|
+
* from run.json and is driven by the outer agent. A `--run-migrations
|
|
21
|
+
* --run-id` continue takes `agentic` only, to select the agent of the new
|
|
22
|
+
* session. A `--start-fresh` starts a new run and takes all five.
|
|
23
23
|
*
|
|
24
24
|
* `include` is carried as `includeFromConfig` so it is never mistaken for an
|
|
25
25
|
* explicit `--include`: `resolveInclude` applies it only when the resolved
|
|
@@ -60,6 +60,12 @@ function applyNxJsonMigrateDefaults(args, migrateConfig, env = process.env) {
|
|
|
60
60
|
assertType(migrateConfig.validate, 'boolean', 'validate');
|
|
61
61
|
merged.validate = migrateConfig.validate;
|
|
62
62
|
}
|
|
63
|
+
if (isRunMigrations &&
|
|
64
|
+
merged.finalValidation === undefined &&
|
|
65
|
+
migrateConfig.finalValidation !== undefined) {
|
|
66
|
+
assertType(migrateConfig.finalValidation, 'boolean', 'finalValidation');
|
|
67
|
+
merged.finalValidation = migrateConfig.finalValidation;
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
// A continue takes `agentic` too; the reconcile and the worker must not:
|
|
65
71
|
// there it trips the `--agentic`/`--run-id` parse conflict.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure presentation helpers for the migrate run phase (`--run-migrations` and
|
|
3
3
|
* the single-migration worker). Shared glyph vocabulary:
|
|
4
|
-
* `→` start,
|
|
4
|
+
* `→` start, `↷` skipped, `ℹ` info, `─` boundary
|
|
5
5
|
*
|
|
6
6
|
* Inputs are typed structurally (e.g. `{ name: string }[]`) so this module
|
|
7
7
|
* stays decoupled from the migration executor in migrate.ts.
|
|
@@ -18,11 +18,6 @@ export declare function resetSgrAfterAgent(): void;
|
|
|
18
18
|
* each migration with the migration index and identity.
|
|
19
19
|
*/
|
|
20
20
|
export declare function logMigrationBoundary(index: number, total: number, pkg: string, name: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Logs the outcome line that closes an agentic phase. Vocabulary:
|
|
23
|
-
* ✓ <label>[ (<sha>)]: <summary>
|
|
24
|
-
*/
|
|
25
|
-
export declare function logAgenticSuccessOutcome(label: string, sha: string | null, summary: string): void;
|
|
26
21
|
/**
|
|
27
22
|
* Callers must already know an agentic step was owed; this only picks which one
|
|
28
23
|
* the waiver dropped. The dropped-`agentContext` note is aimed at the migration
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resetSgrAfterAgent = resetSgrAfterAgent;
|
|
4
4
|
exports.logMigrationBoundary = logMigrationBoundary;
|
|
5
|
-
exports.logAgenticSuccessOutcome = logAgenticSuccessOutcome;
|
|
6
5
|
exports.logWaivedAgenticStep = logWaivedAgenticStep;
|
|
7
6
|
exports.countLandedCommits = countLandedCommits;
|
|
8
7
|
exports.countWaivedAgenticSteps = countWaivedAgenticSteps;
|
|
@@ -19,7 +18,7 @@ const migration_shape_1 = require("./migration-shape");
|
|
|
19
18
|
/**
|
|
20
19
|
* Pure presentation helpers for the migrate run phase (`--run-migrations` and
|
|
21
20
|
* the single-migration worker). Shared glyph vocabulary:
|
|
22
|
-
* `→` start,
|
|
21
|
+
* `→` start, `↷` skipped, `ℹ` info, `─` boundary
|
|
23
22
|
*
|
|
24
23
|
* Inputs are typed structurally (e.g. `{ name: string }[]`) so this module
|
|
25
24
|
* stays decoupled from the migration executor in migrate.ts.
|
|
@@ -43,14 +42,6 @@ function logMigrationBoundary(index, total, pkg, name) {
|
|
|
43
42
|
const dashes = Math.max(3, targetWidth - label.length);
|
|
44
43
|
logger_1.logger.info(`${label}${'─'.repeat(dashes)}`);
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Logs the outcome line that closes an agentic phase. Vocabulary:
|
|
48
|
-
* ✓ <label>[ (<sha>)]: <summary>
|
|
49
|
-
*/
|
|
50
|
-
function logAgenticSuccessOutcome(label, sha, summary) {
|
|
51
|
-
const shaPart = sha ? ` (${sha})` : '';
|
|
52
|
-
logger_1.logger.info(`${pc.green('✓')} ${label}${shaPart}: ${summary}`);
|
|
53
|
-
}
|
|
54
45
|
/**
|
|
55
46
|
* Callers must already know an agentic step was owed; this only picks which one
|
|
56
47
|
* the waiver dropped. The dropped-`agentContext` note is aimed at the migration
|
|
@@ -196,7 +196,9 @@ export { filterDowngradedUpdates };
|
|
|
196
196
|
export declare function generateMigrationsJsonAndUpdatePackageJson(root: string, opts: GenerateMigrations, fetch?: MigratorOptions['fetch']): Promise<void>;
|
|
197
197
|
export { isPromptOnlyMigration, isHybridMigration };
|
|
198
198
|
export declare function formatSkippedPromptsNextStep(skipped: PlannedMigration[]): string;
|
|
199
|
-
export declare function executeMigrations(root: string, migrations: PlannedMigration[], isVerbose: boolean, shouldCreateCommits: boolean, commitPrefix: string, shouldSkipInstall?: boolean, agentic?: ResolvedAgentic,
|
|
199
|
+
export declare function executeMigrations(root: string, migrations: PlannedMigration[], isVerbose: boolean, shouldCreateCommits: boolean, commitPrefix: string, shouldSkipInstall?: boolean, agentic?: Exclude<ResolvedAgentic, {
|
|
200
|
+
kind: 'enabled';
|
|
201
|
+
}>): Promise<{
|
|
200
202
|
migrationsWithNoChanges: PlannedMigration[];
|
|
201
203
|
skippedPromptsCount: number;
|
|
202
204
|
notRunMigrationsCount: number;
|
|
@@ -213,33 +215,4 @@ export declare function migrate(root: string, args: {
|
|
|
213
215
|
}, rawArgs: string[]): Promise<number>;
|
|
214
216
|
export declare function readLocalNxVersion(root: string): string | undefined;
|
|
215
217
|
export declare function runMigration(): Promise<number>;
|
|
216
|
-
/**
|
|
217
|
-
* Resolves a migration's collection once and derives everything the run loop
|
|
218
|
-
* needs from that single read: the implementation context (`collection` +
|
|
219
|
-
* `collectionPath`, handed to `runNxOrAngularMigration`) and, for agentic runs,
|
|
220
|
-
* the workspace-relative documentation path handed to the agent.
|
|
221
|
-
*
|
|
222
|
-
* Read fresh per migration (not cached across the loop) so a prior migration's
|
|
223
|
-
* reinstall is reflected, exactly as before. Error handling matches each field's
|
|
224
|
-
* role:
|
|
225
|
-
* - Migrations that run an implementation REQUIRE the collection; an unreadable
|
|
226
|
-
* collection throws and aborts that migration (caught by the run loop).
|
|
227
|
-
* - Prompt-only migrations don't run an implementation, so the collection is
|
|
228
|
-
* read only to resolve documentation - a failure there is non-fatal: the
|
|
229
|
-
* prompt still runs and the supplementary doc is skipped with a warning.
|
|
230
|
-
*/
|
|
231
|
-
export declare function resolveMigrationForRun(root: string, migration: {
|
|
232
|
-
package: string;
|
|
233
|
-
name: string;
|
|
234
|
-
documentation?: string;
|
|
235
|
-
implementation?: string;
|
|
236
|
-
factory?: string;
|
|
237
|
-
prompt?: string;
|
|
238
|
-
}, resolveDocumentation: boolean): {
|
|
239
|
-
resolvedCollection?: {
|
|
240
|
-
collection: MigrationsJson;
|
|
241
|
-
collectionPath: string;
|
|
242
|
-
};
|
|
243
|
-
documentationPath?: string;
|
|
244
|
-
};
|
|
245
218
|
export declare function nxCliPath(nxWorkspaceRoot?: string): Promise<string>;
|