nx 24.0.0-rc.0 → 24.0.0
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/core/graph/main.js +1 -1
- package/dist/src/devkit-internals.d.ts +1 -1
- package/dist/src/devkit-internals.js +4 -3
- package/dist/src/native/index.d.ts +17 -0
- package/dist/src/native/index.js +6 -1
- 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/tasks-runner/init-tasks-runner.js +3 -1
- package/dist/src/tasks-runner/task-orchestrator.d.ts +3 -2
- package/dist/src/tasks-runner/task-orchestrator.js +9 -4
- package/package.json +11 -11
|
@@ -87,7 +87,7 @@ export { getRelativeProjectJsonSchemaPath } from './generators/utils/project-con
|
|
|
87
87
|
export { hashFile } from './hasher/file-hasher';
|
|
88
88
|
export { filterUsingGlobPatterns, getTargetInputs } from './hasher/task-hasher';
|
|
89
89
|
export type { JsonInput } from './native';
|
|
90
|
-
export { isAiAgent, killProcessTreeGraceful } from './native';
|
|
90
|
+
export { isAiAgent, killProcessTreeGraceful, readShebangHeaders, } from './native';
|
|
91
91
|
export { killChildOnHostExit } from './utils/kill-child-on-host-exit';
|
|
92
92
|
export { connectToNxCloud } from './nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud';
|
|
93
93
|
export type { NxCloudOnBoardingStatus } from './nx-cloud/models/onboarding-status';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hashDaemonClientEnv = exports.getEnvPathsForTask = exports.getGraphTimeDotEnvForTask = exports.getEnvFilesForTask = exports.interpolate = exports.requireWithTsconfigFallback = exports.isTsEsmNamedExportLinkageError = exports.isRequireInEsmScopeError = exports.forceRegisterEsmLoader = exports.loadTsFile = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappings = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmpAsync = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.confirmationPrompt = exports.textPrompt = exports.multiselectPrompt = exports.selectPrompt = exports.splitTarget = exports.createPrettierIgnoreChecker = exports.createOxfmtIgnoreChecker = exports.createGitIgnoreChecker = exports.readTargetDefaultsForTarget = exports.createTargetDefaultsResults = exports.findMatchingProjects = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.findMatchingTargetNames = exports.resolveNxTokensInOptions = exports.resolveCommandSyntacticSugar = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.parseVersionFromPackageManagerField = exports.createTempNpmDirectory = void 0;
|
|
4
4
|
exports.getTargetInputs = exports.filterUsingGlobPatterns = exports.hashFile = exports.getRelativeProjectJsonSchemaPath = exports.FsTree = exports.normalizeRunCommandsArgs = exports.interpolateArgsIntoCommand = exports.LARGE_BUFFER = exports.daemonClient = exports.isProjectGraphProjectNode = exports.isProjectGraphExternalNode = exports.fileDataDepType = exports.fileDataDepTarget = exports.BatchFunctionRunner = exports.getGeneratorInformation = exports.setupAiAgentsGenerator = exports.toOldFormat = exports.toNewFormat = exports.runCommandsExecutor = exports.acknowledgeDeclaredBuildScripts = exports.acknowledgeBuildScripts = exports.getCatalogDependenciesFromPackageJson = exports.getCatalogManager = exports.checkFilesAreOutputs = exports.checkFilesAreInputs = exports.PromptResolutionError = exports.resolvePrompt = exports.SchemaResolutionError = exports.ImplementationResolutionError = exports.resolveSchema = exports.resolveImplementation = exports.emitPluginWorkerLog = exports.safeWriteFileCache = exports.PluginCache = exports.handleImport = exports.signalToCode = exports.globalSpinner = exports.readYamlFile = exports.oxfmtConfigFiles = exports.formatFilesWithOxfmt = exports.detectFormatterInTree = exports.detectFormatter = exports.prettierConfigFiles = exports.isUsingPrettierInTree = exports.createOverrides = exports.createCliOptions = exports.isCI = exports.applyDaemonEnvFromClient = exports.getAppliedDaemonClientEnv = exports.getDaemonClientEnvGeneration = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.resolveStartupHost = exports.safeSpawn = exports.safeExecFileSync = exports.workspaceRootInner = void 0;
|
|
5
|
+
exports.getExecutorForTask = exports.getDependencyConfigs = exports.getCustomHasher = exports.getCliPath = exports.expandWildcardTargetConfiguration = exports.expandInitiatingTasksThroughNoop = exports.expandDependencyConfigSyntaxSugar = exports.createTaskId = exports.calculateReverseDeps = exports.createRunManyDynamicOutputRenderer = exports.CompositeLifeCycle = exports.RemoteCacheV2 = exports.Cache = exports.readCachedProjectConfiguration = exports.preventRecursionInGraphConstruction = exports.handleProjectGraphError = exports.createProjectGraphAndSourceMapsAsync = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.isNpmProject = exports.readFileMapCache = exports.readPackageJson = exports.isWholeFileChange = exports.isLockFileChange = exports.isDeletedFileChange = exports.defaultFileRead = exports.calculateFileChanges = exports.WholeFileChange = exports.TEN_MEGABYTES = exports.LockFileChange = exports.DeletedFileChange = exports.buildPackageJsonWorkspacesMatcher = exports.buildPackageJsonPatterns = exports.getGlobPatternsFromPackageManagerWorkspaces = exports.registerTsConfigPaths = exports.getWorkspacePackagesFromGraph = exports.isBuiltinModuleImport = exports.TargetProjectLocator = exports.findProjectsNpmDependencies = exports.createPackageJson = exports.getLockFileName = exports.generatePrunedDeployOutput = exports.createLockFile = exports.createNxCloudOnboardingURL = exports.getNxCloudAppOnBoardingUrl = exports.createNxCloudOnboardingURLForWelcomeApp = exports.connectToNxCloud = exports.killChildOnHostExit = exports.readShebangHeaders = exports.killProcessTreeGraceful = exports.isAiAgent = void 0;
|
|
6
|
+
exports.setupWorkspaceContext = exports.resetWorkspaceContext = exports.globWithWorkspaceContext = exports.getFilesInDirectoryUsingContext = exports.nxVersion = exports.SyncError = exports.quoteShellArg = exports.getSourceDirOfDependentProjects = exports.findAllProjectNodeDependencies = exports.findInstalledPlugins = exports.deriveGroupNameFromTarget = exports.warnUnshippableLocalPathSpec = exports.relocatePrunedLocalPathSpec = exports.movePeerDependencyToDependencies = exports.dropEmptyPeerDependencySections = exports.readNxMigrateConfig = exports.isNxCloudUsed = exports.getNxCloudUrl = exports.orange = exports.NX_PREFIX = exports.getNxRequirePaths = exports.isGlobPattern = exports.combineGlobPatterns = exports.getLatestCommitSha = exports.readFileIfExisting = exports.isRelativePath = exports.fileExists = exports.directoryExists = exports.createDirectory = exports.deduceDefaultBase = exports.codeFrameColumns = exports.runNxSync = exports.workspaceDataDirectory = exports.getLastValueFromAsyncIterableIterator = exports.validateOutputs = exports.unparse = exports.transformLegacyOutputs = exports.shouldStreamOutput = exports.removeTasksFromTaskGraph = exports.readProjectAndTargetFromTargetString = exports.normalizeTargetDependencyWithStringProjects = exports.normalizeDependencyConfigProjects = exports.normalizeDependencyConfigDefinition = exports.isCacheableTask = exports.getUnparsedOverrideArgs = exports.getTargetConfigurationForTask = exports.getSerializedArgsForTask = exports.getPrintableCommandArgsForTask = exports.getOutputs = exports.getExecutorNameForTask = void 0;
|
|
7
|
+
exports.resolveStartupHost = exports.safeSpawn = exports.safeExecFileSync = exports.workspaceRootInner = exports.setWorkspaceRoot = void 0;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
/**
|
|
10
10
|
* Note to developers: STOP! These are nx internals, not part of the public
|
|
@@ -192,6 +192,7 @@ Object.defineProperty(exports, "getTargetInputs", { enumerable: true, get: funct
|
|
|
192
192
|
var native_1 = require("./native");
|
|
193
193
|
Object.defineProperty(exports, "isAiAgent", { enumerable: true, get: function () { return native_1.isAiAgent; } });
|
|
194
194
|
Object.defineProperty(exports, "killProcessTreeGraceful", { enumerable: true, get: function () { return native_1.killProcessTreeGraceful; } });
|
|
195
|
+
Object.defineProperty(exports, "readShebangHeaders", { enumerable: true, get: function () { return native_1.readShebangHeaders; } });
|
|
195
196
|
var kill_child_on_host_exit_1 = require("./utils/kill-child-on-host-exit");
|
|
196
197
|
Object.defineProperty(exports, "killChildOnHostExit", { enumerable: true, get: function () { return kill_child_on_host_exit_1.killChildOnHostExit; } });
|
|
197
198
|
var connect_to_nx_cloud_1 = require("./nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
|
|
@@ -1184,6 +1184,14 @@ export interface ReadinessProbeConfig {
|
|
|
1184
1184
|
interval?: number
|
|
1185
1185
|
}
|
|
1186
1186
|
|
|
1187
|
+
/**
|
|
1188
|
+
* The `files` (workspace-relative) that start with `#!`, each with its header
|
|
1189
|
+
* (see `read_shebang_header`), read in parallel and sorted by path. Files that
|
|
1190
|
+
* cannot be read are left out, as are entries that `join` would follow out of
|
|
1191
|
+
* the root (rooted, drive-prefixed, or climbing with `..`).
|
|
1192
|
+
*/
|
|
1193
|
+
export declare function readShebangHeaders(workspaceRoot: string, files: Array<string>): Array<ShebangFile>
|
|
1194
|
+
|
|
1187
1195
|
export declare function remove(src: string): void
|
|
1188
1196
|
|
|
1189
1197
|
/**
|
|
@@ -1223,6 +1231,15 @@ export interface RuntimeInput {
|
|
|
1223
1231
|
runtime: string
|
|
1224
1232
|
}
|
|
1225
1233
|
|
|
1234
|
+
/**
|
|
1235
|
+
* A workspace file that starts with `#!`, with its header (see
|
|
1236
|
+
* `read_shebang_header`).
|
|
1237
|
+
*/
|
|
1238
|
+
export interface ShebangFile {
|
|
1239
|
+
file: string
|
|
1240
|
+
header: string
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1226
1243
|
/**
|
|
1227
1244
|
* One resolved socket location, and everything `daemon/tmp-dir.ts` needs to
|
|
1228
1245
|
* explain it. Every user-facing sentence is rendered on the TypeScript side,
|
package/dist/src/native/index.js
CHANGED
|
@@ -209,7 +209,12 @@ Module._load = function (request, parent, isMain) {
|
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
const indexModulePath = require.resolve('./native-bindings.js');
|
|
212
|
-
|
|
212
|
+
// Absent on Node 22.15–22.22.2 and 24.0–24.11.0 under a `module.registerHooks()`
|
|
213
|
+
// load hook (Playwright 1.64): node evaluates CJS imported from ESM with its
|
|
214
|
+
// internal loader there.
|
|
215
|
+
if (require.cache) {
|
|
216
|
+
delete require.cache[indexModulePath];
|
|
217
|
+
}
|
|
213
218
|
// A direct re-export: node's CommonJS export lexer follows this form, so ESM
|
|
214
219
|
// importers see the named exports. Assigning via a variable hides them.
|
|
215
220
|
module.exports = require('./native-bindings.js');
|
|
@@ -642,6 +642,7 @@ module.exports.matchGlobPaths = nativeBinding.matchGlobPaths
|
|
|
642
642
|
module.exports.matchOutputPaths = nativeBinding.matchOutputPaths
|
|
643
643
|
module.exports.openUrl = nativeBinding.openUrl
|
|
644
644
|
module.exports.parseTaskStatus = nativeBinding.parseTaskStatus
|
|
645
|
+
module.exports.readShebangHeaders = nativeBinding.readShebangHeaders
|
|
645
646
|
module.exports.remove = nativeBinding.remove
|
|
646
647
|
module.exports.resolveDaemonSocketPath = nativeBinding.resolveDaemonSocketPath
|
|
647
648
|
module.exports.resolveForkedProcessSocketPath = nativeBinding.resolveForkedProcessSocketPath
|
|
Binary file
|
|
Binary file
|
|
@@ -50,7 +50,6 @@ async function createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, li
|
|
|
50
50
|
// `outputStyle` does not reach them; it merges under its own name.
|
|
51
51
|
nxArgs.specifiedOutputStyle, nxArgs.resolvedOutputStyle ?? 'static-failures-only', fullTaskGraph);
|
|
52
52
|
await orchestrator.init();
|
|
53
|
-
orchestrator.processAllScheduledTasks();
|
|
54
53
|
return orchestrator;
|
|
55
54
|
}
|
|
56
55
|
// A client bundle built before edges became objects hands plain task ids
|
|
@@ -89,6 +88,8 @@ ultracacheConfigurations) {
|
|
|
89
88
|
nextBatch = orchestrator.nextBatch();
|
|
90
89
|
}
|
|
91
90
|
const discreteTasks = tasks.filter((task) => !batchTasks.has(task.id));
|
|
91
|
+
// Every task here starts directly, but the schedule hashes only the tasks it admits
|
|
92
|
+
orchestrator.processTasks(discreteTasks.map((task) => task.id));
|
|
92
93
|
// Bulk-resolve every discrete task's cache state in one shot —
|
|
93
94
|
// single SQL call plus parallel remote retrievals. Batches kicked
|
|
94
95
|
// off above continue running concurrently while we await this.
|
|
@@ -115,6 +116,7 @@ async function runContinuousTasks(tasks, projectGraph, fullTaskGraph, nxJson, li
|
|
|
115
116
|
/** The set to hash from, e.g. from `importUltracacheConfigurations`; omitted hashes natively. */
|
|
116
117
|
ultracacheConfigurations) {
|
|
117
118
|
const orchestrator = await createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle, ultracacheConfigurations);
|
|
119
|
+
orchestrator.processTasks(tasks.map((task) => task.id));
|
|
118
120
|
const runningTasks = tasks.reduce((current, task, index) => {
|
|
119
121
|
current[task.id] = orchestrator.startContinuousTask(task, index);
|
|
120
122
|
return current;
|
|
@@ -103,6 +103,7 @@ export declare class TaskOrchestrator {
|
|
|
103
103
|
private scheduleAfterReadiness;
|
|
104
104
|
private processTask;
|
|
105
105
|
processAllScheduledTasks(): void;
|
|
106
|
+
processTasks(taskIds: string[]): void;
|
|
106
107
|
/**
|
|
107
108
|
* Registers a task invocation and checks for loops across nested Nx
|
|
108
109
|
* processes. registerTask() returns the invocation chain only when an
|
|
@@ -240,8 +241,8 @@ export declare class TaskOrchestrator {
|
|
|
240
241
|
* for running those via {@link runTaskDirectly}.
|
|
241
242
|
*
|
|
242
243
|
* Fires scheduleTask lifecycle for hits that haven't been through
|
|
243
|
-
*
|
|
244
|
-
*
|
|
244
|
+
* processTasks yet. That's a coordinator gap-filler and a no-op for
|
|
245
|
+
* callers that process their tasks first.
|
|
245
246
|
*
|
|
246
247
|
* The caller provides `groupId` — cache hits share one slot since they
|
|
247
248
|
* don't actually compete for parallelism.
|
|
@@ -382,7 +382,10 @@ class TaskOrchestrator {
|
|
|
382
382
|
}
|
|
383
383
|
processAllScheduledTasks() {
|
|
384
384
|
const { scheduledTasks } = this.tasksSchedule.getAllScheduledTasks();
|
|
385
|
-
|
|
385
|
+
this.processTasks(scheduledTasks);
|
|
386
|
+
}
|
|
387
|
+
processTasks(taskIds) {
|
|
388
|
+
for (const taskId of taskIds) {
|
|
386
389
|
// Task is already handled or being handled
|
|
387
390
|
if (!this.processedTasks.has(taskId)) {
|
|
388
391
|
this.processedTasks.set(taskId, this.processTask(taskId));
|
|
@@ -1001,8 +1004,8 @@ class TaskOrchestrator {
|
|
|
1001
1004
|
* for running those via {@link runTaskDirectly}.
|
|
1002
1005
|
*
|
|
1003
1006
|
* Fires scheduleTask lifecycle for hits that haven't been through
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
1007
|
+
* processTasks yet. That's a coordinator gap-filler and a no-op for
|
|
1008
|
+
* callers that process their tasks first.
|
|
1006
1009
|
*
|
|
1007
1010
|
* The caller provides `groupId` — cache hits share one slot since they
|
|
1008
1011
|
* don't actually compete for parallelism.
|
|
@@ -1021,7 +1024,7 @@ class TaskOrchestrator {
|
|
|
1021
1024
|
return [];
|
|
1022
1025
|
// scheduleTask lifecycle for hits the coordinator resolved before
|
|
1023
1026
|
// processAllScheduledTasks could fire it. No-op for callers that
|
|
1024
|
-
// already ran
|
|
1027
|
+
// already ran processTasks (every hit is in processedTasks).
|
|
1025
1028
|
await Promise.all(cacheHits
|
|
1026
1029
|
.filter(({ task }) => !this.processedTasks.has(task.id))
|
|
1027
1030
|
.map(({ task }) => this.options.lifeCycle.scheduleTask(task)));
|
|
@@ -1307,6 +1310,8 @@ class TaskOrchestrator {
|
|
|
1307
1310
|
async startContinuousTask(task, groupId) {
|
|
1308
1311
|
if (this.runningTasksService &&
|
|
1309
1312
|
this.runningTasksService.getRunningTasks([task.id]).length) {
|
|
1313
|
+
// This branch never reads the hash, so a failure to compute it is dropped
|
|
1314
|
+
void this.processedTasks.get(task.id)?.catch(() => { });
|
|
1310
1315
|
let readyWhen;
|
|
1311
1316
|
let uncheckedReason;
|
|
1312
1317
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "24.0.0
|
|
3
|
+
"version": "24.0.0",
|
|
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.",
|
|
@@ -150,16 +150,16 @@
|
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
"optionalDependencies": {
|
|
153
|
-
"@nx/nx-darwin-arm64": "24.0.0
|
|
154
|
-
"@nx/nx-darwin-x64": "24.0.0
|
|
155
|
-
"@nx/nx-freebsd-x64": "24.0.0
|
|
156
|
-
"@nx/nx-linux-arm-gnueabihf": "24.0.0
|
|
157
|
-
"@nx/nx-linux-arm64-gnu": "24.0.0
|
|
158
|
-
"@nx/nx-linux-arm64-musl": "24.0.0
|
|
159
|
-
"@nx/nx-linux-x64-gnu": "24.0.0
|
|
160
|
-
"@nx/nx-linux-x64-musl": "24.0.0
|
|
161
|
-
"@nx/nx-win32-arm64-msvc": "24.0.0
|
|
162
|
-
"@nx/nx-win32-x64-msvc": "24.0.0
|
|
153
|
+
"@nx/nx-darwin-arm64": "24.0.0",
|
|
154
|
+
"@nx/nx-darwin-x64": "24.0.0",
|
|
155
|
+
"@nx/nx-freebsd-x64": "24.0.0",
|
|
156
|
+
"@nx/nx-linux-arm-gnueabihf": "24.0.0",
|
|
157
|
+
"@nx/nx-linux-arm64-gnu": "24.0.0",
|
|
158
|
+
"@nx/nx-linux-arm64-musl": "24.0.0",
|
|
159
|
+
"@nx/nx-linux-x64-gnu": "24.0.0",
|
|
160
|
+
"@nx/nx-linux-x64-musl": "24.0.0",
|
|
161
|
+
"@nx/nx-win32-arm64-msvc": "24.0.0",
|
|
162
|
+
"@nx/nx-win32-x64-msvc": "24.0.0"
|
|
163
163
|
},
|
|
164
164
|
"nx-migrations": {
|
|
165
165
|
"migrations": "./migrations.json",
|