nx 19.5.0-beta.0 → 19.5.0-beta.2
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/schemas/project-schema.json +26 -0
- 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 +2 -3
- 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/task-graph.d.ts +4 -0
- package/src/config/to-project-name.js +1 -2
- package/src/config/workspace-json-project-json.d.ts +5 -0
- 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/index.d.ts +1 -0
- 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 +2 -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 +1 -3
- 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 +6 -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.js +30 -14
- package/src/project-graph/utils/retrieve-workspace-files.js +6 -7
- package/src/tasks-runner/create-task-graph.d.ts +2 -1
- package/src/tasks-runner/create-task-graph.js +18 -33
- 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/tasks-schedule.d.ts +1 -0
- package/src/tasks-runner/tasks-schedule.js +28 -4
- package/src/tasks-runner/utils.d.ts +15 -2
- package/src/tasks-runner/utils.js +107 -43
- 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 +5 -5
- 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.d.ts +2 -0
- package/src/utils/globs.js +12 -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 +7 -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,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.nxFileMap = exports.nxProjectGraph = void 0;
|
4
|
+
exports.ensureCacheDirectory = ensureCacheDirectory;
|
5
|
+
exports.readFileMapCache = readFileMapCache;
|
6
|
+
exports.readProjectGraphCache = readProjectGraphCache;
|
7
|
+
exports.createProjectFileMapCache = createProjectFileMapCache;
|
8
|
+
exports.writeCache = writeCache;
|
9
|
+
exports.shouldRecomputeWholeGraph = shouldRecomputeWholeGraph;
|
10
|
+
exports.extractCachedFileData = extractCachedFileData;
|
4
11
|
const fs_1 = require("fs");
|
5
12
|
const fs_extra_1 = require("fs-extra");
|
6
13
|
const path_1 = require("path");
|
@@ -32,7 +39,6 @@ function ensureCacheDirectory() {
|
|
32
39
|
}
|
33
40
|
}
|
34
41
|
}
|
35
|
-
exports.ensureCacheDirectory = ensureCacheDirectory;
|
36
42
|
function readFileMapCache() {
|
37
43
|
perf_hooks_1.performance.mark('read cache:start');
|
38
44
|
ensureCacheDirectory();
|
@@ -50,7 +56,6 @@ function readFileMapCache() {
|
|
50
56
|
perf_hooks_1.performance.measure('read cache', 'read cache:start', 'read cache:end');
|
51
57
|
return data ?? null;
|
52
58
|
}
|
53
|
-
exports.readFileMapCache = readFileMapCache;
|
54
59
|
function readProjectGraphCache() {
|
55
60
|
perf_hooks_1.performance.mark('read project-graph:start');
|
56
61
|
ensureCacheDirectory();
|
@@ -68,7 +73,6 @@ function readProjectGraphCache() {
|
|
68
73
|
perf_hooks_1.performance.measure('read cache', 'read project-graph:start', 'read project-graph:end');
|
69
74
|
return data ?? null;
|
70
75
|
}
|
71
|
-
exports.readProjectGraphCache = readProjectGraphCache;
|
72
76
|
function createProjectFileMapCache(nxJson, packageJsonDeps, fileMap, tsConfig) {
|
73
77
|
const nxJsonPlugins = getNxJsonPluginsData(nxJson, packageJsonDeps);
|
74
78
|
const newValue = {
|
@@ -83,7 +87,6 @@ function createProjectFileMapCache(nxJson, packageJsonDeps, fileMap, tsConfig) {
|
|
83
87
|
};
|
84
88
|
return newValue;
|
85
89
|
}
|
86
|
-
exports.createProjectFileMapCache = createProjectFileMapCache;
|
87
90
|
function writeCache(cache, projectGraph) {
|
88
91
|
perf_hooks_1.performance.mark('write cache:start');
|
89
92
|
let retry = 1;
|
@@ -117,7 +120,6 @@ function writeCache(cache, projectGraph) {
|
|
117
120
|
perf_hooks_1.performance.mark('write cache:end');
|
118
121
|
perf_hooks_1.performance.measure('write cache', 'write cache:start', 'write cache:end');
|
119
122
|
}
|
120
|
-
exports.writeCache = writeCache;
|
121
123
|
function shouldRecomputeWholeGraph(cache, packageJsonDeps, projects, nxJson, tsConfig) {
|
122
124
|
if (cache.version !== '6.0') {
|
123
125
|
return true;
|
@@ -153,7 +155,6 @@ function shouldRecomputeWholeGraph(cache, packageJsonDeps, projects, nxJson, tsC
|
|
153
155
|
}
|
154
156
|
return false;
|
155
157
|
}
|
156
|
-
exports.shouldRecomputeWholeGraph = shouldRecomputeWholeGraph;
|
157
158
|
/*
|
158
159
|
This can only be invoked when the list of projects is either the same
|
159
160
|
or new projects have been added, so every project in the cache has a corresponding
|
@@ -178,7 +179,6 @@ function extractCachedFileData(fileMap, c) {
|
|
178
179
|
cachedFileData,
|
179
180
|
};
|
180
181
|
}
|
181
|
-
exports.extractCachedFileData = extractCachedFileData;
|
182
182
|
function processNonProjectFiles(cachedFiles, nonProjectFiles, filesToProcess, cachedFileData) {
|
183
183
|
const cachedHashMap = new Map(cachedFiles.map((f) => [f.file, f]));
|
184
184
|
for (const f of nonProjectFiles) {
|
@@ -1,6 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.pruneExternalNodes = void 0;
|
4
|
+
exports.reverse = reverse;
|
5
|
+
exports.filterNodes = filterNodes;
|
6
|
+
exports.isNpmProject = isNpmProject;
|
7
|
+
exports.withDeps = withDeps;
|
4
8
|
const reverseMemo = new Map();
|
5
9
|
/**
|
6
10
|
* Returns a new project graph where all the edges are reversed.
|
@@ -40,7 +44,6 @@ function reverse(graph) {
|
|
40
44
|
reverseMemo.set(result, graph);
|
41
45
|
return result;
|
42
46
|
}
|
43
|
-
exports.reverse = reverse;
|
44
47
|
function filterNodes(predicate) {
|
45
48
|
return (original) => {
|
46
49
|
const graph = { nodes: {}, dependencies: {} };
|
@@ -62,11 +65,9 @@ function filterNodes(predicate) {
|
|
62
65
|
return graph;
|
63
66
|
};
|
64
67
|
}
|
65
|
-
exports.filterNodes = filterNodes;
|
66
68
|
function isNpmProject(project) {
|
67
69
|
return project?.type === 'npm';
|
68
70
|
}
|
69
|
-
exports.isNpmProject = isNpmProject;
|
70
71
|
exports.pruneExternalNodes = filterNodes();
|
71
72
|
function withDeps(original, subsetNodes) {
|
72
73
|
const res = { nodes: {}, dependencies: {} };
|
@@ -111,4 +112,3 @@ function withDeps(original, subsetNodes) {
|
|
111
112
|
});
|
112
113
|
}
|
113
114
|
}
|
114
|
-
exports.withDeps = withDeps;
|
@@ -25,5 +25,5 @@ export declare const nxPluginCache: Map<unknown, [
|
|
25
25
|
Promise<LoadedNxPlugin>,
|
26
26
|
() => void
|
27
27
|
]>;
|
28
|
-
export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<[LoadedNxPlugin[], () => void]>;
|
28
|
+
export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<readonly [LoadedNxPlugin[], () => void]>;
|
29
29
|
export declare function getDefaultPlugins(root: string): Promise<string[]>;
|
@@ -2,7 +2,9 @@
|
|
2
2
|
// This file contains the bits and bobs of the internal API for loading and interacting with Nx plugins.
|
3
3
|
// For the public API, used by plugin authors, see `./public-api.ts`.
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
-
exports.
|
5
|
+
exports.nxPluginCache = exports.LoadedNxPlugin = void 0;
|
6
|
+
exports.loadNxPlugins = loadNxPlugins;
|
7
|
+
exports.getDefaultPlugins = getDefaultPlugins;
|
6
8
|
const path_1 = require("path");
|
7
9
|
const workspace_root_1 = require("../../utils/workspace-root");
|
8
10
|
const angular_json_1 = require("../../adapter/angular-json");
|
@@ -69,18 +71,19 @@ exports.LoadedNxPlugin = LoadedNxPlugin;
|
|
69
71
|
// referenced multiple times.
|
70
72
|
exports.nxPluginCache = new Map();
|
71
73
|
async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
|
72
|
-
|
73
|
-
const loadingMethod = process.env.NX_ISOLATE_PLUGINS
|
74
|
+
performance.mark('loadNxPlugins:start');
|
75
|
+
const loadingMethod = process.env.NX_ISOLATE_PLUGINS !== 'false'
|
74
76
|
? isolation_1.loadNxPluginInIsolation
|
75
77
|
: loader_1.loadNxPlugin;
|
76
78
|
plugins = await normalizePlugins(plugins, root);
|
79
|
+
const result = new Array(plugins?.length);
|
77
80
|
const cleanupFunctions = [];
|
78
|
-
|
81
|
+
await Promise.all(plugins.map(async (plugin, idx) => {
|
79
82
|
const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root);
|
80
|
-
result
|
83
|
+
result[idx] = loadedPluginPromise;
|
81
84
|
cleanupFunctions.push(cleanup);
|
82
|
-
}
|
83
|
-
|
85
|
+
}));
|
86
|
+
const ret = [
|
84
87
|
await Promise.all(result),
|
85
88
|
() => {
|
86
89
|
for (const fn of cleanupFunctions) {
|
@@ -91,8 +94,10 @@ async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
|
|
91
94
|
}
|
92
95
|
},
|
93
96
|
];
|
97
|
+
performance.mark('loadNxPlugins:end');
|
98
|
+
performance.measure('loadNxPlugins', 'loadNxPlugins:start', 'loadNxPlugins:end');
|
99
|
+
return ret;
|
94
100
|
}
|
95
|
-
exports.loadNxPlugins = loadNxPlugins;
|
96
101
|
async function normalizePlugins(plugins, root) {
|
97
102
|
plugins ??= [];
|
98
103
|
return [
|
@@ -114,4 +119,3 @@ async function getDefaultPlugins(root) {
|
|
114
119
|
(0, path_1.join)(__dirname, '../../plugins/project-json/build-nodes/project-json'),
|
115
120
|
];
|
116
121
|
}
|
117
|
-
exports.getDefaultPlugins = getDefaultPlugins;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.loadNxPluginInIsolation =
|
3
|
+
exports.loadNxPluginInIsolation = loadNxPluginInIsolation;
|
4
4
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
5
5
|
const plugin_pool_1 = require("./plugin-pool");
|
6
6
|
async function loadNxPluginInIsolation(plugin, root = workspace_root_1.workspaceRoot) {
|
@@ -12,4 +12,3 @@ async function loadNxPluginInIsolation(plugin, root = workspace_root_1.workspace
|
|
12
12
|
},
|
13
13
|
];
|
14
14
|
}
|
15
|
-
exports.loadNxPluginInIsolation = loadNxPluginInIsolation;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
1
|
import { ProjectGraph, ProjectGraphProcessorContext } from '../../../config/project-graph';
|
4
2
|
import { PluginConfiguration } from '../../../config/nx-json';
|
5
3
|
import { CreateDependenciesContext, CreateMetadataContext, CreateNodesContextV2 } from '../public-api';
|
@@ -84,7 +82,7 @@ export interface PluginCreateMetadataResult {
|
|
84
82
|
tx: string;
|
85
83
|
} | {
|
86
84
|
success: false;
|
87
|
-
error:
|
85
|
+
error: Error;
|
88
86
|
tx: string;
|
89
87
|
};
|
90
88
|
}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.isPluginWorkerMessage = isPluginWorkerMessage;
|
4
|
+
exports.isPluginWorkerResult = isPluginWorkerResult;
|
5
|
+
exports.consumeMessage = consumeMessage;
|
6
|
+
exports.sendMessageOverSocket = sendMessageOverSocket;
|
4
7
|
function isPluginWorkerMessage(message) {
|
5
8
|
return (typeof message === 'object' &&
|
6
9
|
'type' in message &&
|
@@ -13,7 +16,6 @@ function isPluginWorkerMessage(message) {
|
|
13
16
|
'createMetadata',
|
14
17
|
].includes(message.type));
|
15
18
|
}
|
16
|
-
exports.isPluginWorkerMessage = isPluginWorkerMessage;
|
17
19
|
function isPluginWorkerResult(message) {
|
18
20
|
return (typeof message === 'object' &&
|
19
21
|
'type' in message &&
|
@@ -26,7 +28,6 @@ function isPluginWorkerResult(message) {
|
|
26
28
|
'createMetadataResult',
|
27
29
|
].includes(message.type));
|
28
30
|
}
|
29
|
-
exports.isPluginWorkerResult = isPluginWorkerResult;
|
30
31
|
// Takes a message and a map of handlers and calls the appropriate handler
|
31
32
|
// type safe and requires all handlers to be handled
|
32
33
|
async function consumeMessage(socket, raw, handlers) {
|
@@ -39,8 +40,6 @@ async function consumeMessage(socket, raw, handlers) {
|
|
39
40
|
}
|
40
41
|
}
|
41
42
|
}
|
42
|
-
exports.consumeMessage = consumeMessage;
|
43
43
|
function sendMessageOverSocket(socket, message) {
|
44
44
|
socket.write(JSON.stringify(message) + String.fromCodePoint(4));
|
45
45
|
}
|
46
|
-
exports.sendMessageOverSocket = sendMessageOverSocket;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.loadRemoteNxPlugin =
|
3
|
+
exports.loadRemoteNxPlugin = loadRemoteNxPlugin;
|
4
4
|
const child_process_1 = require("child_process");
|
5
5
|
const path = require("path");
|
6
6
|
const net_1 = require("net");
|
@@ -48,7 +48,6 @@ async function loadRemoteNxPlugin(plugin, root) {
|
|
48
48
|
nxPluginWorkerCache.set(cacheKey, pluginPromise);
|
49
49
|
return [pluginPromise, cleanupFunction];
|
50
50
|
}
|
51
|
-
exports.loadRemoteNxPlugin = loadRemoteNxPlugin;
|
52
51
|
function shutdownPluginWorker(worker) {
|
53
52
|
// Clears the plugin cache so no refs to the workers are held
|
54
53
|
internal_api_1.nxPluginCache.clear();
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const messaging_1 = require("./messaging");
|
4
4
|
const loader_1 = require("../loader");
|
5
5
|
const serializable_error_1 = require("../../../utils/serializable-error");
|
6
|
-
const net_1 = require("net");
|
7
6
|
const consume_messages_from_socket_1 = require("../../../utils/consume-messages-from-socket");
|
7
|
+
const net_1 = require("net");
|
8
8
|
const fs_1 = require("fs");
|
9
9
|
if (process.env.NX_PERF_LOGGING === 'true') {
|
10
10
|
require('../../../utils/perf-logging');
|
@@ -117,7 +117,11 @@ const server = (0, net_1.createServer)((socket) => {
|
|
117
117
|
catch (e) {
|
118
118
|
return {
|
119
119
|
type: 'createMetadataResult',
|
120
|
-
payload: {
|
120
|
+
payload: {
|
121
|
+
success: false,
|
122
|
+
error: (0, serializable_error_1.createSerializableError)(e),
|
123
|
+
tx,
|
124
|
+
},
|
121
125
|
};
|
122
126
|
}
|
123
127
|
},
|
@@ -1,7 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
// This file contains methods and utilities that should **only** be used by the plugin worker.
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.
|
4
|
+
exports.unregisterPluginTSTranspiler = void 0;
|
5
|
+
exports.readPluginPackageJson = readPluginPackageJson;
|
6
|
+
exports.resolveLocalNxPlugin = resolveLocalNxPlugin;
|
7
|
+
exports.registerPluginTSTranspiler = registerPluginTSTranspiler;
|
8
|
+
exports.getPluginPathAndName = getPluginPathAndName;
|
9
|
+
exports.loadNxPlugin = loadNxPlugin;
|
10
|
+
exports.loadNxPluginAsync = loadNxPluginAsync;
|
5
11
|
const posix_1 = require("node:path/posix");
|
6
12
|
const installation_directory_1 = require("../../utils/installation-directory");
|
7
13
|
const package_json_1 = require("../../utils/package-json");
|
@@ -44,11 +50,9 @@ function readPluginPackageJson(pluginName, projects, paths = (0, installation_di
|
|
44
50
|
throw e;
|
45
51
|
}
|
46
52
|
}
|
47
|
-
exports.readPluginPackageJson = readPluginPackageJson;
|
48
53
|
function resolveLocalNxPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {
|
49
54
|
return lookupLocalPlugin(importPath, projects, root);
|
50
55
|
}
|
51
|
-
exports.resolveLocalNxPlugin = resolveLocalNxPlugin;
|
52
56
|
exports.unregisterPluginTSTranspiler = null;
|
53
57
|
/**
|
54
58
|
* Register swc-node or ts-node if they are not currently registered
|
@@ -78,7 +82,6 @@ function registerPluginTSTranspiler() {
|
|
78
82
|
cleanupFns.forEach((fn) => fn?.());
|
79
83
|
};
|
80
84
|
}
|
81
|
-
exports.registerPluginTSTranspiler = registerPluginTSTranspiler;
|
82
85
|
function lookupLocalPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {
|
83
86
|
const projectConfig = findNxProjectForImportPath(importPath, projects, root);
|
84
87
|
if (!projectConfig) {
|
@@ -173,7 +176,6 @@ function getPluginPathAndName(moduleName, paths, projects, root) {
|
|
173
176
|
: { name: moduleName };
|
174
177
|
return { pluginPath, name };
|
175
178
|
}
|
176
|
-
exports.getPluginPathAndName = getPluginPathAndName;
|
177
179
|
let projectsWithoutInference;
|
178
180
|
function loadNxPlugin(plugin, root) {
|
179
181
|
return [
|
@@ -181,7 +183,6 @@ function loadNxPlugin(plugin, root) {
|
|
181
183
|
() => { },
|
182
184
|
];
|
183
185
|
}
|
184
|
-
exports.loadNxPlugin = loadNxPlugin;
|
185
186
|
async function loadNxPluginAsync(pluginConfiguration, paths, root) {
|
186
187
|
const moduleName = typeof pluginConfiguration === 'string'
|
187
188
|
? pluginConfiguration
|
@@ -207,7 +208,6 @@ async function loadNxPluginAsync(pluginConfiguration, paths, root) {
|
|
207
208
|
throw new error_types_1.LoadPluginError(moduleName, e);
|
208
209
|
}
|
209
210
|
}
|
210
|
-
exports.loadNxPluginAsync = loadNxPluginAsync;
|
211
211
|
async function importPluginModule(pluginPath) {
|
212
212
|
const m = await Promise.resolve(`${pluginPath}`).then(s => require(s));
|
213
213
|
if (m.default &&
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.isNxPluginV2 = isNxPluginV2;
|
4
|
+
exports.isNxPluginV1 = isNxPluginV1;
|
5
|
+
exports.normalizeNxPlugin = normalizeNxPlugin;
|
6
|
+
exports.createNodesFromFiles = createNodesFromFiles;
|
4
7
|
const node_path_1 = require("node:path");
|
5
8
|
const to_project_name_1 = require("../../config/to-project-name");
|
6
9
|
const globs_1 = require("../../utils/globs");
|
@@ -8,11 +11,9 @@ const error_types_1 = require("../error-types");
|
|
8
11
|
function isNxPluginV2(plugin) {
|
9
12
|
return 'createNodes' in plugin || 'createDependencies' in plugin;
|
10
13
|
}
|
11
|
-
exports.isNxPluginV2 = isNxPluginV2;
|
12
14
|
function isNxPluginV1(plugin) {
|
13
15
|
return 'processProjectGraph' in plugin || 'projectFilePatterns' in plugin;
|
14
16
|
}
|
15
|
-
exports.isNxPluginV1 = isNxPluginV1;
|
16
17
|
function normalizeNxPlugin(plugin) {
|
17
18
|
if (isNxPluginV2(plugin)) {
|
18
19
|
return plugin;
|
@@ -38,7 +39,6 @@ function normalizeNxPlugin(plugin) {
|
|
38
39
|
}
|
39
40
|
return plugin;
|
40
41
|
}
|
41
|
-
exports.normalizeNxPlugin = normalizeNxPlugin;
|
42
42
|
async function createNodesFromFiles(createNodes, configFiles, options, context) {
|
43
43
|
const results = [];
|
44
44
|
const errors = [];
|
@@ -59,4 +59,3 @@ async function createNodesFromFiles(createNodes, configFiles, options, context)
|
|
59
59
|
}
|
60
60
|
return results;
|
61
61
|
}
|
62
|
-
exports.createNodesFromFiles = createNodesFromFiles;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.ProjectGraphBuilder = void 0;
|
4
|
+
exports.validateDependency = validateDependency;
|
4
5
|
/**
|
5
6
|
* Builder for adding nodes and dependencies to a {@link ProjectGraph}
|
6
7
|
*/
|
@@ -312,7 +313,6 @@ function validateDependency(dependency, ctx) {
|
|
312
313
|
}
|
313
314
|
validateCommonDependencyRules(dependency, ctx);
|
314
315
|
}
|
315
|
-
exports.validateDependency = validateDependency;
|
316
316
|
function validateCommonDependencyRules(d, { externalNodes, projects, fileMap }) {
|
317
317
|
if (!projects[d.source] && !externalNodes[d.source]) {
|
318
318
|
throw new Error(`Source project does not exist: ${d.source}`);
|
@@ -1,6 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.readCachedProjectGraph = readCachedProjectGraph;
|
4
|
+
exports.readCachedProjectConfiguration = readCachedProjectConfiguration;
|
5
|
+
exports.readProjectsConfigurationFromProjectGraph = readProjectsConfigurationFromProjectGraph;
|
6
|
+
exports.buildProjectGraphAndSourceMapsWithoutDaemon = buildProjectGraphAndSourceMapsWithoutDaemon;
|
7
|
+
exports.handleProjectGraphError = handleProjectGraphError;
|
8
|
+
exports.createProjectGraphAsync = createProjectGraphAsync;
|
9
|
+
exports.createProjectGraphAndSourceMapsAsync = createProjectGraphAndSourceMapsAsync;
|
4
10
|
const perf_hooks_1 = require("perf_hooks");
|
5
11
|
const nx_json_1 = require("../config/nx-json");
|
6
12
|
const client_1 = require("../daemon/client/client");
|
@@ -41,7 +47,6 @@ function readCachedProjectGraph() {
|
|
41
47
|
}
|
42
48
|
return projectGraphCache;
|
43
49
|
}
|
44
|
-
exports.readCachedProjectGraph = readCachedProjectGraph;
|
45
50
|
function readCachedProjectConfiguration(projectName) {
|
46
51
|
const graph = readCachedProjectGraph();
|
47
52
|
const node = graph.nodes[projectName];
|
@@ -52,7 +57,6 @@ function readCachedProjectConfiguration(projectName) {
|
|
52
57
|
throw new Error(`Cannot find project: '${projectName}' in your workspace.`);
|
53
58
|
}
|
54
59
|
}
|
55
|
-
exports.readCachedProjectConfiguration = readCachedProjectConfiguration;
|
56
60
|
/**
|
57
61
|
* Get the {@link ProjectsConfigurations} from the {@link ProjectGraph}
|
58
62
|
*/
|
@@ -65,7 +69,6 @@ function readProjectsConfigurationFromProjectGraph(projectGraph) {
|
|
65
69
|
version: 2,
|
66
70
|
};
|
67
71
|
}
|
68
|
-
exports.readProjectsConfigurationFromProjectGraph = readProjectsConfigurationFromProjectGraph;
|
69
72
|
async function buildProjectGraphAndSourceMapsWithoutDaemon() {
|
70
73
|
global.NX_GRAPH_CREATION = true;
|
71
74
|
const nxJson = (0, nx_json_1.readNxJson)();
|
@@ -135,7 +138,6 @@ async function buildProjectGraphAndSourceMapsWithoutDaemon() {
|
|
135
138
|
return { projectGraph, sourceMaps };
|
136
139
|
}
|
137
140
|
}
|
138
|
-
exports.buildProjectGraphAndSourceMapsWithoutDaemon = buildProjectGraphAndSourceMapsWithoutDaemon;
|
139
141
|
function handleProjectGraphError(opts, e) {
|
140
142
|
if (opts.exitOnError) {
|
141
143
|
const isVerbose = process.env.NX_VERBOSE_LOGGING === 'true';
|
@@ -168,7 +170,6 @@ function handleProjectGraphError(opts, e) {
|
|
168
170
|
throw e;
|
169
171
|
}
|
170
172
|
}
|
171
|
-
exports.handleProjectGraphError = handleProjectGraphError;
|
172
173
|
/**
|
173
174
|
* Computes and returns a ProjectGraph.
|
174
175
|
*
|
@@ -197,7 +198,6 @@ async function createProjectGraphAsync(opts = {
|
|
197
198
|
const projectGraphAndSourceMaps = await createProjectGraphAndSourceMapsAsync(opts);
|
198
199
|
return projectGraphAndSourceMaps.projectGraph;
|
199
200
|
}
|
200
|
-
exports.createProjectGraphAsync = createProjectGraphAsync;
|
201
201
|
async function createProjectGraphAndSourceMapsAsync(opts = {
|
202
202
|
exitOnError: false,
|
203
203
|
resetDaemonClient: false,
|
@@ -259,4 +259,3 @@ async function createProjectGraphAndSourceMapsAsync(opts = {
|
|
259
259
|
}
|
260
260
|
}
|
261
261
|
}
|
262
|
-
exports.createProjectGraphAndSourceMapsAsync = createProjectGraphAndSourceMapsAsync;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.buildAllWorkspaceFiles =
|
3
|
+
exports.buildAllWorkspaceFiles = buildAllWorkspaceFiles;
|
4
4
|
const perf_hooks_1 = require("perf_hooks");
|
5
5
|
function buildAllWorkspaceFiles(projectFileMap, globalFiles) {
|
6
6
|
perf_hooks_1.performance.mark('get-all-workspace-files:start');
|
@@ -12,4 +12,3 @@ function buildAllWorkspaceFiles(projectFileMap, globalFiles) {
|
|
12
12
|
perf_hooks_1.performance.measure('get-all-workspace-files', 'get-all-workspace-files:start', 'get-all-workspace-files:end');
|
13
13
|
return fileData;
|
14
14
|
}
|
15
|
-
exports.buildAllWorkspaceFiles = buildAllWorkspaceFiles;
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.createProjectRootMappingsFromProjectConfigurations = createProjectRootMappingsFromProjectConfigurations;
|
4
|
+
exports.createProjectRootMappings = createProjectRootMappings;
|
5
|
+
exports.findProjectForPath = findProjectForPath;
|
6
|
+
exports.normalizeProjectRoot = normalizeProjectRoot;
|
4
7
|
const path_1 = require("path");
|
5
8
|
const path_2 = require("../../utils/path");
|
6
9
|
/**
|
@@ -14,7 +17,6 @@ function createProjectRootMappingsFromProjectConfigurations(projects) {
|
|
14
17
|
}
|
15
18
|
return projectRootMappings;
|
16
19
|
}
|
17
|
-
exports.createProjectRootMappingsFromProjectConfigurations = createProjectRootMappingsFromProjectConfigurations;
|
18
20
|
/**
|
19
21
|
* This creates a map of project roots to project names to easily look up the project of a file
|
20
22
|
* @param nodes This is the nodes from the project graph
|
@@ -27,7 +29,6 @@ function createProjectRootMappings(nodes) {
|
|
27
29
|
}
|
28
30
|
return projectRootMappings;
|
29
31
|
}
|
30
|
-
exports.createProjectRootMappings = createProjectRootMappings;
|
31
32
|
/**
|
32
33
|
* Locates a project in projectRootMap based on a file within it
|
33
34
|
* @param filePath path that is inside of projectName. This should be relative from the workspace root
|
@@ -48,9 +49,7 @@ function findProjectForPath(filePath, projectRootMap) {
|
|
48
49
|
}
|
49
50
|
return projectRootMap.get(currentPath);
|
50
51
|
}
|
51
|
-
exports.findProjectForPath = findProjectForPath;
|
52
52
|
function normalizeProjectRoot(root) {
|
53
53
|
root = root === '' ? '.' : root;
|
54
54
|
return root && root.endsWith('/') ? root.substring(0, root.length - 1) : root;
|
55
55
|
}
|
56
|
-
exports.normalizeProjectRoot = normalizeProjectRoot;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.applyImplicitDependencies =
|
3
|
+
exports.applyImplicitDependencies = applyImplicitDependencies;
|
4
4
|
function applyImplicitDependencies(projects, builder) {
|
5
5
|
Object.keys(projects).forEach((source) => {
|
6
6
|
const p = projects[source];
|
@@ -16,4 +16,3 @@ function applyImplicitDependencies(projects, builder) {
|
|
16
16
|
}
|
17
17
|
});
|
18
18
|
}
|
19
|
-
exports.applyImplicitDependencies = applyImplicitDependencies;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.normalizeProjectNodes = normalizeProjectNodes;
|
4
|
+
exports.normalizeImplicitDependencies = normalizeImplicitDependencies;
|
4
5
|
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
5
6
|
async function normalizeProjectNodes({ projects }, builder) {
|
6
7
|
// Sorting projects by name to make sure that the order of projects in the graph is deterministic.
|
@@ -56,7 +57,6 @@ async function normalizeProjectNodes({ projects }, builder) {
|
|
56
57
|
});
|
57
58
|
});
|
58
59
|
}
|
59
|
-
exports.normalizeProjectNodes = normalizeProjectNodes;
|
60
60
|
function normalizeImplicitDependencies(source, implicitDependencies, projects) {
|
61
61
|
if (!implicitDependencies?.length) {
|
62
62
|
return implicitDependencies ?? [];
|
@@ -86,4 +86,3 @@ function normalizeImplicitDependencies(source, implicitDependencies, projects) {
|
|
86
86
|
// detected by createDependencies.
|
87
87
|
return deps.concat(alwaysIgnoredDeps.map((x) => '!' + x));
|
88
88
|
}
|
89
|
-
exports.normalizeImplicitDependencies = normalizeImplicitDependencies;
|