@ohos-ports/nx 17.3.2-beta.0
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/.eslintrc.json +106 -0
- package/LICENSE +22 -0
- package/README.md +66 -0
- package/bin/init-local.d.ts +8 -0
- package/bin/init-local.js +175 -0
- package/bin/nx-cloud.d.ts +2 -0
- package/bin/nx-cloud.js +55 -0
- package/bin/nx.d.ts +2 -0
- package/bin/nx.js +230 -0
- package/bin/post-install.d.ts +1 -0
- package/bin/post-install.js +55 -0
- package/bin/run-executor.d.ts +1 -0
- package/bin/run-executor.js +66 -0
- package/executors.json +19 -0
- package/generators.json +10 -0
- package/migrations.json +87 -0
- package/package.json +186 -0
- package/plugins/package-json.d.ts +1 -0
- package/plugins/package-json.js +12 -0
- package/presets/core.json +1 -0
- package/presets/npm.json +7 -0
- package/release/changelog-renderer/index.d.ts +56 -0
- package/release/changelog-renderer/index.js +238 -0
- package/release/index.d.ts +4 -0
- package/release/index.js +11 -0
- package/schemas/nx-schema.json +623 -0
- package/schemas/project-schema.json +244 -0
- package/schemas/workspace-schema.json +185 -0
- package/src/adapter/angular-json.d.ts +9 -0
- package/src/adapter/angular-json.js +127 -0
- package/src/adapter/compat.d.ts +2 -0
- package/src/adapter/compat.js +136 -0
- package/src/adapter/decorate-cli.d.ts +1 -0
- package/src/adapter/decorate-cli.js +25 -0
- package/src/adapter/ngcli-adapter.d.ts +90 -0
- package/src/adapter/ngcli-adapter.js +848 -0
- package/src/adapter/rxjs-for-await.d.ts +109 -0
- package/src/adapter/rxjs-for-await.js +362 -0
- package/src/command-line/add/add.d.ts +2 -0
- package/src/command-line/add/add.js +165 -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.d.ts +7 -0
- package/src/command-line/affected/affected.js +105 -0
- package/src/command-line/affected/command-object.d.ts +16 -0
- package/src/command-line/affected/command-object.js +93 -0
- package/src/command-line/affected/print-affected.d.ts +11 -0
- package/src/command-line/affected/print-affected.js +108 -0
- package/src/command-line/connect/command-object.d.ts +3 -0
- package/src/command-line/connect/command-object.js +19 -0
- package/src/command-line/connect/connect-to-nx-cloud.d.ts +8 -0
- package/src/command-line/connect/connect-to-nx-cloud.js +96 -0
- package/src/command-line/connect/view-logs.d.ts +1 -0
- package/src/command-line/connect/view-logs.js +53 -0
- package/src/command-line/daemon/command-object.d.ts +2 -0
- package/src/command-line/daemon/command-object.js +21 -0
- package/src/command-line/daemon/daemon.d.ts +2 -0
- package/src/command-line/daemon/daemon.js +27 -0
- package/src/command-line/examples.d.ts +5 -0
- package/src/command-line/examples.js +347 -0
- package/src/command-line/exec/command-object.d.ts +2 -0
- package/src/command-line/exec/command-object.js +19 -0
- package/src/command-line/exec/exec.d.ts +1 -0
- package/src/command-line/exec/exec.js +141 -0
- package/src/command-line/format/command-object.d.ts +3 -0
- package/src/command-line/format/command-object.js +46 -0
- package/src/command-line/format/format.d.ts +2 -0
- package/src/command-line/format/format.js +155 -0
- package/src/command-line/generate/command-object.d.ts +2 -0
- package/src/command-line/generate/command-object.js +70 -0
- package/src/command-line/generate/generate.d.ts +21 -0
- package/src/command-line/generate/generate.js +266 -0
- package/src/command-line/generate/generator-utils.d.ts +17 -0
- package/src/command-line/generate/generator-utils.js +87 -0
- package/src/command-line/graph/command-object.d.ts +2 -0
- package/src/command-line/graph/command-object.js +21 -0
- package/src/command-line/graph/graph.d.ts +39 -0
- package/src/command-line/graph/graph.js +661 -0
- package/src/command-line/init/command-object.d.ts +2 -0
- package/src/command-line/init/command-object.js +81 -0
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +4 -0
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +133 -0
- package/src/command-line/init/implementation/add-nx-to-nest.d.ts +5 -0
- package/src/command-line/init/implementation/add-nx-to-nest.js +346 -0
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +4 -0
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +66 -0
- package/src/command-line/init/implementation/angular/index.d.ts +2 -0
- package/src/command-line/init/implementation/angular/index.js +128 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.d.ts +1 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.js +10 -0
- package/src/command-line/init/implementation/angular/legacy-angular-versions.d.ts +2 -0
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +125 -0
- package/src/command-line/init/implementation/angular/standalone-workspace.d.ts +1 -0
- package/src/command-line/init/implementation/angular/standalone-workspace.js +178 -0
- package/src/command-line/init/implementation/angular/types.d.ts +20 -0
- package/src/command-line/init/implementation/angular/types.js +2 -0
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +7 -0
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +91 -0
- package/src/command-line/init/implementation/dot-nx/nxw.d.ts +1 -0
- package/src/command-line/init/implementation/dot-nx/nxw.js +116 -0
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts +1 -0
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +22 -0
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts +1 -0
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +19 -0
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts +1 -0
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +18 -0
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts +1 -0
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +16 -0
- package/src/command-line/init/implementation/react/clean-up-files.d.ts +1 -0
- package/src/command-line/init/implementation/react/clean-up-files.js +31 -0
- package/src/command-line/init/implementation/react/index.d.ts +4 -0
- package/src/command-line/init/implementation/react/index.js +230 -0
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts +1 -0
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +17 -0
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts +1 -0
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +23 -0
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts +1 -0
- package/src/command-line/init/implementation/react/tsconfig-setup.js +109 -0
- package/src/command-line/init/implementation/react/write-craco-config.d.ts +1 -0
- package/src/command-line/init/implementation/react/write-craco-config.js +62 -0
- package/src/command-line/init/implementation/react/write-vite-config.d.ts +1 -0
- package/src/command-line/init/implementation/react/write-vite-config.js +38 -0
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts +1 -0
- package/src/command-line/init/implementation/react/write-vite-index-html.js +25 -0
- package/src/command-line/init/implementation/utils.d.ts +16 -0
- package/src/command-line/init/implementation/utils.js +176 -0
- package/src/command-line/init/init-v1.d.ts +11 -0
- package/src/command-line/init/init-v1.js +118 -0
- package/src/command-line/init/init-v2.d.ts +7 -0
- package/src/command-line/init/init-v2.js +165 -0
- package/src/command-line/list/command-object.d.ts +2 -0
- package/src/command-line/list/command-object.js +15 -0
- package/src/command-line/list/list.d.ts +13 -0
- package/src/command-line/list/list.js +47 -0
- package/src/command-line/migrate/command-object.d.ts +3 -0
- package/src/command-line/migrate/command-object.js +150 -0
- package/src/command-line/migrate/migrate.d.ts +114 -0
- package/src/command-line/migrate/migrate.js +1115 -0
- package/src/command-line/new/command-object.d.ts +2 -0
- package/src/command-line/new/command-object.js +25 -0
- package/src/command-line/new/new.d.ts +3 -0
- package/src/command-line/new/new.js +30 -0
- package/src/command-line/nx-commands.d.ts +10 -0
- package/src/command-line/nx-commands.js +77 -0
- package/src/command-line/release/changelog.d.ts +8 -0
- package/src/command-line/release/changelog.js +696 -0
- package/src/command-line/release/command-object.d.ts +45 -0
- package/src/command-line/release/command-object.js +237 -0
- package/src/command-line/release/config/config.d.ts +56 -0
- package/src/command-line/release/config/config.js +501 -0
- package/src/command-line/release/config/filter-release-groups.d.ts +13 -0
- package/src/command-line/release/config/filter-release-groups.js +150 -0
- 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 +8 -0
- package/src/command-line/release/publish.js +149 -0
- package/src/command-line/release/release.d.ts +4 -0
- package/src/command-line/release/release.js +124 -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 +55 -0
- package/src/command-line/release/utils/git.js +261 -0
- package/src/command-line/release/utils/github.d.ts +27 -0
- package/src/command-line/release/utils/github.js +229 -0
- package/src/command-line/release/utils/launch-editor.d.ts +1 -0
- package/src/command-line/release/utils/launch-editor.js +42 -0
- package/src/command-line/release/utils/markdown.d.ts +6 -0
- package/src/command-line/release/utils/markdown.js +29 -0
- package/src/command-line/release/utils/print-changes.d.ts +7 -0
- package/src/command-line/release/utils/print-changes.js +60 -0
- package/src/command-line/release/utils/resolve-nx-json-error-message.d.ts +1 -0
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +52 -0
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +3 -0
- package/src/command-line/release/utils/resolve-semver-specifier.js +69 -0
- package/src/command-line/release/utils/semver.d.ts +17 -0
- package/src/command-line/release/utils/semver.js +56 -0
- package/src/command-line/release/utils/shared.d.ts +34 -0
- package/src/command-line/release/utils/shared.js +211 -0
- package/src/command-line/release/version.d.ts +42 -0
- package/src/command-line/release/version.js +347 -0
- package/src/command-line/repair/command-object.d.ts +2 -0
- package/src/command-line/repair/command-object.js +22 -0
- package/src/command-line/repair/repair.d.ts +3 -0
- package/src/command-line/repair/repair.js +37 -0
- package/src/command-line/repair.d.ts +4 -0
- package/src/command-line/repair.js +7 -0
- package/src/command-line/report/command-object.d.ts +2 -0
- package/src/command-line/report/command-object.js +11 -0
- package/src/command-line/report/report.d.ts +48 -0
- package/src/command-line/report/report.js +232 -0
- package/src/command-line/reset/command-object.d.ts +2 -0
- package/src/command-line/reset/command-object.js +9 -0
- package/src/command-line/reset/reset.d.ts +1 -0
- package/src/command-line/reset/reset.js +23 -0
- package/src/command-line/run/command-object.d.ts +6 -0
- package/src/command-line/run/command-object.js +25 -0
- package/src/command-line/run/executor-utils.d.ts +7 -0
- package/src/command-line/run/executor-utils.js +73 -0
- package/src/command-line/run/run-one.d.ts +7 -0
- package/src/command-line/run/run-one.js +117 -0
- package/src/command-line/run/run.d.ts +51 -0
- package/src/command-line/run/run.js +172 -0
- package/src/command-line/run-many/command-object.d.ts +2 -0
- package/src/command-line/run-many/command-object.js +11 -0
- package/src/command-line/run-many/run-many.d.ts +10 -0
- package/src/command-line/run-many/run-many.js +90 -0
- package/src/command-line/run-many.d.ts +4 -0
- package/src/command-line/run-many.js +7 -0
- package/src/command-line/run-one.d.ts +4 -0
- package/src/command-line/run-one.js +7 -0
- package/src/command-line/run.d.ts +4 -0
- package/src/command-line/run.js +7 -0
- package/src/command-line/show/command-object.d.ts +22 -0
- package/src/command-line/show/command-object.js +84 -0
- package/src/command-line/show/show.d.ts +3 -0
- package/src/command-line/show/show.js +126 -0
- package/src/command-line/watch/command-object.d.ts +2 -0
- package/src/command-line/watch/command-object.js +64 -0
- package/src/command-line/watch/watch.d.ts +23 -0
- package/src/command-line/watch/watch.js +169 -0
- package/src/command-line/watch.d.ts +4 -0
- package/src/command-line/watch.js +7 -0
- package/src/command-line/yargs-utils/documentation.d.ts +2 -0
- package/src/command-line/yargs-utils/documentation.js +12 -0
- package/src/command-line/yargs-utils/shared-options.d.ts +89 -0
- package/src/command-line/yargs-utils/shared-options.js +284 -0
- 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/calculate-default-project-name.d.ts +4 -0
- package/src/config/calculate-default-project-name.js +42 -0
- package/src/config/configuration.d.ts +8 -0
- package/src/config/configuration.js +17 -0
- package/src/config/misc-interfaces.d.ts +199 -0
- package/src/config/misc-interfaces.js +2 -0
- package/src/config/nx-json.d.ts +372 -0
- package/src/config/nx-json.js +40 -0
- package/src/config/project-graph.d.ts +137 -0
- package/src/config/project-graph.js +37 -0
- package/src/config/schema-utils.d.ts +15 -0
- package/src/config/schema-utils.js +59 -0
- package/src/config/task-graph.d.ts +100 -0
- package/src/config/task-graph.js +2 -0
- package/src/config/workspace-json-project-json.d.ts +189 -0
- package/src/config/workspace-json-project-json.js +2 -0
- package/src/config/workspaces.d.ts +18 -0
- package/src/config/workspaces.js +35 -0
- package/src/core/graph/3rdpartylicenses.txt +833 -0
- package/src/core/graph/environment.js +1 -0
- package/src/core/graph/favicon.ico +0 -0
- package/src/core/graph/index.html +31 -0
- package/src/core/graph/main.js +1 -0
- package/src/core/graph/polyfills.js +1 -0
- package/src/core/graph/runtime.js +1 -0
- package/src/core/graph/styles.css +3 -0
- package/src/core/graph/styles.js +1 -0
- package/src/daemon/cache.d.ts +9 -0
- package/src/daemon/cache.js +52 -0
- package/src/daemon/client/client.d.ts +56 -0
- package/src/daemon/client/client.js +359 -0
- package/src/daemon/client/daemon-socket-messenger.d.ts +13 -0
- package/src/daemon/client/daemon-socket-messenger.js +26 -0
- package/src/daemon/client/exec-is-server-available.d.ts +1 -0
- package/src/daemon/client/exec-is-server-available.js +11 -0
- package/src/daemon/client/generate-help-output.d.ts +1 -0
- package/src/daemon/client/generate-help-output.js +26 -0
- package/src/daemon/server/file-watching/changed-projects.d.ts +10 -0
- package/src/daemon/server/file-watching/changed-projects.js +45 -0
- package/src/daemon/server/file-watching/file-watcher-sockets.d.ts +13 -0
- package/src/daemon/server/file-watching/file-watcher-sockets.js +66 -0
- package/src/daemon/server/handle-hash-tasks.d.ts +10 -0
- package/src/daemon/server/handle-hash-tasks.js +26 -0
- package/src/daemon/server/handle-outputs-tracking.d.ts +15 -0
- package/src/daemon/server/handle-outputs-tracking.js +36 -0
- package/src/daemon/server/handle-process-in-background.d.ts +6 -0
- package/src/daemon/server/handle-process-in-background.js +33 -0
- package/src/daemon/server/handle-request-file-data.d.ts +4 -0
- package/src/daemon/server/handle-request-file-data.js +13 -0
- package/src/daemon/server/handle-request-project-graph.d.ts +2 -0
- package/src/daemon/server/handle-request-project-graph.js +37 -0
- package/src/daemon/server/handle-request-shutdown.d.ts +6 -0
- package/src/daemon/server/handle-request-shutdown.js +26 -0
- package/src/daemon/server/logger.d.ts +18 -0
- package/src/daemon/server/logger.js +37 -0
- package/src/daemon/server/outputs-tracking.d.ts +8 -0
- package/src/daemon/server/outputs-tracking.js +94 -0
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +22 -0
- package/src/daemon/server/project-graph-incremental-recomputation.js +227 -0
- package/src/daemon/server/server.d.ts +9 -0
- package/src/daemon/server/server.js +303 -0
- package/src/daemon/server/shutdown-utils.d.ts +17 -0
- package/src/daemon/server/shutdown-utils.js +77 -0
- package/src/daemon/server/start.d.ts +1 -0
- package/src/daemon/server/start.js +17 -0
- package/src/daemon/server/watcher.d.ts +12 -0
- package/src/daemon/server/watcher.js +96 -0
- package/src/daemon/socket-utils.d.ts +11 -0
- package/src/daemon/socket-utils.js +42 -0
- package/src/daemon/tmp-dir.d.ts +8 -0
- package/src/daemon/tmp-dir.js +68 -0
- package/src/devkit-exports.d.ts +135 -0
- package/src/devkit-exports.js +140 -0
- package/src/devkit-internals.d.ts +19 -0
- package/src/devkit-internals.js +37 -0
- package/src/devkit-testing-exports.d.ts +2 -0
- package/src/devkit-testing-exports.js +8 -0
- package/src/executors/noop/noop.impl.d.ts +3 -0
- package/src/executors/noop/noop.impl.js +6 -0
- package/src/executors/noop/schema.json +10 -0
- package/src/executors/run-commands/run-commands.impl.d.ts +42 -0
- package/src/executors/run-commands/run-commands.impl.js +247 -0
- package/src/executors/run-commands/schema.json +150 -0
- package/src/executors/run-script/run-script.impl.d.ts +8 -0
- package/src/executors/run-script/run-script.impl.js +56 -0
- package/src/executors/run-script/schema.json +28 -0
- package/src/executors/utils/convert-nx-executor.d.ts +10 -0
- package/src/executors/utils/convert-nx-executor.js +82 -0
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +8 -0
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +49 -0
- package/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +11 -0
- package/src/generators/testing-utils/create-tree-with-empty-workspace.js +46 -0
- package/src/generators/testing-utils/create-tree.d.ts +5 -0
- package/src/generators/testing-utils/create-tree.js +11 -0
- package/src/generators/tree.d.ts +128 -0
- package/src/generators/tree.js +309 -0
- package/src/generators/utils/glob.d.ts +11 -0
- package/src/generators/utils/glob.js +35 -0
- package/src/generators/utils/json.d.ts +28 -0
- package/src/generators/utils/json.js +48 -0
- package/src/generators/utils/nx-json.d.ts +11 -0
- package/src/generators/utils/nx-json.js +59 -0
- package/src/generators/utils/project-configuration.d.ts +42 -0
- package/src/generators/utils/project-configuration.js +239 -0
- package/src/hasher/create-task-hasher.d.ts +4 -0
- package/src/hasher/create-task-hasher.js +16 -0
- package/src/hasher/file-hasher.d.ts +2 -0
- package/src/hasher/file-hasher.js +19 -0
- package/src/hasher/hash-task.d.ts +7 -0
- package/src/hasher/hash-task.js +54 -0
- 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 +129 -0
- package/src/hasher/task-hasher.js +266 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -0
- package/src/migrations/update-15-0-0/migrate-to-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +102 -0
- package/src/migrations/update-15-0-0/prefix-outputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/prefix-outputs.js +64 -0
- package/src/migrations/update-15-1-0/set-project-names.d.ts +2 -0
- package/src/migrations/update-15-1-0/set-project-names.js +32 -0
- package/src/migrations/update-15-8-2/update-nxw.d.ts +2 -0
- package/src/migrations/update-15-8-2/update-nxw.js +7 -0
- package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +2 -0
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +16 -0
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +2 -0
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +97 -0
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +2 -0
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +27 -0
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +2 -0
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +45 -0
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +12 -0
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +60 -0
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.d.ts +2 -0
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +21 -0
- package/src/migrations/update-17-0-0/move-cache-directory.d.ts +2 -0
- package/src/migrations/update-17-0-0/move-cache-directory.js +35 -0
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.d.ts +2 -0
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +72 -0
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.d.ts +2 -0
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +122 -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 +49 -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/native/assert-supported-platform.d.ts +1 -0
- package/src/native/assert-supported-platform.js +39 -0
- package/src/native/index.d.ts +192 -0
- package/src/native/index.js +289 -0
- package/src/native/transform-objects.d.ts +3 -0
- package/src/native/transform-objects.js +50 -0
- package/src/nx-cloud/debug-logger.d.ts +1 -0
- package/src/nx-cloud/debug-logger.js +9 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +8 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +107 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +27 -0
- package/src/nx-cloud/nx-cloud-tasks-runner-shell.d.ts +15 -0
- package/src/nx-cloud/nx-cloud-tasks-runner-shell.js +41 -0
- package/src/nx-cloud/resolution-helpers.d.ts +1 -0
- package/src/nx-cloud/resolution-helpers.js +20 -0
- package/src/nx-cloud/update-manager.d.ts +17 -0
- package/src/nx-cloud/update-manager.js +240 -0
- package/src/nx-cloud/utilities/axios.d.ts +2 -0
- package/src/nx-cloud/utilities/axios.js +24 -0
- package/src/nx-cloud/utilities/environment.d.ts +3 -0
- package/src/nx-cloud/utilities/environment.js +47 -0
- package/src/nx-cloud/utilities/get-cloud-options.d.ts +2 -0
- package/src/nx-cloud/utilities/get-cloud-options.js +11 -0
- package/src/plugins/js/hasher/hasher.d.ts +5 -0
- package/src/plugins/js/hasher/hasher.js +52 -0
- package/src/plugins/js/index.d.ts +4 -0
- package/src/plugins/js/index.js +96 -0
- package/src/plugins/js/lock-file/lock-file.d.ts +34 -0
- package/src/plugins/js/lock-file/lock-file.js +169 -0
- package/src/plugins/js/lock-file/npm-parser.d.ts +7 -0
- package/src/plugins/js/lock-file/npm-parser.js +463 -0
- package/src/plugins/js/lock-file/pnpm-parser.d.ts +7 -0
- package/src/plugins/js/lock-file/pnpm-parser.js +294 -0
- package/src/plugins/js/lock-file/project-graph-pruning.d.ts +7 -0
- package/src/plugins/js/lock-file/project-graph-pruning.js +155 -0
- package/src/plugins/js/lock-file/utils/package-json.d.ts +10 -0
- package/src/plugins/js/lock-file/utils/package-json.js +34 -0
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +38 -0
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +575 -0
- package/src/plugins/js/lock-file/yarn-parser.d.ts +7 -0
- package/src/plugins/js/lock-file/yarn-parser.js +437 -0
- package/src/plugins/js/package-json/create-package-json.d.ts +27 -0
- package/src/plugins/js/package-json/create-package-json.js +207 -0
- package/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +4 -0
- package/src/plugins/js/project-graph/affected/lock-file-changes.js +16 -0
- package/src/plugins/js/project-graph/affected/npm-packages.d.ts +4 -0
- package/src/plugins/js/project-graph/affected/npm-packages.js +56 -0
- package/src/plugins/js/project-graph/affected/touched-projects.d.ts +2 -0
- package/src/plugins/js/project-graph/affected/touched-projects.js +18 -0
- package/src/plugins/js/project-graph/affected/tsconfig-json-changes.d.ts +4 -0
- package/src/plugins/js/project-graph/affected/tsconfig-json-changes.js +63 -0
- package/src/plugins/js/project-graph/build-dependencies/build-dependencies.d.ts +6 -0
- package/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +33 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +3 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +82 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.d.ts +3 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +94 -0
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +7 -0
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +156 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +32 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +183 -0
- package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +16 -0
- package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +120 -0
- package/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.d.ts +2 -0
- package/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.js +32 -0
- package/src/plugins/js/utils/config.d.ts +2 -0
- package/src/plugins/js/utils/config.js +65 -0
- package/src/plugins/js/utils/register.d.ts +151 -0
- package/src/plugins/js/utils/register.js +215 -0
- package/src/plugins/js/utils/typescript.d.ts +14 -0
- package/src/plugins/js/utils/typescript.js +98 -0
- package/src/plugins/js/versions.d.ts +1 -0
- package/src/plugins/js/versions.js +4 -0
- package/src/plugins/package-json-workspaces/create-nodes.d.ts +19 -0
- package/src/plugins/package-json-workspaces/create-nodes.js +130 -0
- 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 +4 -0
- package/src/plugins/project-json/build-nodes/project-json.js +29 -0
- package/src/plugins/target-defaults/target-defaults-plugin.d.ts +8 -0
- package/src/plugins/target-defaults/target-defaults-plugin.js +103 -0
- package/src/project-graph/affected/affected-project-graph-models.d.ts +11 -0
- package/src/project-graph/affected/affected-project-graph-models.js +2 -0
- package/src/project-graph/affected/affected-project-graph.d.ts +4 -0
- package/src/project-graph/affected/affected-project-graph.js +83 -0
- package/src/project-graph/affected/locators/project-glob-changes.d.ts +2 -0
- package/src/project-graph/affected/locators/project-glob-changes.js +31 -0
- package/src/project-graph/affected/locators/workspace-json-changes.d.ts +4 -0
- package/src/project-graph/affected/locators/workspace-json-changes.js +47 -0
- package/src/project-graph/affected/locators/workspace-projects.d.ts +5 -0
- package/src/project-graph/affected/locators/workspace-projects.js +85 -0
- package/src/project-graph/build-project-graph.d.ts +14 -0
- package/src/project-graph/build-project-graph.js +219 -0
- package/src/project-graph/file-map-utils.d.ts +15 -0
- package/src/project-graph/file-map-utils.js +63 -0
- package/src/project-graph/file-utils.d.ts +31 -0
- package/src/project-graph/file-utils.js +181 -0
- package/src/project-graph/nx-deps-cache.d.ts +48 -0
- package/src/project-graph/nx-deps-cache.js +228 -0
- package/src/project-graph/operators.d.ts +12 -0
- package/src/project-graph/operators.js +114 -0
- package/src/project-graph/project-graph-builder.d.ts +133 -0
- package/src/project-graph/project-graph-builder.js +379 -0
- package/src/project-graph/project-graph.d.ts +48 -0
- package/src/project-graph/project-graph.js +188 -0
- 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/find-project-for-path.d.ts +20 -0
- package/src/project-graph/utils/find-project-for-path.js +57 -0
- package/src/project-graph/utils/implicit-project-dependencies.d.ts +3 -0
- package/src/project-graph/utils/implicit-project-dependencies.js +19 -0
- package/src/project-graph/utils/normalize-project-nodes.d.ts +10 -0
- package/src/project-graph/utils/normalize-project-nodes.js +92 -0
- package/src/project-graph/utils/project-configuration-utils.d.ts +53 -0
- package/src/project-graph/utils/project-configuration-utils.js +456 -0
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +37 -0
- package/src/project-graph/utils/retrieve-workspace-files.js +109 -0
- package/src/tasks-runner/batch/batch-messages.d.ts +33 -0
- package/src/tasks-runner/batch/batch-messages.js +9 -0
- package/src/tasks-runner/batch/run-batch.d.ts +1 -0
- package/src/tasks-runner/batch/run-batch.js +77 -0
- package/src/tasks-runner/cache.d.ts +36 -0
- package/src/tasks-runner/cache.js +236 -0
- package/src/tasks-runner/create-task-graph.d.ts +25 -0
- package/src/tasks-runner/create-task-graph.js +225 -0
- package/src/tasks-runner/default-tasks-runner.d.ts +20 -0
- package/src/tasks-runner/default-tasks-runner.js +29 -0
- 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 +44 -0
- package/src/tasks-runner/forked-process-task-runner.js +396 -0
- package/src/tasks-runner/init-tasks-runner.d.ts +11 -0
- package/src/tasks-runner/init-tasks-runner.js +57 -0
- package/src/tasks-runner/life-cycle.d.ts +43 -0
- package/src/tasks-runner/life-cycle.js +71 -0
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts +25 -0
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +345 -0
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts +24 -0
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +224 -0
- package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.d.ts +5 -0
- package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js +16 -0
- package/src/tasks-runner/life-cycles/formatting-utils.d.ts +3 -0
- package/src/tasks-runner/life-cycles/formatting-utils.js +44 -0
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +17 -0
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +67 -0
- package/src/tasks-runner/life-cycles/pretty-time.d.ts +4 -0
- package/src/tasks-runner/life-cycles/pretty-time.js +74 -0
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +33 -0
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +99 -0
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +31 -0
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +89 -0
- package/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +22 -0
- package/src/tasks-runner/life-cycles/store-run-information-life-cycle.js +87 -0
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +19 -0
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.js +73 -0
- package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +13 -0
- package/src/tasks-runner/life-cycles/task-timings-life-cycle.js +39 -0
- package/src/tasks-runner/life-cycles/view-logs-utils.d.ts +1 -0
- package/src/tasks-runner/life-cycles/view-logs-utils.js +16 -0
- package/src/tasks-runner/psuedo-ipc.d.ts +49 -0
- package/src/tasks-runner/psuedo-ipc.js +140 -0
- package/src/tasks-runner/remove-old-cache-records.d.ts +1 -0
- package/src/tasks-runner/remove-old-cache-records.js +61 -0
- package/src/tasks-runner/run-command.d.ts +28 -0
- package/src/tasks-runner/run-command.js +353 -0
- package/src/tasks-runner/task-env.d.ts +8 -0
- package/src/tasks-runner/task-env.js +144 -0
- package/src/tasks-runner/task-graph-utils.d.ts +7 -0
- package/src/tasks-runner/task-graph-utils.js +55 -0
- package/src/tasks-runner/task-orchestrator.d.ts +50 -0
- package/src/tasks-runner/task-orchestrator.js +375 -0
- package/src/tasks-runner/tasks-runner.d.ts +23 -0
- package/src/tasks-runner/tasks-runner.js +2 -0
- package/src/tasks-runner/tasks-schedule.d.ts +36 -0
- package/src/tasks-runner/tasks-schedule.js +142 -0
- package/src/tasks-runner/utils.d.ts +51 -0
- package/src/tasks-runner/utils.js +293 -0
- package/src/utils/ab-testing.d.ts +51 -0
- package/src/utils/ab-testing.js +91 -0
- package/src/utils/all-file-data.d.ts +2 -0
- package/src/utils/all-file-data.js +15 -0
- package/src/utils/app-root.d.ts +8 -0
- package/src/utils/app-root.js +12 -0
- package/src/utils/assert-workspace-validity.d.ts +3 -0
- package/src/utils/assert-workspace-validity.js +84 -0
- package/src/utils/async-iterator.d.ts +2 -0
- package/src/utils/async-iterator.js +17 -0
- package/src/utils/cache-directory.d.ts +6 -0
- package/src/utils/cache-directory.js +60 -0
- package/src/utils/child-process.d.ts +19 -0
- package/src/utils/child-process.js +117 -0
- package/src/utils/chunkify.d.ts +1 -0
- package/src/utils/chunkify.js +38 -0
- package/src/utils/code-frames.d.ts +14 -0
- package/src/utils/code-frames.js +119 -0
- package/src/utils/collapse-expanded-outputs.d.ts +1 -0
- package/src/utils/collapse-expanded-outputs.js +41 -0
- package/src/utils/command-line-utils.d.ts +48 -0
- package/src/utils/command-line-utils.js +254 -0
- package/src/utils/consume-messages-from-socket.d.ts +1 -0
- package/src/utils/consume-messages-from-socket.js +22 -0
- package/src/utils/default-base.d.ts +1 -0
- package/src/utils/default-base.js +15 -0
- package/src/utils/exit-codes.d.ts +6 -0
- package/src/utils/exit-codes.js +20 -0
- package/src/utils/fileutils.d.ts +69 -0
- package/src/utils/fileutils.js +135 -0
- package/src/utils/find-matching-projects.d.ts +10 -0
- package/src/utils/find-matching-projects.js +198 -0
- package/src/utils/find-workspace-root.d.ts +11 -0
- package/src/utils/find-workspace-root.js +34 -0
- package/src/utils/globs.d.ts +1 -0
- package/src/utils/globs.js +8 -0
- package/src/utils/ignore.d.ts +8 -0
- package/src/utils/ignore.js +68 -0
- package/src/utils/installation-directory.d.ts +2 -0
- package/src/utils/installation-directory.js +13 -0
- package/src/utils/is-ci.d.ts +1 -0
- package/src/utils/is-ci.js +20 -0
- package/src/utils/json-diff.d.ts +18 -0
- package/src/utils/json-diff.js +112 -0
- package/src/utils/json.d.ts +44 -0
- package/src/utils/json.js +60 -0
- package/src/utils/logger.d.ts +11 -0
- package/src/utils/logger.js +47 -0
- package/src/utils/nx-cloud-utils.d.ts +4 -0
- package/src/utils/nx-cloud-utils.js +27 -0
- package/src/utils/nx-plugin.d.ts +119 -0
- package/src/utils/nx-plugin.deprecated.d.ts +31 -0
- package/src/utils/nx-plugin.deprecated.js +25 -0
- package/src/utils/nx-plugin.js +293 -0
- package/src/utils/object-sort.d.ts +1 -0
- package/src/utils/object-sort.js +10 -0
- package/src/utils/output.d.ts +72 -0
- package/src/utils/output.js +239 -0
- package/src/utils/package-json.d.ts +98 -0
- package/src/utils/package-json.js +134 -0
- package/src/utils/package-manager.d.ts +93 -0
- package/src/utils/package-manager.js +300 -0
- package/src/utils/params.d.ts +138 -0
- package/src/utils/params.js +684 -0
- package/src/utils/path.d.ts +19 -0
- package/src/utils/path.js +38 -0
- package/src/utils/perf-logging.d.ts +1 -0
- package/src/utils/perf-logging.js +11 -0
- package/src/utils/plugins/community-plugins.d.ts +2 -0
- package/src/utils/plugins/community-plugins.js +29 -0
- package/src/utils/plugins/core-plugins.d.ts +3 -0
- package/src/utils/plugins/core-plugins.js +114 -0
- package/src/utils/plugins/index.d.ts +4 -0
- package/src/utils/plugins/index.js +14 -0
- package/src/utils/plugins/installed-plugins.d.ts +6 -0
- package/src/utils/plugins/installed-plugins.js +104 -0
- package/src/utils/plugins/local-plugins.d.ts +5 -0
- package/src/utils/plugins/local-plugins.js +58 -0
- package/src/utils/plugins/models.d.ts +22 -0
- package/src/utils/plugins/models.js +2 -0
- package/src/utils/plugins/plugin-capabilities.d.ts +4 -0
- package/src/utils/plugins/plugin-capabilities.js +124 -0
- package/src/utils/plugins/shared.d.ts +1 -0
- package/src/utils/plugins/shared.js +8 -0
- package/src/utils/print-help.d.ts +11 -0
- package/src/utils/print-help.js +265 -0
- package/src/utils/project-graph-utils.d.ts +13 -0
- package/src/utils/project-graph-utils.js +74 -0
- package/src/utils/promised-based-queue.d.ts +6 -0
- package/src/utils/promised-based-queue.js +43 -0
- package/src/utils/serialize-overrides-into-command-line.d.ts +3 -0
- package/src/utils/serialize-overrides-into-command-line.js +43 -0
- package/src/utils/split-target.d.ts +3 -0
- package/src/utils/split-target.js +49 -0
- package/src/utils/strip-indents.d.ts +14 -0
- package/src/utils/strip-indents.js +24 -0
- package/src/utils/typescript.d.ts +1 -0
- package/src/utils/typescript.js +5 -0
- package/src/utils/update-nxw.d.ts +2 -0
- package/src/utils/update-nxw.js +12 -0
- package/src/utils/versions.d.ts +1 -0
- package/src/utils/versions.js +4 -0
- package/src/utils/workspace-configuration-check.d.ts +1 -0
- package/src/utils/workspace-configuration-check.js +37 -0
- package/src/utils/workspace-context.d.ts +10 -0
- package/src/utils/workspace-context.js +56 -0
- package/src/utils/workspace-root.d.ts +6 -0
- package/src/utils/workspace-root.js +39 -0
- package/tasks-runners/default.d.ts +1 -0
- package/tasks-runners/default.js +5 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNxCloudToken = exports.getNxCloudUrl = exports.isNxCloudUsed = void 0;
|
|
4
|
+
function isNxCloudUsed(nxJson) {
|
|
5
|
+
return (process.env.NX_CLOUD_ACCESS_TOKEN ||
|
|
6
|
+
!!nxJson.nxCloudAccessToken ||
|
|
7
|
+
!!Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud'));
|
|
8
|
+
}
|
|
9
|
+
exports.isNxCloudUsed = isNxCloudUsed;
|
|
10
|
+
function getNxCloudUrl(nxJson) {
|
|
11
|
+
const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
|
|
12
|
+
if (!cloudRunner &&
|
|
13
|
+
!(nxJson.nxCloudAccessToken || process.env.NX_CLOUD_ACCESS_TOKEN))
|
|
14
|
+
throw new Error('nx-cloud runner not found in nx.json');
|
|
15
|
+
return cloudRunner?.options?.url ?? nxJson.nxCloudUrl ?? 'https://nx.app';
|
|
16
|
+
}
|
|
17
|
+
exports.getNxCloudUrl = getNxCloudUrl;
|
|
18
|
+
function getNxCloudToken(nxJson) {
|
|
19
|
+
const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
|
|
20
|
+
if (!cloudRunner &&
|
|
21
|
+
!(nxJson.nxCloudAccessToken || process.env.NX_CLOUD_ACCESS_TOKEN))
|
|
22
|
+
throw new Error('nx-cloud runner not found in nx.json');
|
|
23
|
+
return (process.env.NX_CLOUD_ACCESS_TOKEN ??
|
|
24
|
+
cloudRunner?.options.accessToken ??
|
|
25
|
+
nxJson.nxCloudAccessToken);
|
|
26
|
+
}
|
|
27
|
+
exports.getNxCloudToken = getNxCloudToken;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { FileMap, ProjectGraph, ProjectGraphExternalNode } from '../config/project-graph';
|
|
2
|
+
import { PackageJson } from './package-json';
|
|
3
|
+
import { ProjectConfiguration } from '../config/workspace-json-project-json';
|
|
4
|
+
import { NxJsonConfiguration, PluginConfiguration } from '../config/nx-json';
|
|
5
|
+
import { NxPluginV1 } from './nx-plugin.deprecated';
|
|
6
|
+
import { RawProjectGraphDependency } from '../project-graph/project-graph-builder';
|
|
7
|
+
/**
|
|
8
|
+
* Context for {@link CreateNodesFunction}
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateNodesContext {
|
|
11
|
+
readonly nxJsonConfiguration: NxJsonConfiguration;
|
|
12
|
+
readonly workspaceRoot: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A function which parses a configuration file into a set of nodes.
|
|
16
|
+
* Used for creating nodes for the {@link ProjectGraph}
|
|
17
|
+
*/
|
|
18
|
+
export type CreateNodesFunction<T = unknown> = (projectConfigurationFile: string, options: T | undefined, context: CreateNodesContext) => CreateNodesResult | Promise<CreateNodesResult>;
|
|
19
|
+
export interface CreateNodesResult {
|
|
20
|
+
/**
|
|
21
|
+
* A map of project root -> project configuration
|
|
22
|
+
*/
|
|
23
|
+
projects?: Record<string, Optional<ProjectConfiguration, 'root'>>;
|
|
24
|
+
/**
|
|
25
|
+
* A map of external node name -> external node. External nodes do not have a root, so the key is their name.
|
|
26
|
+
*/
|
|
27
|
+
externalNodes?: Record<string, ProjectGraphExternalNode>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A pair of file patterns and {@link CreateNodesFunction}
|
|
31
|
+
*/
|
|
32
|
+
export type CreateNodes<T = unknown> = readonly [
|
|
33
|
+
projectFilePattern: string,
|
|
34
|
+
createNodesFunction: CreateNodesFunction<T>
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Context for {@link CreateDependencies}
|
|
38
|
+
*/
|
|
39
|
+
export interface CreateDependenciesContext {
|
|
40
|
+
/**
|
|
41
|
+
* The external nodes that have been added to the graph.
|
|
42
|
+
*/
|
|
43
|
+
readonly externalNodes: ProjectGraph['externalNodes'];
|
|
44
|
+
/**
|
|
45
|
+
* The configuration of each project in the workspace.
|
|
46
|
+
*/
|
|
47
|
+
readonly projects: Record<string, ProjectConfiguration>;
|
|
48
|
+
/**
|
|
49
|
+
* The `nx.json` configuration from the workspace
|
|
50
|
+
*/
|
|
51
|
+
readonly nxJsonConfiguration: NxJsonConfiguration;
|
|
52
|
+
/**
|
|
53
|
+
* All files in the workspace
|
|
54
|
+
*/
|
|
55
|
+
readonly fileMap: FileMap;
|
|
56
|
+
/**
|
|
57
|
+
* Files changes since last invocation
|
|
58
|
+
*/
|
|
59
|
+
readonly filesToProcess: FileMap;
|
|
60
|
+
readonly workspaceRoot: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A function which parses files in the workspace to create dependencies in the {@link ProjectGraph}
|
|
64
|
+
* Use {@link validateDependency} to validate dependencies
|
|
65
|
+
*/
|
|
66
|
+
export type CreateDependencies<T = unknown> = (options: T | undefined, context: CreateDependenciesContext) => RawProjectGraphDependency[] | Promise<RawProjectGraphDependency[]>;
|
|
67
|
+
/**
|
|
68
|
+
* A plugin for Nx which creates nodes and dependencies for the {@link ProjectGraph}
|
|
69
|
+
*/
|
|
70
|
+
export type NxPluginV2<TOptions = unknown> = {
|
|
71
|
+
name: string;
|
|
72
|
+
/**
|
|
73
|
+
* Provides a file pattern and function that retrieves configuration info from
|
|
74
|
+
* those files. e.g. { '**\/*.csproj': buildProjectsFromCsProjFile }
|
|
75
|
+
*/
|
|
76
|
+
createNodes?: CreateNodes;
|
|
77
|
+
/**
|
|
78
|
+
* Provides a function to analyze files to create dependencies for the {@link ProjectGraph}
|
|
79
|
+
*/
|
|
80
|
+
createDependencies?: CreateDependencies<TOptions>;
|
|
81
|
+
};
|
|
82
|
+
export * from './nx-plugin.deprecated';
|
|
83
|
+
/**
|
|
84
|
+
* A plugin for Nx
|
|
85
|
+
*/
|
|
86
|
+
export type NxPlugin = NxPluginV1 | NxPluginV2;
|
|
87
|
+
export type LoadedNxPlugin = {
|
|
88
|
+
plugin: NxPluginV2 & Pick<NxPluginV1, 'processProjectGraph'>;
|
|
89
|
+
options?: unknown;
|
|
90
|
+
};
|
|
91
|
+
export declare const nxPluginCache: Map<string, LoadedNxPlugin['plugin']>;
|
|
92
|
+
export declare function getPluginPathAndName(moduleName: string, paths: string[], projects: Record<string, ProjectConfiguration>, root: string): {
|
|
93
|
+
pluginPath: string;
|
|
94
|
+
name: any;
|
|
95
|
+
};
|
|
96
|
+
export declare function loadNxPluginAsync(pluginConfiguration: PluginConfiguration, paths: string[], projects: Record<string, ProjectConfiguration>, root: string): Promise<LoadedNxPlugin>;
|
|
97
|
+
export declare function loadNxPlugins(plugins: PluginConfiguration[], paths?: string[], root?: string, projects?: Record<string, ProjectConfiguration>): Promise<LoadedNxPlugin[]>;
|
|
98
|
+
export declare function ensurePluginIsV2(plugin: NxPlugin): NxPluginV2;
|
|
99
|
+
export declare function isNxPluginV2(plugin: NxPlugin): plugin is NxPluginV2;
|
|
100
|
+
export declare function isNxPluginV1(plugin: NxPlugin): plugin is NxPluginV1;
|
|
101
|
+
export declare function readPluginPackageJson(pluginName: string, projects: Record<string, ProjectConfiguration>, paths?: string[]): {
|
|
102
|
+
path: string;
|
|
103
|
+
json: PackageJson;
|
|
104
|
+
};
|
|
105
|
+
export declare function resolveLocalNxPlugin(importPath: string, nxJsonConfiguration: NxJsonConfiguration, projects: Record<string, ProjectConfiguration>, root?: string): {
|
|
106
|
+
path: string;
|
|
107
|
+
projectConfig: ProjectConfiguration;
|
|
108
|
+
} | null;
|
|
109
|
+
/**
|
|
110
|
+
* Register swc-node or ts-node if they are not currently registered
|
|
111
|
+
* with some default settings which work well for Nx plugins.
|
|
112
|
+
*/
|
|
113
|
+
export declare function registerPluginTSTranspiler(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Unregister the ts-node transpiler if it is registered
|
|
116
|
+
*/
|
|
117
|
+
export declare function unregisterPluginTSTranspiler(): void;
|
|
118
|
+
export declare function getDefaultPlugins(root: string): Promise<LoadedNxPlugin[]>;
|
|
119
|
+
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ProjectGraphProcessor } from '../config/project-graph';
|
|
2
|
+
import { TargetConfiguration } from '../config/workspace-json-project-json';
|
|
3
|
+
import { LoadedNxPlugin } from './nx-plugin';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Add targets to the projects in a {@link CreateNodes} function instead. This will be removed in Nx 19
|
|
6
|
+
*/
|
|
7
|
+
export type ProjectTargetConfigurator = (file: string) => Record<string, TargetConfiguration>;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use {@link NxPluginV2} instead. This will be removed in Nx 19
|
|
10
|
+
*/
|
|
11
|
+
export type NxPluginV1 = {
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx 19
|
|
15
|
+
*/
|
|
16
|
+
processProjectGraph?: ProjectGraphProcessor;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Add targets to the projects inside of {@link CreateNodes} instead. This will be removed in Nx 19
|
|
19
|
+
*/
|
|
20
|
+
registerProjectTargets?: ProjectTargetConfigurator;
|
|
21
|
+
/**
|
|
22
|
+
* A glob pattern to search for non-standard project files.
|
|
23
|
+
* @example: ["*.csproj", "pom.xml"]
|
|
24
|
+
* @deprecated Use {@link CreateNodes} instead. This will be removed in Nx 19
|
|
25
|
+
*/
|
|
26
|
+
projectFilePatterns?: string[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @todo(@agentender) v19: Remove this fn when we remove readWorkspaceConfig
|
|
30
|
+
*/
|
|
31
|
+
export declare function getDefaultPluginsSync(root: string): LoadedNxPlugin[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultPlugins = exports.unregisterPluginTSTranspiler = exports.registerPluginTSTranspiler = exports.resolveLocalNxPlugin = exports.readPluginPackageJson = exports.isNxPluginV1 = exports.isNxPluginV2 = exports.ensurePluginIsV2 = exports.loadNxPlugins = exports.loadNxPluginAsync = exports.getPluginPathAndName = exports.nxPluginCache = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const workspaces_1 = require("../config/workspaces");
|
|
8
|
+
const workspace_root_1 = require("./workspace-root");
|
|
9
|
+
const fileutils_1 = require("../utils/fileutils");
|
|
10
|
+
const package_json_1 = require("./package-json");
|
|
11
|
+
const register_1 = require("../plugins/js/utils/register");
|
|
12
|
+
const logger_1 = require("./logger");
|
|
13
|
+
const find_project_for_path_1 = require("../project-graph/utils/find-project-for-path");
|
|
14
|
+
const path_1 = require("./path");
|
|
15
|
+
const path_2 = require("path");
|
|
16
|
+
const installation_directory_1 = require("./installation-directory");
|
|
17
|
+
const typescript_1 = require("../plugins/js/utils/typescript");
|
|
18
|
+
const nx_json_1 = require("../config/nx-json");
|
|
19
|
+
const globs_1 = require("./globs");
|
|
20
|
+
const angular_json_1 = require("../adapter/angular-json");
|
|
21
|
+
const package_json_workspaces_1 = require("../plugins/package-json-workspaces");
|
|
22
|
+
const project_json_1 = require("../plugins/project-json/build-nodes/project-json");
|
|
23
|
+
const package_json_next_to_project_json_1 = require("../plugins/project-json/build-nodes/package-json-next-to-project-json");
|
|
24
|
+
const retrieve_workspace_files_1 = require("../project-graph/utils/retrieve-workspace-files");
|
|
25
|
+
const target_defaults_plugin_1 = require("../plugins/target-defaults/target-defaults-plugin");
|
|
26
|
+
tslib_1.__exportStar(require("./nx-plugin.deprecated"), exports);
|
|
27
|
+
// Short lived cache (cleared between cmd runs)
|
|
28
|
+
// holding resolved nx plugin objects.
|
|
29
|
+
// Allows loadNxPlugins to be called multiple times w/o
|
|
30
|
+
// executing resolution mulitple times.
|
|
31
|
+
exports.nxPluginCache = new Map();
|
|
32
|
+
function getPluginPathAndName(moduleName, paths, projects, root) {
|
|
33
|
+
let pluginPath;
|
|
34
|
+
try {
|
|
35
|
+
pluginPath = require.resolve(moduleName, {
|
|
36
|
+
paths,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
if (e.code === 'MODULE_NOT_FOUND') {
|
|
41
|
+
const plugin = resolveLocalNxPlugin(moduleName, (0, nx_json_1.readNxJson)(root), projects, root);
|
|
42
|
+
if (plugin) {
|
|
43
|
+
const main = readPluginMainFromProjectConfiguration(plugin.projectConfig);
|
|
44
|
+
pluginPath = main ? path.join(root, main) : plugin.path;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
logger_1.logger.error(`Plugin listed in \`nx.json\` not found: ${moduleName}`);
|
|
48
|
+
throw e;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
throw e;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const packageJsonPath = path.join(pluginPath, 'package.json');
|
|
56
|
+
const extension = path.extname(pluginPath);
|
|
57
|
+
// Register the ts-transpiler if we are pointing to a
|
|
58
|
+
// plain ts file that's not part of a plugin project
|
|
59
|
+
if (extension === '.ts' && !tsNodeAndPathsUnregisterCallback) {
|
|
60
|
+
registerPluginTSTranspiler();
|
|
61
|
+
}
|
|
62
|
+
const { name } = !['.ts', '.js'].some((x) => x === extension) && // Not trying to point to a ts or js file
|
|
63
|
+
(0, fs_1.existsSync)(packageJsonPath) // plugin has a package.json
|
|
64
|
+
? (0, fileutils_1.readJsonFile)(packageJsonPath) // read name from package.json
|
|
65
|
+
: { name: moduleName };
|
|
66
|
+
return { pluginPath, name };
|
|
67
|
+
}
|
|
68
|
+
exports.getPluginPathAndName = getPluginPathAndName;
|
|
69
|
+
async function loadNxPluginAsync(pluginConfiguration, paths, projects, root) {
|
|
70
|
+
const { plugin: moduleName, options } = typeof pluginConfiguration === 'object'
|
|
71
|
+
? pluginConfiguration
|
|
72
|
+
: { plugin: pluginConfiguration, options: undefined };
|
|
73
|
+
let pluginModule = exports.nxPluginCache.get(moduleName);
|
|
74
|
+
if (pluginModule) {
|
|
75
|
+
return { plugin: pluginModule, options };
|
|
76
|
+
}
|
|
77
|
+
performance.mark(`Load Nx Plugin: ${moduleName} - start`);
|
|
78
|
+
let { pluginPath, name } = await getPluginPathAndName(moduleName, paths, projects, root);
|
|
79
|
+
const plugin = ensurePluginIsV2((await Promise.resolve(`${pluginPath}`).then(s => require(s))));
|
|
80
|
+
plugin.name ??= name;
|
|
81
|
+
exports.nxPluginCache.set(moduleName, plugin);
|
|
82
|
+
performance.mark(`Load Nx Plugin: ${moduleName} - end`);
|
|
83
|
+
performance.measure(`Load Nx Plugin: ${moduleName}`, `Load Nx Plugin: ${moduleName} - start`, `Load Nx Plugin: ${moduleName} - end`);
|
|
84
|
+
return { plugin, options };
|
|
85
|
+
}
|
|
86
|
+
exports.loadNxPluginAsync = loadNxPluginAsync;
|
|
87
|
+
async function loadNxPlugins(plugins, paths = (0, installation_directory_1.getNxRequirePaths)(), root = workspace_root_1.workspaceRoot, projects) {
|
|
88
|
+
const result = [
|
|
89
|
+
{ plugin: package_json_next_to_project_json_1.PackageJsonProjectsNextToProjectJsonPlugin },
|
|
90
|
+
];
|
|
91
|
+
plugins ??= [];
|
|
92
|
+
// When loading plugins for `createNodes`, we don't know what projects exist yet.
|
|
93
|
+
// Try resolving plugins
|
|
94
|
+
for (const plugin of plugins) {
|
|
95
|
+
try {
|
|
96
|
+
require.resolve(typeof plugin === 'string' ? plugin : plugin.plugin);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// If a plugin cannot be resolved, we will need projects to resolve it
|
|
100
|
+
projects ??= await (0, retrieve_workspace_files_1.retrieveProjectConfigurationsWithoutPluginInference)(root);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (const plugin of plugins) {
|
|
105
|
+
result.push(await loadNxPluginAsync(plugin, paths, projects, root));
|
|
106
|
+
}
|
|
107
|
+
// We push the nx core node plugins onto the end, s.t. it overwrites any other plugins
|
|
108
|
+
result.push(...(await getDefaultPlugins(root)));
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
exports.loadNxPlugins = loadNxPlugins;
|
|
112
|
+
function ensurePluginIsV2(plugin) {
|
|
113
|
+
if (isNxPluginV2(plugin)) {
|
|
114
|
+
return plugin;
|
|
115
|
+
}
|
|
116
|
+
if (isNxPluginV1(plugin) && plugin.projectFilePatterns) {
|
|
117
|
+
return {
|
|
118
|
+
...plugin,
|
|
119
|
+
createNodes: [
|
|
120
|
+
`*/**/${(0, globs_1.combineGlobPatterns)(plugin.projectFilePatterns)}`,
|
|
121
|
+
(configFilePath) => {
|
|
122
|
+
const root = (0, path_2.dirname)(configFilePath);
|
|
123
|
+
return {
|
|
124
|
+
projects: {
|
|
125
|
+
[root]: {
|
|
126
|
+
name: (0, workspaces_1.toProjectName)(configFilePath),
|
|
127
|
+
root,
|
|
128
|
+
targets: plugin.registerProjectTargets?.(configFilePath),
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return plugin;
|
|
137
|
+
}
|
|
138
|
+
exports.ensurePluginIsV2 = ensurePluginIsV2;
|
|
139
|
+
function isNxPluginV2(plugin) {
|
|
140
|
+
return 'createNodes' in plugin || 'createDependencies' in plugin;
|
|
141
|
+
}
|
|
142
|
+
exports.isNxPluginV2 = isNxPluginV2;
|
|
143
|
+
function isNxPluginV1(plugin) {
|
|
144
|
+
return 'processProjectGraph' in plugin || 'projectFilePatterns' in plugin;
|
|
145
|
+
}
|
|
146
|
+
exports.isNxPluginV1 = isNxPluginV1;
|
|
147
|
+
function readPluginPackageJson(pluginName, projects, paths = (0, installation_directory_1.getNxRequirePaths)()) {
|
|
148
|
+
try {
|
|
149
|
+
const result = (0, package_json_1.readModulePackageJsonWithoutFallbacks)(pluginName, paths);
|
|
150
|
+
return {
|
|
151
|
+
json: result.packageJson,
|
|
152
|
+
path: result.path,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
if (e.code === 'MODULE_NOT_FOUND') {
|
|
157
|
+
const nxJson = (0, nx_json_1.readNxJson)();
|
|
158
|
+
const localPluginPath = resolveLocalNxPlugin(pluginName, nxJson, projects);
|
|
159
|
+
if (localPluginPath) {
|
|
160
|
+
const localPluginPackageJson = path.join(localPluginPath.path, 'package.json');
|
|
161
|
+
return {
|
|
162
|
+
path: localPluginPackageJson,
|
|
163
|
+
json: (0, fileutils_1.readJsonFile)(localPluginPackageJson),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
throw e;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.readPluginPackageJson = readPluginPackageJson;
|
|
171
|
+
/**
|
|
172
|
+
* Builds a plugin package and returns the path to output
|
|
173
|
+
* @param importPath What is the import path that refers to a potential plugin?
|
|
174
|
+
* @returns The path to the built plugin, or null if it doesn't exist
|
|
175
|
+
*/
|
|
176
|
+
const localPluginCache = {};
|
|
177
|
+
function resolveLocalNxPlugin(importPath, nxJsonConfiguration, projects, root = workspace_root_1.workspaceRoot) {
|
|
178
|
+
localPluginCache[importPath] ??= lookupLocalPlugin(importPath, nxJsonConfiguration, projects, root);
|
|
179
|
+
return localPluginCache[importPath];
|
|
180
|
+
}
|
|
181
|
+
exports.resolveLocalNxPlugin = resolveLocalNxPlugin;
|
|
182
|
+
let tsNodeAndPathsUnregisterCallback = undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Register swc-node or ts-node if they are not currently registered
|
|
185
|
+
* with some default settings which work well for Nx plugins.
|
|
186
|
+
*/
|
|
187
|
+
function registerPluginTSTranspiler() {
|
|
188
|
+
if (!tsNodeAndPathsUnregisterCallback) {
|
|
189
|
+
// nx-ignore-next-line
|
|
190
|
+
const ts = require('typescript');
|
|
191
|
+
// Get the first tsconfig that matches the allowed set
|
|
192
|
+
const tsConfigName = [
|
|
193
|
+
(0, path_2.join)(workspace_root_1.workspaceRoot, 'tsconfig.base.json'),
|
|
194
|
+
(0, path_2.join)(workspace_root_1.workspaceRoot, 'tsconfig.json'),
|
|
195
|
+
].find((x) => (0, fs_1.existsSync)(x));
|
|
196
|
+
const tsConfig = tsConfigName
|
|
197
|
+
? (0, typescript_1.readTsConfig)(tsConfigName)
|
|
198
|
+
: {};
|
|
199
|
+
const unregisterTsConfigPaths = (0, register_1.registerTsConfigPaths)(tsConfigName);
|
|
200
|
+
const unregisterTranspiler = (0, register_1.registerTranspiler)({
|
|
201
|
+
experimentalDecorators: true,
|
|
202
|
+
emitDecoratorMetadata: true,
|
|
203
|
+
...tsConfig.options,
|
|
204
|
+
});
|
|
205
|
+
tsNodeAndPathsUnregisterCallback = () => {
|
|
206
|
+
unregisterTsConfigPaths();
|
|
207
|
+
unregisterTranspiler();
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.registerPluginTSTranspiler = registerPluginTSTranspiler;
|
|
212
|
+
/**
|
|
213
|
+
* Unregister the ts-node transpiler if it is registered
|
|
214
|
+
*/
|
|
215
|
+
function unregisterPluginTSTranspiler() {
|
|
216
|
+
if (tsNodeAndPathsUnregisterCallback) {
|
|
217
|
+
tsNodeAndPathsUnregisterCallback();
|
|
218
|
+
tsNodeAndPathsUnregisterCallback = undefined;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.unregisterPluginTSTranspiler = unregisterPluginTSTranspiler;
|
|
222
|
+
function lookupLocalPlugin(importPath, nxJsonConfiguration, projects, root = workspace_root_1.workspaceRoot) {
|
|
223
|
+
const plugin = findNxProjectForImportPath(importPath, projects, root);
|
|
224
|
+
if (!plugin) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
if (!tsNodeAndPathsUnregisterCallback) {
|
|
228
|
+
registerPluginTSTranspiler();
|
|
229
|
+
}
|
|
230
|
+
const projectConfig = projects[plugin];
|
|
231
|
+
return { path: path.join(root, projectConfig.root), projectConfig };
|
|
232
|
+
}
|
|
233
|
+
function findNxProjectForImportPath(importPath, projects, root = workspace_root_1.workspaceRoot) {
|
|
234
|
+
const tsConfigPaths = readTsConfigPaths(root);
|
|
235
|
+
const possiblePaths = tsConfigPaths[importPath]?.map((p) => (0, path_1.normalizePath)(path.relative(root, path.join(root, p))));
|
|
236
|
+
if (possiblePaths?.length) {
|
|
237
|
+
const projectRootMappings = (0, find_project_for_path_1.createProjectRootMappingsFromProjectConfigurations)(projects);
|
|
238
|
+
for (const tsConfigPath of possiblePaths) {
|
|
239
|
+
const nxProject = (0, find_project_for_path_1.findProjectForPath)(tsConfigPath, projectRootMappings);
|
|
240
|
+
if (nxProject) {
|
|
241
|
+
return nxProject;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (process.env.NX_VERBOSE_LOGGING) {
|
|
245
|
+
console.log('Unable to find local plugin', possiblePaths, projectRootMappings);
|
|
246
|
+
}
|
|
247
|
+
throw new Error('Unable to resolve local plugin with import path ' + importPath);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
let tsconfigPaths;
|
|
251
|
+
function readTsConfigPaths(root = workspace_root_1.workspaceRoot) {
|
|
252
|
+
if (!tsconfigPaths) {
|
|
253
|
+
const tsconfigPath = ['tsconfig.base.json', 'tsconfig.json']
|
|
254
|
+
.map((x) => path.join(root, x))
|
|
255
|
+
.filter((x) => (0, fs_1.existsSync)(x))[0];
|
|
256
|
+
if (!tsconfigPath) {
|
|
257
|
+
throw new Error('unable to find tsconfig.base.json or tsconfig.json');
|
|
258
|
+
}
|
|
259
|
+
const { compilerOptions } = (0, fileutils_1.readJsonFile)(tsconfigPath);
|
|
260
|
+
tsconfigPaths = compilerOptions?.paths;
|
|
261
|
+
}
|
|
262
|
+
return tsconfigPaths ?? {};
|
|
263
|
+
}
|
|
264
|
+
function readPluginMainFromProjectConfiguration(plugin) {
|
|
265
|
+
const { main } = Object.values(plugin.targets).find((x) => [
|
|
266
|
+
'@nx/js:tsc',
|
|
267
|
+
'@nrwl/js:tsc',
|
|
268
|
+
'@nx/js:swc',
|
|
269
|
+
'@nrwl/js:swc',
|
|
270
|
+
'@nx/node:package',
|
|
271
|
+
'@nrwl/node:package',
|
|
272
|
+
].includes(x.executor))?.options ||
|
|
273
|
+
plugin.targets?.build?.options ||
|
|
274
|
+
{};
|
|
275
|
+
return main;
|
|
276
|
+
}
|
|
277
|
+
async function getDefaultPlugins(root) {
|
|
278
|
+
const plugins = [
|
|
279
|
+
await Promise.resolve().then(() => require('../plugins/js')),
|
|
280
|
+
target_defaults_plugin_1.TargetDefaultsPlugin,
|
|
281
|
+
...((0, angular_json_1.shouldMergeAngularProjects)(root, false)
|
|
282
|
+
? [
|
|
283
|
+
await Promise.resolve().then(() => require('../adapter/angular-json')).then((m) => m.NxAngularJsonPlugin),
|
|
284
|
+
]
|
|
285
|
+
: []),
|
|
286
|
+
(0, package_json_workspaces_1.getNxPackageJsonWorkspacesPlugin)(root),
|
|
287
|
+
project_json_1.ProjectJsonProjectsPlugin,
|
|
288
|
+
];
|
|
289
|
+
return plugins.map((p) => ({
|
|
290
|
+
plugin: p,
|
|
291
|
+
}));
|
|
292
|
+
}
|
|
293
|
+
exports.getDefaultPlugins = getDefaultPlugins;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sortObjectByKeys(originalObject: object): {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sortObjectByKeys = void 0;
|
|
4
|
+
function sortObjectByKeys(originalObject) {
|
|
5
|
+
const keys = Object.keys(originalObject).sort();
|
|
6
|
+
const sortedObject = {};
|
|
7
|
+
keys.forEach((key) => (sortedObject[key] = originalObject[key]));
|
|
8
|
+
return sortedObject;
|
|
9
|
+
}
|
|
10
|
+
exports.sortObjectByKeys = sortObjectByKeys;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
|
+
import { TaskStatus } from '../tasks-runner/tasks-runner';
|
|
3
|
+
export interface CLIErrorMessageConfig {
|
|
4
|
+
title: string;
|
|
5
|
+
bodyLines?: string[];
|
|
6
|
+
slug?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CLIWarnMessageConfig {
|
|
9
|
+
title: string;
|
|
10
|
+
bodyLines?: string[];
|
|
11
|
+
slug?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CLINoteMessageConfig {
|
|
14
|
+
title: string;
|
|
15
|
+
bodyLines?: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface CLISuccessMessageConfig {
|
|
18
|
+
title: string;
|
|
19
|
+
bodyLines?: string[];
|
|
20
|
+
}
|
|
21
|
+
declare class CLIOutput {
|
|
22
|
+
readonly X_PADDING = " ";
|
|
23
|
+
cliName: string;
|
|
24
|
+
formatCommand: (taskId: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Longer dash character which forms more of a continuous line when place side to side
|
|
27
|
+
* with itself, unlike the standard dash character
|
|
28
|
+
*/
|
|
29
|
+
private get VERTICAL_SEPARATOR();
|
|
30
|
+
/**
|
|
31
|
+
* Expose some color and other utility functions so that other parts of the codebase that need
|
|
32
|
+
* more fine-grained control of message bodies are still using a centralized
|
|
33
|
+
* implementation.
|
|
34
|
+
*/
|
|
35
|
+
colors: {
|
|
36
|
+
gray: chalk.Chalk;
|
|
37
|
+
green: chalk.Chalk;
|
|
38
|
+
red: chalk.Chalk;
|
|
39
|
+
cyan: chalk.Chalk;
|
|
40
|
+
white: chalk.Chalk;
|
|
41
|
+
};
|
|
42
|
+
bold: chalk.Chalk;
|
|
43
|
+
underline: chalk.Chalk;
|
|
44
|
+
dim: chalk.Chalk;
|
|
45
|
+
private writeToStdOut;
|
|
46
|
+
overwriteLine(lineText?: string): void;
|
|
47
|
+
private writeOutputTitle;
|
|
48
|
+
private writeOptionalOutputBody;
|
|
49
|
+
applyNxPrefix(color: string, text: string): string;
|
|
50
|
+
addNewline(): void;
|
|
51
|
+
addVerticalSeparator(color?: string): void;
|
|
52
|
+
addVerticalSeparatorWithoutNewLines(color?: string): void;
|
|
53
|
+
getVerticalSeparatorLines(color?: string): string[];
|
|
54
|
+
private getVerticalSeparator;
|
|
55
|
+
error({ title, slug, bodyLines }: CLIErrorMessageConfig): void;
|
|
56
|
+
warn({ title, slug, bodyLines }: CLIWarnMessageConfig): void;
|
|
57
|
+
note({ title, bodyLines }: CLINoteMessageConfig): void;
|
|
58
|
+
success({ title, bodyLines }: CLISuccessMessageConfig): void;
|
|
59
|
+
logSingleLine(message: string): void;
|
|
60
|
+
logCommand(message: string, taskStatus?: TaskStatus): void;
|
|
61
|
+
logCommandOutput(message: string, taskStatus: TaskStatus, output: string): void;
|
|
62
|
+
private getCommandWithStatus;
|
|
63
|
+
private getStatusIcon;
|
|
64
|
+
private normalizeMessage;
|
|
65
|
+
private addTaskStatus;
|
|
66
|
+
log({ title, bodyLines, color }: CLIWarnMessageConfig & {
|
|
67
|
+
color?: string;
|
|
68
|
+
}): void;
|
|
69
|
+
drain(): Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
export declare const output: CLIOutput;
|
|
72
|
+
export {};
|