nx 19.5.0-canary.20240710-2b7b523 → 19.5.0-canary.20240712-0b0db78
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/init-local.js +2 -3
- package/package.json +12 -12
- package/src/adapter/angular-json.js +6 -6
- package/src/adapter/decorate-cli.js +1 -2
- package/src/adapter/ngcli-adapter.js +8 -8
- package/src/adapter/rxjs-for-await.js +5 -5
- package/src/command-line/add/add.js +2 -2
- package/src/command-line/affected/affected.js +2 -3
- package/src/command-line/connect/connect-to-nx-cloud.js +5 -6
- package/src/command-line/connect/view-logs.js +1 -2
- package/src/command-line/daemon/daemon.js +1 -2
- package/src/command-line/exec/exec.js +1 -2
- package/src/command-line/format/format.js +1 -2
- package/src/command-line/generate/generate.js +4 -5
- package/src/command-line/generate/generator-utils.js +2 -3
- package/src/command-line/graph/command-object.js +2 -2
- package/src/command-line/graph/graph.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-nest.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -2
- package/src/command-line/init/implementation/angular/index.js +1 -2
- package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -2
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -2
- package/src/command-line/init/implementation/angular/standalone-workspace.js +1 -2
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +1 -1
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +7 -7
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +1 -2
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +1 -2
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +1 -2
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +1 -2
- package/src/command-line/init/implementation/react/clean-up-files.js +1 -2
- package/src/command-line/init/implementation/react/index.js +1 -2
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +1 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +1 -2
- package/src/command-line/init/implementation/react/tsconfig-setup.js +1 -2
- package/src/command-line/init/implementation/react/write-craco-config.js +1 -2
- package/src/command-line/init/implementation/react/write-vite-config.js +1 -2
- package/src/command-line/init/implementation/react/write-vite-index-html.js +1 -2
- package/src/command-line/init/implementation/utils.js +10 -11
- package/src/command-line/init/init-v1.js +1 -2
- package/src/command-line/init/init-v2.js +1 -2
- package/src/command-line/list/list.js +1 -2
- package/src/command-line/migrate/migrate.d.ts +1 -1
- package/src/command-line/migrate/migrate.js +5 -5
- package/src/command-line/new/new.js +1 -2
- package/src/command-line/release/changelog.js +3 -3
- package/src/command-line/release/config/config.js +3 -3
- package/src/command-line/release/config/filter-release-groups.js +1 -2
- package/src/command-line/release/config/version-plans.js +3 -4
- package/src/command-line/release/plan.js +2 -2
- package/src/command-line/release/publish.js +2 -2
- package/src/command-line/release/release.js +2 -2
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +1 -2
- package/src/command-line/release/utils/exec-command.js +1 -2
- package/src/command-line/release/utils/git.js +11 -12
- package/src/command-line/release/utils/github.js +5 -6
- package/src/command-line/release/utils/launch-editor.js +1 -2
- package/src/command-line/release/utils/markdown.js +1 -2
- package/src/command-line/release/utils/print-changes.d.ts +0 -1
- package/src/command-line/release/utils/print-changes.js +2 -3
- package/src/command-line/release/utils/resolve-changelog-renderer.js +1 -2
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -2
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -3
- package/src/command-line/release/utils/semver.js +4 -5
- package/src/command-line/release/utils/shared.js +6 -6
- package/src/command-line/release/version.js +2 -2
- package/src/command-line/repair/repair.js +1 -2
- package/src/command-line/report/report.js +27 -19
- package/src/command-line/reset/reset.js +1 -2
- package/src/command-line/run/executor-utils.js +2 -3
- package/src/command-line/run/run-one.js +1 -2
- package/src/command-line/run/run.js +5 -6
- package/src/command-line/run-many/run-many.js +2 -3
- package/src/command-line/show/project.js +1 -2
- package/src/command-line/show/projects.js +1 -2
- package/src/command-line/watch/watch.js +2 -2
- package/src/command-line/yargs-utils/documentation.js +1 -2
- package/src/command-line/yargs-utils/shared-options.js +12 -13
- package/src/commands-runner/create-command-graph.js +1 -2
- package/src/commands-runner/get-command-projects.js +1 -2
- package/src/config/calculate-default-project-name.js +2 -3
- package/src/config/configuration.js +2 -2
- package/src/config/nx-json.js +2 -3
- package/src/config/project-graph.js +3 -3
- package/src/config/schema-utils.js +3 -4
- package/src/config/to-project-name.js +1 -2
- package/src/core/graph/main.js +1 -1
- package/src/daemon/cache.js +6 -6
- package/src/daemon/client/client.d.ts +0 -2
- package/src/daemon/client/client.js +2 -2
- package/src/daemon/client/daemon-socket-messenger.d.ts +0 -1
- package/src/daemon/client/generate-help-output.js +1 -2
- package/src/daemon/is-on-daemon.js +1 -2
- package/src/daemon/message-types/get-context-file-data.js +2 -2
- package/src/daemon/message-types/get-files-in-directory.js +2 -2
- package/src/daemon/message-types/get-nx-workspace-files.js +2 -2
- package/src/daemon/message-types/glob.js +2 -2
- package/src/daemon/message-types/hash-glob.js +2 -2
- package/src/daemon/message-types/task-history.js +3 -3
- package/src/daemon/message-types/update-context-files.js +2 -2
- package/src/daemon/server/file-watching/changed-projects.js +1 -2
- package/src/daemon/server/file-watching/file-watcher-sockets.d.ts +0 -1
- package/src/daemon/server/file-watching/file-watcher-sockets.js +4 -4
- package/src/daemon/server/handle-context-file-data.js +1 -2
- package/src/daemon/server/handle-get-files-in-directory.js +1 -2
- package/src/daemon/server/handle-get-task-history.js +1 -2
- package/src/daemon/server/handle-glob.js +1 -2
- package/src/daemon/server/handle-hash-glob.js +1 -2
- package/src/daemon/server/handle-hash-tasks.js +1 -2
- package/src/daemon/server/handle-nx-workspace-files.js +1 -2
- package/src/daemon/server/handle-outputs-tracking.js +2 -3
- package/src/daemon/server/handle-process-in-background.js +1 -2
- package/src/daemon/server/handle-request-project-graph.js +1 -2
- package/src/daemon/server/handle-request-shutdown.d.ts +0 -1
- package/src/daemon/server/handle-request-shutdown.js +1 -2
- package/src/daemon/server/handle-write-task-runs-to-history.js +1 -2
- package/src/daemon/server/outputs-tracking.js +7 -8
- package/src/daemon/server/plugins.js +2 -3
- package/src/daemon/server/project-graph-incremental-recomputation.js +3 -3
- package/src/daemon/server/server.d.ts +0 -1
- package/src/daemon/server/server.js +2 -3
- package/src/daemon/server/shutdown-utils.d.ts +0 -1
- package/src/daemon/server/shutdown-utils.js +9 -9
- package/src/daemon/server/watcher.d.ts +0 -1
- package/src/daemon/server/watcher.js +3 -4
- package/src/daemon/socket-utils.js +3 -3
- package/src/daemon/tmp-dir.js +6 -6
- package/src/executors/noop/noop.impl.js +1 -1
- package/src/executors/run-commands/run-commands.impl.js +3 -3
- package/src/executors/run-script/run-script.impl.js +1 -1
- package/src/executors/utils/convert-nx-executor.js +1 -2
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +1 -2
- package/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +1 -1
- package/src/generators/testing-utils/create-tree-with-empty-workspace.js +2 -3
- package/src/generators/testing-utils/create-tree.js +1 -2
- package/src/generators/tree.d.ts +0 -2
- package/src/generators/tree.js +3 -3
- package/src/generators/utils/glob.js +2 -3
- package/src/generators/utils/json.js +3 -4
- package/src/generators/utils/nx-json.js +2 -3
- package/src/generators/utils/project-configuration.js +7 -7
- package/src/hasher/create-task-hasher.js +1 -2
- package/src/hasher/file-hasher.js +2 -3
- package/src/hasher/hash-task.d.ts +0 -1
- package/src/hasher/hash-task.js +2 -3
- package/src/hasher/native-task-hasher-impl.d.ts +0 -1
- package/src/hasher/node-task-hasher-impl.d.ts +0 -1
- package/src/hasher/task-hasher.d.ts +0 -1
- package/src/hasher/task-hasher.js +10 -10
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +1 -1
- package/src/migrations/update-15-0-0/prefix-outputs.js +1 -1
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +1 -1
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +1 -1
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +1 -1
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +1 -1
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +1 -1
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +1 -1
- package/src/migrations/update-17-0-0/move-cache-directory.js +1 -1
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +1 -1
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +1 -1
- package/src/migrations/update-17-2-0/move-default-base.js +1 -1
- package/src/migrations/update-17-3-0/nx-release-path.js +2 -3
- package/src/migrations/update-17-3-0/update-nxw.js +1 -1
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +1 -1
- package/src/migrations/update-19-2-0/move-workspace-data-directory.js +3 -4
- package/src/migrations/update-19-2-4/set-project-name.js +1 -1
- package/src/native/assert-supported-platform.js +1 -2
- package/src/native/native-file-cache-location.js +1 -2
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/native/transform-objects.js +1 -2
- package/src/nx-cloud/debug-logger.js +1 -2
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -2
- package/src/nx-cloud/resolution-helpers.js +1 -2
- package/src/nx-cloud/update-manager.js +2 -2
- package/src/nx-cloud/utilities/axios.js +1 -2
- package/src/nx-cloud/utilities/get-cloud-options.js +1 -2
- package/src/nx-cloud/utilities/url-shorten.js +8 -9
- package/src/plugins/js/hasher/hasher.js +1 -2
- package/src/plugins/js/lock-file/lock-file.js +6 -6
- package/src/plugins/js/lock-file/npm-parser.js +3 -4
- package/src/plugins/js/lock-file/pnpm-parser.js +3 -4
- package/src/plugins/js/lock-file/project-graph-pruning.js +1 -2
- package/src/plugins/js/lock-file/utils/package-json.js +2 -3
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +5 -6
- package/src/plugins/js/lock-file/yarn-parser.js +3 -4
- package/src/plugins/js/package-json/create-package-json.js +2 -3
- package/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -2
- package/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.js +1 -2
- package/src/plugins/js/utils/config.js +1 -2
- package/src/plugins/js/utils/register.d.ts +1 -0
- package/src/plugins/js/utils/register.js +7 -8
- package/src/plugins/js/utils/resolve-relative-to-dir.js +1 -2
- package/src/plugins/js/utils/typescript.js +5 -6
- package/src/plugins/js/versions.d.ts +1 -1
- package/src/plugins/js/versions.js +1 -1
- package/src/plugins/package-json-workspaces/create-nodes.js +5 -5
- package/src/plugins/project-json/build-nodes/project-json.js +3 -3
- package/src/project-graph/affected/affected-project-graph.js +1 -2
- package/src/project-graph/build-project-graph.js +3 -4
- package/src/project-graph/error-types.js +11 -11
- package/src/project-graph/file-map-utils.js +4 -5
- package/src/project-graph/file-utils.d.ts +1 -1
- package/src/project-graph/file-utils.js +7 -7
- package/src/project-graph/nx-deps-cache.js +8 -8
- package/src/project-graph/operators.js +5 -5
- package/src/project-graph/plugins/internal-api.d.ts +1 -1
- package/src/project-graph/plugins/internal-api.js +13 -9
- package/src/project-graph/plugins/isolation/index.js +1 -2
- package/src/project-graph/plugins/isolation/messaging.d.ts +0 -2
- package/src/project-graph/plugins/isolation/messaging.js +4 -5
- package/src/project-graph/plugins/isolation/plugin-pool.js +1 -2
- package/src/project-graph/plugins/isolation/plugin-worker.js +1 -1
- package/src/project-graph/plugins/loader.js +7 -7
- package/src/project-graph/plugins/utils.js +4 -5
- package/src/project-graph/project-graph-builder.js +2 -2
- package/src/project-graph/project-graph.js +7 -8
- package/src/project-graph/utils/build-all-workspace-files.js +1 -2
- package/src/project-graph/utils/find-project-for-path.js +4 -5
- package/src/project-graph/utils/implicit-project-dependencies.js +1 -2
- package/src/project-graph/utils/normalize-project-nodes.js +2 -3
- package/src/project-graph/utils/project-configuration-utils.js +11 -12
- package/src/project-graph/utils/retrieve-workspace-files.js +6 -7
- package/src/tasks-runner/create-task-graph.js +3 -3
- package/src/tasks-runner/forked-process-task-runner.d.ts +0 -1
- package/src/tasks-runner/init-tasks-runner.js +1 -2
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/formatting-utils.js +2 -3
- package/src/tasks-runner/life-cycles/pretty-time.js +1 -2
- package/src/tasks-runner/life-cycles/view-logs-utils.js +1 -2
- package/src/tasks-runner/pseudo-ipc.d.ts +0 -1
- package/src/tasks-runner/pseudo-terminal.d.ts +0 -1
- package/src/tasks-runner/pseudo-terminal.js +2 -2
- package/src/tasks-runner/run-command.js +4 -5
- package/src/tasks-runner/task-env.d.ts +0 -1
- package/src/tasks-runner/task-env.js +5 -6
- package/src/tasks-runner/task-graph-utils.js +2 -3
- package/src/tasks-runner/task-orchestrator.js +8 -0
- package/src/tasks-runner/utils.js +25 -26
- package/src/utils/ab-testing.js +2 -2
- package/src/utils/all-file-data.js +1 -2
- package/src/utils/assert-workspace-validity.js +1 -2
- package/src/utils/async-iterator.js +2 -3
- package/src/utils/cache-directory.js +2 -2
- package/src/utils/child-process.d.ts +0 -1
- package/src/utils/child-process.js +3 -3
- package/src/utils/chunkify.js +1 -2
- package/src/utils/code-frames.js +1 -2
- package/src/utils/collapse-expanded-outputs.js +1 -2
- package/src/utils/command-line-utils.js +5 -6
- package/src/utils/consume-messages-from-socket.js +1 -2
- package/src/utils/default-base.js +1 -2
- package/src/utils/dotenv.js +1 -2
- package/src/utils/exit-codes.d.ts +0 -1
- package/src/utils/exit-codes.js +1 -2
- package/src/utils/fileutils.d.ts +0 -1
- package/src/utils/fileutils.js +9 -10
- package/src/utils/find-matching-projects.js +2 -2
- package/src/utils/find-workspace-root.js +1 -2
- package/src/utils/get-package-name-from-import-path.js +1 -2
- package/src/utils/git-utils.js +4 -5
- package/src/utils/globs.js +1 -2
- package/src/utils/ignore.js +4 -4
- package/src/utils/installation-directory.js +2 -3
- package/src/utils/is-ci.js +1 -2
- package/src/utils/json-diff.js +5 -5
- package/src/utils/json.js +3 -3
- package/src/utils/logger.js +2 -2
- package/src/utils/nx-cloud-utils.js +3 -4
- package/src/utils/nx-plugin.deprecated.js +1 -2
- package/src/utils/object-sort.js +1 -2
- package/src/utils/package-json.js +8 -9
- package/src/utils/package-manager.js +13 -14
- package/src/utils/params.js +14 -14
- package/src/utils/path.js +3 -4
- package/src/utils/plugins/community-plugins.js +1 -2
- package/src/utils/plugins/core-plugins.js +2 -3
- package/src/utils/plugins/installed-plugins.js +3 -4
- package/src/utils/plugins/local-plugins.js +2 -3
- package/src/utils/plugins/plugin-capabilities.js +2 -3
- package/src/utils/plugins/shared.js +1 -2
- package/src/utils/print-help.js +1 -2
- package/src/utils/project-graph-utils.js +4 -5
- package/src/utils/serializable-error.js +1 -2
- package/src/utils/serialize-overrides-into-command-line.js +1 -2
- package/src/utils/serialize-target.js +1 -2
- package/src/utils/split-target.js +2 -3
- package/src/utils/strip-indents.js +1 -2
- package/src/utils/task-history.js +3 -3
- package/src/utils/update-nxw.js +1 -2
- package/src/utils/workspace-configuration-check.js +1 -2
- package/src/utils/workspace-context.js +10 -11
- package/src/utils/workspace-root.js +3 -3
@@ -1,6 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.detectPackageManager = detectPackageManager;
|
4
|
+
exports.isWorkspacesEnabled = isWorkspacesEnabled;
|
5
|
+
exports.getPackageManagerCommand = getPackageManagerCommand;
|
6
|
+
exports.getPackageManagerVersion = getPackageManagerVersion;
|
7
|
+
exports.findFileInPackageJsonDirectory = findFileInPackageJsonDirectory;
|
8
|
+
exports.modifyYarnRcYmlToFitNewDirectory = modifyYarnRcYmlToFitNewDirectory;
|
9
|
+
exports.modifyYarnRcToFitNewDirectory = modifyYarnRcToFitNewDirectory;
|
10
|
+
exports.copyPackageManagerConfigurationFiles = copyPackageManagerConfigurationFiles;
|
11
|
+
exports.createTempNpmDirectory = createTempNpmDirectory;
|
12
|
+
exports.resolvePackageVersionUsingRegistry = resolvePackageVersionUsingRegistry;
|
13
|
+
exports.resolvePackageVersionUsingInstallation = resolvePackageVersionUsingInstallation;
|
14
|
+
exports.packageRegistryView = packageRegistryView;
|
15
|
+
exports.packageRegistryPack = packageRegistryPack;
|
4
16
|
const child_process_1 = require("child_process");
|
5
17
|
const fs_1 = require("fs");
|
6
18
|
const fs_extra_1 = require("fs-extra");
|
@@ -28,7 +40,6 @@ function detectPackageManager(dir = '') {
|
|
28
40
|
? 'pnpm'
|
29
41
|
: 'npm'));
|
30
42
|
}
|
31
|
-
exports.detectPackageManager = detectPackageManager;
|
32
43
|
/**
|
33
44
|
* Returns true if the workspace is using npm workspaces, yarn workspaces, or pnpm workspaces.
|
34
45
|
* @param packageManager The package manager to use. If not provided, it will be detected based on the lock file.
|
@@ -42,7 +53,6 @@ function isWorkspacesEnabled(packageManager = detectPackageManager(), root = wor
|
|
42
53
|
const packageJson = (0, file_utils_1.readPackageJson)();
|
43
54
|
return !!packageJson?.workspaces;
|
44
55
|
}
|
45
|
-
exports.isWorkspacesEnabled = isWorkspacesEnabled;
|
46
56
|
/**
|
47
57
|
* Returns commands for the package manager used in the workspace.
|
48
58
|
* By default, the package manager is derived based on the lock file,
|
@@ -155,7 +165,6 @@ function getPackageManagerCommand(packageManager = detectPackageManager(), root
|
|
155
165
|
};
|
156
166
|
return commands[packageManager]();
|
157
167
|
}
|
158
|
-
exports.getPackageManagerCommand = getPackageManagerCommand;
|
159
168
|
/**
|
160
169
|
* Returns the version of the package manager used in the workspace.
|
161
170
|
* By default, the package manager is derived based on the lock file,
|
@@ -186,7 +195,6 @@ function getPackageManagerVersion(packageManager = detectPackageManager(), cwd =
|
|
186
195
|
}
|
187
196
|
return version;
|
188
197
|
}
|
189
|
-
exports.getPackageManagerVersion = getPackageManagerVersion;
|
190
198
|
/**
|
191
199
|
* Checks for a project level npmrc file by crawling up the file tree until
|
192
200
|
* hitting a package.json file, as this is how npm finds them as well.
|
@@ -198,7 +206,6 @@ function findFileInPackageJsonDirectory(file, directory = process.cwd()) {
|
|
198
206
|
const path = (0, path_1.join)(directory, file);
|
199
207
|
return (0, fs_1.existsSync)(path) ? path : null;
|
200
208
|
}
|
201
|
-
exports.findFileInPackageJsonDirectory = findFileInPackageJsonDirectory;
|
202
209
|
/**
|
203
210
|
* We copy yarnrc.yml to the temporary directory to ensure things like the specified
|
204
211
|
* package registry are still used. However, there are a few relative paths that can
|
@@ -224,7 +231,6 @@ function modifyYarnRcYmlToFitNewDirectory(contents) {
|
|
224
231
|
}
|
225
232
|
return stringifySyml(parsed);
|
226
233
|
}
|
227
|
-
exports.modifyYarnRcYmlToFitNewDirectory = modifyYarnRcYmlToFitNewDirectory;
|
228
234
|
/**
|
229
235
|
* We copy .yarnrc to the temporary directory to ensure things like the specified
|
230
236
|
* package registry are still used. However, there are a few relative paths that can
|
@@ -243,7 +249,6 @@ function modifyYarnRcToFitNewDirectory(contents) {
|
|
243
249
|
}
|
244
250
|
return lines.join('\n');
|
245
251
|
}
|
246
|
-
exports.modifyYarnRcToFitNewDirectory = modifyYarnRcToFitNewDirectory;
|
247
252
|
function copyPackageManagerConfigurationFiles(root, destination) {
|
248
253
|
for (const packageManagerConfigFile of [
|
249
254
|
'.npmrc',
|
@@ -281,7 +286,6 @@ function copyPackageManagerConfigurationFiles(root, destination) {
|
|
281
286
|
}
|
282
287
|
}
|
283
288
|
}
|
284
|
-
exports.copyPackageManagerConfigurationFiles = copyPackageManagerConfigurationFiles;
|
285
289
|
/**
|
286
290
|
* Creates a temporary directory where you can run package manager commands safely.
|
287
291
|
*
|
@@ -304,7 +308,6 @@ function createTempNpmDirectory() {
|
|
304
308
|
};
|
305
309
|
return { dir, cleanup };
|
306
310
|
}
|
307
|
-
exports.createTempNpmDirectory = createTempNpmDirectory;
|
308
311
|
/**
|
309
312
|
* Returns the resolved version for a given package and version tag using the
|
310
313
|
* NPM registry (when using Yarn it will fall back to NPM to fetch the info).
|
@@ -337,7 +340,6 @@ async function resolvePackageVersionUsingRegistry(packageName, version) {
|
|
337
340
|
throw new Error(`Unable to resolve version ${packageName}@${version}.`);
|
338
341
|
}
|
339
342
|
}
|
340
|
-
exports.resolvePackageVersionUsingRegistry = resolvePackageVersionUsingRegistry;
|
341
343
|
/**
|
342
344
|
* Return the resolved version for a given package and version tag using by
|
343
345
|
* installing it in a temporary directory and fetching the version from the
|
@@ -355,7 +357,6 @@ async function resolvePackageVersionUsingInstallation(packageName, version) {
|
|
355
357
|
await cleanup();
|
356
358
|
}
|
357
359
|
}
|
358
|
-
exports.resolvePackageVersionUsingInstallation = resolvePackageVersionUsingInstallation;
|
359
360
|
async function packageRegistryView(pkg, version, args) {
|
360
361
|
let pm = detectPackageManager();
|
361
362
|
if (pm === 'yarn' || pm === 'bun') {
|
@@ -374,7 +375,6 @@ async function packageRegistryView(pkg, version, args) {
|
|
374
375
|
const { stdout } = await execAsync(`${pm} view ${pkg}@${version} ${args}`);
|
375
376
|
return stdout.toString().trim();
|
376
377
|
}
|
377
|
-
exports.packageRegistryView = packageRegistryView;
|
378
378
|
async function packageRegistryPack(cwd, pkg, version) {
|
379
379
|
let pm = detectPackageManager();
|
380
380
|
if (pm === 'yarn' || pm === 'bun') {
|
@@ -393,4 +393,3 @@ async function packageRegistryPack(cwd, pkg, version) {
|
|
393
393
|
const tarballPath = stdout.trim();
|
394
394
|
return { tarballPath };
|
395
395
|
}
|
396
|
-
exports.packageRegistryPack = packageRegistryPack;
|
package/src/utils/params.js
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.SchemaError = void 0;
|
4
|
+
exports.handleErrors = handleErrors;
|
5
|
+
exports.convertToCamelCase = convertToCamelCase;
|
6
|
+
exports.coerceTypesInOptions = coerceTypesInOptions;
|
7
|
+
exports.convertAliases = convertAliases;
|
8
|
+
exports.validateOptsAgainstSchema = validateOptsAgainstSchema;
|
9
|
+
exports.validateObject = validateObject;
|
10
|
+
exports.setDefaults = setDefaults;
|
11
|
+
exports.applyVerbosity = applyVerbosity;
|
12
|
+
exports.combineOptionsForExecutor = combineOptionsForExecutor;
|
13
|
+
exports.combineOptionsForGenerator = combineOptionsForGenerator;
|
14
|
+
exports.warnDeprecations = warnDeprecations;
|
15
|
+
exports.convertSmartDefaultsIntoNamedParams = convertSmartDefaultsIntoNamedParams;
|
16
|
+
exports.getPromptsForSchema = getPromptsForSchema;
|
4
17
|
const logger_1 = require("./logger");
|
5
18
|
const output_1 = require("./output");
|
6
19
|
const client_1 = require("../daemon/client/client");
|
@@ -51,7 +64,6 @@ async function handleErrors(isVerbose, fn) {
|
|
51
64
|
return 1;
|
52
65
|
}
|
53
66
|
}
|
54
|
-
exports.handleErrors = handleErrors;
|
55
67
|
function camelCase(input) {
|
56
68
|
if (input.indexOf('-') > 1) {
|
57
69
|
return input
|
@@ -72,7 +84,6 @@ function convertToCamelCase(parsed, schema) {
|
|
72
84
|
}
|
73
85
|
}, {});
|
74
86
|
}
|
75
|
-
exports.convertToCamelCase = convertToCamelCase;
|
76
87
|
/**
|
77
88
|
* Coerces (and replaces) options identified as 'boolean' or 'number' in the Schema
|
78
89
|
*
|
@@ -87,7 +98,6 @@ function coerceTypesInOptions(opts, schema) {
|
|
87
98
|
});
|
88
99
|
return opts;
|
89
100
|
}
|
90
|
-
exports.coerceTypesInOptions = coerceTypesInOptions;
|
91
101
|
function coerceType(prop, value) {
|
92
102
|
if (!prop)
|
93
103
|
return value;
|
@@ -154,7 +164,6 @@ function convertAliases(opts, schema, excludeUnmatched) {
|
|
154
164
|
return acc;
|
155
165
|
}, {});
|
156
166
|
}
|
157
|
-
exports.convertAliases = convertAliases;
|
158
167
|
class SchemaError {
|
159
168
|
constructor(message) {
|
160
169
|
this.message = message;
|
@@ -164,7 +173,6 @@ exports.SchemaError = SchemaError;
|
|
164
173
|
function validateOptsAgainstSchema(opts, schema) {
|
165
174
|
validateObject(opts, schema, schema.definitions || {});
|
166
175
|
}
|
167
|
-
exports.validateOptsAgainstSchema = validateOptsAgainstSchema;
|
168
176
|
function validateObject(opts, schema, definitions) {
|
169
177
|
if (schema.anyOf) {
|
170
178
|
const errors = [];
|
@@ -241,7 +249,6 @@ function validateObject(opts, schema, definitions) {
|
|
241
249
|
}
|
242
250
|
});
|
243
251
|
}
|
244
|
-
exports.validateObject = validateObject;
|
245
252
|
function validateProperty(propName, value, schema, definitions) {
|
246
253
|
if (!schema)
|
247
254
|
return;
|
@@ -386,7 +393,6 @@ function setDefaults(opts, schema) {
|
|
386
393
|
setDefaultsInObject(opts, schema.properties || {}, schema.definitions || {});
|
387
394
|
return opts;
|
388
395
|
}
|
389
|
-
exports.setDefaults = setDefaults;
|
390
396
|
function setDefaultsInObject(opts, properties, definitions) {
|
391
397
|
Object.keys(properties).forEach((p) => {
|
392
398
|
setPropertyDefault(opts, p, properties[p], definitions);
|
@@ -441,7 +447,6 @@ function applyVerbosity(options, schema, isVerbose) {
|
|
441
447
|
options['verbose'] = true;
|
442
448
|
}
|
443
449
|
}
|
444
|
-
exports.applyVerbosity = applyVerbosity;
|
445
450
|
function combineOptionsForExecutor(commandLineOpts, config, target, schema, defaultProjectName, relativeCwd, isVerbose = false) {
|
446
451
|
const r = convertAliases(coerceTypesInOptions(convertToCamelCase(commandLineOpts, schema), schema), schema, false);
|
447
452
|
let combined = target.options || {};
|
@@ -457,7 +462,6 @@ function combineOptionsForExecutor(commandLineOpts, config, target, schema, defa
|
|
457
462
|
applyVerbosity(combined, schema, isVerbose);
|
458
463
|
return combined;
|
459
464
|
}
|
460
|
-
exports.combineOptionsForExecutor = combineOptionsForExecutor;
|
461
465
|
async function combineOptionsForGenerator(commandLineOpts, collectionName, generatorName, projectsConfigurations, nxJsonConfiguration, schema, isInteractive, defaultProjectName, relativeCwd, isVerbose = false) {
|
462
466
|
const generatorDefaults = projectsConfigurations
|
463
467
|
? getGeneratorDefaults(defaultProjectName, projectsConfigurations, nxJsonConfiguration, collectionName, generatorName)
|
@@ -473,7 +477,6 @@ async function combineOptionsForGenerator(commandLineOpts, collectionName, gener
|
|
473
477
|
applyVerbosity(combined, schema, isVerbose);
|
474
478
|
return combined;
|
475
479
|
}
|
476
|
-
exports.combineOptionsForGenerator = combineOptionsForGenerator;
|
477
480
|
function warnDeprecations(opts, schema) {
|
478
481
|
Object.keys(opts).forEach((option) => {
|
479
482
|
const deprecated = schema.properties[option]?.['x-deprecated'];
|
@@ -482,7 +485,6 @@ function warnDeprecations(opts, schema) {
|
|
482
485
|
}
|
483
486
|
});
|
484
487
|
}
|
485
|
-
exports.warnDeprecations = warnDeprecations;
|
486
488
|
function convertSmartDefaultsIntoNamedParams(opts, schema, defaultProjectName, relativeCwd) {
|
487
489
|
const argv = opts['_'] || [];
|
488
490
|
const usedPositionalArgs = {};
|
@@ -530,7 +532,6 @@ function convertSmartDefaultsIntoNamedParams(opts, schema, defaultProjectName, r
|
|
530
532
|
}
|
531
533
|
delete opts['__overrides_unparsed__'];
|
532
534
|
}
|
533
|
-
exports.convertSmartDefaultsIntoNamedParams = convertSmartDefaultsIntoNamedParams;
|
534
535
|
function getGeneratorDefaults(projectName, projectsConfigurations, nxJsonConfiguration, collectionName, generatorName) {
|
535
536
|
let defaults = {};
|
536
537
|
if (nxJsonConfiguration?.generators) {
|
@@ -660,7 +661,6 @@ function getPromptsForSchema(opts, schema, projectsConfigurations) {
|
|
660
661
|
});
|
661
662
|
return prompts;
|
662
663
|
}
|
663
|
-
exports.getPromptsForSchema = getPromptsForSchema;
|
664
664
|
async function promptForValues(opts, schema, projectsConfigurations) {
|
665
665
|
return await (await Promise.resolve().then(() => require('enquirer')))
|
666
666
|
.prompt(getPromptsForSchema(opts, schema, projectsConfigurations))
|
package/src/utils/path.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.normalizePath = normalizePath;
|
4
|
+
exports.joinPathFragments = joinPathFragments;
|
5
|
+
exports.getCwd = getCwd;
|
4
6
|
const path = require("path");
|
5
7
|
const workspace_root_1 = require("./workspace-root");
|
6
8
|
function removeWindowsDriveLetter(osSpecificPath) {
|
@@ -13,7 +15,6 @@ function removeWindowsDriveLetter(osSpecificPath) {
|
|
13
15
|
function normalizePath(osSpecificPath) {
|
14
16
|
return removeWindowsDriveLetter(osSpecificPath).split('\\').join('/');
|
15
17
|
}
|
16
|
-
exports.normalizePath = normalizePath;
|
17
18
|
/**
|
18
19
|
* Normalized path fragments and joins them. Use this when writing paths to config files.
|
19
20
|
* This should not be used to read files on disk because of the removal of Windows drive letters.
|
@@ -21,7 +22,6 @@ exports.normalizePath = normalizePath;
|
|
21
22
|
function joinPathFragments(...fragments) {
|
22
23
|
return normalizePath(path.join(...fragments));
|
23
24
|
}
|
24
|
-
exports.joinPathFragments = joinPathFragments;
|
25
25
|
/**
|
26
26
|
* When running a script with the package manager (e.g. `npm run`), the package manager will
|
27
27
|
* traverse the directory tree upwards until it finds a `package.json` and will set `process.cwd()`
|
@@ -35,4 +35,3 @@ function getCwd() {
|
|
35
35
|
? process.env.INIT_CWD
|
36
36
|
: process.cwd();
|
37
37
|
}
|
38
|
-
exports.getCwd = getCwd;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.fetchCommunityPlugins =
|
3
|
+
exports.fetchCommunityPlugins = fetchCommunityPlugins;
|
4
4
|
const https_1 = require("https");
|
5
5
|
const COMMUNITY_PLUGINS_JSON_URL = 'https://raw.githubusercontent.com/nrwl/nx/master/community/approved-plugins.json';
|
6
6
|
async function fetchCommunityPlugins() {
|
@@ -26,4 +26,3 @@ async function fetchCommunityPlugins() {
|
|
26
26
|
req.end();
|
27
27
|
});
|
28
28
|
}
|
29
|
-
exports.fetchCommunityPlugins = fetchCommunityPlugins;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.fetchCorePlugins = fetchCorePlugins;
|
4
|
+
exports.listCorePlugins = listCorePlugins;
|
4
5
|
const chalk = require("chalk");
|
5
6
|
const output_1 = require("../output");
|
6
7
|
function fetchCorePlugins() {
|
@@ -103,7 +104,6 @@ function fetchCorePlugins() {
|
|
103
104
|
},
|
104
105
|
];
|
105
106
|
}
|
106
|
-
exports.fetchCorePlugins = fetchCorePlugins;
|
107
107
|
function listCorePlugins(installedPlugins, corePlugins) {
|
108
108
|
const alsoAvailable = corePlugins.filter((p) => !installedPlugins.has(p.name));
|
109
109
|
if (alsoAvailable.length) {
|
@@ -115,4 +115,3 @@ function listCorePlugins(installedPlugins, corePlugins) {
|
|
115
115
|
});
|
116
116
|
}
|
117
117
|
}
|
118
|
-
exports.listCorePlugins = listCorePlugins;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.findInstalledPlugins = findInstalledPlugins;
|
4
|
+
exports.getInstalledPluginsAndCapabilities = getInstalledPluginsAndCapabilities;
|
5
|
+
exports.listInstalledPlugins = listInstalledPlugins;
|
4
6
|
const chalk = require("chalk");
|
5
7
|
const output_1 = require("../output");
|
6
8
|
const plugin_capabilities_1 = require("./plugin-capabilities");
|
@@ -24,7 +26,6 @@ function findInstalledPlugins() {
|
|
24
26
|
}
|
25
27
|
return result.sort((a, b) => a.name.localeCompare(b.name));
|
26
28
|
}
|
27
|
-
exports.findInstalledPlugins = findInstalledPlugins;
|
28
29
|
function getNxPluginPackageJsonOrNull(pkg) {
|
29
30
|
try {
|
30
31
|
const { packageJson } = (0, package_json_1.readModulePackageJson)(pkg, (0, installation_directory_1.getNxRequirePaths)());
|
@@ -77,7 +78,6 @@ async function getInstalledPluginsAndCapabilities(workspaceRoot, projects) {
|
|
77
78
|
}
|
78
79
|
return result;
|
79
80
|
}
|
80
|
-
exports.getInstalledPluginsAndCapabilities = getInstalledPluginsAndCapabilities;
|
81
81
|
function listInstalledPlugins(installedPlugins) {
|
82
82
|
const bodyLines = [];
|
83
83
|
for (const [, p] of installedPlugins) {
|
@@ -101,4 +101,3 @@ function listInstalledPlugins(installedPlugins) {
|
|
101
101
|
bodyLines: bodyLines,
|
102
102
|
});
|
103
103
|
}
|
104
|
-
exports.listInstalledPlugins = listInstalledPlugins;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.getLocalWorkspacePlugins = getLocalWorkspacePlugins;
|
4
|
+
exports.listLocalWorkspacePlugins = listLocalWorkspacePlugins;
|
4
5
|
const chalk = require("chalk");
|
5
6
|
const output_1 = require("../output");
|
6
7
|
const shared_1 = require("./shared");
|
@@ -31,7 +32,6 @@ async function getLocalWorkspacePlugins(projectsConfiguration, nxJson) {
|
|
31
32
|
}
|
32
33
|
return plugins;
|
33
34
|
}
|
34
|
-
exports.getLocalWorkspacePlugins = getLocalWorkspacePlugins;
|
35
35
|
function listLocalWorkspacePlugins(installedPlugins) {
|
36
36
|
const bodyLines = [];
|
37
37
|
for (const [, p] of installedPlugins) {
|
@@ -55,4 +55,3 @@ function listLocalWorkspacePlugins(installedPlugins) {
|
|
55
55
|
bodyLines: bodyLines,
|
56
56
|
});
|
57
57
|
}
|
58
|
-
exports.listLocalWorkspacePlugins = listLocalWorkspacePlugins;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.getPluginCapabilities = getPluginCapabilities;
|
4
|
+
exports.listPluginCapabilities = listPluginCapabilities;
|
4
5
|
const chalk = require("chalk");
|
5
6
|
const path_1 = require("path");
|
6
7
|
const plugins_1 = require("../../project-graph/plugins");
|
@@ -56,7 +57,6 @@ async function getPluginCapabilities(workspaceRoot, pluginName, projects, includ
|
|
56
57
|
return null;
|
57
58
|
}
|
58
59
|
}
|
59
|
-
exports.getPluginCapabilities = getPluginCapabilities;
|
60
60
|
async function tryGetModule(packageJson, workspaceRoot) {
|
61
61
|
try {
|
62
62
|
if (packageJson.generators ??
|
@@ -127,7 +127,6 @@ async function listPluginCapabilities(pluginName, projects) {
|
|
127
127
|
bodyLines,
|
128
128
|
});
|
129
129
|
}
|
130
|
-
exports.listPluginCapabilities = listPluginCapabilities;
|
131
130
|
function resolveExecutorDescription(executorJsonEntry, projects) {
|
132
131
|
try {
|
133
132
|
if (typeof executorJsonEntry === 'string') {
|
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
// Lifted in part from https://github.com/nrwl/angular-console
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.hasElements =
|
4
|
+
exports.hasElements = hasElements;
|
5
5
|
function hasElements(obj) {
|
6
6
|
return obj && Object.values(obj).length > 0;
|
7
7
|
}
|
8
|
-
exports.hasElements = hasElements;
|
package/src/utils/print-help.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.printHelp =
|
3
|
+
exports.printHelp = printHelp;
|
4
4
|
const chalk = require("chalk");
|
5
5
|
const stringWidth = require("string-width");
|
6
6
|
const logger_1 = require("./logger");
|
@@ -36,7 +36,6 @@ ${generateLinkOutput({
|
|
36
36
|
})}
|
37
37
|
`);
|
38
38
|
}
|
39
|
-
exports.printHelp = printHelp;
|
40
39
|
function generateOverviewOutput({ pluginName, name, description, mode, aliases, }) {
|
41
40
|
switch (mode) {
|
42
41
|
case 'generate':
|
@@ -1,19 +1,20 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.projectHasTarget = projectHasTarget;
|
4
|
+
exports.projectHasTargetAndConfiguration = projectHasTargetAndConfiguration;
|
5
|
+
exports.getSourceDirOfDependentProjects = getSourceDirOfDependentProjects;
|
6
|
+
exports.findAllProjectNodeDependencies = findAllProjectNodeDependencies;
|
4
7
|
const project_graph_1 = require("../project-graph/project-graph");
|
5
8
|
function projectHasTarget(project, target) {
|
6
9
|
return !!(project.data &&
|
7
10
|
project.data.targets &&
|
8
11
|
project.data.targets[target]);
|
9
12
|
}
|
10
|
-
exports.projectHasTarget = projectHasTarget;
|
11
13
|
function projectHasTargetAndConfiguration(project, target, configuration) {
|
12
14
|
return (projectHasTarget(project, target) &&
|
13
15
|
project.data.targets[target].configurations &&
|
14
16
|
project.data.targets[target].configurations[configuration]);
|
15
17
|
}
|
16
|
-
exports.projectHasTargetAndConfiguration = projectHasTargetAndConfiguration;
|
17
18
|
function getSourceDirOfDependentProjects(projectName, projectGraph = (0, project_graph_1.readCachedProjectGraph)()) {
|
18
19
|
if (!projectGraph.nodes[projectName]) {
|
19
20
|
throw new Error(`Couldn't find project "${projectName}" in this Nx workspace`);
|
@@ -29,7 +30,6 @@ function getSourceDirOfDependentProjects(projectName, projectGraph = (0, project
|
|
29
30
|
return result;
|
30
31
|
}, [[], []]);
|
31
32
|
}
|
32
|
-
exports.getSourceDirOfDependentProjects = getSourceDirOfDependentProjects;
|
33
33
|
/**
|
34
34
|
* Find all internal project dependencies.
|
35
35
|
* All the external (npm) dependencies will be filtered out unless includeExternalDependencies is set to true
|
@@ -43,7 +43,6 @@ function findAllProjectNodeDependencies(parentNodeName, projectGraph = (0, proje
|
|
43
43
|
collectDependentProjectNodesNames(projectGraph, dependencyNodeNames, parentNodeName, includeExternalDependencies);
|
44
44
|
return Array.from(dependencyNodeNames);
|
45
45
|
}
|
46
|
-
exports.findAllProjectNodeDependencies = findAllProjectNodeDependencies;
|
47
46
|
// Recursively get all the dependencies of the node
|
48
47
|
function collectDependentProjectNodesNames(nxDeps, dependencyNodeNames, parentNodeName, includeExternalDependencies) {
|
49
48
|
const dependencies = nxDeps.dependencies[parentNodeName];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createSerializableError =
|
3
|
+
exports.createSerializableError = createSerializableError;
|
4
4
|
/**
|
5
5
|
* This function transforms an error into an object which can be properly serialized and deserialized to be sent between processes.
|
6
6
|
*/
|
@@ -31,4 +31,3 @@ function createSerializableError(error) {
|
|
31
31
|
});
|
32
32
|
return res;
|
33
33
|
}
|
34
|
-
exports.createSerializableError = createSerializableError;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.serializeOverridesIntoCommandLine =
|
3
|
+
exports.serializeOverridesIntoCommandLine = serializeOverridesIntoCommandLine;
|
4
4
|
const flat_1 = require("flat");
|
5
5
|
function serializeOverridesIntoCommandLine(options) {
|
6
6
|
const unparsed = options._ ? [...options._] : [];
|
@@ -12,7 +12,6 @@ function serializeOverridesIntoCommandLine(options) {
|
|
12
12
|
}
|
13
13
|
return unparsed;
|
14
14
|
}
|
15
|
-
exports.serializeOverridesIntoCommandLine = serializeOverridesIntoCommandLine;
|
16
15
|
function serializeOption(key, value, unparsed) {
|
17
16
|
if (value === true) {
|
18
17
|
unparsed.push(`--${key}`);
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.serializeTarget =
|
3
|
+
exports.serializeTarget = serializeTarget;
|
4
4
|
function serializeTarget(project, target, configuration) {
|
5
5
|
return [project, target, configuration].filter((part) => !!part).join(':');
|
6
6
|
}
|
7
|
-
exports.serializeTarget = serializeTarget;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.splitTarget = splitTarget;
|
4
|
+
exports.splitByColons = splitByColons;
|
4
5
|
function splitTarget(s, projectGraph) {
|
5
6
|
let [project, ...segments] = splitByColons(s);
|
6
7
|
const validTargets = projectGraph.nodes[project]
|
@@ -9,7 +10,6 @@ function splitTarget(s, projectGraph) {
|
|
9
10
|
const validTargetNames = new Set(Object.keys(validTargets ?? {}));
|
10
11
|
return [project, ...groupJointSegments(segments, validTargetNames)];
|
11
12
|
}
|
12
|
-
exports.splitTarget = splitTarget;
|
13
13
|
function groupJointSegments(segments, validTargetNames) {
|
14
14
|
for (let endingSegmentIdx = segments.length; endingSegmentIdx > 0; endingSegmentIdx--) {
|
15
15
|
const potentialTargetName = segments.slice(0, endingSegmentIdx).join(':');
|
@@ -46,4 +46,3 @@ function splitByColons(s) {
|
|
46
46
|
parts.push(currentPart);
|
47
47
|
return parts;
|
48
48
|
}
|
49
|
-
exports.splitByColons = splitByColons;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.stripIndents =
|
3
|
+
exports.stripIndents = stripIndents;
|
4
4
|
/**
|
5
5
|
* Removes indents, which is useful for printing warning and messages.
|
6
6
|
*
|
@@ -21,4 +21,3 @@ function stripIndents(strings, ...values) {
|
|
21
21
|
.join('\n')
|
22
22
|
.trim();
|
23
23
|
}
|
24
|
-
exports.stripIndents = stripIndents;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.taskHistoryFile =
|
3
|
+
exports.taskHistoryFile = void 0;
|
4
|
+
exports.getHistoryForHashes = getHistoryForHashes;
|
5
|
+
exports.writeTaskRunsToHistory = writeTaskRunsToHistory;
|
4
6
|
const fs_1 = require("fs");
|
5
7
|
const path_1 = require("path");
|
6
8
|
const client_1 = require("../daemon/client/client");
|
@@ -37,7 +39,6 @@ async function getHistoryForHashes(hashes) {
|
|
37
39
|
}
|
38
40
|
return await client_1.daemonClient.getTaskHistoryForHashes(hashes);
|
39
41
|
}
|
40
|
-
exports.getHistoryForHashes = getHistoryForHashes;
|
41
42
|
async function writeTaskRunsToHistory(taskRuns) {
|
42
43
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
43
44
|
if (taskHistory === undefined) {
|
@@ -58,7 +59,6 @@ async function writeTaskRunsToHistory(taskRuns) {
|
|
58
59
|
await client_1.daemonClient.writeTaskRunsToHistory(taskRuns);
|
59
60
|
}
|
60
61
|
}
|
61
|
-
exports.writeTaskRunsToHistory = writeTaskRunsToHistory;
|
62
62
|
exports.taskHistoryFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'task-history.csv');
|
63
63
|
function loadTaskHistoryFromDisk() {
|
64
64
|
taskHashToIndicesMap.clear();
|
package/src/utils/update-nxw.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.updateNxw =
|
3
|
+
exports.updateNxw = updateNxw;
|
4
4
|
const add_nx_scripts_1 = require("../command-line/init/implementation/dot-nx/add-nx-scripts");
|
5
5
|
const path_1 = require("../utils/path");
|
6
6
|
function updateNxw(tree) {
|
@@ -9,4 +9,3 @@ function updateNxw(tree) {
|
|
9
9
|
tree.write(wrapperPath, (0, add_nx_scripts_1.getNxWrapperContents)());
|
10
10
|
}
|
11
11
|
}
|
12
|
-
exports.updateNxw = updateNxw;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.workspaceConfigurationCheck =
|
3
|
+
exports.workspaceConfigurationCheck = workspaceConfigurationCheck;
|
4
4
|
const workspace_root_1 = require("./workspace-root");
|
5
5
|
const fs_1 = require("fs");
|
6
6
|
const path_1 = require("path");
|
@@ -34,4 +34,3 @@ function workspaceConfigurationCheck() {
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
}
|
37
|
-
exports.workspaceConfigurationCheck = workspaceConfigurationCheck;
|
@@ -1,6 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.setupWorkspaceContext = setupWorkspaceContext;
|
4
|
+
exports.getNxWorkspaceFilesFromContext = getNxWorkspaceFilesFromContext;
|
5
|
+
exports.globWithWorkspaceContextSync = globWithWorkspaceContextSync;
|
6
|
+
exports.globWithWorkspaceContext = globWithWorkspaceContext;
|
7
|
+
exports.hashWithWorkspaceContext = hashWithWorkspaceContext;
|
8
|
+
exports.updateFilesInContext = updateFilesInContext;
|
9
|
+
exports.getAllFileDataInContext = getAllFileDataInContext;
|
10
|
+
exports.getFilesInDirectoryUsingContext = getFilesInDirectoryUsingContext;
|
11
|
+
exports.updateProjectFiles = updateProjectFiles;
|
12
|
+
exports.resetWorkspaceContext = resetWorkspaceContext;
|
4
13
|
const perf_hooks_1 = require("perf_hooks");
|
5
14
|
const cache_directory_1 = require("./cache-directory");
|
6
15
|
const is_on_daemon_1 = require("../daemon/is-on-daemon");
|
@@ -13,7 +22,6 @@ function setupWorkspaceContext(workspaceRoot) {
|
|
13
22
|
perf_hooks_1.performance.mark('workspace-context:end');
|
14
23
|
perf_hooks_1.performance.measure('workspace context init', 'workspace-context', 'workspace-context:end');
|
15
24
|
}
|
16
|
-
exports.setupWorkspaceContext = setupWorkspaceContext;
|
17
25
|
async function getNxWorkspaceFilesFromContext(workspaceRoot, projectRootMap) {
|
18
26
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
19
27
|
ensureContextAvailable(workspaceRoot);
|
@@ -21,7 +29,6 @@ async function getNxWorkspaceFilesFromContext(workspaceRoot, projectRootMap) {
|
|
21
29
|
}
|
22
30
|
return client_1.daemonClient.getWorkspaceFiles(projectRootMap);
|
23
31
|
}
|
24
|
-
exports.getNxWorkspaceFilesFromContext = getNxWorkspaceFilesFromContext;
|
25
32
|
/**
|
26
33
|
* Sync method to get files matching globs from workspace context.
|
27
34
|
* NOTE: This method will create the workspace context if it doesn't exist.
|
@@ -33,7 +40,6 @@ function globWithWorkspaceContextSync(workspaceRoot, globs, exclude) {
|
|
33
40
|
ensureContextAvailable(workspaceRoot);
|
34
41
|
return workspaceContext.glob(globs, exclude);
|
35
42
|
}
|
36
|
-
exports.globWithWorkspaceContextSync = globWithWorkspaceContextSync;
|
37
43
|
async function globWithWorkspaceContext(workspaceRoot, globs, exclude) {
|
38
44
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
39
45
|
ensureContextAvailable(workspaceRoot);
|
@@ -43,7 +49,6 @@ async function globWithWorkspaceContext(workspaceRoot, globs, exclude) {
|
|
43
49
|
return client_1.daemonClient.glob(globs, exclude);
|
44
50
|
}
|
45
51
|
}
|
46
|
-
exports.globWithWorkspaceContext = globWithWorkspaceContext;
|
47
52
|
async function hashWithWorkspaceContext(workspaceRoot, globs, exclude) {
|
48
53
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
49
54
|
ensureContextAvailable(workspaceRoot);
|
@@ -51,11 +56,9 @@ async function hashWithWorkspaceContext(workspaceRoot, globs, exclude) {
|
|
51
56
|
}
|
52
57
|
return client_1.daemonClient.hashGlob(globs, exclude);
|
53
58
|
}
|
54
|
-
exports.hashWithWorkspaceContext = hashWithWorkspaceContext;
|
55
59
|
function updateFilesInContext(updatedFiles, deletedFiles) {
|
56
60
|
return workspaceContext?.incrementalUpdate(updatedFiles, deletedFiles);
|
57
61
|
}
|
58
|
-
exports.updateFilesInContext = updateFilesInContext;
|
59
62
|
async function getAllFileDataInContext(workspaceRoot) {
|
60
63
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
61
64
|
ensureContextAvailable(workspaceRoot);
|
@@ -63,7 +66,6 @@ async function getAllFileDataInContext(workspaceRoot) {
|
|
63
66
|
}
|
64
67
|
return client_1.daemonClient.getWorkspaceContextFileData();
|
65
68
|
}
|
66
|
-
exports.getAllFileDataInContext = getAllFileDataInContext;
|
67
69
|
async function getFilesInDirectoryUsingContext(workspaceRoot, dir) {
|
68
70
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
69
71
|
ensureContextAvailable(workspaceRoot);
|
@@ -71,11 +73,9 @@ async function getFilesInDirectoryUsingContext(workspaceRoot, dir) {
|
|
71
73
|
}
|
72
74
|
return client_1.daemonClient.getFilesInDirectory(dir);
|
73
75
|
}
|
74
|
-
exports.getFilesInDirectoryUsingContext = getFilesInDirectoryUsingContext;
|
75
76
|
function updateProjectFiles(projectRootMappings, rustReferences, updatedFiles, deletedFiles) {
|
76
77
|
return workspaceContext?.updateProjectFiles(projectRootMappings, rustReferences.projectFiles, rustReferences.globalFiles, updatedFiles, deletedFiles);
|
77
78
|
}
|
78
|
-
exports.updateProjectFiles = updateProjectFiles;
|
79
79
|
function ensureContextAvailable(workspaceRoot) {
|
80
80
|
if (!workspaceContext || workspaceContext?.workspaceRoot !== workspaceRoot) {
|
81
81
|
setupWorkspaceContext(workspaceRoot);
|
@@ -84,4 +84,3 @@ function ensureContextAvailable(workspaceRoot) {
|
|
84
84
|
function resetWorkspaceContext() {
|
85
85
|
workspaceContext = undefined;
|
86
86
|
}
|
87
|
-
exports.resetWorkspaceContext = resetWorkspaceContext;
|