nx 19.4.3 → 19.5.0-beta.1
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 +30 -26
- 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 +9 -5
- 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 +7 -7
- 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 +8 -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 +1 -2
- package/src/daemon/client/client.js +13 -1
- 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/devkit-exports.d.ts +1 -0
- package/src/devkit-exports.js +3 -1
- 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/browser.js +1 -0
- package/src/native/index.d.ts +178 -138
- package/src/native/index.js +16 -0
- package/src/native/native-bindings.js +352 -238
- package/src/native/native-file-cache-location.js +1 -2
- package/src/native/nx.wasi-browser.js +108 -0
- package/src/native/nx.wasi.cjs +139 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/native/transform-objects.js +1 -2
- package/src/native/wasi-worker-browser.mjs +32 -0
- package/src/native/wasi-worker.mjs +63 -0
- 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.js +4 -5
- 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/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.d.ts +8 -6
- package/src/project-graph/utils/project-configuration-utils.js +118 -54
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
- 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 +5 -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/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 -4
- 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
- package/src/plugins/target-defaults/symbols.d.ts +0 -17
- package/src/plugins/target-defaults/symbols.js +0 -20
- package/src/plugins/target-defaults/target-defaults-plugin.d.ts +0 -121
- package/src/plugins/target-defaults/target-defaults-plugin.js +0 -176
@@ -1,6 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.SERVER_INACTIVITY_TIMEOUT_MS = void 0;
|
4
|
+
exports.storeWatcherInstance = storeWatcherInstance;
|
5
|
+
exports.getWatcherInstance = getWatcherInstance;
|
6
|
+
exports.storeOutputWatcherInstance = storeOutputWatcherInstance;
|
7
|
+
exports.getOutputWatcherInstance = getOutputWatcherInstance;
|
8
|
+
exports.handleServerProcessTermination = handleServerProcessTermination;
|
9
|
+
exports.resetInactivityTimeout = resetInactivityTimeout;
|
10
|
+
exports.respondToClient = respondToClient;
|
11
|
+
exports.respondWithErrorAndExit = respondWithErrorAndExit;
|
4
12
|
const workspace_root_1 = require("../../utils/workspace-root");
|
5
13
|
const logger_1 = require("./logger");
|
6
14
|
const socket_utils_1 = require("../socket-utils");
|
@@ -12,20 +20,16 @@ let watcherInstance;
|
|
12
20
|
function storeWatcherInstance(instance) {
|
13
21
|
watcherInstance = instance;
|
14
22
|
}
|
15
|
-
exports.storeWatcherInstance = storeWatcherInstance;
|
16
23
|
function getWatcherInstance() {
|
17
24
|
return watcherInstance;
|
18
25
|
}
|
19
|
-
exports.getWatcherInstance = getWatcherInstance;
|
20
26
|
let outputWatcherInstance;
|
21
27
|
function storeOutputWatcherInstance(instance) {
|
22
28
|
outputWatcherInstance = instance;
|
23
29
|
}
|
24
|
-
exports.storeOutputWatcherInstance = storeOutputWatcherInstance;
|
25
30
|
function getOutputWatcherInstance() {
|
26
31
|
return outputWatcherInstance;
|
27
32
|
}
|
28
|
-
exports.getOutputWatcherInstance = getOutputWatcherInstance;
|
29
33
|
async function handleServerProcessTermination({ server, reason, }) {
|
30
34
|
try {
|
31
35
|
server.close();
|
@@ -45,7 +49,6 @@ async function handleServerProcessTermination({ server, reason, }) {
|
|
45
49
|
process.exit(0);
|
46
50
|
}
|
47
51
|
}
|
48
|
-
exports.handleServerProcessTermination = handleServerProcessTermination;
|
49
52
|
let serverInactivityTimerId;
|
50
53
|
function resetInactivityTimeout(cb) {
|
51
54
|
if (serverInactivityTimerId) {
|
@@ -53,7 +56,6 @@ function resetInactivityTimeout(cb) {
|
|
53
56
|
}
|
54
57
|
serverInactivityTimerId = setTimeout(cb, exports.SERVER_INACTIVITY_TIMEOUT_MS);
|
55
58
|
}
|
56
|
-
exports.resetInactivityTimeout = resetInactivityTimeout;
|
57
59
|
function respondToClient(socket, response, description) {
|
58
60
|
return new Promise(async (res) => {
|
59
61
|
if (description) {
|
@@ -68,7 +70,6 @@ function respondToClient(socket, response, description) {
|
|
68
70
|
});
|
69
71
|
});
|
70
72
|
}
|
71
|
-
exports.respondToClient = respondToClient;
|
72
73
|
async function respondWithErrorAndExit(socket, description, error) {
|
73
74
|
const normalizedError = error instanceof error_types_1.DaemonProjectGraphError
|
74
75
|
? error_types_1.ProjectGraphError.fromDaemonProjectGraphError(error)
|
@@ -79,4 +80,3 @@ async function respondWithErrorAndExit(socket, description, error) {
|
|
79
80
|
// Respond with the original error
|
80
81
|
await respondToClient(socket, (0, socket_utils_1.serializeResult)(error, null, null), null);
|
81
82
|
}
|
82
|
-
exports.respondWithErrorAndExit = respondWithErrorAndExit;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.watchWorkspace = watchWorkspace;
|
4
|
+
exports.watchOutputFiles = watchOutputFiles;
|
5
|
+
exports.convertChangeEventsToLogMessage = convertChangeEventsToLogMessage;
|
4
6
|
const workspace_root_1 = require("../../utils/workspace-root");
|
5
7
|
const path_1 = require("path");
|
6
8
|
const socket_utils_1 = require("../socket-utils");
|
@@ -40,7 +42,6 @@ async function watchWorkspace(server, cb) {
|
|
40
42
|
});
|
41
43
|
return watcher;
|
42
44
|
}
|
43
|
-
exports.watchWorkspace = watchWorkspace;
|
44
45
|
async function watchOutputFiles(cb) {
|
45
46
|
const { Watcher } = await Promise.resolve().then(() => require('../../native'));
|
46
47
|
let watcher = new Watcher(workspace_root_1.workspaceRoot, null, false);
|
@@ -54,7 +55,6 @@ async function watchOutputFiles(cb) {
|
|
54
55
|
});
|
55
56
|
return watcher;
|
56
57
|
}
|
57
|
-
exports.watchOutputFiles = watchOutputFiles;
|
58
58
|
/**
|
59
59
|
* NOTE: An event type of "create" will also apply to the case where the user has restored
|
60
60
|
* an original version of a file after modifying/deleting it by using git, so we adjust
|
@@ -96,4 +96,3 @@ function convertChangeEventsToLogMessage(changeEvents) {
|
|
96
96
|
}
|
97
97
|
return `${numCreatedOrRestoredFiles} file(s) created or restored, ${numModifiedFiles} file(s) modified, ${numDeletedFiles} file(s) deleted`;
|
98
98
|
}
|
99
|
-
exports.convertChangeEventsToLogMessage = convertChangeEventsToLogMessage;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.getPluginOsSocketPath = exports.getForkedProcessOsSocketPath = exports.getFullOsSocketPath = exports.isWindows = void 0;
|
4
|
+
exports.killSocketOrPath = killSocketOrPath;
|
5
|
+
exports.serializeResult = serializeResult;
|
4
6
|
const fs_1 = require("fs");
|
5
7
|
const os_1 = require("os");
|
6
8
|
const path_1 = require("path");
|
@@ -33,10 +35,8 @@ function killSocketOrPath() {
|
|
33
35
|
}
|
34
36
|
catch { }
|
35
37
|
}
|
36
|
-
exports.killSocketOrPath = killSocketOrPath;
|
37
38
|
// Prepare a serialized project graph result for sending over IPC from the server to the client
|
38
39
|
function serializeResult(error, serializedProjectGraph, serializedSourceMaps) {
|
39
40
|
// We do not want to repeat work `JSON.stringify`ing an object containing the potentially large project graph so merge as strings
|
40
41
|
return `{ "error": ${JSON.stringify(error ? (0, serializable_error_1.createSerializableError)(error) : error)}, "projectGraph": ${serializedProjectGraph}, "sourceMaps": ${serializedSourceMaps} }`;
|
41
42
|
}
|
42
|
-
exports.serializeResult = serializeResult;
|
package/src/daemon/tmp-dir.js
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.getDaemonSocketDir = exports.DAEMON_OUTPUT_LOG_FILE = exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = void 0;
|
4
|
+
exports.writeDaemonLogs = writeDaemonLogs;
|
5
|
+
exports.markDaemonAsDisabled = markDaemonAsDisabled;
|
6
|
+
exports.isDaemonDisabled = isDaemonDisabled;
|
7
|
+
exports.getSocketDir = getSocketDir;
|
8
|
+
exports.removeSocketDir = removeSocketDir;
|
4
9
|
/**
|
5
10
|
* Per workspace (to avoid subtle differences and issues), we want to have a deterministic
|
6
11
|
* location within the OS's tmp directory where we write log files for background processes
|
@@ -24,11 +29,9 @@ function writeDaemonLogs(error) {
|
|
24
29
|
(0, fs_1.writeFileSync)(file, error);
|
25
30
|
return file;
|
26
31
|
}
|
27
|
-
exports.writeDaemonLogs = writeDaemonLogs;
|
28
32
|
function markDaemonAsDisabled() {
|
29
33
|
(0, fs_1.writeFileSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'), 'true');
|
30
34
|
}
|
31
|
-
exports.markDaemonAsDisabled = markDaemonAsDisabled;
|
32
35
|
function isDaemonDisabled() {
|
33
36
|
try {
|
34
37
|
(0, fs_1.statSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'));
|
@@ -38,7 +41,6 @@ function isDaemonDisabled() {
|
|
38
41
|
return false;
|
39
42
|
}
|
40
43
|
}
|
41
|
-
exports.isDaemonDisabled = isDaemonDisabled;
|
42
44
|
function socketDirName() {
|
43
45
|
const hasher = (0, crypto_1.createHash)('sha256');
|
44
46
|
hasher.update(workspace_root_1.workspaceRoot.toLowerCase());
|
@@ -59,11 +61,9 @@ function getSocketDir() {
|
|
59
61
|
return exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE;
|
60
62
|
}
|
61
63
|
}
|
62
|
-
exports.getSocketDir = getSocketDir;
|
63
64
|
function removeSocketDir() {
|
64
65
|
try {
|
65
66
|
(0, fs_extra_1.rmSync)(getSocketDir(), { recursive: true, force: true });
|
66
67
|
}
|
67
68
|
catch (e) { }
|
68
69
|
}
|
69
|
-
exports.removeSocketDir = removeSocketDir;
|
package/src/devkit-exports.d.ts
CHANGED
package/src/devkit-exports.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
* Try hard to not add to this API to reduce the surface area we need to maintain.
|
5
5
|
*/
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
-
exports.createProjectFileMapUsingProjectGraph = exports.cacheDir = exports.hashArray = exports.defaultTasksRunner = exports.getOutputsForTargetAndConfiguration = exports.readProjectsConfigurationFromProjectGraph = exports.readCachedProjectGraph = exports.createProjectGraphAsync = exports.reverse = exports.appRootPath = exports.workspaceRoot = exports.normalizePath = exports.joinPathFragments = exports.stripIndents = exports.writeJsonFile = exports.readJsonFile = exports.stripJsonComments = exports.serializeJson = exports.parseJson = exports.updateJson = exports.writeJson = exports.readJson = exports.validateDependency = exports.ProjectGraphBuilder = exports.DependencyType = exports.updateNxJson = exports.readNxJson = exports.globAsync = exports.glob = exports.getProjects = exports.updateProjectConfiguration = exports.removeProjectConfiguration = exports.readProjectConfiguration = exports.addProjectConfiguration = exports.runExecutor = exports.isWorkspacesEnabled = exports.getPackageManagerVersion = exports.detectPackageManager = exports.getPackageManagerCommand = exports.output = exports.logger = exports.createNodesFromFiles = exports.AggregateCreateNodesError = exports.workspaceLayout = void 0;
|
7
|
+
exports.isDaemonEnabled = exports.createProjectFileMapUsingProjectGraph = exports.cacheDir = exports.hashArray = exports.defaultTasksRunner = exports.getOutputsForTargetAndConfiguration = exports.readProjectsConfigurationFromProjectGraph = exports.readCachedProjectGraph = exports.createProjectGraphAsync = exports.reverse = exports.appRootPath = exports.workspaceRoot = exports.normalizePath = exports.joinPathFragments = exports.stripIndents = exports.writeJsonFile = exports.readJsonFile = exports.stripJsonComments = exports.serializeJson = exports.parseJson = exports.updateJson = exports.writeJson = exports.readJson = exports.validateDependency = exports.ProjectGraphBuilder = exports.DependencyType = exports.updateNxJson = exports.readNxJson = exports.globAsync = exports.glob = exports.getProjects = exports.updateProjectConfiguration = exports.removeProjectConfiguration = exports.readProjectConfiguration = exports.addProjectConfiguration = exports.runExecutor = exports.isWorkspacesEnabled = exports.getPackageManagerVersion = exports.detectPackageManager = exports.getPackageManagerCommand = exports.output = exports.logger = exports.createNodesFromFiles = exports.AggregateCreateNodesError = exports.workspaceLayout = void 0;
|
8
8
|
var configuration_1 = require("./config/configuration");
|
9
9
|
Object.defineProperty(exports, "workspaceLayout", { enumerable: true, get: function () { return configuration_1.workspaceLayout; } });
|
10
10
|
var error_types_1 = require("./project-graph/error-types");
|
@@ -138,3 +138,5 @@ Object.defineProperty(exports, "cacheDir", { enumerable: true, get: function ()
|
|
138
138
|
*/
|
139
139
|
var file_map_utils_1 = require("./project-graph/file-map-utils");
|
140
140
|
Object.defineProperty(exports, "createProjectFileMapUsingProjectGraph", { enumerable: true, get: function () { return file_map_utils_1.createProjectFileMapUsingProjectGraph; } });
|
141
|
+
var client_1 = require("./daemon/client/client");
|
142
|
+
Object.defineProperty(exports, "isDaemonEnabled", { enumerable: true, get: function () { return client_1.isDaemonEnabled; } });
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.LARGE_BUFFER = void 0;
|
4
|
+
exports.default = default_1;
|
5
|
+
exports.interpolateArgsIntoCommand = interpolateArgsIntoCommand;
|
4
6
|
const child_process_1 = require("child_process");
|
5
7
|
const path = require("path");
|
6
8
|
const yargsParser = require("yargs-parser");
|
@@ -72,7 +74,6 @@ async function default_1(options, context) {
|
|
72
74
|
throw new Error(`ERROR: Something went wrong in run-commands - ${e.message}`);
|
73
75
|
}
|
74
76
|
}
|
75
|
-
exports.default = default_1;
|
76
77
|
async function runInParallel(options, context) {
|
77
78
|
const procs = options.commands.map((c) => createProcess(null, c, options.readyWhenStatus, options.color, calculateCwd(options.cwd, context), options.env ?? {}, true, options.usePty, options.streamOutput, options.tty, options.envFile).then((result) => ({
|
78
79
|
result,
|
@@ -345,7 +346,6 @@ function interpolateArgsIntoCommand(command, opts, forwardAllArgs) {
|
|
345
346
|
return command;
|
346
347
|
}
|
347
348
|
}
|
348
|
-
exports.interpolateArgsIntoCommand = interpolateArgsIntoCommand;
|
349
349
|
function parseArgs(unparsedCommandArgs, unknownOptions, args) {
|
350
350
|
if (!args) {
|
351
351
|
return { ...unknownOptions, ...unparsedCommandArgs };
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = default_1;
|
3
4
|
const path = require("path");
|
4
5
|
const package_manager_1 = require("../../utils/package-manager");
|
5
6
|
const child_process_1 = require("child_process");
|
@@ -29,7 +30,6 @@ async function default_1(options, context) {
|
|
29
30
|
return { success: false };
|
30
31
|
}
|
31
32
|
}
|
32
|
-
exports.default = default_1;
|
33
33
|
function nodeProcess(command, cwd, env) {
|
34
34
|
(0, child_process_1.execSync)(command, {
|
35
35
|
stdio: ['inherit', 'inherit', 'inherit'],
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* This is a copy of the @nx/devkit utility but this should not be used outside of the nx package
|
4
4
|
*/
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.convertNxExecutor =
|
6
|
+
exports.convertNxExecutor = convertNxExecutor;
|
7
7
|
const nx_json_1 = require("../../config/nx-json");
|
8
8
|
const retrieve_workspace_files_1 = require("../../project-graph/utils/retrieve-workspace-files");
|
9
9
|
const project_configuration_utils_1 = require("../../project-graph/utils/project-configuration-utils");
|
@@ -43,7 +43,6 @@ function convertNxExecutor(executor) {
|
|
43
43
|
};
|
44
44
|
return require('@angular-devkit/architect').createBuilder(builderFunction);
|
45
45
|
}
|
46
|
-
exports.convertNxExecutor = convertNxExecutor;
|
47
46
|
function toObservable(promiseOrAsyncIterator) {
|
48
47
|
return new (require('rxjs').Observable)((subscriber) => {
|
49
48
|
promiseOrAsyncIterator
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.formatChangedFilesWithPrettierIfAvailable =
|
3
|
+
exports.formatChangedFilesWithPrettierIfAvailable = formatChangedFilesWithPrettierIfAvailable;
|
4
4
|
const path = require("path");
|
5
5
|
/**
|
6
6
|
* Formats all the created or updated files using Prettier
|
@@ -46,4 +46,3 @@ async function formatChangedFilesWithPrettierIfAvailable(tree, options) {
|
|
46
46
|
}
|
47
47
|
}));
|
48
48
|
}
|
49
|
-
exports.formatChangedFilesWithPrettierIfAvailable = formatChangedFilesWithPrettierIfAvailable;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.createTreeWithEmptyWorkspace = createTreeWithEmptyWorkspace;
|
4
|
+
exports.createTreeWithEmptyV1Workspace = createTreeWithEmptyV1Workspace;
|
4
5
|
const tree_1 = require("../tree");
|
5
6
|
const workspace_root_1 = require("../../utils/workspace-root");
|
6
7
|
/**
|
@@ -16,14 +17,12 @@ function createTreeWithEmptyWorkspace(opts = {}) {
|
|
16
17
|
process.env.INIT_CWD = workspace_root_1.workspaceRoot;
|
17
18
|
return addCommonFiles(tree, opts.layout === 'apps-libs');
|
18
19
|
}
|
19
|
-
exports.createTreeWithEmptyWorkspace = createTreeWithEmptyWorkspace;
|
20
20
|
/**
|
21
21
|
* @deprecated use createTreeWithEmptyWorkspace instead
|
22
22
|
*/
|
23
23
|
function createTreeWithEmptyV1Workspace() {
|
24
24
|
throw new Error('Use createTreeWithEmptyWorkspace instead of createTreeWithEmptyV1Workspace');
|
25
25
|
}
|
26
|
-
exports.createTreeWithEmptyV1Workspace = createTreeWithEmptyV1Workspace;
|
27
26
|
function addCommonFiles(tree, addAppsAndLibsFolders) {
|
28
27
|
tree.write('./.prettierrc', JSON.stringify({ singleQuote: true }));
|
29
28
|
tree.write('/package.json', JSON.stringify({
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createTree =
|
3
|
+
exports.createTree = createTree;
|
4
4
|
const tree_1 = require("../tree");
|
5
5
|
/**
|
6
6
|
* Creates a host for testing.
|
@@ -8,4 +8,3 @@ const tree_1 = require("../tree");
|
|
8
8
|
function createTree() {
|
9
9
|
return new tree_1.FsTree('/virtual', false);
|
10
10
|
}
|
11
|
-
exports.createTree = createTree;
|
package/src/generators/tree.d.ts
CHANGED
package/src/generators/tree.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.FsTree = void 0;
|
4
|
+
exports.flushChanges = flushChanges;
|
5
|
+
exports.printChanges = printChanges;
|
4
6
|
const fs_extra_1 = require("fs-extra");
|
5
7
|
const logger_1 = require("../utils/logger");
|
6
8
|
const output_1 = require("../utils/output");
|
@@ -292,7 +294,6 @@ function flushChanges(root, fileChanges) {
|
|
292
294
|
}
|
293
295
|
});
|
294
296
|
}
|
295
|
-
exports.flushChanges = flushChanges;
|
296
297
|
function printChanges(fileChanges, indent = '') {
|
297
298
|
fileChanges.forEach((f) => {
|
298
299
|
if (f.type === 'CREATE') {
|
@@ -306,4 +307,3 @@ function printChanges(fileChanges, indent = '') {
|
|
306
307
|
}
|
307
308
|
});
|
308
309
|
}
|
309
|
-
exports.printChanges = printChanges;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.glob = glob;
|
4
|
+
exports.globAsync = globAsync;
|
4
5
|
const minimatch_1 = require("minimatch");
|
5
6
|
const globs_1 = require("../../utils/globs");
|
6
7
|
const workspace_context_1 = require("../../utils/workspace-context");
|
@@ -17,7 +18,6 @@ const workspace_context_1 = require("../../utils/workspace-context");
|
|
17
18
|
function glob(tree, patterns) {
|
18
19
|
return combineGlobResultsWithTree(tree, patterns, (0, workspace_context_1.globWithWorkspaceContextSync)(tree.root, patterns));
|
19
20
|
}
|
20
|
-
exports.glob = glob;
|
21
21
|
/**
|
22
22
|
* Performs a tree-aware glob search on the files in a workspace. Able to find newly
|
23
23
|
* created files and hides deleted files before the updates are committed to disk.
|
@@ -30,7 +30,6 @@ exports.glob = glob;
|
|
30
30
|
async function globAsync(tree, patterns) {
|
31
31
|
return combineGlobResultsWithTree(tree, patterns, await (0, workspace_context_1.globWithWorkspaceContext)(tree.root, patterns));
|
32
32
|
}
|
33
|
-
exports.globAsync = globAsync;
|
34
33
|
function combineGlobResultsWithTree(tree, patterns, results) {
|
35
34
|
const matches = new Set(results);
|
36
35
|
const combinedGlob = (0, globs_1.combineGlobPatterns)(patterns);
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.readJson = readJson;
|
4
|
+
exports.writeJson = writeJson;
|
5
|
+
exports.updateJson = updateJson;
|
4
6
|
const json_1 = require("../../utils/json");
|
5
7
|
/**
|
6
8
|
* Reads a json file, removes all comments and parses JSON.
|
@@ -20,7 +22,6 @@ function readJson(tree, path, options) {
|
|
20
22
|
throw new Error(`Cannot parse ${path}: ${e.message}`);
|
21
23
|
}
|
22
24
|
}
|
23
|
-
exports.readJson = readJson;
|
24
25
|
/**
|
25
26
|
* Writes a JSON value to the file system tree
|
26
27
|
|
@@ -33,7 +34,6 @@ function writeJson(tree, path, value, options) {
|
|
33
34
|
const serialized = (0, json_1.serializeJson)(value, options);
|
34
35
|
tree.write(path, `${serialized}\n`);
|
35
36
|
}
|
36
|
-
exports.writeJson = writeJson;
|
37
37
|
/**
|
38
38
|
* Updates a JSON value to the file system tree
|
39
39
|
*
|
@@ -46,4 +46,3 @@ function updateJson(tree, path, updater, options) {
|
|
46
46
|
const updatedValue = updater(readJson(tree, path, options));
|
47
47
|
writeJson(tree, path, updatedValue, options);
|
48
48
|
}
|
49
|
-
exports.updateJson = updateJson;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.readNxJson = readNxJson;
|
4
|
+
exports.updateNxJson = updateNxJson;
|
4
5
|
const path_1 = require("path");
|
5
6
|
const json_1 = require("./json");
|
6
7
|
const nx_json_1 = require("../../config/nx-json");
|
@@ -22,7 +23,6 @@ function readNxJson(tree) {
|
|
22
23
|
return (0, nx_json_1.readNxJson)();
|
23
24
|
}
|
24
25
|
}
|
25
|
-
exports.readNxJson = readNxJson;
|
26
26
|
/**
|
27
27
|
* Update nx.json
|
28
28
|
*/
|
@@ -46,7 +46,6 @@ function updateNxJson(tree, nxJson) {
|
|
46
46
|
});
|
47
47
|
}
|
48
48
|
}
|
49
|
-
exports.updateNxJson = updateNxJson;
|
50
49
|
function readNxJsonExtends(tree, extendsPath) {
|
51
50
|
try {
|
52
51
|
return (0, json_1.readJson)(tree, (0, path_1.relative)(tree.root, require.resolve(extendsPath, {
|
@@ -1,6 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.updateNxJson = exports.readNxJson = void 0;
|
4
|
+
exports.addProjectConfiguration = addProjectConfiguration;
|
5
|
+
exports.updateProjectConfiguration = updateProjectConfiguration;
|
6
|
+
exports.removeProjectConfiguration = removeProjectConfiguration;
|
7
|
+
exports.readProjectConfiguration = readProjectConfiguration;
|
8
|
+
exports.getProjects = getProjects;
|
9
|
+
exports.getRelativeProjectJsonSchemaPath = getRelativeProjectJsonSchemaPath;
|
4
10
|
const minimatch_1 = require("minimatch");
|
5
11
|
const path_1 = require("path");
|
6
12
|
const package_json_workspaces_1 = require("../../plugins/package-json-workspaces");
|
@@ -42,7 +48,6 @@ function addProjectConfiguration(tree, projectName, projectConfiguration, standa
|
|
42
48
|
root: undefined,
|
43
49
|
});
|
44
50
|
}
|
45
|
-
exports.addProjectConfiguration = addProjectConfiguration;
|
46
51
|
/**
|
47
52
|
* Updates the configuration of an existing project.
|
48
53
|
*
|
@@ -63,7 +68,6 @@ function updateProjectConfiguration(tree, projectName, projectConfiguration) {
|
|
63
68
|
root: undefined,
|
64
69
|
});
|
65
70
|
}
|
66
|
-
exports.updateProjectConfiguration = updateProjectConfiguration;
|
67
71
|
/**
|
68
72
|
* Removes the configuration of an existing project.
|
69
73
|
*
|
@@ -80,7 +84,6 @@ function removeProjectConfiguration(tree, projectName) {
|
|
80
84
|
tree.delete(projectConfigFile);
|
81
85
|
}
|
82
86
|
}
|
83
|
-
exports.removeProjectConfiguration = removeProjectConfiguration;
|
84
87
|
/**
|
85
88
|
* Reads a project configuration.
|
86
89
|
*
|
@@ -101,7 +104,6 @@ function readProjectConfiguration(tree, projectName) {
|
|
101
104
|
}
|
102
105
|
return allProjects[projectName];
|
103
106
|
}
|
104
|
-
exports.readProjectConfiguration = readProjectConfiguration;
|
105
107
|
/**
|
106
108
|
* Get a map of all projects in a workspace.
|
107
109
|
*
|
@@ -118,11 +120,9 @@ function getProjects(tree) {
|
|
118
120
|
return [projectName, allProjects[projectName]];
|
119
121
|
}));
|
120
122
|
}
|
121
|
-
exports.getProjects = getProjects;
|
122
123
|
function getRelativeProjectJsonSchemaPath(tree, project) {
|
123
124
|
return (0, path_2.normalizePath)((0, path_1.relative)((0, path_1.join)(tree.root, project.root), (0, path_1.join)(tree.root, 'node_modules/nx/schemas/project-schema.json')));
|
124
125
|
}
|
125
|
-
exports.getRelativeProjectJsonSchemaPath = getRelativeProjectJsonSchemaPath;
|
126
126
|
function readAndCombineAllProjectConfigurations(tree) {
|
127
127
|
/**
|
128
128
|
* We can't update projects that come from plugins anyways, so we are going
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createTaskHasher =
|
3
|
+
exports.createTaskHasher = createTaskHasher;
|
4
4
|
const client_1 = require("../daemon/client/client");
|
5
5
|
const build_project_graph_1 = require("../project-graph/build-project-graph");
|
6
6
|
const task_hasher_1 = require("./task-hasher");
|
@@ -13,4 +13,3 @@ function createTaskHasher(projectGraph, nxJson, runnerOptions) {
|
|
13
13
|
return new task_hasher_1.InProcessTaskHasher(fileMap?.projectFileMap, allWorkspaceFiles, projectGraph, nxJson, rustReferences, runnerOptions);
|
14
14
|
}
|
15
15
|
}
|
16
|
-
exports.createTaskHasher = createTaskHasher;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.hashArray = hashArray;
|
4
|
+
exports.hashObject = hashObject;
|
4
5
|
function hashArray(content) {
|
5
6
|
// Import as needed. There is also an issue running unit tests in Nx repo if this is a top-level import.
|
6
7
|
const { hashArray } = require('../native');
|
7
8
|
return hashArray(content);
|
8
9
|
}
|
9
|
-
exports.hashArray = hashArray;
|
10
10
|
function hashObject(obj) {
|
11
11
|
const { hashArray } = require('../native');
|
12
12
|
const parts = [];
|
@@ -16,4 +16,3 @@ function hashObject(obj) {
|
|
16
16
|
}
|
17
17
|
return hashArray(parts);
|
18
18
|
}
|
19
|
-
exports.hashObject = hashObject;
|
package/src/hasher/hash-task.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
|
4
|
+
exports.hashTask = hashTask;
|
4
5
|
const utils_1 = require("../tasks-runner/utils");
|
5
6
|
const project_graph_1 = require("../project-graph/project-graph");
|
6
7
|
const task_hasher_1 = require("./task-hasher");
|
@@ -30,7 +31,6 @@ async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGrap
|
|
30
31
|
performance.mark('hashMultipleTasks:end');
|
31
32
|
performance.measure('hashMultipleTasks', 'hashMultipleTasks:start', 'hashMultipleTasks:end');
|
32
33
|
}
|
33
|
-
exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
|
34
34
|
async function hashTask(hasher, projectGraph, taskGraph, task, env) {
|
35
35
|
performance.mark('hashSingleTask:start');
|
36
36
|
const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
|
@@ -51,4 +51,3 @@ async function hashTask(hasher, projectGraph, taskGraph, task, env) {
|
|
51
51
|
performance.mark('hashSingleTask:end');
|
52
52
|
performance.measure('hashSingleTask', 'hashSingleTask:start', 'hashSingleTask:end');
|
53
53
|
}
|
54
|
-
exports.hashTask = hashTask;
|
@@ -1,6 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.InProcessTaskHasher = exports.DaemonBasedTaskHasher = void 0;
|
4
|
+
exports.getNamedInputs = getNamedInputs;
|
5
|
+
exports.getTargetInputs = getTargetInputs;
|
6
|
+
exports.extractPatternsFromFileSets = extractPatternsFromFileSets;
|
7
|
+
exports.getInputs = getInputs;
|
8
|
+
exports.isSelfInput = isSelfInput;
|
9
|
+
exports.isDepsOutput = isDepsOutput;
|
10
|
+
exports.expandSingleProjectInputs = expandSingleProjectInputs;
|
11
|
+
exports.expandNamedInput = expandNamedInput;
|
12
|
+
exports.filterUsingGlobPatterns = filterUsingGlobPatterns;
|
4
13
|
const file_hasher_1 = require("./file-hasher");
|
5
14
|
const node_task_hasher_impl_1 = require("./node-task-hasher-impl");
|
6
15
|
const minimatch_1 = require("minimatch");
|
@@ -106,7 +115,6 @@ function getNamedInputs(nxJson, project) {
|
|
106
115
|
...project.data.namedInputs,
|
107
116
|
};
|
108
117
|
}
|
109
|
-
exports.getNamedInputs = getNamedInputs;
|
110
118
|
function getTargetInputs(nxJson, projectNode, target) {
|
111
119
|
const namedInputs = getNamedInputs(nxJson, projectNode);
|
112
120
|
const targetData = projectNode.data.targets[target];
|
@@ -116,13 +124,11 @@ function getTargetInputs(nxJson, projectNode, target) {
|
|
116
124
|
const dependencyInputs = extractPatternsFromFileSets(inputs.depsInputs.map((s) => expandNamedInput(s.input, namedInputs)).flat());
|
117
125
|
return { selfInputs, dependencyInputs };
|
118
126
|
}
|
119
|
-
exports.getTargetInputs = getTargetInputs;
|
120
127
|
function extractPatternsFromFileSets(inputs) {
|
121
128
|
return inputs
|
122
129
|
.filter((c) => !!c['fileset'])
|
123
130
|
.map((c) => c['fileset']);
|
124
131
|
}
|
125
|
-
exports.extractPatternsFromFileSets = extractPatternsFromFileSets;
|
126
132
|
function getInputs(task, projectGraph, nxJson) {
|
127
133
|
const projectNode = projectGraph.nodes[task.target.project];
|
128
134
|
const namedInputs = getNamedInputs(nxJson, projectNode);
|
@@ -131,7 +137,6 @@ function getInputs(task, projectGraph, nxJson) {
|
|
131
137
|
const { selfInputs, depsInputs, depsOutputs, projectInputs } = splitInputsIntoSelfAndDependencies(targetData.inputs || targetDefaults?.inputs || DEFAULT_INPUTS, namedInputs);
|
132
138
|
return { selfInputs, depsInputs, depsOutputs, projectInputs };
|
133
139
|
}
|
134
|
-
exports.getInputs = getInputs;
|
135
140
|
function splitInputsIntoSelfAndDependencies(inputs, namedInputs) {
|
136
141
|
const depsInputs = [];
|
137
142
|
const projectInputs = [];
|
@@ -181,11 +186,9 @@ function splitInputsIntoSelfAndDependencies(inputs, namedInputs) {
|
|
181
186
|
function isSelfInput(input) {
|
182
187
|
return !('dependentTasksOutputFiles' in input);
|
183
188
|
}
|
184
|
-
exports.isSelfInput = isSelfInput;
|
185
189
|
function isDepsOutput(input) {
|
186
190
|
return 'dependentTasksOutputFiles' in input;
|
187
191
|
}
|
188
|
-
exports.isDepsOutput = isDepsOutput;
|
189
192
|
function expandSingleProjectInputs(inputs, namedInputs) {
|
190
193
|
const expanded = [];
|
191
194
|
for (const d of inputs) {
|
@@ -217,14 +220,12 @@ function expandSingleProjectInputs(inputs, namedInputs) {
|
|
217
220
|
}
|
218
221
|
return expanded;
|
219
222
|
}
|
220
|
-
exports.expandSingleProjectInputs = expandSingleProjectInputs;
|
221
223
|
function expandNamedInput(input, namedInputs) {
|
222
224
|
namedInputs ||= {};
|
223
225
|
if (!namedInputs[input])
|
224
226
|
throw new Error(`Input '${input}' is not defined`);
|
225
227
|
return expandSingleProjectInputs(namedInputs[input], namedInputs);
|
226
228
|
}
|
227
|
-
exports.expandNamedInput = expandNamedInput;
|
228
229
|
function filterUsingGlobPatterns(root, files, patterns) {
|
229
230
|
const filesetWithExpandedProjectRoot = patterns
|
230
231
|
.map((f) => f.replace('{projectRoot}', root))
|
@@ -263,4 +264,3 @@ function filterUsingGlobPatterns(root, files, patterns) {
|
|
263
264
|
return negative.every((pattern) => (0, minimatch_1.minimatch)(f.file, pattern));
|
264
265
|
});
|
265
266
|
}
|
266
|
-
exports.filterUsingGlobPatterns = filterUsingGlobPatterns;
|