@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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateNxJson = exports.readNxJson = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const json_1 = require("./json");
|
|
6
|
+
const nx_json_1 = require("../../config/nx-json");
|
|
7
|
+
/**
|
|
8
|
+
* Reads nx.json
|
|
9
|
+
*/
|
|
10
|
+
function readNxJson(tree) {
|
|
11
|
+
if (tree) {
|
|
12
|
+
if (!tree.exists('nx.json')) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
let nxJson = (0, json_1.readJson)(tree, 'nx.json');
|
|
16
|
+
if (nxJson.extends) {
|
|
17
|
+
nxJson = { ...readNxJsonExtends(tree, nxJson.extends), ...nxJson };
|
|
18
|
+
}
|
|
19
|
+
return nxJson;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return (0, nx_json_1.readNxJson)();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.readNxJson = readNxJson;
|
|
26
|
+
/**
|
|
27
|
+
* Update nx.json
|
|
28
|
+
*/
|
|
29
|
+
function updateNxJson(tree, nxJson) {
|
|
30
|
+
if (tree.exists('nx.json')) {
|
|
31
|
+
(0, json_1.updateJson)(tree, 'nx.json', (json) => {
|
|
32
|
+
if (json.extends) {
|
|
33
|
+
const nxJsonExtends = readNxJsonExtends(tree, json.extends);
|
|
34
|
+
const changedPropsOfNxJson = {};
|
|
35
|
+
Object.keys(nxJson).forEach((prop) => {
|
|
36
|
+
if (JSON.stringify(nxJson[prop], null, 2) !=
|
|
37
|
+
JSON.stringify(nxJsonExtends[prop], null, 2)) {
|
|
38
|
+
changedPropsOfNxJson[prop] = nxJson[prop];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return changedPropsOfNxJson;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return nxJson;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.updateNxJson = updateNxJson;
|
|
50
|
+
function readNxJsonExtends(tree, extendsPath) {
|
|
51
|
+
try {
|
|
52
|
+
return (0, json_1.readJson)(tree, (0, path_1.relative)(tree.root, require.resolve(extendsPath, {
|
|
53
|
+
paths: [tree.root],
|
|
54
|
+
})));
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
throw new Error(`Unable to resolve nx.json extends. Error: ${e.message}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
|
2
|
+
import type { Tree } from '../tree';
|
|
3
|
+
export { readNxJson, updateNxJson } from './nx-json';
|
|
4
|
+
/**
|
|
5
|
+
* Adds project configuration to the Nx workspace.
|
|
6
|
+
*
|
|
7
|
+
* @param tree - the file system tree
|
|
8
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
9
|
+
* @param projectConfiguration - project configuration
|
|
10
|
+
* @param standalone - whether the project is configured in workspace.json or not
|
|
11
|
+
*/
|
|
12
|
+
export declare function addProjectConfiguration(tree: Tree, projectName: string, projectConfiguration: ProjectConfiguration, standalone?: boolean): void;
|
|
13
|
+
/**
|
|
14
|
+
* Updates the configuration of an existing project.
|
|
15
|
+
*
|
|
16
|
+
* @param tree - the file system tree
|
|
17
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
18
|
+
* @param projectConfiguration - project configuration
|
|
19
|
+
*/
|
|
20
|
+
export declare function updateProjectConfiguration(tree: Tree, projectName: string, projectConfiguration: ProjectConfiguration): void;
|
|
21
|
+
/**
|
|
22
|
+
* Removes the configuration of an existing project.
|
|
23
|
+
*
|
|
24
|
+
* @param tree - the file system tree
|
|
25
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
26
|
+
*/
|
|
27
|
+
export declare function removeProjectConfiguration(tree: Tree, projectName: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Reads a project configuration.
|
|
30
|
+
*
|
|
31
|
+
* @param tree - the file system tree
|
|
32
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
33
|
+
* @throws If supplied projectName cannot be found
|
|
34
|
+
*/
|
|
35
|
+
export declare function readProjectConfiguration(tree: Tree, projectName: string): ProjectConfiguration;
|
|
36
|
+
/**
|
|
37
|
+
* Get a map of all projects in a workspace.
|
|
38
|
+
*
|
|
39
|
+
* Use {@link readProjectConfiguration} if only one project is needed.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getProjects(tree: Tree): Map<string, ProjectConfiguration>;
|
|
42
|
+
export declare function getRelativeProjectJsonSchemaPath(tree: Tree, project: ProjectConfiguration): string;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRelativeProjectJsonSchemaPath = exports.getProjects = exports.readProjectConfiguration = exports.removeProjectConfiguration = exports.updateProjectConfiguration = exports.addProjectConfiguration = exports.updateNxJson = exports.readNxJson = void 0;
|
|
4
|
+
const minimatch_1 = require("minimatch");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const package_json_workspaces_1 = require("../../plugins/package-json-workspaces");
|
|
7
|
+
const project_json_1 = require("../../plugins/project-json/build-nodes/project-json");
|
|
8
|
+
const angular_json_1 = require("../../adapter/angular-json");
|
|
9
|
+
const project_configuration_utils_1 = require("../../project-graph/utils/project-configuration-utils");
|
|
10
|
+
const retrieve_workspace_files_1 = require("../../project-graph/utils/retrieve-workspace-files");
|
|
11
|
+
const workspace_context_1 = require("../../utils/workspace-context");
|
|
12
|
+
const output_1 = require("../../utils/output");
|
|
13
|
+
const path_2 = require("../../utils/path");
|
|
14
|
+
const json_1 = require("./json");
|
|
15
|
+
const nx_json_1 = require("./nx-json");
|
|
16
|
+
var nx_json_2 = require("./nx-json");
|
|
17
|
+
Object.defineProperty(exports, "readNxJson", { enumerable: true, get: function () { return nx_json_2.readNxJson; } });
|
|
18
|
+
Object.defineProperty(exports, "updateNxJson", { enumerable: true, get: function () { return nx_json_2.updateNxJson; } });
|
|
19
|
+
/**
|
|
20
|
+
* Adds project configuration to the Nx workspace.
|
|
21
|
+
*
|
|
22
|
+
* @param tree - the file system tree
|
|
23
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
24
|
+
* @param projectConfiguration - project configuration
|
|
25
|
+
* @param standalone - whether the project is configured in workspace.json or not
|
|
26
|
+
*/
|
|
27
|
+
function addProjectConfiguration(tree, projectName, projectConfiguration, standalone = true) {
|
|
28
|
+
const projectConfigFile = (0, path_2.joinPathFragments)(projectConfiguration.root, 'project.json');
|
|
29
|
+
if (!standalone) {
|
|
30
|
+
output_1.output.warn({
|
|
31
|
+
title: 'Nx only supports standalone projects. Setting standalone to false is ignored.',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (tree.exists(projectConfigFile)) {
|
|
35
|
+
throw new Error(`Cannot create a new project ${projectName} at ${projectConfiguration.root}. A project already exists in this directory.`);
|
|
36
|
+
}
|
|
37
|
+
delete projectConfiguration.$schema;
|
|
38
|
+
(0, json_1.writeJson)(tree, projectConfigFile, {
|
|
39
|
+
name: projectName,
|
|
40
|
+
$schema: getRelativeProjectJsonSchemaPath(tree, projectConfiguration),
|
|
41
|
+
...projectConfiguration,
|
|
42
|
+
root: undefined,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
exports.addProjectConfiguration = addProjectConfiguration;
|
|
46
|
+
/**
|
|
47
|
+
* Updates the configuration of an existing project.
|
|
48
|
+
*
|
|
49
|
+
* @param tree - the file system tree
|
|
50
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
51
|
+
* @param projectConfiguration - project configuration
|
|
52
|
+
*/
|
|
53
|
+
function updateProjectConfiguration(tree, projectName, projectConfiguration) {
|
|
54
|
+
const projectConfigFile = (0, path_2.joinPathFragments)(projectConfiguration.root, 'project.json');
|
|
55
|
+
if (!tree.exists(projectConfigFile)) {
|
|
56
|
+
throw new Error(`Cannot update Project ${projectName} at ${projectConfiguration.root}. It either doesn't exist yet, or may not use project.json for configuration. Use \`addProjectConfiguration()\` instead if you want to create a new project.`);
|
|
57
|
+
}
|
|
58
|
+
(0, json_1.writeJson)(tree, projectConfigFile, {
|
|
59
|
+
name: projectConfiguration.name ?? projectName,
|
|
60
|
+
$schema: getRelativeProjectJsonSchemaPath(tree, projectConfiguration),
|
|
61
|
+
...projectConfiguration,
|
|
62
|
+
root: undefined,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
exports.updateProjectConfiguration = updateProjectConfiguration;
|
|
66
|
+
/**
|
|
67
|
+
* Removes the configuration of an existing project.
|
|
68
|
+
*
|
|
69
|
+
* @param tree - the file system tree
|
|
70
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
71
|
+
*/
|
|
72
|
+
function removeProjectConfiguration(tree, projectName) {
|
|
73
|
+
const projectConfiguration = readProjectConfiguration(tree, projectName);
|
|
74
|
+
if (!projectConfiguration) {
|
|
75
|
+
throw new Error(`Cannot delete Project ${projectName}`);
|
|
76
|
+
}
|
|
77
|
+
const projectConfigFile = (0, path_2.joinPathFragments)(projectConfiguration.root, 'project.json');
|
|
78
|
+
if (tree.exists(projectConfigFile)) {
|
|
79
|
+
tree.delete(projectConfigFile);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.removeProjectConfiguration = removeProjectConfiguration;
|
|
83
|
+
/**
|
|
84
|
+
* Reads a project configuration.
|
|
85
|
+
*
|
|
86
|
+
* @param tree - the file system tree
|
|
87
|
+
* @param projectName - unique name. Often directories are part of the name (e.g., mydir-mylib)
|
|
88
|
+
* @throws If supplied projectName cannot be found
|
|
89
|
+
*/
|
|
90
|
+
function readProjectConfiguration(tree, projectName) {
|
|
91
|
+
const allProjects = readAndCombineAllProjectConfigurations(tree);
|
|
92
|
+
if (!allProjects[projectName]) {
|
|
93
|
+
// temporary polyfill to make sure our generators work for existing angularcli workspaces
|
|
94
|
+
if (tree.exists('angular.json')) {
|
|
95
|
+
const angularJson = toNewFormat((0, json_1.readJson)(tree, 'angular.json'));
|
|
96
|
+
if (angularJson.projects[projectName])
|
|
97
|
+
return angularJson.projects[projectName];
|
|
98
|
+
}
|
|
99
|
+
throw new Error(`Cannot find configuration for '${projectName}'`);
|
|
100
|
+
}
|
|
101
|
+
return allProjects[projectName];
|
|
102
|
+
}
|
|
103
|
+
exports.readProjectConfiguration = readProjectConfiguration;
|
|
104
|
+
/**
|
|
105
|
+
* Get a map of all projects in a workspace.
|
|
106
|
+
*
|
|
107
|
+
* Use {@link readProjectConfiguration} if only one project is needed.
|
|
108
|
+
*/
|
|
109
|
+
function getProjects(tree) {
|
|
110
|
+
let allProjects = readAndCombineAllProjectConfigurations(tree);
|
|
111
|
+
// temporary polyfill to make sure our generators work for existing angularcli workspaces
|
|
112
|
+
if (tree.exists('angular.json')) {
|
|
113
|
+
const angularJson = toNewFormat((0, json_1.readJson)(tree, 'angular.json'));
|
|
114
|
+
allProjects = { ...allProjects, ...angularJson.projects };
|
|
115
|
+
}
|
|
116
|
+
return new Map(Object.keys(allProjects || {}).map((projectName) => {
|
|
117
|
+
return [projectName, allProjects[projectName]];
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
exports.getProjects = getProjects;
|
|
121
|
+
function getRelativeProjectJsonSchemaPath(tree, project) {
|
|
122
|
+
return (0, path_2.normalizePath)((0, path_1.relative)((0, path_1.join)(tree.root, project.root), (0, path_1.join)(tree.root, 'node_modules/nx/schemas/project-schema.json')));
|
|
123
|
+
}
|
|
124
|
+
exports.getRelativeProjectJsonSchemaPath = getRelativeProjectJsonSchemaPath;
|
|
125
|
+
function readAndCombineAllProjectConfigurations(tree) {
|
|
126
|
+
/**
|
|
127
|
+
* We can't update projects that come from plugins anyways, so we are going
|
|
128
|
+
* to ignore them for now. Plugins should add their own add/create/update methods
|
|
129
|
+
* if they would like to use devkit to update inferred projects.
|
|
130
|
+
*/
|
|
131
|
+
const patterns = [
|
|
132
|
+
'**/project.json',
|
|
133
|
+
'project.json',
|
|
134
|
+
...(0, package_json_workspaces_1.getGlobPatternsFromPackageManagerWorkspaces)(tree.root, (p) => (0, json_1.readJson)(tree, p)),
|
|
135
|
+
];
|
|
136
|
+
const projectGlobPatterns = (0, retrieve_workspace_files_1.configurationGlobs)([
|
|
137
|
+
{ plugin: project_json_1.ProjectJsonProjectsPlugin },
|
|
138
|
+
{ plugin: (0, package_json_workspaces_1.getNxPackageJsonWorkspacesPlugin)(tree.root) },
|
|
139
|
+
]);
|
|
140
|
+
const globbedFiles = (0, workspace_context_1.globWithWorkspaceContext)(tree.root, projectGlobPatterns);
|
|
141
|
+
const createdFiles = findCreatedProjectFiles(tree, patterns);
|
|
142
|
+
const deletedFiles = findDeletedProjectFiles(tree, patterns);
|
|
143
|
+
const projectFiles = [...globbedFiles, ...createdFiles].filter((r) => deletedFiles.indexOf(r) === -1);
|
|
144
|
+
const rootMap = new Map();
|
|
145
|
+
for (const projectFile of projectFiles) {
|
|
146
|
+
if ((0, path_1.basename)(projectFile) === 'project.json') {
|
|
147
|
+
const json = (0, json_1.readJson)(tree, projectFile);
|
|
148
|
+
const config = (0, project_json_1.buildProjectFromProjectJson)(json, projectFile);
|
|
149
|
+
(0, project_configuration_utils_1.mergeProjectConfigurationIntoRootMap)(rootMap, config, undefined, undefined, true);
|
|
150
|
+
}
|
|
151
|
+
else if ((0, path_1.basename)(projectFile) === 'package.json') {
|
|
152
|
+
const packageJson = (0, json_1.readJson)(tree, projectFile);
|
|
153
|
+
const config = (0, package_json_workspaces_1.buildProjectConfigurationFromPackageJson)(packageJson, projectFile, (0, nx_json_1.readNxJson)(tree));
|
|
154
|
+
if (!rootMap.has(config.root)) {
|
|
155
|
+
(0, project_configuration_utils_1.mergeProjectConfigurationIntoRootMap)(rootMap,
|
|
156
|
+
// Inferred targets, tags, etc don't show up when running generators
|
|
157
|
+
// This is to help avoid running into issues when trying to update the workspace
|
|
158
|
+
{
|
|
159
|
+
name: config.name,
|
|
160
|
+
root: config.root,
|
|
161
|
+
}, undefined, undefined, true);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return (0, project_configuration_utils_1.readProjectConfigurationsFromRootMap)(rootMap);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Used to ensure that projects created during
|
|
169
|
+
* the same devkit generator run show up when
|
|
170
|
+
* there is no project.json file, as `glob`
|
|
171
|
+
* cannot find them.
|
|
172
|
+
*
|
|
173
|
+
* We exclude the root `package.json` from this list unless
|
|
174
|
+
* considered a project during workspace generation
|
|
175
|
+
*/
|
|
176
|
+
function findCreatedProjectFiles(tree, globPatterns) {
|
|
177
|
+
const createdProjectFiles = [];
|
|
178
|
+
for (const change of tree.listChanges()) {
|
|
179
|
+
if (change.type === 'CREATE') {
|
|
180
|
+
const fileName = (0, path_1.basename)(change.path);
|
|
181
|
+
if (globPatterns.some((pattern) => (0, minimatch_1.minimatch)(change.path, pattern, { dot: true }))) {
|
|
182
|
+
createdProjectFiles.push(change.path);
|
|
183
|
+
}
|
|
184
|
+
else if (fileName === 'package.json') {
|
|
185
|
+
try {
|
|
186
|
+
const contents = JSON.parse(change.content.toString());
|
|
187
|
+
if (contents.nx) {
|
|
188
|
+
createdProjectFiles.push(change.path);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch { }
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return createdProjectFiles.map(path_2.normalizePath);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Used to ensure that projects created during
|
|
199
|
+
* the same devkit generator run show up when
|
|
200
|
+
* there is no project.json file, as `glob`
|
|
201
|
+
* cannot find them.
|
|
202
|
+
*/
|
|
203
|
+
function findDeletedProjectFiles(tree, globPatterns) {
|
|
204
|
+
return tree
|
|
205
|
+
.listChanges()
|
|
206
|
+
.filter((f) => {
|
|
207
|
+
return (f.type === 'DELETE' &&
|
|
208
|
+
globPatterns.some((pattern) => (0, minimatch_1.minimatch)(f.path, pattern)));
|
|
209
|
+
})
|
|
210
|
+
.map((r) => r.path);
|
|
211
|
+
}
|
|
212
|
+
function toNewFormat(w) {
|
|
213
|
+
const projects = {};
|
|
214
|
+
Object.keys(w.projects || {}).forEach((name) => {
|
|
215
|
+
if (typeof w.projects[name] === 'string')
|
|
216
|
+
return;
|
|
217
|
+
const projectConfig = w.projects[name];
|
|
218
|
+
if (projectConfig.architect) {
|
|
219
|
+
(0, angular_json_1.renamePropertyWithStableKeys)(projectConfig, 'architect', 'targets');
|
|
220
|
+
}
|
|
221
|
+
if (projectConfig.schematics) {
|
|
222
|
+
(0, angular_json_1.renamePropertyWithStableKeys)(projectConfig, 'schematics', 'generators');
|
|
223
|
+
}
|
|
224
|
+
Object.values(projectConfig.targets || {}).forEach((target) => {
|
|
225
|
+
if (target.builder !== undefined) {
|
|
226
|
+
(0, angular_json_1.renamePropertyWithStableKeys)(target, 'builder', 'executor');
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
projects[name] = projectConfig;
|
|
230
|
+
});
|
|
231
|
+
w.projects = projects;
|
|
232
|
+
if (w.schematics) {
|
|
233
|
+
(0, angular_json_1.renamePropertyWithStableKeys)(w, 'schematics', 'generators');
|
|
234
|
+
}
|
|
235
|
+
if (w.version !== 2) {
|
|
236
|
+
w.version = 2;
|
|
237
|
+
}
|
|
238
|
+
return w;
|
|
239
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NxJsonConfiguration } from '../config/nx-json';
|
|
2
|
+
import { ProjectGraph } from '../config/project-graph';
|
|
3
|
+
import { TaskHasher } from './task-hasher';
|
|
4
|
+
export declare function createTaskHasher(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration, runnerOptions?: any): TaskHasher;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTaskHasher = void 0;
|
|
4
|
+
const client_1 = require("../daemon/client/client");
|
|
5
|
+
const build_project_graph_1 = require("../project-graph/build-project-graph");
|
|
6
|
+
const task_hasher_1 = require("./task-hasher");
|
|
7
|
+
function createTaskHasher(projectGraph, nxJson, runnerOptions) {
|
|
8
|
+
if (client_1.daemonClient.enabled()) {
|
|
9
|
+
return new task_hasher_1.DaemonBasedTaskHasher(client_1.daemonClient, runnerOptions);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const { fileMap, allWorkspaceFiles, rustReferences } = (0, build_project_graph_1.getFileMap)();
|
|
13
|
+
return new task_hasher_1.InProcessTaskHasher(fileMap?.projectFileMap, allWorkspaceFiles, projectGraph, nxJson, rustReferences, runnerOptions);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.createTaskHasher = createTaskHasher;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashObject = exports.hashArray = void 0;
|
|
4
|
+
function hashArray(content) {
|
|
5
|
+
// Import as needed. There is also an issue running unit tests in Nx repo if this is a top-level import.
|
|
6
|
+
const { hashArray } = require('../native');
|
|
7
|
+
return hashArray(content);
|
|
8
|
+
}
|
|
9
|
+
exports.hashArray = hashArray;
|
|
10
|
+
function hashObject(obj) {
|
|
11
|
+
const { hashArray } = require('../native');
|
|
12
|
+
const parts = [];
|
|
13
|
+
for (const key of Object.keys(obj).sort()) {
|
|
14
|
+
parts.push(key);
|
|
15
|
+
parts.push(JSON.stringify(obj[key]));
|
|
16
|
+
}
|
|
17
|
+
return hashArray(parts);
|
|
18
|
+
}
|
|
19
|
+
exports.hashObject = hashObject;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Task, TaskGraph } from '../config/task-graph';
|
|
3
|
+
import { TaskHasher } from './task-hasher';
|
|
4
|
+
import { ProjectGraph } from '../config/project-graph';
|
|
5
|
+
import { NxJsonConfiguration } from '../config/nx-json';
|
|
6
|
+
export declare function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration): Promise<void>;
|
|
7
|
+
export declare function hashTask(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, task: Task, env: NodeJS.ProcessEnv): Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashTask = exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = void 0;
|
|
4
|
+
const utils_1 = require("../tasks-runner/utils");
|
|
5
|
+
const project_graph_1 = require("../project-graph/project-graph");
|
|
6
|
+
const task_hasher_1 = require("./task-hasher");
|
|
7
|
+
const nx_json_1 = require("../config/nx-json");
|
|
8
|
+
async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGraph, taskGraph, nxJson) {
|
|
9
|
+
performance.mark('hashMultipleTasks:start');
|
|
10
|
+
const tasks = Object.values(taskGraph.tasks);
|
|
11
|
+
const tasksWithHashers = await Promise.all(tasks.map(async (task) => {
|
|
12
|
+
const customHasher = await (0, utils_1.getCustomHasher)(task, projectGraph);
|
|
13
|
+
return { task, customHasher };
|
|
14
|
+
}));
|
|
15
|
+
const tasksToHash = tasksWithHashers
|
|
16
|
+
.filter(({ task, customHasher }) => {
|
|
17
|
+
// If a task has a custom hasher, it might depend on the outputs of other tasks
|
|
18
|
+
if (customHasher) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return !(taskGraph.dependencies[task.id].length > 0 &&
|
|
22
|
+
(0, task_hasher_1.getInputs)(task, projectGraph, nxJson).depsOutputs.length > 0);
|
|
23
|
+
})
|
|
24
|
+
.map((t) => t.task);
|
|
25
|
+
const hashes = await hasher.hashTasks(tasksToHash, taskGraph);
|
|
26
|
+
for (let i = 0; i < tasksToHash.length; i++) {
|
|
27
|
+
tasksToHash[i].hash = hashes[i].value;
|
|
28
|
+
tasksToHash[i].hashDetails = hashes[i].details;
|
|
29
|
+
}
|
|
30
|
+
performance.mark('hashMultipleTasks:end');
|
|
31
|
+
performance.measure('hashMultipleTasks', 'hashMultipleTasks:start', 'hashMultipleTasks:end');
|
|
32
|
+
}
|
|
33
|
+
exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
|
|
34
|
+
async function hashTask(hasher, projectGraph, taskGraph, task, env) {
|
|
35
|
+
performance.mark('hashSingleTask:start');
|
|
36
|
+
const customHasher = await (0, utils_1.getCustomHasher)(task, projectGraph);
|
|
37
|
+
const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
|
38
|
+
const { value, details } = await (customHasher
|
|
39
|
+
? customHasher(task, {
|
|
40
|
+
hasher,
|
|
41
|
+
projectGraph,
|
|
42
|
+
taskGraph,
|
|
43
|
+
workspaceConfig: projectsConfigurations, // to make the change non-breaking. Remove after v19
|
|
44
|
+
projectsConfigurations,
|
|
45
|
+
nxJsonConfiguration: (0, nx_json_1.readNxJson)(),
|
|
46
|
+
env,
|
|
47
|
+
})
|
|
48
|
+
: hasher.hashTask(task, taskGraph, env));
|
|
49
|
+
task.hash = value;
|
|
50
|
+
task.hashDetails = details;
|
|
51
|
+
performance.mark('hashSingleTask:end');
|
|
52
|
+
performance.measure('hashSingleTask', 'hashSingleTask:start', 'hashSingleTask:end');
|
|
53
|
+
}
|
|
54
|
+
exports.hashTask = hashTask;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { NxJsonConfiguration } from '../config/nx-json';
|
|
3
|
+
import { ProjectGraph } from '../config/project-graph';
|
|
4
|
+
import { Task, TaskGraph } from '../config/task-graph';
|
|
5
|
+
import { ExternalObject, FileData, HasherOptions, HashPlanner, NxWorkspaceFilesExternals, ProjectGraph as NativeProjectGraph, TaskHasher } from '../native';
|
|
6
|
+
import { PartialHash, TaskHasherImpl } from './task-hasher';
|
|
7
|
+
export declare class NativeTaskHasherImpl implements TaskHasherImpl {
|
|
8
|
+
hasher: TaskHasher;
|
|
9
|
+
planner: HashPlanner;
|
|
10
|
+
projectGraphRef: ExternalObject<NativeProjectGraph>;
|
|
11
|
+
allWorkspaceFilesRef: ExternalObject<FileData[]>;
|
|
12
|
+
projectFileMapRef: ExternalObject<Record<string, FileData[]>>;
|
|
13
|
+
options: HasherOptions | undefined;
|
|
14
|
+
constructor(workspaceRoot: string, nxJson: NxJsonConfiguration, projectGraph: ProjectGraph, externals: NxWorkspaceFilesExternals, options: {
|
|
15
|
+
selectivelyHashTsConfig: boolean;
|
|
16
|
+
});
|
|
17
|
+
hashTask(task: Task, taskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<PartialHash>;
|
|
18
|
+
hashTasks(tasks: Task[], taskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<PartialHash[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeTaskHasherImpl = void 0;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
const transform_objects_1 = require("../native/transform-objects");
|
|
6
|
+
const fileutils_1 = require("../utils/fileutils");
|
|
7
|
+
const typescript_1 = require("../plugins/js/utils/typescript");
|
|
8
|
+
class NativeTaskHasherImpl {
|
|
9
|
+
constructor(workspaceRoot, nxJson, projectGraph, externals, options) {
|
|
10
|
+
this.projectGraphRef = (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(projectGraph));
|
|
11
|
+
this.allWorkspaceFilesRef = externals.allWorkspaceFiles;
|
|
12
|
+
this.projectFileMapRef = externals.projectFiles;
|
|
13
|
+
let tsconfig = {};
|
|
14
|
+
let paths = {};
|
|
15
|
+
let rootTsConfigPath = (0, typescript_1.getRootTsConfigPath)();
|
|
16
|
+
if (rootTsConfigPath) {
|
|
17
|
+
tsconfig = (0, fileutils_1.readJsonFile)((0, typescript_1.getRootTsConfigPath)());
|
|
18
|
+
paths = tsconfig.compilerOptions?.paths ?? {};
|
|
19
|
+
if (tsconfig.compilerOptions?.paths) {
|
|
20
|
+
delete tsconfig.compilerOptions.paths;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.planner = new native_1.HashPlanner(nxJson, this.projectGraphRef);
|
|
24
|
+
this.hasher = new native_1.TaskHasher(workspaceRoot, this.projectGraphRef, this.projectFileMapRef, this.allWorkspaceFilesRef, Buffer.from(JSON.stringify(tsconfig)), paths, options);
|
|
25
|
+
}
|
|
26
|
+
async hashTask(task, taskGraph, env) {
|
|
27
|
+
const plans = this.planner.getPlansReference([task.id], taskGraph);
|
|
28
|
+
const hashes = this.hasher.hashPlans(plans, env);
|
|
29
|
+
return hashes[task.id];
|
|
30
|
+
}
|
|
31
|
+
async hashTasks(tasks, taskGraph, env) {
|
|
32
|
+
const plans = this.planner.getPlansReference(tasks.map((t) => t.id), taskGraph);
|
|
33
|
+
const hashes = this.hasher.hashPlans(plans, env);
|
|
34
|
+
return tasks.map((t) => hashes[t.id]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.NativeTaskHasherImpl = NativeTaskHasherImpl;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { NxJsonConfiguration } from '../config/nx-json';
|
|
3
|
+
import { FileData, ProjectFileMap, ProjectGraph } from '../config/project-graph';
|
|
4
|
+
import { Task, TaskGraph } from '../config/task-graph';
|
|
5
|
+
import { PartialHash, TaskHasherImpl } from './task-hasher';
|
|
6
|
+
export declare class NodeTaskHasherImpl implements TaskHasherImpl {
|
|
7
|
+
private readonly nxJson;
|
|
8
|
+
private readonly legacyRuntimeInputs;
|
|
9
|
+
private readonly legacyFilesetInputs;
|
|
10
|
+
private readonly projectFileMap;
|
|
11
|
+
private readonly allWorkspaceFiles;
|
|
12
|
+
private readonly projectGraph;
|
|
13
|
+
private readonly options;
|
|
14
|
+
private filesetHashes;
|
|
15
|
+
private runtimeHashes;
|
|
16
|
+
private externalDependencyHashes;
|
|
17
|
+
private allExternalDependenciesHash;
|
|
18
|
+
private projectRootMappings;
|
|
19
|
+
constructor(nxJson: NxJsonConfiguration, legacyRuntimeInputs: {
|
|
20
|
+
runtime: string;
|
|
21
|
+
}[], legacyFilesetInputs: {
|
|
22
|
+
fileset: string;
|
|
23
|
+
}[], projectFileMap: ProjectFileMap, allWorkspaceFiles: FileData[], projectGraph: ProjectGraph, options: {
|
|
24
|
+
selectivelyHashTsConfig: boolean;
|
|
25
|
+
});
|
|
26
|
+
hashTasks(tasks: Task[], taskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<PartialHash[]>;
|
|
27
|
+
hashTask(task: Task, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, visited?: string[]): Promise<PartialHash>;
|
|
28
|
+
private hashNamedInputForDependencies;
|
|
29
|
+
private hashSelfAndDepsInputs;
|
|
30
|
+
private combinePartialHashes;
|
|
31
|
+
private hashDepsInputs;
|
|
32
|
+
private hashDepsOutputs;
|
|
33
|
+
private hashDepOuputs;
|
|
34
|
+
private hashFiles;
|
|
35
|
+
private getExternalDependencyHash;
|
|
36
|
+
private hashSingleExternalDependency;
|
|
37
|
+
private hashExternalDependency;
|
|
38
|
+
private hashTarget;
|
|
39
|
+
private findExternalDependencyNodeName;
|
|
40
|
+
private hashSingleProjectInputs;
|
|
41
|
+
private hashProjectInputs;
|
|
42
|
+
private hashRootFileset;
|
|
43
|
+
private hashProjectConfig;
|
|
44
|
+
private hashTsConfig;
|
|
45
|
+
private hashProjectFileset;
|
|
46
|
+
private hashRuntime;
|
|
47
|
+
private hashEnv;
|
|
48
|
+
private calculateExternalDependencyHashes;
|
|
49
|
+
}
|