nx 23.0.0-beta.1 → 23.0.0-beta.10
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 +5 -2
- package/dist/plugins/package-json.js +4 -2
- package/dist/src/ai/clone-ai-config-repo.js +20 -3
- package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +15 -23
- package/dist/src/analytics/analytics.js +10 -1
- package/dist/src/command-line/graph/graph.js +0 -1
- package/dist/src/command-line/migrate/command-object.js +12 -2
- package/dist/src/command-line/migrate/migrate.d.ts +30 -2
- package/dist/src/command-line/migrate/migrate.js +415 -130
- package/dist/src/command-line/migrate/multi-major.d.ts +9 -0
- package/dist/src/command-line/migrate/multi-major.js +166 -0
- package/dist/src/command-line/migrate/update-filters.d.ts +11 -0
- package/dist/src/command-line/migrate/update-filters.js +44 -0
- package/dist/src/command-line/migrate/version-utils.d.ts +5 -0
- package/dist/src/command-line/migrate/version-utils.js +53 -0
- 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/command-line/release/utils/shared.js +22 -12
- package/dist/src/command-line/show/show-target/info.d.ts +1 -0
- package/dist/src/command-line/show/show-target/info.js +98 -16
- package/dist/src/config/misc-interfaces.d.ts +6 -0
- package/dist/src/config/task-graph.d.ts +4 -107
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/styles.css +2 -3
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.js +11 -3
- package/dist/src/daemon/client/daemon-environment.d.ts +8 -0
- package/dist/src/daemon/client/daemon-environment.js +29 -0
- package/dist/src/daemon/is-nx-version-mismatch.d.ts +0 -1
- package/dist/src/daemon/is-nx-version-mismatch.js +2 -18
- package/dist/src/daemon/server/file-watching/changed-projects.js +15 -6
- package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +13 -0
- package/dist/src/daemon/server/file-watching/route-workspace-changes.js +65 -0
- package/dist/src/daemon/server/handle-update-workspace-context.js +1 -1
- package/dist/src/daemon/server/latest-nx.js +2 -0
- package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -1
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +189 -138
- package/dist/src/daemon/server/server.js +8 -53
- package/dist/src/daemon/server/start.d.ts +1 -1
- package/dist/src/daemon/server/start.js +2 -0
- package/dist/src/daemon/server/watcher.d.ts +7 -0
- package/dist/src/daemon/server/watcher.js +39 -11
- package/dist/src/devkit-internals.d.ts +1 -0
- package/dist/src/devkit-internals.js +3 -1
- package/dist/src/hasher/hash-plan-inspector.d.ts +1 -1
- package/dist/src/native/index.d.ts +71 -4
- 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/plugins/js/lock-file/npm-parser.js +37 -19
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +51 -4
- package/dist/src/plugins/js/lock-file/project-graph-pruning.js +12 -4
- package/dist/src/plugins/package-json/create-nodes.d.ts +3 -2
- package/dist/src/plugins/package-json/create-nodes.js +7 -5
- package/dist/src/project-graph/build-project-graph.d.ts +5 -0
- package/dist/src/project-graph/build-project-graph.js +6 -2
- package/dist/src/project-graph/file-map-utils.d.ts +5 -0
- package/dist/src/project-graph/file-map-utils.js +10 -1
- package/dist/src/project-graph/plugins/get-plugins.js +7 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +4 -3
- package/dist/src/project-graph/utils/project-configuration/target-defaults.js +22 -4
- package/dist/src/tasks-runner/create-task-graph.d.ts +4 -4
- package/dist/src/tasks-runner/life-cycle.d.ts +7 -8
- package/dist/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +6 -6
- package/dist/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +13 -2
- package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -5
- package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +11 -2
- 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 +81 -9
- package/dist/src/tasks-runner/utils.d.ts +12 -0
- package/dist/src/tasks-runner/utils.js +45 -21
- package/dist/src/utils/ab-testing.js +12 -0
- package/dist/src/utils/child-process.js +2 -2
- 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/has-nx-js-plugin.d.ts +9 -0
- package/dist/src/utils/has-nx-js-plugin.js +24 -0
- package/dist/src/utils/installed-nx-version.d.ts +18 -0
- package/dist/src/utils/installed-nx-version.js +111 -0
- package/dist/src/utils/logger.d.ts +12 -1
- package/dist/src/utils/logger.js +57 -36
- package/dist/src/utils/nx-key.d.ts +0 -1
- package/dist/src/utils/nx-key.js +20 -23
- package/dist/src/utils/output.d.ts +3 -2
- package/dist/src/utils/output.js +29 -28
- package/dist/src/utils/package-json.d.ts +1 -1
- package/dist/src/utils/package-json.js +5 -18
- package/dist/src/utils/perf-logging.js +3 -1
- package/dist/src/utils/plugin-cache-utils.d.ts +13 -4
- package/dist/src/utils/plugin-cache-utils.js +23 -13
- package/dist/src/utils/workspace-context.js +2 -2
- package/package.json +24 -17
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");
|
|
@@ -52,6 +54,7 @@ async function main() {
|
|
|
52
54
|
process.argv[2] === '_migrate' ||
|
|
53
55
|
process.argv[2] === 'init' ||
|
|
54
56
|
process.argv[2] === 'configure-ai-agents' ||
|
|
57
|
+
process.argv[2] === 'mcp' ||
|
|
55
58
|
(process.argv[2] === 'graph' && !workspace)) {
|
|
56
59
|
process.env.NX_DAEMON = 'false';
|
|
57
60
|
(await import('nx/src/command-line/nx-commands')).commandsObject.argv;
|
|
@@ -109,10 +112,10 @@ async function main() {
|
|
|
109
112
|
warnIfUsingOutdatedGlobalInstall(GLOBAL_NX_VERSION, LOCAL_NX_VERSION);
|
|
110
113
|
if (localNx.includes('.nx')) {
|
|
111
114
|
const nxWrapperPath = localNx.replace(/\.nx.*/, '.nx/') + 'nxw.js';
|
|
112
|
-
|
|
115
|
+
require(nxWrapperPath);
|
|
113
116
|
}
|
|
114
117
|
else {
|
|
115
|
-
|
|
118
|
+
require(localNx);
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
}
|
|
@@ -8,6 +8,7 @@ const cache_directory_1 = require("../src/utils/cache-directory");
|
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const fileutils_1 = require("../src/utils/fileutils");
|
|
10
10
|
const plugin_cache_utils_1 = require("../src/utils/plugin-cache-utils");
|
|
11
|
+
const package_manager_1 = require("../src/utils/package-manager");
|
|
11
12
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'package-json.hash');
|
|
12
13
|
let packageJsonPluginCache = null;
|
|
13
14
|
function readPackageJsonConfigurationCache() {
|
|
@@ -16,7 +17,7 @@ function readPackageJsonConfigurationCache() {
|
|
|
16
17
|
}
|
|
17
18
|
function writeCache() {
|
|
18
19
|
if (packageJsonPluginCache) {
|
|
19
|
-
packageJsonPluginCache.writeToDisk(
|
|
20
|
+
packageJsonPluginCache.writeToDisk();
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
const plugin = {
|
|
@@ -27,7 +28,8 @@ const plugin = {
|
|
|
27
28
|
const cache = readPackageJsonConfigurationCache();
|
|
28
29
|
const patterns = (0, package_json_1.buildPackageJsonPatterns)(context.workspaceRoot, (f) => (0, fileutils_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, f)));
|
|
29
30
|
const isInPackageJsonWorkspaces = (0, package_json_1.buildPackageJsonWorkspacesMatcher)(patterns);
|
|
30
|
-
const
|
|
31
|
+
const packageManagerCommand = (0, package_manager_1.getPackageManagerCommand)((0, package_manager_1.detectPackageManager)(context.workspaceRoot), context.workspaceRoot);
|
|
32
|
+
const result = (0, plugins_1.createNodesFromFiles)((packageJsonPath) => (0, package_json_1.createNodeFromPackageJson)(packageJsonPath, workspace_root_1.workspaceRoot, cache, isInPackageJsonWorkspaces(packageJsonPath), packageManagerCommand), configFiles, options, context);
|
|
31
33
|
writeCache();
|
|
32
34
|
return result;
|
|
33
35
|
},
|
|
@@ -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
|
+
}
|
|
@@ -15,38 +15,30 @@ const package_json_1 = require("../../utils/package-json");
|
|
|
15
15
|
const ignore_1 = require("../../utils/ignore");
|
|
16
16
|
const provenance_1 = require("../../utils/provenance");
|
|
17
17
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
18
|
+
const installed_nx_version_1 = require("../../utils/installed-nx-version");
|
|
18
19
|
const constants_1 = require("../constants");
|
|
19
20
|
const clone_ai_config_repo_1 = require("../clone-ai-config-repo");
|
|
20
21
|
const utils_1 = require("../utils");
|
|
21
22
|
const handle_import_1 = require("../../utils/handle-import");
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Best-effort fallback when `getInstalledNxVersion()` can't find an
|
|
25
|
+
* installed nx — read the version declared in the workspace's
|
|
26
|
+
* `package.json` (devDependencies/dependencies), stripping any semver
|
|
27
|
+
* range prefix, and finally a sane default.
|
|
24
28
|
*/
|
|
25
|
-
function
|
|
29
|
+
function getDeclaredNxVersionOrDefault() {
|
|
26
30
|
try {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
31
|
+
const workspacePackageJson = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(workspace_root_1.workspaceRoot, 'package.json'), 'utf-8'));
|
|
32
|
+
const declared = workspacePackageJson.devDependencies?.nx ||
|
|
33
|
+
workspacePackageJson.dependencies?.nx;
|
|
34
|
+
if (declared) {
|
|
35
|
+
return declared.replace(/^[\^~>=<]+/, '');
|
|
36
|
+
}
|
|
30
37
|
}
|
|
31
38
|
catch {
|
|
32
|
-
|
|
33
|
-
// Fallback: try to read from workspace package.json
|
|
34
|
-
const workspacePackageJson = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(workspace_root_1.workspaceRoot, 'package.json'), 'utf-8'));
|
|
35
|
-
// Check devDependencies first, then dependencies
|
|
36
|
-
const nxVersion = workspacePackageJson.devDependencies?.nx ||
|
|
37
|
-
workspacePackageJson.dependencies?.nx;
|
|
38
|
-
if (nxVersion) {
|
|
39
|
-
// Remove any semver range characters (^, ~, >=, etc.)
|
|
40
|
-
return nxVersion.replace(/^[\^~>=<]+/, '');
|
|
41
|
-
}
|
|
42
|
-
throw new Error('Nx not found in package.json');
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
// If we can't determine the version, default to the newer format
|
|
46
|
-
// This handles cases where nx might not be installed or is globally installed
|
|
47
|
-
return '22.0.0';
|
|
48
|
-
}
|
|
39
|
+
// fall through to default
|
|
49
40
|
}
|
|
41
|
+
return '22.0.0';
|
|
50
42
|
}
|
|
51
43
|
async function setupAiAgentsGenerator(tree, options, inner = false) {
|
|
52
44
|
const normalizedOptions = normalizeOptions(options);
|
|
@@ -77,7 +69,7 @@ function normalizeOptions(options) {
|
|
|
77
69
|
}
|
|
78
70
|
async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
79
71
|
const hasAgent = (agent) => options.agents.includes(agent);
|
|
80
|
-
const nxVersion =
|
|
72
|
+
const nxVersion = (0, installed_nx_version_1.getInstalledNxVersion)() ?? getDeclaredNxVersionOrDefault();
|
|
81
73
|
const agentsMd = (0, constants_1.agentsMdPath)(options.directory);
|
|
82
74
|
// write AGENTS.md for most agents
|
|
83
75
|
if (hasAgent('cursor') ||
|
|
@@ -16,6 +16,7 @@ const native_1 = require("../native");
|
|
|
16
16
|
const package_manager_1 = require("../utils/package-manager");
|
|
17
17
|
const semver_1 = require("semver");
|
|
18
18
|
const os = tslib_1.__importStar(require("os"));
|
|
19
|
+
const crypto_1 = require("crypto");
|
|
19
20
|
const machine_id_cache_1 = require("../utils/machine-id-cache");
|
|
20
21
|
const is_ci_1 = require("../utils/is-ci");
|
|
21
22
|
const analytics_prompt_1 = require("../utils/analytics-prompt");
|
|
@@ -56,7 +57,7 @@ async function startAnalytics() {
|
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
59
|
const isNxCloud = !!(nxJson?.nxCloudId ?? nxJson?.nxCloudAccessToken);
|
|
59
|
-
const userId = await (
|
|
60
|
+
const userId = await getTelemetryUserId(workspaceId);
|
|
60
61
|
const packageManagerInfo = getPackageManagerInfo();
|
|
61
62
|
const nodeVersion = (0, semver_1.parse)(process.version);
|
|
62
63
|
const nodeVersionString = nodeVersion
|
|
@@ -225,3 +226,11 @@ function isAnalyticsEnabled() {
|
|
|
225
226
|
const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
|
|
226
227
|
return nxJson?.analytics === true;
|
|
227
228
|
}
|
|
229
|
+
// Mix workspace id in: shared Docker images (Gitpod, Cypress, etc.) bake
|
|
230
|
+
// in /etc/machine-id, so machine-id alone collapses many users into one.
|
|
231
|
+
async function getTelemetryUserId(workspaceId) {
|
|
232
|
+
const machineId = await (0, machine_id_cache_1.getCurrentMachineId)();
|
|
233
|
+
return (0, crypto_1.createHash)('sha256')
|
|
234
|
+
.update(`${machineId}|${workspaceId}`)
|
|
235
|
+
.digest('hex');
|
|
236
|
+
}
|
|
@@ -402,7 +402,6 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
|
|
|
402
402
|
// Avoid https://en.wikipedia.org/wiki/Directory_traversal_attack
|
|
403
403
|
// e.g curl --path-as-is http://localhost:9000/../fileInDanger.txt
|
|
404
404
|
// by limiting the path to current directory only
|
|
405
|
-
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
406
405
|
const sanitizePath = (0, node_path_1.basename)(parsedUrl.pathname);
|
|
407
406
|
if (sanitizePath === 'project-graph.json') {
|
|
408
407
|
const requestFull = parsedUrl.searchParams.get('full') === 'true';
|
|
@@ -67,11 +67,21 @@ function withMigrationOptions(yargs) {
|
|
|
67
67
|
type: 'boolean',
|
|
68
68
|
default: false,
|
|
69
69
|
})
|
|
70
|
-
.
|
|
70
|
+
.option('mode', {
|
|
71
|
+
describe: "Restrict which packages to migrate. Only applies when migrating Nx itself. 'first-party' processes only Nx and its plugins (the target package plus its nx.packageGroup); 'third-party' processes only the third-party dependencies referenced by Nx packageJsonUpdates entries, catching up on any updates that may have been skipped previously; 'all' processes everything. Defaults to 'all' (or prompts in an interactive terminal when targeting Nx).",
|
|
72
|
+
type: 'string',
|
|
73
|
+
choices: ['first-party', 'third-party', 'all'],
|
|
74
|
+
})
|
|
75
|
+
.option('multiMajorMode', {
|
|
76
|
+
describe: "Skip the multi-major migration prompt/warning and pick how to handle the jump. 'direct' migrates straight to the requested target. 'gradual' migrates to the smallest recommended step (re-run `nx migrate` to continue toward the original target). Equivalent env var: NX_MULTI_MAJOR_MODE=direct|gradual.",
|
|
77
|
+
type: 'string',
|
|
78
|
+
choices: ['direct', 'gradual'],
|
|
79
|
+
})
|
|
80
|
+
.check(({ createCommits, commitPrefix, from, excludeAppliedMigrations, mode, }) => {
|
|
71
81
|
if (!createCommits && commitPrefix !== defaultCommitPrefix) {
|
|
72
82
|
throw new Error('Error: Providing a custom commit prefix requires --create-commits to be enabled');
|
|
73
83
|
}
|
|
74
|
-
if (excludeAppliedMigrations && !from) {
|
|
84
|
+
if (excludeAppliedMigrations && !from && mode !== 'third-party') {
|
|
75
85
|
throw new Error('Error: Excluding migrations that should have been previously applied requires --from to be set');
|
|
76
86
|
}
|
|
77
87
|
return true;
|
|
@@ -2,6 +2,9 @@ import { MigrationsJson, PackageJsonUpdateForPackage as PackageUpdate } from '..
|
|
|
2
2
|
import { NxJsonConfiguration } from '../../config/nx-json';
|
|
3
3
|
import { FileChange } from '../../generators/tree';
|
|
4
4
|
import { ArrayPackageGroup, PackageJson } from '../../utils/package-json';
|
|
5
|
+
import { filterDowngradedUpdates } from './update-filters';
|
|
6
|
+
import { normalizeVersion } from './version-utils';
|
|
7
|
+
export { normalizeVersion };
|
|
5
8
|
export interface ResolvedMigrationConfiguration extends MigrationsJson {
|
|
6
9
|
packageGroup?: ArrayPackageGroup;
|
|
7
10
|
}
|
|
@@ -11,7 +14,6 @@ type CommandFailure = {
|
|
|
11
14
|
stdout?: string | Buffer;
|
|
12
15
|
};
|
|
13
16
|
export declare function formatCommandFailure(command: string, error: CommandFailure): string;
|
|
14
|
-
export declare function normalizeVersion(version: string): string;
|
|
15
17
|
export interface MigratorOptions {
|
|
16
18
|
packageJson?: PackageJson;
|
|
17
19
|
nxInstallation?: NxJsonConfiguration['installation'];
|
|
@@ -25,6 +27,15 @@ export interface MigratorOptions {
|
|
|
25
27
|
};
|
|
26
28
|
interactive?: boolean;
|
|
27
29
|
excludeAppliedMigrations?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Restricts `packageJsonUpdates` filtering based on the value:
|
|
32
|
+
* - 'first-party' keeps only packages in `firstPartyPackages`
|
|
33
|
+
* - 'third-party' keeps only packages NOT in `firstPartyPackages`
|
|
34
|
+
* - 'all' / undefined keeps all packages (no filtering)
|
|
35
|
+
*/
|
|
36
|
+
mode?: 'first-party' | 'third-party' | 'all';
|
|
37
|
+
/** First-party package names used by `mode` for filtering. */
|
|
38
|
+
firstPartyPackages?: ReadonlySet<string>;
|
|
28
39
|
}
|
|
29
40
|
export declare class Migrator {
|
|
30
41
|
private readonly packageJson?;
|
|
@@ -34,6 +45,8 @@ export declare class Migrator {
|
|
|
34
45
|
private readonly to;
|
|
35
46
|
private readonly interactive;
|
|
36
47
|
private readonly excludeAppliedMigrations;
|
|
48
|
+
private readonly mode;
|
|
49
|
+
private readonly firstPartyPackages;
|
|
37
50
|
private readonly packageUpdates;
|
|
38
51
|
private readonly collectedVersions;
|
|
39
52
|
private readonly promptAnswers;
|
|
@@ -68,6 +81,8 @@ export declare class Migrator {
|
|
|
68
81
|
*/
|
|
69
82
|
private getPackageJsonUpdatesFromPackageGroup;
|
|
70
83
|
private filterPackageJsonUpdates;
|
|
84
|
+
private shouldExcludePackage;
|
|
85
|
+
private applyModeFilter;
|
|
71
86
|
private shouldApplyPackageUpdate;
|
|
72
87
|
private validatePackageUpdateVersion;
|
|
73
88
|
private addPackageUpdate;
|
|
@@ -83,6 +98,18 @@ export declare class Migrator {
|
|
|
83
98
|
private lt;
|
|
84
99
|
private lte;
|
|
85
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The canonical Nx package for a given target version: `@nrwl/workspace` for
|
|
103
|
+
* legacy (`< 14.0.0-beta.0`), `nx` otherwise. Non-semver inputs (e.g. the
|
|
104
|
+
* literal `'latest'` sentinel before tag resolution) resolve to modern era.
|
|
105
|
+
* Used by `--mode=third-party` to silently swap `@nx/workspace` → `nx` when
|
|
106
|
+
* walking the cascade.
|
|
107
|
+
*/
|
|
108
|
+
export declare function resolveCanonicalNxPackage(targetVersion: string): 'nx' | '@nrwl/workspace';
|
|
109
|
+
export declare function resolveMode(mode: 'first-party' | 'third-party' | 'all' | undefined, targetPackage: string, targetVersion: string, context?: {
|
|
110
|
+
hasFrom: boolean;
|
|
111
|
+
hasExcludeAppliedMigrations: boolean;
|
|
112
|
+
}): Promise<'first-party' | 'third-party' | 'all'>;
|
|
86
113
|
type GenerateMigrations = {
|
|
87
114
|
type: 'generateMigrations';
|
|
88
115
|
targetPackage: string;
|
|
@@ -95,6 +122,7 @@ type GenerateMigrations = {
|
|
|
95
122
|
};
|
|
96
123
|
interactive?: boolean;
|
|
97
124
|
excludeAppliedMigrations?: boolean;
|
|
125
|
+
mode: 'first-party' | 'third-party' | 'all';
|
|
98
126
|
};
|
|
99
127
|
type RunMigrations = {
|
|
100
128
|
type: 'runMigrations';
|
|
@@ -104,6 +132,7 @@ type RunMigrations = {
|
|
|
104
132
|
export declare function parseMigrationsOptions(options: {
|
|
105
133
|
[k: string]: any;
|
|
106
134
|
}): Promise<GenerateMigrations | RunMigrations>;
|
|
135
|
+
export { filterDowngradedUpdates };
|
|
107
136
|
/**
|
|
108
137
|
* Detects npm peer-dependency resolution failures. Keyed on the `ERESOLVE`
|
|
109
138
|
* error code, which npm consistently emits for this class of failure across
|
|
@@ -148,4 +177,3 @@ export declare function getImplementationPath(collection: MigrationsJson, collec
|
|
|
148
177
|
fnSymbol: string;
|
|
149
178
|
};
|
|
150
179
|
export declare function nxCliPath(nxWorkspaceRoot?: string): Promise<string>;
|
|
151
|
-
export {};
|