nx 24.0.6 → 24.1.0-beta.1
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/init-local.js +2 -4
- package/dist/bin/nx-cloud.js +2 -1
- package/dist/bin/nx.js +12 -14
- package/dist/bin/run-executor.js +5 -0
- package/dist/src/adapter/compat.d.ts +1 -1
- package/dist/src/adapter/compat.js +1 -0
- package/dist/src/adapter/ngcli-adapter.js +7 -20
- package/dist/src/command-line/completion/scripts/bash.sh +9 -2
- package/dist/src/command-line/completion/scripts/fish.fish +10 -2
- package/dist/src/command-line/completion/scripts/zsh.zsh +8 -2
- package/dist/src/command-line/completion/scripts.js +18 -8
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +0 -1
- package/dist/src/command-line/conformance/command-object.d.ts +3 -0
- package/dist/src/command-line/conformance/command-object.js +66 -0
- package/dist/src/command-line/generate/generate.js +14 -27
- package/dist/src/command-line/generate/generator-utils.d.ts +1 -0
- package/dist/src/command-line/generate/generator-utils.js +9 -0
- package/dist/src/command-line/graph/graph.js +1 -7
- package/dist/src/command-line/import/import.js +26 -2
- package/dist/src/command-line/import/utils/ai-output.d.ts +9 -1
- package/dist/src/command-line/import/utils/ai-output.js +20 -1
- package/dist/src/command-line/import/utils/prepare-source-repo.js +0 -3
- package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +2 -2
- package/dist/src/command-line/init/init-v2.js +2 -2
- package/dist/src/command-line/migrate/migrate.js +1 -4
- package/dist/src/command-line/migrate/prompt-files.js +5 -5
- package/dist/src/command-line/migrate/run/orchestrator.js +2 -3
- package/dist/src/command-line/migrate/run/worker.js +7 -5
- package/dist/src/command-line/migrate/run-migration-process.js +3 -2
- package/dist/src/command-line/nx-commands.d.ts +1 -1
- package/dist/src/command-line/nx-commands.js +82 -132
- package/dist/src/command-line/release/changelog.js +8 -39
- package/dist/src/command-line/release/command-object.d.ts +1 -0
- package/dist/src/command-line/release/command-object.js +4 -0
- package/dist/src/command-line/release/config/use-legacy-versioning.js +1 -1
- package/dist/src/command-line/release/release.js +6 -4
- package/dist/src/command-line/release/utils/diff.js +0 -14
- package/dist/src/command-line/release/utils/git.js +1 -1
- package/dist/src/command-line/release/utils/resolve-nx-json-error-message.js +2 -24
- package/dist/src/command-line/report/report.js +1 -1
- package/dist/src/command-line/run/executor-utils.js +1 -1
- package/dist/src/command-line/show/show-target/utils.js +1 -1
- package/dist/src/command-line/watch/watch.js +1 -1
- package/dist/src/commands-runner/get-command-projects.js +0 -3
- package/dist/src/config/misc-interfaces.d.ts +0 -1
- package/dist/src/config/nx-json.d.ts +117 -0
- package/dist/src/config/workspace-json-project-json.d.ts +6 -7
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/styles.css +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +13 -20
- package/dist/src/devkit-exports.d.ts +1 -1
- package/dist/src/devkit-internals.d.ts +11 -4
- package/dist/src/devkit-internals.js +27 -5
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +1 -1
- package/dist/src/executors/run-commands/run-commands.impl.js +35 -13
- package/dist/src/hasher/hash-task.js +4 -4
- package/dist/src/hasher/task-hasher.js +2 -2
- package/dist/src/migrations/update-24-1-0/replace-powerpack-conformance.d.ts +4 -0
- package/dist/src/migrations/update-24-1-0/replace-powerpack-conformance.js +117 -0
- package/dist/src/migrations/update-24-1-0/replace-powerpack-conformance.md +38 -0
- package/dist/src/native/index.d.ts +6 -4
- package/dist/src/native/index.js +5 -0
- 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/native/transform-objects.d.ts +2 -0
- package/dist/src/native/transform-objects.js +15 -0
- package/dist/src/nx-cloud/utilities/environment.js +0 -17
- package/dist/src/plugins/js/lock-file/bun-parser.d.ts +1 -2
- package/dist/src/plugins/js/lock-file/bun-parser.js +5 -5
- package/dist/src/plugins/js/lock-file/lock-file-names.d.ts +6 -0
- package/dist/src/plugins/js/lock-file/lock-file-names.js +16 -0
- package/dist/src/plugins/js/lock-file/lock-file.d.ts +1 -2
- package/dist/src/plugins/js/lock-file/lock-file.js +24 -31
- package/dist/src/plugins/js/lock-file/npm-parser.js +1 -2
- package/dist/src/plugins/js/project-graph/affected/npm-packages.js +50 -2
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +5 -0
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +75 -13
- package/dist/src/plugins/js/utils/get-workspace-packages-from-graph.js +1 -1
- package/dist/src/plugins/js/utils/register.js +13 -6
- package/dist/src/project-graph/affected/affected-tasks.js +1 -1
- package/dist/src/project-graph/build-project-graph.js +5 -2
- package/dist/src/project-graph/nx-deps-cache.d.ts +3 -2
- package/dist/src/project-graph/nx-deps-cache.js +8 -2
- package/dist/src/project-graph/utils/project-graph-paths.d.ts +8 -0
- package/dist/src/project-graph/utils/project-graph-paths.js +170 -0
- package/dist/src/tasks-runner/batch/run-batch.js +3 -13
- package/dist/src/tasks-runner/cache.js +19 -18
- package/dist/src/tasks-runner/run-command.js +12 -10
- package/dist/src/tasks-runner/task-orchestrator.d.ts +1 -0
- package/dist/src/tasks-runner/task-orchestrator.js +14 -3
- package/dist/src/tasks-runner/utils.js +1 -12
- package/dist/src/ultracache/overrides.js +1 -1
- package/dist/src/utils/child-process.js +2 -1
- package/dist/src/utils/code-frames.js +0 -1
- package/dist/src/utils/db-connection.js +6 -4
- package/dist/src/utils/find-workspace-root.js +2 -4
- package/dist/src/utils/git-utils.d.ts +5 -0
- package/dist/src/utils/git-utils.js +23 -1
- package/dist/src/utils/handle-import.js +6 -0
- package/dist/src/utils/installation-directory.d.ts +16 -0
- package/dist/src/utils/installation-directory.js +96 -2
- package/dist/src/utils/json.d.ts +7 -0
- package/dist/src/utils/json.js +27 -0
- package/dist/src/utils/min-release-age/behavior/pnpm.js +9 -9
- package/dist/src/utils/min-release-age/behavior/yarn.js +2 -2
- package/dist/src/utils/nx-key.js +11 -8
- package/dist/src/utils/output.d.ts +5 -0
- package/dist/src/utils/output.js +11 -4
- package/dist/src/utils/owned-private-dir.d.ts +10 -0
- package/dist/src/utils/owned-private-dir.js +28 -0
- package/dist/src/utils/plugins/output.js +0 -2
- package/dist/src/utils/require-nx-key.js +6 -4
- package/dist/src/utils/workspace-root.d.ts +12 -0
- package/dist/src/utils/workspace-root.js +56 -7
- package/migrations.json +6 -0
- package/package.json +14 -12
- package/schemas/nx-schema.json +75 -9
- package/schemas/project-schema.json +5 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
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
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.resolveStartupHost = exports.safeSpawn = exports.safeExecFileSync = exports.workspaceRootInner = exports.setWorkspaceRoot = void 0;
|
|
4
|
+
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.pathExists = exports.getPath = exports.findFilesWithDynamicImports = exports.findFilesInCircularPath = exports.expandIgnoredCircularDependencies = exports.circularPathHasPair = exports.checkCircularPath = exports.computeJsonLineNumbers = exports.handleErrors = 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.preventRecursionInGraphConstruction = exports.handleProjectGraphError = exports.createProjectGraphAndSourceMapsAsync = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.isNpmProject = exports.findClosestMatches = exports.readSourceMapsCache = 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.transformProjectGraphForProjectMatching = exports.unmatchedProjectPatterns = exports.readShebangHeaders = exports.killProcessTreeGraceful = exports.isAiAgent = exports.getTargetInputs = exports.filterUsingGlobPatterns = exports.hashFile = exports.getRelativeProjectJsonSchemaPath = exports.flushChanges = exports.FsTree = exports.normalizeRunCommandsArgs = exports.interpolateArgsIntoCommand = exports.LARGE_BUFFER = exports.daemonClient = void 0;
|
|
6
|
+
exports.isNxCloudUsed = exports.getNxCloudUrl = exports.orange = exports.NX_PREFIX = exports.getNxRequirePaths = exports.isGlobPattern = exports.combineGlobPatterns = exports.getVcsRemoteInfo = 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 = 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.createFileMapUsingProjectGraph = exports.readCachedProjectConfiguration = void 0;
|
|
7
|
+
exports.resolveStartupHost = exports.safeSpawn = exports.safeExecFileSync = exports.workspaceRootInner = exports.setWorkspaceRoot = 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 = 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
|
|
@@ -133,6 +133,18 @@ var spinner_1 = require("./utils/spinner");
|
|
|
133
133
|
Object.defineProperty(exports, "globalSpinner", { enumerable: true, get: function () { return spinner_1.globalSpinner; } });
|
|
134
134
|
var exit_codes_1 = require("./utils/exit-codes");
|
|
135
135
|
Object.defineProperty(exports, "signalToCode", { enumerable: true, get: function () { return exit_codes_1.signalToCode; } });
|
|
136
|
+
var handle_errors_1 = require("./utils/handle-errors");
|
|
137
|
+
Object.defineProperty(exports, "handleErrors", { enumerable: true, get: function () { return handle_errors_1.handleErrors; } });
|
|
138
|
+
var json_1 = require("./utils/json");
|
|
139
|
+
Object.defineProperty(exports, "computeJsonLineNumbers", { enumerable: true, get: function () { return json_1.computeJsonLineNumbers; } });
|
|
140
|
+
var project_graph_paths_1 = require("./project-graph/utils/project-graph-paths");
|
|
141
|
+
Object.defineProperty(exports, "checkCircularPath", { enumerable: true, get: function () { return project_graph_paths_1.checkCircularPath; } });
|
|
142
|
+
Object.defineProperty(exports, "circularPathHasPair", { enumerable: true, get: function () { return project_graph_paths_1.circularPathHasPair; } });
|
|
143
|
+
Object.defineProperty(exports, "expandIgnoredCircularDependencies", { enumerable: true, get: function () { return project_graph_paths_1.expandIgnoredCircularDependencies; } });
|
|
144
|
+
Object.defineProperty(exports, "findFilesInCircularPath", { enumerable: true, get: function () { return project_graph_paths_1.findFilesInCircularPath; } });
|
|
145
|
+
Object.defineProperty(exports, "findFilesWithDynamicImports", { enumerable: true, get: function () { return project_graph_paths_1.findFilesWithDynamicImports; } });
|
|
146
|
+
Object.defineProperty(exports, "getPath", { enumerable: true, get: function () { return project_graph_paths_1.getPath; } });
|
|
147
|
+
Object.defineProperty(exports, "pathExists", { enumerable: true, get: function () { return project_graph_paths_1.pathExists; } });
|
|
136
148
|
var handle_import_1 = require("./utils/handle-import");
|
|
137
149
|
Object.defineProperty(exports, "handleImport", { enumerable: true, get: function () { return handle_import_1.handleImport; } });
|
|
138
150
|
var plugin_cache_utils_1 = require("./utils/plugin-cache-utils");
|
|
@@ -182,6 +194,7 @@ Object.defineProperty(exports, "interpolateArgsIntoCommand", { enumerable: true,
|
|
|
182
194
|
Object.defineProperty(exports, "normalizeRunCommandsArgs", { enumerable: true, get: function () { return run_commands_impl_2.normalizeArgs; } });
|
|
183
195
|
var tree_1 = require("./generators/tree");
|
|
184
196
|
Object.defineProperty(exports, "FsTree", { enumerable: true, get: function () { return tree_1.FsTree; } });
|
|
197
|
+
Object.defineProperty(exports, "flushChanges", { enumerable: true, get: function () { return tree_1.flushChanges; } });
|
|
185
198
|
var project_configuration_1 = require("./generators/utils/project-configuration");
|
|
186
199
|
Object.defineProperty(exports, "getRelativeProjectJsonSchemaPath", { enumerable: true, get: function () { return project_configuration_1.getRelativeProjectJsonSchemaPath; } });
|
|
187
200
|
var file_hasher_2 = require("./hasher/file-hasher");
|
|
@@ -193,6 +206,9 @@ var native_1 = require("./native");
|
|
|
193
206
|
Object.defineProperty(exports, "isAiAgent", { enumerable: true, get: function () { return native_1.isAiAgent; } });
|
|
194
207
|
Object.defineProperty(exports, "killProcessTreeGraceful", { enumerable: true, get: function () { return native_1.killProcessTreeGraceful; } });
|
|
195
208
|
Object.defineProperty(exports, "readShebangHeaders", { enumerable: true, get: function () { return native_1.readShebangHeaders; } });
|
|
209
|
+
Object.defineProperty(exports, "unmatchedProjectPatterns", { enumerable: true, get: function () { return native_1.unmatchedProjectPatterns; } });
|
|
210
|
+
var transform_objects_1 = require("./native/transform-objects");
|
|
211
|
+
Object.defineProperty(exports, "transformProjectGraphForProjectMatching", { enumerable: true, get: function () { return transform_objects_1.transformProjectGraphForProjectMatching; } });
|
|
196
212
|
var kill_child_on_host_exit_1 = require("./utils/kill-child-on-host-exit");
|
|
197
213
|
Object.defineProperty(exports, "killChildOnHostExit", { enumerable: true, get: function () { return kill_child_on_host_exit_1.killChildOnHostExit; } });
|
|
198
214
|
var connect_to_nx_cloud_1 = require("./nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
|
|
@@ -234,6 +250,9 @@ Object.defineProperty(exports, "isWholeFileChange", { enumerable: true, get: fun
|
|
|
234
250
|
Object.defineProperty(exports, "readPackageJson", { enumerable: true, get: function () { return file_utils_1.readPackageJson; } });
|
|
235
251
|
var nx_deps_cache_1 = require("./project-graph/nx-deps-cache");
|
|
236
252
|
Object.defineProperty(exports, "readFileMapCache", { enumerable: true, get: function () { return nx_deps_cache_1.readFileMapCache; } });
|
|
253
|
+
Object.defineProperty(exports, "readSourceMapsCache", { enumerable: true, get: function () { return nx_deps_cache_1.readSourceMapsCache; } });
|
|
254
|
+
var string_similarity_1 = require("./utils/string-similarity");
|
|
255
|
+
Object.defineProperty(exports, "findClosestMatches", { enumerable: true, get: function () { return string_similarity_1.findClosestMatches; } });
|
|
237
256
|
var operators_1 = require("./project-graph/operators");
|
|
238
257
|
Object.defineProperty(exports, "isNpmProject", { enumerable: true, get: function () { return operators_1.isNpmProject; } });
|
|
239
258
|
var project_graph_2 = require("./project-graph/project-graph");
|
|
@@ -242,6 +261,8 @@ Object.defineProperty(exports, "createProjectGraphAndSourceMapsAsync", { enumera
|
|
|
242
261
|
Object.defineProperty(exports, "handleProjectGraphError", { enumerable: true, get: function () { return project_graph_2.handleProjectGraphError; } });
|
|
243
262
|
Object.defineProperty(exports, "preventRecursionInGraphConstruction", { enumerable: true, get: function () { return project_graph_2.preventRecursionInGraphConstruction; } });
|
|
244
263
|
Object.defineProperty(exports, "readCachedProjectConfiguration", { enumerable: true, get: function () { return project_graph_2.readCachedProjectConfiguration; } });
|
|
264
|
+
var file_map_utils_1 = require("./project-graph/file-map-utils");
|
|
265
|
+
Object.defineProperty(exports, "createFileMapUsingProjectGraph", { enumerable: true, get: function () { return file_map_utils_1.createFileMapUsingProjectGraph; } });
|
|
245
266
|
var cache_1 = require("./tasks-runner/cache");
|
|
246
267
|
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return cache_1.Cache; } });
|
|
247
268
|
var default_tasks_runner_1 = require("./tasks-runner/default-tasks-runner");
|
|
@@ -257,7 +278,7 @@ Object.defineProperty(exports, "expandDependencyConfigSyntaxSugar", { enumerable
|
|
|
257
278
|
Object.defineProperty(exports, "expandInitiatingTasksThroughNoop", { enumerable: true, get: function () { return utils_2.expandInitiatingTasksThroughNoop; } });
|
|
258
279
|
Object.defineProperty(exports, "expandWildcardTargetConfiguration", { enumerable: true, get: function () { return utils_2.expandWildcardTargetConfiguration; } });
|
|
259
280
|
Object.defineProperty(exports, "getCliPath", { enumerable: true, get: function () { return utils_2.getCliPath; } });
|
|
260
|
-
// TODO(v25): remove custom hasher support.
|
|
281
|
+
// TODO(v25): remove custom hasher support (NXC-5052).
|
|
261
282
|
Object.defineProperty(exports, "getCustomHasher", { enumerable: true, get: function () { return utils_2.getCustomHasher; } });
|
|
262
283
|
Object.defineProperty(exports, "getDependencyConfigs", { enumerable: true, get: function () { return utils_2.getDependencyConfigs; } });
|
|
263
284
|
Object.defineProperty(exports, "getExecutorForTask", { enumerable: true, get: function () { return utils_2.getExecutorForTask; } });
|
|
@@ -295,6 +316,7 @@ Object.defineProperty(exports, "isRelativePath", { enumerable: true, get: functi
|
|
|
295
316
|
Object.defineProperty(exports, "readFileIfExisting", { enumerable: true, get: function () { return fileutils_2.readFileIfExisting; } });
|
|
296
317
|
var git_utils_1 = require("./utils/git-utils");
|
|
297
318
|
Object.defineProperty(exports, "getLatestCommitSha", { enumerable: true, get: function () { return git_utils_1.getLatestCommitSha; } });
|
|
319
|
+
Object.defineProperty(exports, "getVcsRemoteInfo", { enumerable: true, get: function () { return git_utils_1.getVcsRemoteInfo; } });
|
|
298
320
|
var globs_1 = require("./utils/globs");
|
|
299
321
|
Object.defineProperty(exports, "combineGlobPatterns", { enumerable: true, get: function () { return globs_1.combineGlobPatterns; } });
|
|
300
322
|
Object.defineProperty(exports, "isGlobPattern", { enumerable: true, get: function () { return globs_1.isGlobPattern; } });
|
|
@@ -56,7 +56,7 @@ export default function (options: RunCommandsOptions, context: ExecutorContext):
|
|
|
56
56
|
success: boolean;
|
|
57
57
|
terminalOutput: string;
|
|
58
58
|
}>;
|
|
59
|
-
export declare function runCommands(options: RunCommandsOptions, context: ExecutorContext, task?: Pick<Task, 'id' | 'ultracache' | 'continuous'>, baseEnv?: NodeJS.ProcessEnv): Promise<NoopChildProcess | ParallelRunningTasks | import("../../tasks-runner/pseudo-terminal").PseudoTtyProcess | SeriallyRunningTasks>;
|
|
59
|
+
export declare function runCommands(options: RunCommandsOptions, context: ExecutorContext, task?: Pick<Task, 'id' | 'ultracache' | 'continuous'>, baseEnv?: NodeJS.ProcessEnv, warn?: (message: string) => void): Promise<NoopChildProcess | ParallelRunningTasks | import("../../tasks-runner/pseudo-terminal").PseudoTtyProcess | SeriallyRunningTasks>;
|
|
60
60
|
/** The options `interpolateArgsIntoCommand` reads, from the task's options. */
|
|
61
61
|
export declare function normalizeArgs(options: RunCommandsOptions): Pick<NormalizedRunCommandsOptions, 'args' | 'parsedArgs' | '__unparsed__' | 'unknownOptions' | 'unparsedCommandArgs'>;
|
|
62
62
|
export declare function interpolateArgsIntoCommand(command: string, opts: Pick<NormalizedRunCommandsOptions, 'args' | 'parsedArgs' | '__unparsed__' | 'unknownOptions' | 'unparsedCommandArgs'>, forwardAllArgs: boolean, env?: () => NodeJS.ProcessEnv): string;
|
|
@@ -13,6 +13,7 @@ const tokens_1 = require("../../tasks-runner/tokens");
|
|
|
13
13
|
const utils_1 = require("../../tasks-runner/utils");
|
|
14
14
|
const noop_child_process_1 = require("../../tasks-runner/running-tasks/noop-child-process");
|
|
15
15
|
const running_tasks_1 = require("./running-tasks");
|
|
16
|
+
const logger_1 = require("../../utils/logger");
|
|
16
17
|
const shell_quoting_1 = require("../../utils/shell-quoting");
|
|
17
18
|
exports.LARGE_BUFFER = 1024 * 1000000;
|
|
18
19
|
const propKeys = [
|
|
@@ -23,6 +24,7 @@ const propKeys = [
|
|
|
23
24
|
'parallel',
|
|
24
25
|
'no-parallel',
|
|
25
26
|
'readyWhen',
|
|
27
|
+
'readyWhenStatus',
|
|
26
28
|
'cwd',
|
|
27
29
|
'args',
|
|
28
30
|
'envFile',
|
|
@@ -42,9 +44,13 @@ async function default_1(options, context) {
|
|
|
42
44
|
success: results.code === 0,
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
|
-
async function runCommands(options, context, task, baseEnv) {
|
|
47
|
+
async function runCommands(options, context, task, baseEnv, warn = (message) => logger_1.logger.warn(message)) {
|
|
48
|
+
// The orchestrator's in-process path passes the task with a stub context,
|
|
49
|
+
// so prefer it.
|
|
50
|
+
const resolvedTaskId = task?.id ??
|
|
51
|
+
(0, utils_1.createTaskId)(context.projectName, context.targetName, context.configurationName);
|
|
46
52
|
let env;
|
|
47
|
-
const normalized = normalizeOptions(options, () => (env ??= (0, running_tasks_1.processEnv)(options.color, (0, running_tasks_1.calculateCwd)(options.cwd, context), options.env ?? {}, options.envFile, baseEnv)));
|
|
53
|
+
const normalized = normalizeOptions(options, () => (env ??= (0, running_tasks_1.processEnv)(options.color, (0, running_tasks_1.calculateCwd)(options.cwd, context), options.env ?? {}, options.envFile, baseEnv)), resolvedTaskId, warn);
|
|
48
54
|
if (normalized.readyWhenStatus.length && !normalized.parallel) {
|
|
49
55
|
throw new Error('ERROR: Bad executor config for run-commands - "readyWhen" can only be used when "parallel=true".');
|
|
50
56
|
}
|
|
@@ -65,13 +71,9 @@ async function runCommands(options, context, task, baseEnv) {
|
|
|
65
71
|
normalized.usePty;
|
|
66
72
|
const tuiEnabled = (0, is_tui_enabled_1.isTuiEnabled)();
|
|
67
73
|
try {
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
// and only then is the config unknowable, which counts as tracked and
|
|
72
|
-
// discrete.
|
|
73
|
-
const resolvedTaskId = task?.id ??
|
|
74
|
-
(0, utils_1.createTaskId)(context.projectName, context.targetName, context.configurationName);
|
|
74
|
+
// `runExecutor` can name a target the task graph does not hold, hence the
|
|
75
|
+
// project lookup; `convert-nx-executor` has neither graph, and only then
|
|
76
|
+
// is the config unknowable, which counts as tracked and discrete.
|
|
75
77
|
// `projectGraph` is typed as present, but `convert-nx-executor` passes
|
|
76
78
|
// null for both graphs.
|
|
77
79
|
const targetConfiguration = context.projectName && context.targetName
|
|
@@ -101,7 +103,7 @@ async function runCommands(options, context, task, baseEnv) {
|
|
|
101
103
|
throw new Error(`ERROR: Something went wrong in run-commands - ${e.message}`);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
function normalizeOptions(options, env) {
|
|
106
|
+
function normalizeOptions(options, env, taskId, warn) {
|
|
105
107
|
if (options.readyWhen && typeof options.readyWhen === 'string') {
|
|
106
108
|
options.readyWhenStatus = [
|
|
107
109
|
{ stringToMatch: options.readyWhen, found: false },
|
|
@@ -128,10 +130,21 @@ function normalizeOptions(options, env) {
|
|
|
128
130
|
options.commands = options.commands.map((c) => typeof c === 'string' ? { command: c } : c);
|
|
129
131
|
}
|
|
130
132
|
Object.assign(options, normalizeArgs(options));
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
const normalized = options;
|
|
134
|
+
let forwardsUnknownOptions = false;
|
|
135
|
+
normalized.commands.forEach((c) => {
|
|
136
|
+
const forwardAllArgs = c.forwardAllArgs ?? options.forwardAllArgs ?? true;
|
|
137
|
+
forwardsUnknownOptions ||=
|
|
138
|
+
c.command.indexOf('{args.') === -1 &&
|
|
139
|
+
(c.command.indexOf('{args}') > -1 || forwardAllArgs);
|
|
140
|
+
c.command = interpolateArgsIntoCommand(c.command, normalized, forwardAllArgs, env);
|
|
133
141
|
});
|
|
134
|
-
|
|
142
|
+
if (forwardsUnknownOptions) {
|
|
143
|
+
for (const option of droppedUnknownOptions(normalized)) {
|
|
144
|
+
warn(`Option "${option}" was not forwarded to the command for ${taskId} because its value is an object or array. Use "args" to pass extra values to the command.`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return normalized;
|
|
135
148
|
}
|
|
136
149
|
/** The options `interpolateArgsIntoCommand` reads, from the task's options. */
|
|
137
150
|
function normalizeArgs(options) {
|
|
@@ -205,6 +218,15 @@ function interpolateArgsIntoCommand(command, opts, forwardAllArgs, env = () => p
|
|
|
205
218
|
return command;
|
|
206
219
|
}
|
|
207
220
|
}
|
|
221
|
+
// `null` unsets an option, so it is skipped without a warning. A dotted flag
|
|
222
|
+
// such as `--a.b=1` reaches the command through `__unparsed__`.
|
|
223
|
+
function droppedUnknownOptions(opts) {
|
|
224
|
+
const unparsedKeys = Object.keys(opts.unparsedCommandArgs ?? {});
|
|
225
|
+
return Object.keys(opts.unknownOptions ?? {}).filter((k) => typeof opts.unknownOptions[k] === 'object' &&
|
|
226
|
+
opts.unknownOptions[k] !== null &&
|
|
227
|
+
opts.parsedArgs[k] === opts.unknownOptions[k] &&
|
|
228
|
+
!unparsedKeys.some((u) => u.startsWith(`${k}.`)));
|
|
229
|
+
}
|
|
208
230
|
function unknownOptionsToArgsArray(opts) {
|
|
209
231
|
return Object.keys(opts.unknownOptions ?? {})
|
|
210
232
|
.filter((k) => typeof opts.unknownOptions[k] !== 'object' &&
|
|
@@ -9,7 +9,7 @@ const native_1 = require("../native");
|
|
|
9
9
|
const project_graph_1 = require("../project-graph/project-graph");
|
|
10
10
|
const task_io_service_1 = require("../tasks-runner/task-io-service");
|
|
11
11
|
const task_env_1 = require("../tasks-runner/task-env");
|
|
12
|
-
// TODO(v25): remove custom hasher support.
|
|
12
|
+
// TODO(v25): remove custom hasher support (NXC-5052).
|
|
13
13
|
const utils_1 = require("../tasks-runner/utils");
|
|
14
14
|
const db_connection_1 = require("../utils/db-connection");
|
|
15
15
|
const task_hasher_1 = require("./task-hasher");
|
|
@@ -33,7 +33,7 @@ async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGrap
|
|
|
33
33
|
? new Set((0, native_1.getUltracacheDeferredTaskIds)(ultracacheConfigurations, taskGraph))
|
|
34
34
|
: null;
|
|
35
35
|
const tasks = Object.values(taskGraph.tasks);
|
|
36
|
-
// TODO(v25): remove custom hasher support.
|
|
36
|
+
// TODO(v25): remove custom hasher support (NXC-5052).
|
|
37
37
|
const tasksWithHashers = await Promise.all(tasks.map(async (task) => {
|
|
38
38
|
const customHasher = (0, utils_1.getCustomHasher)(task, projects);
|
|
39
39
|
return { task, customHasher };
|
|
@@ -83,7 +83,7 @@ function readsDependencyOutputs(task, taskGraph, projectGraph, nxJson) {
|
|
|
83
83
|
async function hashTask(hasher, projectGraph, taskGraph, task, env, taskDetails) {
|
|
84
84
|
performance.mark('hashSingleTask:start');
|
|
85
85
|
const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
|
86
|
-
// TODO(v25): remove custom hasher support.
|
|
86
|
+
// TODO(v25): remove custom hasher support (NXC-5052).
|
|
87
87
|
const customHasher = (0, utils_1.getCustomHasher)(task, projectsConfigurations.projects);
|
|
88
88
|
const { value, details, inputs } = await (customHasher
|
|
89
89
|
? customHasher(task, {
|
|
@@ -129,7 +129,7 @@ async function hashTasks(hasher, projectGraph, taskGraph, perTaskEnvs, taskDetai
|
|
|
129
129
|
const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
|
130
130
|
const nxJson = (0, nx_json_1.readNxJson)();
|
|
131
131
|
const tasks = (tasksToHashOverride ?? Object.values(taskGraph.tasks)).filter((task) => !task.hash);
|
|
132
|
-
// TODO(v25): remove custom hasher support.
|
|
132
|
+
// TODO(v25): remove custom hasher support (NXC-5052).
|
|
133
133
|
// Separate tasks with custom hashers from those without
|
|
134
134
|
const tasksWithCustomHashers = [];
|
|
135
135
|
const tasksWithoutCustomHashers = [];
|
|
@@ -201,7 +201,7 @@ function splitInputsIntoSelfAndDependencies(inputs, namedInputs) {
|
|
|
201
201
|
else if ('input' in d &&
|
|
202
202
|
!('fileset' in d) &&
|
|
203
203
|
(('dependencies' in d && d.dependencies && !('projects' in d)) ||
|
|
204
|
-
//
|
|
204
|
+
// TODO(v25): remove the 'dependencies' magic string (NXC-5157)
|
|
205
205
|
('projects' in d &&
|
|
206
206
|
typeof d.projects === 'string' &&
|
|
207
207
|
d.projects === 'dependencies'))) {
|
|
@@ -214,7 +214,7 @@ function splitInputsIntoSelfAndDependencies(inputs, namedInputs) {
|
|
|
214
214
|
!('fileset' in d) &&
|
|
215
215
|
'projects' in d &&
|
|
216
216
|
d.projects &&
|
|
217
|
-
//
|
|
217
|
+
// TODO(v25): remove the 'self' magic string (NXC-5157)
|
|
218
218
|
!(d.projects === 'self')) {
|
|
219
219
|
projectInputs.push({
|
|
220
220
|
input: d.input,
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = replacePowerpackConformance;
|
|
4
|
+
const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
|
|
5
|
+
const json_1 = require("../../generators/utils/json");
|
|
6
|
+
const nx_json_1 = require("../../generators/utils/nx-json");
|
|
7
|
+
const project_configuration_1 = require("../../generators/utils/project-configuration");
|
|
8
|
+
const target_defaults_1 = require("../../project-graph/utils/project-configuration/target-defaults");
|
|
9
|
+
const ignore_1 = require("../../utils/ignore");
|
|
10
|
+
const versions_1 = require("../../utils/versions");
|
|
11
|
+
const POWERPACK_CONFORMANCE = '@nx/powerpack-conformance';
|
|
12
|
+
const CONFORMANCE = '@nx/conformance';
|
|
13
|
+
const OWNERS = '@nx/owners';
|
|
14
|
+
const BUNDLE_RULES_EXECUTOR = '@nx/conformance:bundle-rules';
|
|
15
|
+
const ESBUILD_VERSION = '^0.25.0';
|
|
16
|
+
const DEPENDENCY_FIELDS = [
|
|
17
|
+
'dependencies',
|
|
18
|
+
'devDependencies',
|
|
19
|
+
'peerDependencies',
|
|
20
|
+
'optionalDependencies',
|
|
21
|
+
];
|
|
22
|
+
const SOURCE_FILE = /\.[cm]?[jt]sx?$/;
|
|
23
|
+
// A quoted `@nx/powerpack-conformance` specifier, executor or rule, e.g.
|
|
24
|
+
// `"@nx/powerpack-conformance:bundle-rules"` or `'@nx/powerpack-conformance/ensure-owners'`
|
|
25
|
+
const SPECIFIER = /(["'`])@nx\/powerpack-conformance([:/][^"'`]*)?\1/g;
|
|
26
|
+
async function replacePowerpackConformance(tree) {
|
|
27
|
+
if (!tree.exists('package.json') ||
|
|
28
|
+
!declaresDependency((0, json_1.readJson)(tree, 'package.json'), POWERPACK_CONFORMANCE)) {
|
|
29
|
+
return { skipAgentic: true };
|
|
30
|
+
}
|
|
31
|
+
let movedEnsureOwners = false;
|
|
32
|
+
const rewrite = (content) => content.replace(SPECIFIER, (_, quote, rest = '') => {
|
|
33
|
+
if (rest === '/ensure-owners') {
|
|
34
|
+
movedEnsureOwners = true;
|
|
35
|
+
return `${quote}${OWNERS}/ensure-owners${quote}`;
|
|
36
|
+
}
|
|
37
|
+
return `${quote}${CONFORMANCE}${rest}${quote}`;
|
|
38
|
+
});
|
|
39
|
+
for (const path of filesToRewrite(tree)) {
|
|
40
|
+
if (path === 'package.json' || path.endsWith('/package.json')) {
|
|
41
|
+
(0, json_1.updateJson)(tree, path, replaceDependency);
|
|
42
|
+
}
|
|
43
|
+
const content = tree.read(path, 'utf-8');
|
|
44
|
+
const updated = rewrite(content);
|
|
45
|
+
if (updated !== content) {
|
|
46
|
+
tree.write(path, updated);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
(0, json_1.updateJson)(tree, 'package.json', (json) => {
|
|
50
|
+
if (movedEnsureOwners && !declaresDependency(json, OWNERS)) {
|
|
51
|
+
addDevDependency(json, OWNERS, versions_1.nxVersion);
|
|
52
|
+
}
|
|
53
|
+
if (usesBundleRules(tree) && !declaresDependency(json, 'esbuild')) {
|
|
54
|
+
addDevDependency(json, 'esbuild', ESBUILD_VERSION);
|
|
55
|
+
}
|
|
56
|
+
return json;
|
|
57
|
+
});
|
|
58
|
+
await (0, format_changed_files_1.formatChangedFiles)(tree);
|
|
59
|
+
return { skipAgentic: true };
|
|
60
|
+
}
|
|
61
|
+
function filesToRewrite(tree) {
|
|
62
|
+
const isIgnored = (0, ignore_1.createGitIgnoreChecker)(tree);
|
|
63
|
+
const files = [];
|
|
64
|
+
const visit = (dir) => {
|
|
65
|
+
for (const child of tree.children(dir)) {
|
|
66
|
+
const path = dir ? `${dir}/${child}` : child;
|
|
67
|
+
if (tree.isFile(path)) {
|
|
68
|
+
if ((child === 'package.json' ||
|
|
69
|
+
child === 'project.json' ||
|
|
70
|
+
child === 'nx.json' ||
|
|
71
|
+
SOURCE_FILE.test(child)) &&
|
|
72
|
+
!isIgnored.isIgnoredFile(path)) {
|
|
73
|
+
files.push(path);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else if (!isIgnored.isIgnoredDirectory(path)) {
|
|
77
|
+
visit(path);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
visit('');
|
|
82
|
+
return files;
|
|
83
|
+
}
|
|
84
|
+
// Swaps the dependency for @nx/conformance at the current Nx version, since the
|
|
85
|
+
// two packages were versioned separately
|
|
86
|
+
function replaceDependency(json) {
|
|
87
|
+
for (const field of DEPENDENCY_FIELDS) {
|
|
88
|
+
const dependencies = json[field];
|
|
89
|
+
if (!dependencies?.[POWERPACK_CONFORMANCE]) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
delete dependencies[POWERPACK_CONFORMANCE];
|
|
93
|
+
if (!declaresDependency(json, CONFORMANCE)) {
|
|
94
|
+
dependencies[CONFORMANCE] = versions_1.nxVersion;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return json;
|
|
98
|
+
}
|
|
99
|
+
function declaresDependency(json, name) {
|
|
100
|
+
return DEPENDENCY_FIELDS.some((field) => Boolean(json[field]?.[name]));
|
|
101
|
+
}
|
|
102
|
+
function addDevDependency(json, name, version) {
|
|
103
|
+
json.devDependencies = { ...json.devDependencies, [name]: version };
|
|
104
|
+
}
|
|
105
|
+
function usesBundleRules(tree) {
|
|
106
|
+
const targetDefaults = (0, nx_json_1.readNxJson)(tree)?.targetDefaults;
|
|
107
|
+
for (const [, project] of (0, project_configuration_1.getProjects)(tree)) {
|
|
108
|
+
for (const [targetName, target] of Object.entries(project.targets ?? {})) {
|
|
109
|
+
const executor = target.executor ??
|
|
110
|
+
(0, target_defaults_1.readTargetDefaultsForTarget)(targetName, targetDefaults)?.executor;
|
|
111
|
+
if (executor === BUNDLE_RULES_EXECUTOR) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#### Replace @nx/powerpack-conformance with @nx/conformance
|
|
2
|
+
|
|
3
|
+
`nx conformance` and `nx conformance:check` now load `@nx/conformance` only. `@nx/powerpack-conformance` was a wrapper around `@nx/conformance`, so this migration replaces it.
|
|
4
|
+
|
|
5
|
+
When the root `package.json` declares `@nx/powerpack-conformance`, the migration:
|
|
6
|
+
|
|
7
|
+
- Replaces `@nx/powerpack-conformance` with `@nx/conformance` in every `package.json`.
|
|
8
|
+
- Rewrites `@nx/powerpack-conformance` rule specifiers, executors, generator defaults and imports in `nx.json`, `project.json`, `package.json` and source files to `@nx/conformance`.
|
|
9
|
+
- Rewrites `@nx/powerpack-conformance/ensure-owners` to `@nx/owners/ensure-owners`, which moved to `@nx/owners`, and adds `@nx/owners`.
|
|
10
|
+
- Adds `esbuild` when a project uses the `@nx/conformance:bundle-rules` executor, since `@nx/conformance` lists it only as an optional peer dependency.
|
|
11
|
+
|
|
12
|
+
#### Sample code changes
|
|
13
|
+
|
|
14
|
+
##### Before
|
|
15
|
+
|
|
16
|
+
```json title="nx.json"
|
|
17
|
+
{
|
|
18
|
+
"conformance": {
|
|
19
|
+
"rules": [
|
|
20
|
+
{ "rule": "@nx/powerpack-conformance/enforce-project-boundaries" },
|
|
21
|
+
{ "rule": "@nx/powerpack-conformance/ensure-owners" }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
##### After
|
|
28
|
+
|
|
29
|
+
```json title="nx.json"
|
|
30
|
+
{
|
|
31
|
+
"conformance": {
|
|
32
|
+
"rules": [
|
|
33
|
+
{ "rule": "@nx/conformance/enforce-project-boundaries" },
|
|
34
|
+
{ "rule": "@nx/owners/ensure-owners" }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -149,11 +149,11 @@ export declare class NxCache {
|
|
|
149
149
|
getBatch(hashes: Array<string>): Array<CachedResult | undefined | null>
|
|
150
150
|
put(hash: string, terminalOutput: string, outputs: Array<string>, code: number): CachedOutputs
|
|
151
151
|
/**
|
|
152
|
-
* Restores and records a result fetched from a remote cache
|
|
153
|
-
*
|
|
154
|
-
* output it sits in.
|
|
152
|
+
* Restores and records a result fetched from a remote cache, returning
|
|
153
|
+
* its terminal output as stored for replay. Returns `None`, discarding
|
|
154
|
+
* the artifact, when it holds a link that leaves the output it sits in.
|
|
155
155
|
*/
|
|
156
|
-
applyRemoteCacheResults(hash: string, result: CachedResult, outputs?: Array<string> | undefined | null):
|
|
156
|
+
applyRemoteCacheResults(hash: string, result: CachedResult, outputs?: Array<string> | undefined | null): string | null
|
|
157
157
|
/**
|
|
158
158
|
* Register terminal outputs that were written without a cache entry —
|
|
159
159
|
* uncacheable tasks, and cacheable ones run with `--skip-nx-cache`.
|
|
@@ -1610,6 +1610,8 @@ export interface UltracacheReport {
|
|
|
1610
1610
|
resolution: UltracacheConfigurationResolution
|
|
1611
1611
|
}
|
|
1612
1612
|
|
|
1613
|
+
export declare function unmatchedProjectPatterns(projectGraph: ExternalObject<ProjectGraph>, patterns: Array<string>): Array<string>
|
|
1614
|
+
|
|
1613
1615
|
export interface UpdatedWorkspaceFiles {
|
|
1614
1616
|
fileMap: FileMap
|
|
1615
1617
|
externalReferences: NxWorkspaceFilesExternals
|
package/dist/src/native/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Node passes a stand-in require, without a cache, require.extensions or
|
|
2
|
+
// Module._load, when an ESM loader hook supplies this module's source, as
|
|
3
|
+
// Yarn PnP does.
|
|
4
|
+
if (!require.cache) require = require('module').createRequire(__filename);
|
|
5
|
+
|
|
1
6
|
const { join, basename } = require('path');
|
|
2
7
|
const {
|
|
3
8
|
chmodSync,
|
|
@@ -659,5 +659,6 @@ module.exports.trackEvent = nativeBinding.trackEvent
|
|
|
659
659
|
module.exports.trackPageView = nativeBinding.trackPageView
|
|
660
660
|
module.exports.transferProjectGraph = nativeBinding.transferProjectGraph
|
|
661
661
|
module.exports.UltracacheMode = nativeBinding.UltracacheMode
|
|
662
|
+
module.exports.unmatchedProjectPatterns = nativeBinding.unmatchedProjectPatterns
|
|
662
663
|
module.exports.validateOutputs = nativeBinding.validateOutputs
|
|
663
664
|
module.exports.WorkspaceErrors = nativeBinding.WorkspaceErrors
|
|
Binary file
|
|
Binary file
|
|
@@ -8,5 +8,7 @@ export declare function transformProjectGraphForRust(graph: ProjectGraph): Exter
|
|
|
8
8
|
* what the locators themselves do on a large workspace.
|
|
9
9
|
*/
|
|
10
10
|
export declare function transformProjectGraphForLocators(graph: ProjectGraph): ExternalObject<RustProjectGraph>;
|
|
11
|
+
/** Only what project patterns match against: names, roots and tags. */
|
|
12
|
+
export declare function transformProjectGraphForProjectMatching(graph: ProjectGraph): ExternalObject<RustProjectGraph>;
|
|
11
13
|
/** The graph in Rust's shape, still a JS object. Uncached, so safe to edit. */
|
|
12
14
|
export declare function toRustProjectGraph(graph: ProjectGraph): RustProjectGraph;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformProjectGraphForRust = transformProjectGraphForRust;
|
|
4
4
|
exports.transformProjectGraphForLocators = transformProjectGraphForLocators;
|
|
5
|
+
exports.transformProjectGraphForProjectMatching = transformProjectGraphForProjectMatching;
|
|
5
6
|
exports.toRustProjectGraph = toRustProjectGraph;
|
|
6
7
|
const index_1 = require("./index");
|
|
7
8
|
/**
|
|
@@ -45,6 +46,20 @@ function transformProjectGraphForLocators(graph) {
|
|
|
45
46
|
}
|
|
46
47
|
return ref;
|
|
47
48
|
}
|
|
49
|
+
const transferredForProjectMatching = new WeakMap();
|
|
50
|
+
/** Only what project patterns match against: names, roots and tags. */
|
|
51
|
+
function transformProjectGraphForProjectMatching(graph) {
|
|
52
|
+
let ref = transferredForProjectMatching.get(graph);
|
|
53
|
+
if (!ref) {
|
|
54
|
+
const nodes = {};
|
|
55
|
+
for (const [name, node] of Object.entries(graph.nodes)) {
|
|
56
|
+
nodes[name] = { root: node.data.root, tags: node.data.tags, targets: {} };
|
|
57
|
+
}
|
|
58
|
+
ref = (0, index_1.transferProjectGraph)({ nodes, externalNodes: {}, dependencies: {} });
|
|
59
|
+
transferredForProjectMatching.set(graph, ref);
|
|
60
|
+
}
|
|
61
|
+
return ref;
|
|
62
|
+
}
|
|
48
63
|
/** The graph in Rust's shape, still a JS object. Uncached, so safe to edit. */
|
|
49
64
|
function toRustProjectGraph(graph) {
|
|
50
65
|
const dependencies = {};
|
|
@@ -5,26 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const dotenv = tslib_1.__importStar(require("dotenv"));
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
-
const is_ci_1 = require("../../utils/is-ci");
|
|
9
8
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
10
9
|
// Set once
|
|
11
10
|
exports.UNLIMITED_TIMEOUT = 9999999;
|
|
12
|
-
process.env.NX_CLOUD_AGENT_TIMEOUT_MS
|
|
13
|
-
? Number(process.env.NX_CLOUD_AGENT_TIMEOUT_MS)
|
|
14
|
-
: 3600000;
|
|
15
|
-
// 60 minutes
|
|
16
|
-
process.env.NX_CLOUD_ORCHESTRATOR_TIMEOUT_MS
|
|
17
|
-
? Number(process.env.NX_CLOUD_ORCHESTRATOR_TIMEOUT_MS)
|
|
18
|
-
: 3600000;
|
|
19
|
-
// 60 minutes
|
|
20
|
-
process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT
|
|
21
|
-
? Number(process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT)
|
|
22
|
-
: null;
|
|
23
|
-
process.env.NX_CLOUD_NUMBER_OF_RETRIES
|
|
24
|
-
? Number(process.env.NX_CLOUD_NUMBER_OF_RETRIES)
|
|
25
|
-
: (0, is_ci_1.isCI)()
|
|
26
|
-
? 10
|
|
27
|
-
: 1;
|
|
28
11
|
loadEnvVars();
|
|
29
12
|
function parseEnv() {
|
|
30
13
|
try {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ProjectGraphExternalNode } from '../../../config/project-graph';
|
|
2
2
|
import type { CreateDependenciesContext } from '../../../project-graph/plugins';
|
|
3
3
|
import { type RawProjectGraphDependency } from '../../../project-graph/project-graph-builder';
|
|
4
|
-
export
|
|
5
|
-
export declare const BUN_TEXT_LOCK_FILE = "bun.lock";
|
|
4
|
+
export { BUN_LOCK_FILE, BUN_TEXT_LOCK_FILE } from './lock-file-names';
|
|
6
5
|
export declare class BunLockfileParseError extends Error {
|
|
7
6
|
readonly cause?: Error;
|
|
8
7
|
constructor(message: string, cause?: Error);
|
|
@@ -12,6 +12,7 @@ const project_graph_1 = require("../../../config/project-graph");
|
|
|
12
12
|
const file_hasher_1 = require("../../../hasher/file-hasher");
|
|
13
13
|
const project_graph_builder_1 = require("../../../project-graph/project-graph-builder");
|
|
14
14
|
const json_1 = require("../../../utils/json");
|
|
15
|
+
const lock_file_names_1 = require("./lock-file-names");
|
|
15
16
|
// Highest bun.lock version this parser has been verified against:
|
|
16
17
|
// - 1: workspace packages are no longer listed with their dependencies
|
|
17
18
|
// - 2: identical content, stricter validation in Bun's own reader
|
|
@@ -28,13 +29,13 @@ const DEPENDENCY_TYPES = [
|
|
|
28
29
|
'optionalDependencies',
|
|
29
30
|
'peerDependencies',
|
|
30
31
|
];
|
|
31
|
-
|
|
32
|
-
exports
|
|
32
|
+
var lock_file_names_2 = require("./lock-file-names");
|
|
33
|
+
Object.defineProperty(exports, "BUN_LOCK_FILE", { enumerable: true, get: function () { return lock_file_names_2.BUN_LOCK_FILE; } });
|
|
34
|
+
Object.defineProperty(exports, "BUN_TEXT_LOCK_FILE", { enumerable: true, get: function () { return lock_file_names_2.BUN_TEXT_LOCK_FILE; } });
|
|
33
35
|
let currentLockFileHash;
|
|
34
36
|
let cachedParsedLockFile;
|
|
35
37
|
let cachedPackageIndex;
|
|
36
38
|
const keyMap = new Map();
|
|
37
|
-
const packageVersions = new Map();
|
|
38
39
|
const specParseCache = new Map();
|
|
39
40
|
// Memoizes (packageName, versionSpec) -> resolved version for the current
|
|
40
41
|
// lockfile. The same name/range pairs repeat across many dependency lists, so
|
|
@@ -50,7 +51,7 @@ class BunLockfileParseError extends Error {
|
|
|
50
51
|
}
|
|
51
52
|
exports.BunLockfileParseError = BunLockfileParseError;
|
|
52
53
|
function readBunLockFile(lockFilePath) {
|
|
53
|
-
if (lockFilePath.endsWith(
|
|
54
|
+
if (lockFilePath.endsWith(lock_file_names_1.BUN_TEXT_LOCK_FILE)) {
|
|
54
55
|
return (0, node_fs_1.readFileSync)(lockFilePath, { encoding: 'utf-8' });
|
|
55
56
|
}
|
|
56
57
|
return (0, node_child_process_1.execSync)(`bun ${lockFilePath}`, {
|
|
@@ -84,7 +85,6 @@ function clearCache() {
|
|
|
84
85
|
cachedParsedLockFile = undefined;
|
|
85
86
|
cachedPackageIndex = undefined;
|
|
86
87
|
keyMap.clear();
|
|
87
|
-
packageVersions.clear();
|
|
88
88
|
specParseCache.clear();
|
|
89
89
|
resolvedVersionCache.clear();
|
|
90
90
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const YARN_LOCK_FILE = "yarn.lock";
|
|
2
|
+
export declare const NPM_LOCK_FILE = "package-lock.json";
|
|
3
|
+
export declare const PNPM_LOCK_FILE = "pnpm-lock.yaml";
|
|
4
|
+
export declare const BUN_LOCK_FILE = "bun.lockb";
|
|
5
|
+
export declare const BUN_TEXT_LOCK_FILE = "bun.lock";
|
|
6
|
+
export declare const LOCKFILES: string[];
|