nx 17.0.3 → 17.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +9 -4
- package/bin/init-local.js +10 -60
- package/bin/nx-cloud.js +6 -0
- package/bin/nx.js +1 -9
- package/bin/post-install.js +5 -1
- package/bin/run-executor.js +1 -1
- package/migrations.json +18 -0
- package/package.json +21 -18
- package/plugins/package-json.js +1 -1
- package/{changelog-renderer → release/changelog-renderer}/index.d.ts +18 -3
- package/{changelog-renderer → release/changelog-renderer}/index.js +78 -34
- package/release/index.d.ts +4 -0
- package/release/index.js +11 -0
- package/schemas/nx-schema.json +203 -19
- package/schemas/project-schema.json +20 -0
- package/src/adapter/angular-json.js +28 -18
- package/src/adapter/compat.d.ts +2 -2
- package/src/adapter/compat.js +6 -1
- package/src/adapter/ngcli-adapter.d.ts +16 -4
- package/src/adapter/ngcli-adapter.js +85 -28
- package/src/command-line/add/add.d.ts +2 -0
- package/src/command-line/add/add.js +169 -0
- package/src/command-line/add/command-object.d.ts +7 -0
- package/src/command-line/add/command-object.js +24 -0
- package/src/command-line/affected/affected.js +0 -3
- package/src/command-line/affected/command-object.d.ts +4 -4
- package/src/command-line/affected/command-object.js +53 -26
- package/src/command-line/affected/print-affected.js +10 -1
- package/src/command-line/connect/command-object.d.ts +1 -2
- package/src/command-line/connect/command-object.js +3 -7
- package/src/command-line/connect/connect-to-nx-cloud.d.ts +4 -5
- package/src/command-line/connect/connect-to-nx-cloud.js +43 -31
- package/src/command-line/connect/view-logs.js +5 -21
- package/src/command-line/examples.js +18 -0
- package/src/command-line/exec/command-object.js +2 -1
- package/src/command-line/exec/exec.d.ts +1 -1
- package/src/command-line/exec/exec.js +78 -35
- package/src/command-line/format/format.js +13 -4
- package/src/command-line/generate/generate.js +9 -9
- package/src/command-line/generate/generator-utils.d.ts +3 -2
- package/src/command-line/generate/generator-utils.js +5 -5
- package/src/command-line/graph/graph.d.ts +1 -1
- package/src/command-line/graph/graph.js +82 -37
- package/src/command-line/init/command-object.js +70 -43
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +4 -2
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +11 -2
- package/src/command-line/init/implementation/add-nx-to-nest.d.ts +1 -1
- package/src/command-line/init/implementation/add-nx-to-nest.js +9 -6
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +4 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +14 -4
- package/src/command-line/init/implementation/angular/index.js +4 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +10 -5
- package/src/command-line/init/implementation/angular/standalone-workspace.js +1 -1
- package/src/command-line/init/implementation/angular/types.d.ts +1 -1
- package/src/command-line/init/implementation/dot-nx/nxw.js +47 -16
- package/src/command-line/init/implementation/react/index.d.ts +1 -1
- package/src/command-line/init/implementation/react/index.js +4 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +4 -2
- package/src/command-line/init/implementation/utils.d.ts +5 -5
- package/src/command-line/init/implementation/utils.js +46 -44
- package/src/command-line/init/{init.js → init-v1.js} +5 -13
- package/src/command-line/init/init-v2.d.ts +7 -0
- package/src/command-line/init/init-v2.js +201 -0
- package/src/command-line/list/list.js +6 -5
- package/src/command-line/migrate/command-object.js +19 -4
- package/src/command-line/migrate/migrate.js +21 -17
- package/src/command-line/new/new.js +1 -1
- package/src/command-line/nx-commands.js +4 -1
- package/src/command-line/release/changelog.d.ts +22 -1
- package/src/command-line/release/changelog.js +459 -257
- package/src/command-line/release/command-object.d.ts +29 -7
- package/src/command-line/release/command-object.js +120 -20
- package/src/command-line/release/config/config.d.ts +26 -21
- package/src/command-line/release/config/config.js +416 -59
- package/src/command-line/release/config/conventional-commits.d.ts +2 -0
- package/src/command-line/release/config/conventional-commits.js +98 -0
- package/src/command-line/release/config/filter-release-groups.d.ts +1 -2
- package/src/command-line/release/config/filter-release-groups.js +38 -1
- package/src/command-line/release/index.d.ts +16 -0
- package/src/command-line/release/index.js +23 -0
- package/src/command-line/release/publish.d.ts +7 -3
- package/src/command-line/release/publish.js +89 -37
- package/src/command-line/release/release.d.ts +4 -0
- package/src/command-line/release/release.js +176 -0
- package/src/command-line/release/utils/batch-projects-by-generator-config.d.ts +7 -0
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +37 -0
- package/src/command-line/release/utils/exec-command.d.ts +1 -0
- package/src/command-line/release/utils/exec-command.js +34 -0
- package/src/command-line/release/utils/git.d.ts +34 -1
- package/src/command-line/release/utils/git.js +238 -34
- package/src/command-line/release/utils/github.d.ts +5 -5
- package/src/command-line/release/utils/github.js +155 -8
- package/src/command-line/release/utils/markdown.js +6 -1
- package/src/command-line/release/utils/print-changes.d.ts +1 -1
- package/src/command-line/release/utils/print-changes.js +3 -3
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +4 -1
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +4 -0
- package/src/command-line/release/utils/resolve-semver-specifier.js +58 -0
- package/src/command-line/release/utils/semver.d.ts +8 -0
- package/src/command-line/release/utils/semver.js +30 -1
- package/src/command-line/release/utils/shared.d.ts +39 -0
- package/src/command-line/release/utils/shared.js +213 -0
- package/src/command-line/release/version.d.ts +37 -3
- package/src/command-line/release/version.js +312 -117
- package/src/command-line/repair/repair.js +13 -9
- package/src/command-line/report/report.d.ts +3 -0
- package/src/command-line/report/report.js +22 -5
- package/src/command-line/run/command-object.d.ts +4 -0
- package/src/command-line/run/command-object.js +18 -2
- package/src/command-line/run/executor-utils.d.ts +2 -1
- package/src/command-line/run/executor-utils.js +4 -4
- package/src/command-line/run/run-one.js +3 -6
- package/src/command-line/run/run.js +34 -9
- package/src/command-line/run-many/command-object.js +4 -1
- package/src/command-line/run-many/run-many.js +0 -3
- package/src/command-line/show/command-object.d.ts +3 -0
- package/src/command-line/show/command-object.js +29 -2
- package/src/command-line/show/show.js +9 -0
- package/src/command-line/yargs-utils/shared-options.d.ts +4 -1
- package/src/command-line/yargs-utils/shared-options.js +23 -9
- package/src/commands-runner/command-graph.d.ts +13 -0
- package/src/commands-runner/command-graph.js +2 -0
- package/src/commands-runner/create-command-graph.d.ts +4 -0
- package/src/commands-runner/create-command-graph.js +44 -0
- package/src/commands-runner/get-command-projects.d.ts +3 -0
- package/src/commands-runner/get-command-projects.js +19 -0
- package/src/config/nx-json.d.ts +160 -25
- package/src/config/project-graph.d.ts +3 -3
- package/src/config/workspace-json-project-json.d.ts +23 -1
- package/src/config/workspaces.d.ts +1 -1
- package/src/config/workspaces.js +4 -6
- package/src/core/graph/3rdpartylicenses.txt +144 -74
- package/src/core/graph/environment.js +1 -1
- package/src/core/graph/index.html +4 -6
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/runtime.js +1 -1
- package/src/core/graph/styles.css +3 -3
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +5 -1
- package/src/daemon/client/client.js +27 -8
- package/src/daemon/client/{socket-messenger.d.ts → daemon-socket-messenger.d.ts} +1 -1
- package/src/daemon/client/{socket-messenger.js → daemon-socket-messenger.js} +3 -3
- package/src/daemon/daemon-project-graph-error.d.ts +8 -0
- package/src/daemon/daemon-project-graph-error.js +13 -0
- package/src/daemon/server/handle-hash-tasks.js +12 -2
- package/src/daemon/server/handle-request-project-graph.js +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +14 -13
- package/src/daemon/server/project-graph-incremental-recomputation.js +98 -33
- package/src/daemon/server/shutdown-utils.js +2 -4
- package/src/daemon/server/watcher.js +0 -3
- package/src/daemon/socket-utils.d.ts +2 -1
- package/src/daemon/socket-utils.js +15 -4
- package/src/daemon/tmp-dir.d.ts +1 -0
- package/src/daemon/tmp-dir.js +4 -4
- package/src/devkit-exports.d.ts +2 -2
- package/src/devkit-exports.js +3 -2
- package/src/devkit-internals.d.ts +3 -0
- package/src/devkit-internals.js +7 -1
- package/src/executors/noop/schema.json +1 -1
- package/src/executors/run-commands/run-commands.impl.d.ts +10 -2
- package/src/executors/run-commands/run-commands.impl.js +152 -48
- package/src/executors/run-commands/schema.json +11 -1
- package/src/executors/run-script/run-script.impl.js +43 -11
- package/src/executors/utils/convert-nx-executor.js +1 -1
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +3 -1
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +4 -2
- package/src/generators/testing-utils/create-tree-with-empty-workspace.js +0 -6
- package/src/generators/tree.d.ts +1 -0
- package/src/generators/utils/glob.js +2 -2
- package/src/generators/utils/project-configuration.js +28 -9
- package/src/hasher/create-task-hasher.d.ts +4 -0
- package/src/hasher/create-task-hasher.js +16 -0
- package/src/hasher/hash-task.js +9 -3
- package/src/hasher/native-task-hasher-impl.d.ts +19 -0
- package/src/hasher/native-task-hasher-impl.js +37 -0
- package/src/hasher/node-task-hasher-impl.d.ts +49 -0
- package/src/hasher/node-task-hasher-impl.js +431 -0
- package/src/hasher/task-hasher.d.ts +33 -21
- package/src/hasher/task-hasher.js +30 -428
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +5 -5
- package/src/migrations/update-15-1-0/set-project-names.js +2 -1
- package/src/migrations/update-15-8-2/update-nxw.js +2 -6
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +3 -3
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +49 -13
- package/src/migrations/update-17-2-0/move-default-base.d.ts +5 -0
- package/src/migrations/update-17-2-0/move-default-base.js +21 -0
- package/src/migrations/update-17-3-0/nx-release-path.d.ts +3 -0
- package/src/migrations/update-17-3-0/nx-release-path.js +48 -0
- package/src/migrations/update-17-3-0/update-nxw.d.ts +2 -0
- package/src/migrations/update-17-3-0/update-nxw.js +7 -0
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +2 -0
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +9 -0
- package/src/native/index.d.ts +65 -15
- package/src/native/index.js +6 -2
- package/src/native/transform-objects.js +2 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +1 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +13 -12
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +6 -1
- package/src/nx-cloud/update-manager.js +2 -1
- package/src/plugins/js/index.d.ts +1 -1
- package/src/plugins/js/index.js +3 -3
- package/src/plugins/js/lock-file/lock-file.d.ts +2 -2
- package/src/plugins/js/lock-file/lock-file.js +15 -3
- package/src/plugins/js/package-json/create-package-json.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +1 -1
- package/src/plugins/js/utils/register.d.ts +1 -1
- package/src/plugins/js/utils/register.js +28 -8
- package/src/plugins/js/versions.d.ts +1 -1
- package/src/plugins/js/versions.js +1 -1
- package/{plugins/package-json-workspaces.d.ts → src/plugins/package-json-workspaces/create-nodes.d.ts} +4 -4
- package/{plugins/package-json-workspaces.js → src/plugins/package-json-workspaces/create-nodes.js} +34 -12
- package/src/plugins/package-json-workspaces/index.d.ts +1 -0
- package/src/plugins/package-json-workspaces/index.js +4 -0
- package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.d.ts +2 -0
- package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.js +47 -0
- package/src/plugins/project-json/build-nodes/project-json.d.ts +2 -5
- package/src/plugins/project-json/build-nodes/project-json.js +6 -44
- package/src/plugins/target-defaults/target-defaults-plugin.d.ts +66 -0
- package/src/plugins/target-defaults/target-defaults-plugin.js +182 -0
- package/src/project-graph/affected/locators/project-glob-changes.js +3 -3
- package/src/project-graph/affected/locators/workspace-projects.d.ts +0 -2
- package/src/project-graph/affected/locators/workspace-projects.js +16 -29
- package/src/project-graph/build-project-graph.d.ts +20 -1
- package/src/project-graph/build-project-graph.js +91 -33
- package/src/project-graph/file-map-utils.d.ts +9 -5
- package/src/project-graph/file-map-utils.js +16 -63
- package/src/project-graph/file-utils.d.ts +1 -1
- package/src/project-graph/file-utils.js +44 -2
- package/src/project-graph/nx-deps-cache.js +1 -1
- package/src/project-graph/project-graph-builder.d.ts +1 -1
- package/src/project-graph/project-graph-builder.js +1 -1
- package/src/project-graph/project-graph.d.ts +32 -1
- package/src/project-graph/project-graph.js +147 -23
- package/src/project-graph/utils/build-all-workspace-files.d.ts +2 -0
- package/src/project-graph/utils/build-all-workspace-files.js +15 -0
- package/src/project-graph/utils/normalize-project-nodes.d.ts +2 -3
- package/src/project-graph/utils/normalize-project-nodes.js +7 -33
- package/src/project-graph/utils/project-configuration-utils.d.ts +66 -4
- package/src/project-graph/utils/project-configuration-utils.js +509 -62
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +12 -31
- package/src/project-graph/utils/retrieve-workspace-files.js +27 -90
- package/src/tasks-runner/batch/run-batch.js +3 -3
- package/src/tasks-runner/cache.js +6 -3
- package/src/tasks-runner/create-task-graph.js +1 -1
- package/src/tasks-runner/fork.d.ts +1 -0
- package/src/tasks-runner/fork.js +23 -0
- package/src/tasks-runner/forked-process-task-runner.d.ts +13 -5
- package/src/tasks-runner/forked-process-task-runner.js +112 -21
- package/src/tasks-runner/init-tasks-runner.js +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +28 -28
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +19 -22
- package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js +1 -3
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +1 -3
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +2 -4
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +1 -0
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +11 -5
- package/src/tasks-runner/life-cycles/view-logs-utils.js +1 -1
- package/src/tasks-runner/pseudo-ipc.d.ts +49 -0
- package/src/tasks-runner/pseudo-ipc.js +140 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +43 -0
- package/src/tasks-runner/pseudo-terminal.js +159 -0
- package/src/tasks-runner/run-command.d.ts +1 -1
- package/src/tasks-runner/run-command.js +13 -19
- package/src/tasks-runner/task-env.js +1 -2
- package/src/tasks-runner/task-graph-utils.d.ts +7 -3
- package/src/tasks-runner/task-graph-utils.js +15 -15
- package/src/tasks-runner/task-orchestrator.js +68 -12
- package/src/tasks-runner/tasks-schedule.js +3 -3
- package/src/tasks-runner/utils.d.ts +16 -7
- package/src/tasks-runner/utils.js +30 -16
- package/src/utils/ab-testing.d.ts +36 -2
- package/src/utils/ab-testing.js +34 -16
- package/src/utils/assert-workspace-validity.js +1 -1
- package/src/utils/cache-directory.d.ts +1 -0
- package/src/utils/cache-directory.js +5 -1
- package/src/utils/child-process.d.ts +15 -1
- package/src/utils/child-process.js +91 -1
- package/src/utils/command-line-utils.js +2 -1
- package/src/utils/exit-codes.d.ts +6 -0
- package/src/utils/exit-codes.js +20 -0
- package/src/utils/fileutils.d.ts +1 -0
- package/src/utils/find-matching-projects.js +5 -5
- package/src/utils/find-workspace-root.js +1 -0
- package/src/utils/ignore.js +8 -1
- package/src/utils/json-diff.d.ts +1 -0
- package/src/utils/json-diff.js +2 -1
- package/src/utils/json.js +3 -1
- package/src/utils/logger.js +1 -1
- package/src/utils/nx-cloud-utils.d.ts +1 -1
- package/src/utils/nx-cloud-utils.js +9 -4
- package/src/utils/nx-plugin.d.ts +32 -15
- package/src/utils/nx-plugin.deprecated.d.ts +10 -5
- package/src/utils/nx-plugin.deprecated.js +23 -0
- package/src/utils/nx-plugin.js +71 -80
- package/src/utils/output.d.ts +4 -2
- package/src/utils/output.js +44 -9
- package/src/utils/package-json.d.ts +4 -4
- package/src/utils/package-json.js +18 -12
- package/src/utils/package-manager.d.ts +7 -0
- package/src/utils/package-manager.js +24 -4
- package/src/utils/params.d.ts +12 -4
- package/src/utils/params.js +37 -4
- package/src/utils/plugins/core-plugins.js +8 -0
- package/src/utils/plugins/installed-plugins.d.ts +2 -1
- package/src/utils/plugins/installed-plugins.js +2 -2
- package/src/utils/plugins/local-plugins.js +1 -1
- package/src/utils/plugins/plugin-capabilities.d.ts +3 -2
- package/src/utils/plugins/plugin-capabilities.js +7 -7
- package/src/utils/typescript.js +1 -1
- package/src/utils/update-nxw.d.ts +2 -0
- package/src/utils/update-nxw.js +12 -0
- package/src/utils/workspace-configuration-check.js +1 -1
- package/src/utils/workspace-context.d.ts +6 -4
- package/src/utils/workspace-context.js +19 -9
- package/src/core/graph/polyfills.js +0 -1
- /package/src/command-line/init/{init.d.ts → init-v1.d.ts} +0 -0
|
@@ -1,7 +1,40 @@
|
|
|
1
|
+
export type MessageOptionKey = 'yes' | 'skip';
|
|
2
|
+
declare const messageOptions: {
|
|
3
|
+
readonly setupNxCloud: readonly [{
|
|
4
|
+
readonly code: "enable-caching";
|
|
5
|
+
readonly message: "Would you like remote caching to make your build faster?";
|
|
6
|
+
readonly initial: 0;
|
|
7
|
+
readonly choices: readonly [{
|
|
8
|
+
readonly value: "yes";
|
|
9
|
+
readonly name: "Yes";
|
|
10
|
+
}, {
|
|
11
|
+
readonly value: "skip";
|
|
12
|
+
readonly name: "Skip for now";
|
|
13
|
+
}];
|
|
14
|
+
readonly footer: "\nRead more about remote cache at https://nx.dev/ci/features/remote-cache";
|
|
15
|
+
readonly hint: "\n(it's free and can be disabled any time)";
|
|
16
|
+
}];
|
|
17
|
+
readonly setupViewLogs: readonly [{
|
|
18
|
+
readonly code: "connect-to-view-logs";
|
|
19
|
+
readonly message: "To view the logs, Nx needs to connect your workspace to Nx Cloud and upload the most recent run details";
|
|
20
|
+
readonly initial: 0;
|
|
21
|
+
readonly choices: readonly [{
|
|
22
|
+
readonly value: "yes";
|
|
23
|
+
readonly name: "Yes";
|
|
24
|
+
readonly hint: "Connect to Nx Cloud and upload the run details";
|
|
25
|
+
}, {
|
|
26
|
+
readonly value: "skip";
|
|
27
|
+
readonly name: "No";
|
|
28
|
+
}];
|
|
29
|
+
readonly footer: "\nRead more about remote cache at https://nx.dev/ci/features/remote-cache";
|
|
30
|
+
readonly hint: "\n(it's free and can be disabled any time)";
|
|
31
|
+
}];
|
|
32
|
+
};
|
|
33
|
+
export type MessageKey = keyof typeof messageOptions;
|
|
34
|
+
export type MessageData = typeof messageOptions[MessageKey][number];
|
|
1
35
|
export declare class PromptMessages {
|
|
2
|
-
private messages;
|
|
3
36
|
private selectedMessages;
|
|
4
|
-
|
|
37
|
+
getPrompt(key: MessageKey): MessageData;
|
|
5
38
|
codeOfSelectedPromptMessage(key: string): string;
|
|
6
39
|
}
|
|
7
40
|
export declare const messages: PromptMessages;
|
|
@@ -15,3 +48,4 @@ export declare function recordStat(opts: {
|
|
|
15
48
|
useCloud: boolean;
|
|
16
49
|
meta: string;
|
|
17
50
|
}): Promise<void>;
|
|
51
|
+
export {};
|
package/src/utils/ab-testing.js
CHANGED
|
@@ -2,39 +2,57 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.recordStat = exports.messages = exports.PromptMessages = void 0;
|
|
4
4
|
const is_ci_1 = require("./is-ci");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
5
|
+
const messageOptions = {
|
|
6
|
+
setupNxCloud: [
|
|
7
|
+
{
|
|
8
|
+
code: 'enable-caching',
|
|
9
|
+
message: `Would you like remote caching to make your build faster?`,
|
|
10
|
+
initial: 0,
|
|
11
|
+
choices: [
|
|
12
|
+
{ value: 'yes', name: 'Yes' },
|
|
13
|
+
{ value: 'skip', name: 'Skip for now' },
|
|
13
14
|
],
|
|
14
|
-
|
|
15
|
+
footer: '\nRead more about remote cache at https://nx.dev/ci/features/remote-cache',
|
|
16
|
+
hint: `\n(it's free and can be disabled any time)`,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
setupViewLogs: [
|
|
20
|
+
{
|
|
21
|
+
code: 'connect-to-view-logs',
|
|
22
|
+
message: `To view the logs, Nx needs to connect your workspace to Nx Cloud and upload the most recent run details`,
|
|
23
|
+
initial: 0,
|
|
24
|
+
choices: [
|
|
15
25
|
{
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
value: 'yes',
|
|
27
|
+
name: 'Yes',
|
|
28
|
+
hint: 'Connect to Nx Cloud and upload the run details',
|
|
18
29
|
},
|
|
30
|
+
{ value: 'skip', name: 'No' },
|
|
19
31
|
],
|
|
20
|
-
|
|
32
|
+
footer: '\nRead more about remote cache at https://nx.dev/ci/features/remote-cache',
|
|
33
|
+
hint: `\n(it's free and can be disabled any time)`,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
class PromptMessages {
|
|
38
|
+
constructor() {
|
|
21
39
|
this.selectedMessages = {};
|
|
22
40
|
}
|
|
23
|
-
|
|
41
|
+
getPrompt(key) {
|
|
24
42
|
if (this.selectedMessages[key] === undefined) {
|
|
25
43
|
if (process.env.NX_GENERATE_DOCS_PROCESS === 'true') {
|
|
26
44
|
this.selectedMessages[key] = 0;
|
|
27
45
|
}
|
|
28
46
|
else {
|
|
29
|
-
this.selectedMessages[key] = Math.floor(Math.random() *
|
|
47
|
+
this.selectedMessages[key] = Math.floor(Math.random() * messageOptions[key].length);
|
|
30
48
|
}
|
|
31
49
|
}
|
|
32
|
-
return
|
|
50
|
+
return messageOptions[key][this.selectedMessages[key]];
|
|
33
51
|
}
|
|
34
52
|
codeOfSelectedPromptMessage(key) {
|
|
35
53
|
if (this.selectedMessages[key] === undefined)
|
|
36
54
|
return null;
|
|
37
|
-
return
|
|
55
|
+
return messageOptions[key][this.selectedMessages[key]].code;
|
|
38
56
|
}
|
|
39
57
|
}
|
|
40
58
|
exports.PromptMessages = PromptMessages;
|
|
@@ -9,7 +9,7 @@ function assertWorkspaceValidity(projects, nxJson) {
|
|
|
9
9
|
const projectConfiguration = projects[project];
|
|
10
10
|
graph[project] = {
|
|
11
11
|
name: project,
|
|
12
|
-
type: projectConfiguration.projectType === 'library' ? 'lib' : 'app',
|
|
12
|
+
type: projectConfiguration.projectType === 'library' ? 'lib' : 'app', // missing fallback to `e2e`
|
|
13
13
|
data: {
|
|
14
14
|
...projectConfiguration,
|
|
15
15
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.projectGraphCacheDirectory = exports.cacheDir = void 0;
|
|
3
|
+
exports.projectGraphCacheDirectory = exports.cacheDirectoryForWorkspace = exports.cacheDir = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const fileutils_1 = require("./fileutils");
|
|
@@ -52,5 +52,9 @@ function defaultCacheDirectory(root) {
|
|
|
52
52
|
* Path to the directory where Nx stores its cache and daemon-related files.
|
|
53
53
|
*/
|
|
54
54
|
exports.cacheDir = cacheDirectory(workspace_root_1.workspaceRoot, readCacheDirectoryProperty(workspace_root_1.workspaceRoot));
|
|
55
|
+
function cacheDirectoryForWorkspace(workspaceRoot) {
|
|
56
|
+
return cacheDirectory(workspaceRoot, readCacheDirectoryProperty(workspaceRoot));
|
|
57
|
+
}
|
|
58
|
+
exports.cacheDirectoryForWorkspace = cacheDirectoryForWorkspace;
|
|
55
59
|
exports.projectGraphCacheDirectory = absolutePath(workspace_root_1.workspaceRoot, process.env.NX_PROJECT_GRAPH_CACHE_DIRECTORY ??
|
|
56
60
|
defaultCacheDirectory(workspace_root_1.workspaceRoot));
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { ExecSyncOptions } from 'child_process';
|
|
2
|
+
import { type ExecOptions, type ExecSyncOptions } from 'child_process';
|
|
3
|
+
import { ChildProcess } from '../native';
|
|
3
4
|
export declare function runNxSync(cmd: string, options?: ExecSyncOptions & {
|
|
4
5
|
cwd?: string;
|
|
5
6
|
}): void;
|
|
7
|
+
export declare function runNxAsync(cmd: string, options?: ExecOptions & {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
silent?: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare class PseudoTtyProcess {
|
|
12
|
+
private childProcess;
|
|
13
|
+
isAlive: boolean;
|
|
14
|
+
exitCallbacks: any[];
|
|
15
|
+
constructor(childProcess: ChildProcess);
|
|
16
|
+
onExit(callback: (code: number) => void): void;
|
|
17
|
+
onOutput(callback: (message: string) => void): void;
|
|
18
|
+
kill(): void;
|
|
19
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runNxSync = void 0;
|
|
3
|
+
exports.PseudoTtyProcess = exports.runNxAsync = exports.runNxSync = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -25,3 +25,93 @@ function runNxSync(cmd, options) {
|
|
|
25
25
|
(0, child_process_1.execSync)(`${baseCmd} ${cmd}`, options);
|
|
26
26
|
}
|
|
27
27
|
exports.runNxSync = runNxSync;
|
|
28
|
+
async function runNxAsync(cmd, options) {
|
|
29
|
+
let baseCmd;
|
|
30
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(workspace_root_1.workspaceRoot, 'package.json'))) {
|
|
31
|
+
baseCmd = `${(0, package_manager_1.getPackageManagerCommand)().exec} nx`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
options ??= {};
|
|
35
|
+
options.cwd ??= process.cwd();
|
|
36
|
+
const offsetFromRoot = (0, path_1.relative)(options.cwd, (0, workspace_root_1.workspaceRootInner)(options.cwd, null));
|
|
37
|
+
if (process.platform === 'win32') {
|
|
38
|
+
baseCmd = '.\\' + (0, path_1.join)(`${offsetFromRoot}`, 'nx.bat');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
baseCmd = './' + (0, path_1.join)(`${offsetFromRoot}`, 'nx');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const silent = options?.silent ?? true;
|
|
45
|
+
if (options?.silent) {
|
|
46
|
+
delete options.silent;
|
|
47
|
+
}
|
|
48
|
+
await new Promise((resolve, reject) => {
|
|
49
|
+
const child = (0, child_process_1.exec)(`${baseCmd} ${cmd}`, options, (error, stdout, stderr) => {
|
|
50
|
+
if (error) {
|
|
51
|
+
reject(error);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
resolve(stdout);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
if (!silent) {
|
|
58
|
+
child.stdout?.pipe(process.stdout);
|
|
59
|
+
child.stderr?.pipe(process.stderr);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.runNxAsync = runNxAsync;
|
|
64
|
+
function messageToCode(message) {
|
|
65
|
+
if (message.startsWith('Terminated by ')) {
|
|
66
|
+
switch (message.replace('Terminated by ', '').trim()) {
|
|
67
|
+
case 'Termination':
|
|
68
|
+
return 143;
|
|
69
|
+
case 'Interrupt':
|
|
70
|
+
return 130;
|
|
71
|
+
default:
|
|
72
|
+
return 128;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (message.startsWith('Exited with code ')) {
|
|
76
|
+
return parseInt(message.replace('Exited with code ', '').trim());
|
|
77
|
+
}
|
|
78
|
+
else if (message === 'Success') {
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class PseudoTtyProcess {
|
|
86
|
+
constructor(childProcess) {
|
|
87
|
+
this.childProcess = childProcess;
|
|
88
|
+
this.isAlive = true;
|
|
89
|
+
this.exitCallbacks = [];
|
|
90
|
+
childProcess.onExit((message) => {
|
|
91
|
+
this.isAlive = false;
|
|
92
|
+
const exitCode = messageToCode(message);
|
|
93
|
+
this.exitCallbacks.forEach((cb) => cb(exitCode));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
onExit(callback) {
|
|
97
|
+
this.exitCallbacks.push(callback);
|
|
98
|
+
}
|
|
99
|
+
onOutput(callback) {
|
|
100
|
+
this.childProcess.onOutput(callback);
|
|
101
|
+
}
|
|
102
|
+
kill() {
|
|
103
|
+
try {
|
|
104
|
+
this.childProcess.kill();
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// when the child process completes before we explicitly call kill, this will throw
|
|
108
|
+
// do nothing
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
if (this.isAlive == true) {
|
|
112
|
+
this.isAlive = false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.PseudoTtyProcess = PseudoTtyProcess;
|
|
@@ -84,7 +84,8 @@ function splitArgsIntoNxArgsAndOverrides(args, mode, options = { printWarnings:
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
if (!nxArgs.base) {
|
|
87
|
-
nxArgs.base =
|
|
87
|
+
nxArgs.base =
|
|
88
|
+
nxJson.defaultBase ?? nxJson.affected?.defaultBase ?? 'main';
|
|
88
89
|
// No user-provided arguments to set the affected criteria, so inform the user of the defaults being used
|
|
89
90
|
if (options.printWarnings &&
|
|
90
91
|
!nxArgs.head &&
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signalToCode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Translates NodeJS signals to numeric exit code
|
|
6
|
+
* @param signal
|
|
7
|
+
*/
|
|
8
|
+
function signalToCode(signal) {
|
|
9
|
+
switch (signal) {
|
|
10
|
+
case 'SIGHUP':
|
|
11
|
+
return 128 + 1;
|
|
12
|
+
case 'SIGINT':
|
|
13
|
+
return 128 + 2;
|
|
14
|
+
case 'SIGTERM':
|
|
15
|
+
return 128 + 15;
|
|
16
|
+
default:
|
|
17
|
+
return 128;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.signalToCode = signalToCode;
|
package/src/utils/fileutils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMatchingStringsWithCache = exports.findMatchingProjects = void 0;
|
|
4
|
-
const
|
|
4
|
+
const minimatch_1 = require("minimatch");
|
|
5
5
|
const validPatternTypes = [
|
|
6
|
-
'name',
|
|
7
|
-
'tag',
|
|
8
|
-
'directory',
|
|
6
|
+
'name', // Pattern is based on the project's name
|
|
7
|
+
'tag', // Pattern is based on the project's tags
|
|
8
|
+
'directory', // Pattern is based on the project's root directory
|
|
9
9
|
'unlabeled', // Pattern was passed without specifying a type
|
|
10
10
|
];
|
|
11
11
|
const globCharacters = ['*', '|', '{', '}', '(', ')'];
|
|
@@ -177,7 +177,7 @@ exports.getMatchingStringsWithCache = (() => {
|
|
|
177
177
|
}
|
|
178
178
|
const patternCache = minimatchCache.get(pattern);
|
|
179
179
|
if (!regexCache.has(pattern)) {
|
|
180
|
-
const regex = minimatch.makeRe(pattern, { dot: true });
|
|
180
|
+
const regex = minimatch_1.minimatch.makeRe(pattern, { dot: true });
|
|
181
181
|
if (regex) {
|
|
182
182
|
regexCache.set(pattern, regex);
|
|
183
183
|
}
|
package/src/utils/ignore.js
CHANGED
|
@@ -27,7 +27,14 @@ function getIgnoredGlobs(root = workspace_root_1.workspaceRoot, prependRoot = tr
|
|
|
27
27
|
}
|
|
28
28
|
exports.getIgnoredGlobs = getIgnoredGlobs;
|
|
29
29
|
function getAlwaysIgnore(root) {
|
|
30
|
-
const paths = [
|
|
30
|
+
const paths = [
|
|
31
|
+
'node_modules',
|
|
32
|
+
'**/node_modules',
|
|
33
|
+
'.git',
|
|
34
|
+
'.nx',
|
|
35
|
+
'.vscode',
|
|
36
|
+
'.yarn/cache',
|
|
37
|
+
];
|
|
31
38
|
return root ? paths.map((x) => (0, path_1.joinPathFragments)(root, x)) : paths;
|
|
32
39
|
}
|
|
33
40
|
exports.getAlwaysIgnore = getAlwaysIgnore;
|
package/src/utils/json-diff.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export interface JsonChange extends Change {
|
|
|
15
15
|
export declare function isJsonChange(change: Change): change is JsonChange;
|
|
16
16
|
export declare function jsonDiff(lhs: any, rhs: any): JsonChange[];
|
|
17
17
|
export declare function walkJsonTree(json: any, currPath: string[], visitor: (path: string[], value: any) => boolean): void;
|
|
18
|
+
export declare function deepEquals(a: any, b: any): boolean;
|
package/src/utils/json-diff.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.walkJsonTree = exports.jsonDiff = exports.isJsonChange = exports.JsonDiffType = void 0;
|
|
3
|
+
exports.deepEquals = exports.walkJsonTree = exports.jsonDiff = exports.isJsonChange = exports.JsonDiffType = void 0;
|
|
4
4
|
var JsonDiffType;
|
|
5
5
|
(function (JsonDiffType) {
|
|
6
6
|
JsonDiffType["Deleted"] = "JsonPropertyDeleted";
|
|
@@ -109,3 +109,4 @@ function deepEquals(a, b) {
|
|
|
109
109
|
return deepEquals(aValue, b[key]);
|
|
110
110
|
}, true);
|
|
111
111
|
}
|
|
112
|
+
exports.deepEquals = deepEquals;
|
package/src/utils/json.js
CHANGED
|
@@ -15,7 +15,9 @@ const code_frames_1 = require("./code-frames");
|
|
|
15
15
|
*/
|
|
16
16
|
function parseJson(input, options) {
|
|
17
17
|
try {
|
|
18
|
-
|
|
18
|
+
if (options?.expectComments !== true) {
|
|
19
|
+
return JSON.parse(input);
|
|
20
|
+
}
|
|
19
21
|
}
|
|
20
22
|
catch { }
|
|
21
23
|
options = { allowTrailingComma: true, ...options };
|
package/src/utils/logger.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stripIndent = exports.logger = exports.NX_ERROR = exports.NX_PREFIX = void 0;
|
|
4
4
|
const chalk = require("chalk");
|
|
5
|
-
exports.NX_PREFIX =
|
|
5
|
+
exports.NX_PREFIX = chalk.inverse(chalk.bold(chalk.cyan(' NX ')));
|
|
6
6
|
exports.NX_ERROR = chalk.inverse(chalk.bold(chalk.red(' ERROR ')));
|
|
7
7
|
exports.logger = {
|
|
8
8
|
warn: (s) => console.warn(chalk.bold(chalk.yellow(s))),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NxJsonConfiguration } from '../config/nx-json';
|
|
2
|
-
export declare function isNxCloudUsed(nxJson: NxJsonConfiguration): boolean;
|
|
2
|
+
export declare function isNxCloudUsed(nxJson: NxJsonConfiguration): string | boolean;
|
|
3
3
|
export declare function getNxCloudUrl(nxJson: NxJsonConfiguration): string;
|
|
4
4
|
export declare function getNxCloudToken(nxJson: NxJsonConfiguration): string;
|
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNxCloudToken = exports.getNxCloudUrl = exports.isNxCloudUsed = void 0;
|
|
4
4
|
function isNxCloudUsed(nxJson) {
|
|
5
|
-
return (
|
|
5
|
+
return (process.env.NX_CLOUD_ACCESS_TOKEN ||
|
|
6
|
+
!!nxJson.nxCloudAccessToken ||
|
|
6
7
|
!!Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud'));
|
|
7
8
|
}
|
|
8
9
|
exports.isNxCloudUsed = isNxCloudUsed;
|
|
9
10
|
function getNxCloudUrl(nxJson) {
|
|
10
11
|
const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
|
|
11
|
-
if (!cloudRunner &&
|
|
12
|
+
if (!cloudRunner &&
|
|
13
|
+
!(nxJson.nxCloudAccessToken || process.env.NX_CLOUD_ACCESS_TOKEN))
|
|
12
14
|
throw new Error('nx-cloud runner not found in nx.json');
|
|
13
15
|
return cloudRunner?.options?.url ?? nxJson.nxCloudUrl ?? 'https://nx.app';
|
|
14
16
|
}
|
|
15
17
|
exports.getNxCloudUrl = getNxCloudUrl;
|
|
16
18
|
function getNxCloudToken(nxJson) {
|
|
17
19
|
const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
|
|
18
|
-
if (!cloudRunner &&
|
|
20
|
+
if (!cloudRunner &&
|
|
21
|
+
!(nxJson.nxCloudAccessToken || process.env.NX_CLOUD_ACCESS_TOKEN))
|
|
19
22
|
throw new Error('nx-cloud runner not found in nx.json');
|
|
20
|
-
return
|
|
23
|
+
return (process.env.NX_CLOUD_ACCESS_TOKEN ??
|
|
24
|
+
cloudRunner?.options.accessToken ??
|
|
25
|
+
nxJson.nxCloudAccessToken);
|
|
21
26
|
}
|
|
22
27
|
exports.getNxCloudToken = getNxCloudToken;
|
package/src/utils/nx-plugin.d.ts
CHANGED
|
@@ -10,20 +10,31 @@ import { RawProjectGraphDependency } from '../project-graph/project-graph-builde
|
|
|
10
10
|
export interface CreateNodesContext {
|
|
11
11
|
readonly nxJsonConfiguration: NxJsonConfiguration;
|
|
12
12
|
readonly workspaceRoot: string;
|
|
13
|
+
/**
|
|
14
|
+
* The subset of configuration files which match the createNodes pattern
|
|
15
|
+
*/
|
|
16
|
+
readonly configFiles: string[];
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* A function which parses a configuration file into a set of nodes.
|
|
16
20
|
* Used for creating nodes for the {@link ProjectGraph}
|
|
17
21
|
*/
|
|
18
|
-
export type CreateNodesFunction<T = unknown> = (projectConfigurationFile: string, options: T | undefined, context: CreateNodesContext) =>
|
|
19
|
-
|
|
22
|
+
export type CreateNodesFunction<T = unknown> = (projectConfigurationFile: string, options: T | undefined, context: CreateNodesContext) => CreateNodesResult | Promise<CreateNodesResult>;
|
|
23
|
+
export interface CreateNodesResult {
|
|
24
|
+
/**
|
|
25
|
+
* A map of project root -> project configuration
|
|
26
|
+
*/
|
|
27
|
+
projects?: Record<string, Optional<ProjectConfiguration, 'root'>>;
|
|
28
|
+
/**
|
|
29
|
+
* A map of external node name -> external node. External nodes do not have a root, so the key is their name.
|
|
30
|
+
*/
|
|
20
31
|
externalNodes?: Record<string, ProjectGraphExternalNode>;
|
|
21
|
-
}
|
|
32
|
+
}
|
|
22
33
|
/**
|
|
23
34
|
* A pair of file patterns and {@link CreateNodesFunction}
|
|
24
35
|
*/
|
|
25
36
|
export type CreateNodes<T = unknown> = readonly [
|
|
26
|
-
|
|
37
|
+
configFilePattern: string,
|
|
27
38
|
createNodesFunction: CreateNodesFunction<T>
|
|
28
39
|
];
|
|
29
40
|
/**
|
|
@@ -60,17 +71,17 @@ export type CreateDependencies<T = unknown> = (options: T | undefined, context:
|
|
|
60
71
|
/**
|
|
61
72
|
* A plugin for Nx which creates nodes and dependencies for the {@link ProjectGraph}
|
|
62
73
|
*/
|
|
63
|
-
export type NxPluginV2<
|
|
74
|
+
export type NxPluginV2<TOptions = unknown> = {
|
|
64
75
|
name: string;
|
|
65
76
|
/**
|
|
66
77
|
* Provides a file pattern and function that retrieves configuration info from
|
|
67
78
|
* those files. e.g. { '**\/*.csproj': buildProjectsFromCsProjFile }
|
|
68
79
|
*/
|
|
69
|
-
createNodes?: CreateNodes
|
|
80
|
+
createNodes?: CreateNodes;
|
|
70
81
|
/**
|
|
71
82
|
* Provides a function to analyze files to create dependencies for the {@link ProjectGraph}
|
|
72
83
|
*/
|
|
73
|
-
createDependencies?: CreateDependencies<
|
|
84
|
+
createDependencies?: CreateDependencies<TOptions>;
|
|
74
85
|
};
|
|
75
86
|
export * from './nx-plugin.deprecated';
|
|
76
87
|
/**
|
|
@@ -80,20 +91,24 @@ export type NxPlugin = NxPluginV1 | NxPluginV2;
|
|
|
80
91
|
export type LoadedNxPlugin = {
|
|
81
92
|
plugin: NxPluginV2 & Pick<NxPluginV1, 'processProjectGraph'>;
|
|
82
93
|
options?: unknown;
|
|
94
|
+
include?: string[];
|
|
95
|
+
exclude?: string[];
|
|
83
96
|
};
|
|
84
|
-
export declare
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
export declare function
|
|
97
|
+
export declare const nxPluginCache: Map<string, LoadedNxPlugin['plugin']>;
|
|
98
|
+
export declare function getPluginPathAndName(moduleName: string, paths: string[], projects: Record<string, ProjectConfiguration>, root: string): {
|
|
99
|
+
pluginPath: string;
|
|
100
|
+
name: any;
|
|
101
|
+
};
|
|
102
|
+
export declare function loadNxPluginAsync(pluginConfiguration: PluginConfiguration, paths: string[], projects: Record<string, ProjectConfiguration>, root: string): Promise<LoadedNxPlugin>;
|
|
103
|
+
export declare function loadNxPlugins(plugins: PluginConfiguration[], paths?: string[], root?: string, projects?: Record<string, ProjectConfiguration>): Promise<LoadedNxPlugin[]>;
|
|
104
|
+
export declare function ensurePluginIsV2(plugin: NxPlugin): NxPluginV2;
|
|
90
105
|
export declare function isNxPluginV2(plugin: NxPlugin): plugin is NxPluginV2;
|
|
91
106
|
export declare function isNxPluginV1(plugin: NxPlugin): plugin is NxPluginV1;
|
|
92
|
-
export declare function readPluginPackageJson(pluginName: string, paths?: string[]): {
|
|
107
|
+
export declare function readPluginPackageJson(pluginName: string, projects: Record<string, ProjectConfiguration>, paths?: string[]): {
|
|
93
108
|
path: string;
|
|
94
109
|
json: PackageJson;
|
|
95
110
|
};
|
|
96
|
-
export declare function resolveLocalNxPlugin(importPath: string, root?: string): {
|
|
111
|
+
export declare function resolveLocalNxPlugin(importPath: string, nxJsonConfiguration: NxJsonConfiguration, projects: Record<string, ProjectConfiguration>, root?: string): {
|
|
97
112
|
path: string;
|
|
98
113
|
projectConfig: ProjectConfiguration;
|
|
99
114
|
} | null;
|
|
@@ -106,3 +121,5 @@ export declare function registerPluginTSTranspiler(): void;
|
|
|
106
121
|
* Unregister the ts-node transpiler if it is registered
|
|
107
122
|
*/
|
|
108
123
|
export declare function unregisterPluginTSTranspiler(): void;
|
|
124
|
+
export declare function getDefaultPlugins(root: string): Promise<LoadedNxPlugin[]>;
|
|
125
|
+
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import { ProjectGraphProcessor } from '../config/project-graph';
|
|
2
2
|
import { TargetConfiguration } from '../config/workspace-json-project-json';
|
|
3
|
+
import { LoadedNxPlugin } from './nx-plugin';
|
|
3
4
|
/**
|
|
4
|
-
* @deprecated Add targets to the projects in a {@link CreateNodes} function instead. This will be removed in Nx
|
|
5
|
+
* @deprecated Add targets to the projects in a {@link CreateNodes} function instead. This will be removed in Nx 19
|
|
5
6
|
*/
|
|
6
7
|
export type ProjectTargetConfigurator = (file: string) => Record<string, TargetConfiguration>;
|
|
7
8
|
/**
|
|
8
|
-
* @deprecated Use {@link NxPluginV2} instead. This will be removed in Nx
|
|
9
|
+
* @deprecated Use {@link NxPluginV2} instead. This will be removed in Nx 19
|
|
9
10
|
*/
|
|
10
11
|
export type NxPluginV1 = {
|
|
11
12
|
name: string;
|
|
12
13
|
/**
|
|
13
|
-
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx
|
|
14
|
+
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx 19
|
|
14
15
|
*/
|
|
15
16
|
processProjectGraph?: ProjectGraphProcessor;
|
|
16
17
|
/**
|
|
17
|
-
* @deprecated Add targets to the projects inside of {@link CreateNodes} instead. This will be removed in Nx
|
|
18
|
+
* @deprecated Add targets to the projects inside of {@link CreateNodes} instead. This will be removed in Nx 19
|
|
18
19
|
*/
|
|
19
20
|
registerProjectTargets?: ProjectTargetConfigurator;
|
|
20
21
|
/**
|
|
21
22
|
* A glob pattern to search for non-standard project files.
|
|
22
23
|
* @example: ["*.csproj", "pom.xml"]
|
|
23
|
-
* @deprecated Use {@link CreateNodes} instead. This will be removed in Nx
|
|
24
|
+
* @deprecated Use {@link CreateNodes} instead. This will be removed in Nx 19
|
|
24
25
|
*/
|
|
25
26
|
projectFilePatterns?: string[];
|
|
26
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @todo(@agentender) v19: Remove this fn when we remove readWorkspaceConfig
|
|
30
|
+
*/
|
|
31
|
+
export declare function getDefaultPluginsSync(root: string): LoadedNxPlugin[];
|
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultPluginsSync = void 0;
|
|
4
|
+
const angular_json_1 = require("../adapter/angular-json");
|
|
5
|
+
const project_json_1 = require("../plugins/project-json/build-nodes/project-json");
|
|
6
|
+
const target_defaults_plugin_1 = require("../plugins/target-defaults/target-defaults-plugin");
|
|
7
|
+
const package_json_workspaces_1 = require("../plugins/package-json-workspaces");
|
|
8
|
+
/**
|
|
9
|
+
* @todo(@agentender) v19: Remove this fn when we remove readWorkspaceConfig
|
|
10
|
+
*/
|
|
11
|
+
function getDefaultPluginsSync(root) {
|
|
12
|
+
const plugins = [
|
|
13
|
+
require('../plugins/js'),
|
|
14
|
+
...((0, angular_json_1.shouldMergeAngularProjects)(root, false)
|
|
15
|
+
? [require('../adapter/angular-json').NxAngularJsonPlugin]
|
|
16
|
+
: []),
|
|
17
|
+
target_defaults_plugin_1.TargetDefaultsPlugin,
|
|
18
|
+
(0, package_json_workspaces_1.getNxPackageJsonWorkspacesPlugin)(root),
|
|
19
|
+
project_json_1.ProjectJsonProjectsPlugin,
|
|
20
|
+
];
|
|
21
|
+
return plugins.map((p) => ({
|
|
22
|
+
plugin: p,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
exports.getDefaultPluginsSync = getDefaultPluginsSync;
|