@ohos-ports/nx 19.8.4-beta.2 → 20.8.4-beta.1
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 +146 -0
- package/LICENSE +1 -1
- package/bin/init-local.js +0 -39
- package/bin/nx.js +28 -15
- package/bin/post-install.js +7 -5
- package/migrations.json +11 -37
- package/ohos-build/build-Cargo.toml.patch +12 -0
- package/ohos-build/build-cargo-config.patch +20 -0
- package/ohos-build/index.js.patch +18 -0
- package/ohos-build/native-bindings.js.patch +25 -0
- package/ohos-build/nix-0.25.1-ohos.patch +539 -0
- package/ohos-build/nix-0.27.1-ohos.patch +436 -0
- package/package.json +25 -62
- package/plugins/package-json.d.ts +5 -1
- package/plugins/package-json.js +27 -2
- package/release/changelog-renderer/index.d.ts +102 -0
- package/release/changelog-renderer/index.js +339 -0
- package/release/index.d.ts +4 -0
- package/release/index.js +13 -0
- package/schemas/nx-schema.json +964 -0
- package/schemas/project-schema.json +331 -0
- package/schemas/workspace-schema.json +185 -0
- package/src/adapter/angular-json.js +2 -8
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +3 -1
- package/src/adapter/ngcli-adapter.js +7 -7
- package/src/command-line/add/add.js +21 -48
- package/src/command-line/affected/affected.js +3 -3
- package/src/command-line/connect/view-logs.js +1 -1
- package/src/command-line/examples.js +0 -4
- package/src/command-line/exec/exec.js +3 -3
- package/src/command-line/format/command-object.js +9 -0
- package/src/command-line/format/format.js +10 -6
- package/src/command-line/generate/command-object.js +1 -2
- package/src/command-line/generate/generate.d.ts +1 -1
- package/src/command-line/generate/generate.js +3 -1
- package/src/command-line/generate/generator-utils.js +10 -5
- package/src/command-line/graph/graph.js +6 -9
- package/src/command-line/import/import.js +110 -71
- package/src/command-line/init/command-object.js +25 -9
- package/src/command-line/init/configure-plugins.d.ts +34 -0
- package/src/command-line/init/configure-plugins.js +203 -0
- package/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
- package/src/command-line/init/implementation/add-nx-to-turborepo.js +49 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +4 -3
- package/src/command-line/init/implementation/angular/standalone-workspace.js +8 -5
- package/src/command-line/init/implementation/check-compatible-with-plugins.d.ts +15 -0
- package/src/command-line/init/implementation/check-compatible-with-plugins.js +134 -0
- package/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
- package/src/command-line/init/implementation/deduce-default-base.js +53 -0
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +1 -1
- package/src/command-line/init/implementation/dot-nx/nxw.js +1 -1
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +6 -4
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +1 -1
- package/src/command-line/init/implementation/react/index.d.ts +1 -1
- package/src/command-line/init/implementation/react/index.js +33 -186
- package/src/command-line/init/implementation/react/write-vite-config.js +19 -3
- package/src/command-line/init/implementation/utils.d.ts +6 -2
- package/src/command-line/init/implementation/utils.js +116 -37
- package/src/command-line/init/init-v1.js +2 -2
- package/src/command-line/init/init-v2.d.ts +2 -2
- package/src/command-line/init/init-v2.js +73 -55
- package/src/command-line/login/login.js +3 -0
- package/src/command-line/logout/logout.js +3 -0
- package/src/command-line/migrate/command-object.js +2 -96
- package/src/command-line/migrate/migrate.d.ts +1 -0
- package/src/command-line/migrate/migrate.js +111 -19
- package/src/command-line/nx-commands.js +20 -6
- package/src/command-line/register/command-object.d.ts +6 -0
- package/src/command-line/{activate-powerpack → register}/command-object.js +9 -9
- package/src/command-line/register/register.d.ts +2 -0
- package/src/command-line/register/register.js +9 -0
- package/src/command-line/release/changelog.d.ts +5 -4
- package/src/command-line/release/changelog.js +64 -79
- package/src/command-line/release/command-object.d.ts +7 -4
- package/src/command-line/release/command-object.js +24 -13
- package/src/command-line/release/config/config.d.ts +8 -7
- package/src/command-line/release/config/config.js +173 -43
- package/src/command-line/release/config/conventional-commits.js +7 -0
- package/src/command-line/release/config/filter-release-groups.d.ts +4 -0
- package/src/command-line/release/config/filter-release-groups.js +10 -3
- package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
- package/src/command-line/release/config/use-legacy-versioning.js +9 -0
- package/src/command-line/release/config/version-plans.js +1 -1
- package/src/command-line/release/index.d.ts +9 -2
- package/src/command-line/release/index.js +6 -1
- package/src/command-line/release/plan-check.js +6 -3
- package/src/command-line/release/plan.js +8 -4
- package/src/command-line/release/publish.d.ts +6 -1
- package/src/command-line/release/publish.js +50 -27
- package/src/command-line/release/release.js +33 -20
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
- package/src/command-line/release/utils/exec-command.js +1 -1
- package/src/command-line/release/utils/git.d.ts +3 -2
- package/src/command-line/release/utils/git.js +104 -19
- package/src/command-line/release/utils/github.d.ts +1 -0
- package/src/command-line/release/utils/github.js +6 -2
- package/src/command-line/release/utils/launch-editor.js +2 -2
- package/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -2
- package/src/command-line/release/utils/resolve-changelog-renderer.js +3 -3
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
- package/src/command-line/release/utils/semver.d.ts +8 -0
- package/src/command-line/release/utils/semver.js +8 -0
- package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
- package/src/command-line/release/utils/shared-legacy.js +2 -0
- package/src/command-line/release/utils/shared.d.ts +11 -17
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
- package/src/command-line/release/version/project-logger.d.ts +8 -0
- package/src/command-line/release/version/project-logger.js +45 -0
- package/src/command-line/release/version/release-group-processor.d.ts +251 -0
- package/src/command-line/release/version/release-group-processor.js +1048 -0
- package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
- package/src/command-line/release/version/resolve-current-version.js +241 -0
- package/src/command-line/release/version/test-utils.d.ts +95 -0
- package/src/command-line/release/version/test-utils.js +416 -0
- package/src/command-line/release/version/topological-sort.d.ts +9 -0
- package/src/command-line/release/version/topological-sort.js +41 -0
- package/src/command-line/release/version/version-actions.d.ts +170 -0
- package/src/command-line/release/version/version-actions.js +183 -0
- package/src/command-line/release/version-legacy.d.ts +46 -0
- package/src/command-line/release/version-legacy.js +453 -0
- package/src/command-line/release/version.d.ts +0 -40
- package/src/command-line/release/version.js +93 -255
- package/src/command-line/report/report.d.ts +7 -3
- package/src/command-line/report/report.js +52 -16
- package/src/command-line/run/executor-utils.js +4 -4
- package/src/command-line/run/run-one.js +37 -15
- package/src/command-line/run/run.js +1 -2
- package/src/command-line/run-many/run-many.js +1 -4
- package/src/command-line/show/project.js +25 -3
- package/src/command-line/show/projects.js +4 -0
- package/src/command-line/sync/sync.js +3 -3
- package/src/command-line/watch/watch.js +1 -1
- package/src/command-line/yargs-utils/shared-options.d.ts +4 -0
- package/src/command-line/yargs-utils/shared-options.js +26 -0
- package/src/config/misc-interfaces.d.ts +3 -15
- package/src/config/nx-json.d.ts +145 -19
- package/src/config/project-graph.d.ts +4 -4
- package/src/config/project-graph.js +8 -0
- package/src/config/schema-utils.d.ts +4 -3
- package/src/config/schema-utils.js +71 -4
- package/src/config/workspace-json-project-json.d.ts +23 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/runtime.js +1 -1
- package/src/core/graph/styles.css +2 -2
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +5 -0
- package/src/daemon/client/client.js +42 -4
- package/src/daemon/client/generate-help-output.js +1 -1
- package/src/daemon/message-types/glob.d.ts +7 -0
- package/src/daemon/message-types/glob.js +9 -1
- package/src/daemon/message-types/hash-glob.d.ts +6 -0
- package/src/daemon/message-types/hash-glob.js +9 -1
- package/src/daemon/message-types/run-tasks-execution-hooks.d.ts +13 -0
- package/src/daemon/message-types/run-tasks-execution-hooks.js +19 -0
- package/src/daemon/server/handle-glob.d.ts +1 -0
- package/src/daemon/server/handle-glob.js +8 -0
- package/src/daemon/server/handle-hash-glob.d.ts +1 -0
- package/src/daemon/server/handle-hash-glob.js +8 -0
- package/src/daemon/server/handle-hash-tasks.js +1 -1
- package/src/daemon/server/handle-tasks-execution-hooks.d.ts +19 -0
- package/src/daemon/server/handle-tasks-execution-hooks.js +35 -0
- package/src/daemon/server/logger.js +2 -1
- package/src/daemon/server/project-graph-incremental-recomputation.js +5 -5
- package/src/daemon/server/server.js +26 -2
- package/src/daemon/server/shutdown-utils.js +4 -2
- package/src/devkit-exports.d.ts +10 -7
- package/src/devkit-exports.js +4 -6
- package/src/devkit-internals.d.ts +4 -2
- package/src/devkit-internals.js +8 -3
- package/src/executors/run-commands/run-commands.impl.d.ts +1 -0
- package/src/executors/run-commands/run-commands.impl.js +11 -4
- package/src/executors/run-commands/schema.json +14 -0
- package/src/executors/run-script/run-script.impl.js +1 -1
- package/src/executors/utils/convert-nx-executor.js +2 -4
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +8 -0
- package/src/generators/testing-utils/create-tree.js +5 -1
- package/src/generators/utils/nx-json.d.ts +1 -1
- package/src/generators/utils/project-configuration.js +15 -4
- package/src/hasher/create-task-hasher.js +1 -1
- package/src/hasher/file-hasher.d.ts +1 -0
- package/src/hasher/file-hasher.js +5 -0
- package/src/hasher/hash-task.js +1 -1
- package/src/hasher/task-hasher.d.ts +2 -6
- package/src/hasher/task-hasher.js +6 -32
- package/src/migrations/update-20-0-0/move-use-daemon-process.d.ts +2 -0
- package/src/migrations/update-20-0-0/move-use-daemon-process.js +25 -0
- package/src/migrations/update-20-0-1/use-legacy-cache.d.ts +2 -0
- package/src/migrations/update-20-0-1/use-legacy-cache.js +20 -0
- package/src/native/index.d.ts +49 -20
- package/src/native/index.js +18 -3
- package/src/native/native-bindings.js +12 -2
- package/src/native/nx.openharmony-arm64.node +0 -0
- package/src/native/nx.wasi-browser.js +11 -8
- package/src/native/nx.wasi.cjs +11 -8
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/native/tests/__fixtures__/file-lock.fixture.js +20 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +3 -2
- package/src/nx-cloud/update-manager.js +13 -1
- package/src/plugins/js/index.js +2 -2
- package/src/plugins/js/lock-file/lock-file.js +28 -13
- package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
- package/src/plugins/js/lock-file/utils/package-json.js +3 -1
- package/src/plugins/js/lock-file/yarn-parser.js +102 -44
- package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +2 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +6 -20
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +14 -2
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +81 -19
- package/src/plugins/js/utils/config.js +2 -9
- package/src/plugins/js/utils/packages.d.ts +8 -0
- package/src/plugins/js/utils/packages.js +91 -0
- package/src/plugins/js/utils/register.d.ts +5 -1
- package/src/plugins/js/utils/register.js +2 -1
- package/src/plugins/js/utils/typescript.d.ts +1 -0
- package/src/plugins/js/utils/typescript.js +4 -3
- package/src/plugins/js/versions.d.ts +1 -1
- package/src/plugins/js/versions.js +1 -1
- package/src/plugins/package-json/create-nodes.d.ts +7 -8
- package/src/plugins/package-json/create-nodes.js +34 -12
- package/src/project-graph/affected/affected-project-graph.js +3 -0
- package/src/project-graph/affected/locators/project-glob-changes.js +16 -4
- package/src/project-graph/build-project-graph.d.ts +2 -1
- package/src/project-graph/build-project-graph.js +66 -43
- package/src/project-graph/error-types.d.ts +15 -12
- package/src/project-graph/error-types.js +109 -23
- package/src/project-graph/file-utils.d.ts +3 -3
- package/src/project-graph/file-utils.js +8 -7
- package/src/project-graph/nx-deps-cache.d.ts +6 -3
- package/src/project-graph/nx-deps-cache.js +66 -11
- package/src/project-graph/plugins/get-plugins.d.ts +4 -0
- package/src/project-graph/plugins/get-plugins.js +144 -0
- package/src/project-graph/plugins/in-process-loader.d.ts +10 -0
- package/src/project-graph/plugins/in-process-loader.js +60 -0
- package/src/project-graph/plugins/index.d.ts +2 -1
- package/src/project-graph/plugins/index.js +5 -3
- package/src/project-graph/plugins/isolation/enabled.d.ts +1 -0
- package/src/project-graph/plugins/isolation/enabled.js +19 -0
- package/src/project-graph/plugins/isolation/index.d.ts +2 -2
- package/src/project-graph/plugins/isolation/index.js +1 -7
- package/src/project-graph/plugins/isolation/messaging.d.ts +39 -21
- package/src/project-graph/plugins/isolation/messaging.js +5 -1
- package/src/project-graph/plugins/isolation/plugin-pool.d.ts +1 -1
- package/src/project-graph/plugins/isolation/plugin-pool.js +58 -49
- package/src/project-graph/plugins/isolation/plugin-worker.js +79 -29
- package/src/project-graph/plugins/load-resolved-plugin.d.ts +3 -0
- package/src/project-graph/plugins/load-resolved-plugin.js +22 -0
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts +20 -0
- package/src/project-graph/plugins/loaded-nx-plugin.js +80 -0
- package/src/project-graph/plugins/public-api.d.ts +32 -13
- package/src/project-graph/plugins/resolve-plugin.d.ts +15 -0
- package/src/project-graph/plugins/resolve-plugin.js +134 -0
- package/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -0
- package/src/project-graph/plugins/tasks-execution-hooks.js +65 -0
- package/src/project-graph/plugins/transpiler.d.ts +8 -0
- package/src/project-graph/plugins/transpiler.js +47 -0
- package/src/project-graph/plugins/utils.d.ts +2 -8
- package/src/project-graph/plugins/utils.js +2 -39
- package/src/project-graph/project-graph.d.ts +3 -1
- package/src/project-graph/project-graph.js +86 -20
- package/src/project-graph/utils/project-configuration-utils.d.ts +2 -2
- package/src/project-graph/utils/project-configuration-utils.js +55 -25
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -7
- package/src/project-graph/utils/retrieve-workspace-files.js +17 -23
- package/src/tasks-runner/batch/batch-messages.d.ts +2 -0
- package/src/tasks-runner/batch/run-batch.js +2 -4
- package/src/tasks-runner/cache.d.ts +22 -4
- package/src/tasks-runner/cache.js +160 -18
- package/src/tasks-runner/create-task-graph.d.ts +13 -1
- package/src/tasks-runner/create-task-graph.js +50 -22
- package/src/tasks-runner/default-tasks-runner.d.ts +1 -0
- package/src/tasks-runner/default-tasks-runner.js +20 -2
- package/src/tasks-runner/forked-process-task-runner.d.ts +4 -1
- package/src/tasks-runner/forked-process-task-runner.js +62 -40
- package/src/tasks-runner/init-tasks-runner.js +0 -2
- package/src/tasks-runner/life-cycle.d.ts +7 -0
- package/src/tasks-runner/run-command.d.ts +2 -4
- package/src/tasks-runner/run-command.js +51 -18
- package/src/tasks-runner/task-graph-utils.d.ts +11 -0
- package/src/tasks-runner/task-graph-utils.js +23 -0
- package/src/tasks-runner/task-orchestrator.js +14 -4
- package/src/tasks-runner/utils.js +2 -0
- package/src/utils/ab-testing.js +1 -1
- package/src/utils/assert-workspace-validity.js +4 -0
- package/src/utils/child-process.d.ts +4 -0
- package/src/utils/child-process.js +23 -30
- package/src/utils/command-line-utils.d.ts +5 -3
- package/src/utils/command-line-utils.js +37 -57
- package/src/utils/db-connection.d.ts +2 -1
- package/src/utils/db-connection.js +7 -0
- package/src/utils/default-base.js +1 -1
- package/src/utils/delayed-spinner.d.ts +42 -0
- package/src/utils/delayed-spinner.js +80 -0
- package/src/utils/find-matching-projects.js +13 -1
- package/src/utils/git-utils.index-filter.js +2 -2
- package/src/utils/git-utils.js +4 -4
- package/src/utils/git-utils.tree-filter.js +1 -1
- package/src/utils/handle-errors.js +24 -13
- package/src/utils/is-ci.js +4 -1
- package/src/utils/is-using-prettier.d.ts +3 -0
- package/src/utils/is-using-prettier.js +62 -0
- package/src/utils/nx-cloud-utils.js +3 -0
- package/src/utils/nx-key.d.ts +7 -0
- package/src/utils/nx-key.js +52 -0
- package/src/utils/package-json.d.ts +5 -1
- package/src/utils/package-json.js +9 -3
- package/src/utils/package-manager.d.ts +14 -0
- package/src/utils/package-manager.js +89 -3
- package/src/utils/path.js +1 -1
- package/src/utils/plugins/core-plugins.js +4 -0
- package/src/utils/plugins/plugin-capabilities.js +4 -5
- package/src/utils/print-help.js +3 -9
- package/src/utils/require-nx-key.d.ts +1 -0
- package/src/utils/require-nx-key.js +22 -0
- package/src/utils/sync-generators.js +9 -14
- package/src/utils/task-history.d.ts +1 -1
- package/src/utils/task-history.js +2 -2
- package/src/utils/workspace-context.d.ts +2 -0
- package/src/utils/workspace-context.js +16 -0
- package/tasks-runners/default.d.ts +1 -0
- package/tasks-runners/default.js +5 -0
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +0 -2
- package/src/command-line/activate-powerpack/activate-powerpack.js +0 -34
- package/src/command-line/activate-powerpack/command-object.d.ts +0 -6
- package/src/command-line/import/utils/needs-install.d.ts +0 -3
- package/src/command-line/import/utils/needs-install.js +0 -31
- package/src/command-line/init/implementation/react/write-craco-config.d.ts +0 -1
- package/src/command-line/init/implementation/react/write-craco-config.js +0 -61
- package/src/daemon/server/plugins.d.ts +0 -3
- package/src/daemon/server/plugins.js +0 -32
- package/src/hasher/node-task-hasher-impl.d.ts +0 -48
- package/src/hasher/node-task-hasher-impl.js +0 -449
- package/src/migrations/update-15-0-0/migrate-to-inputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +0 -102
- package/src/migrations/update-15-0-0/prefix-outputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/prefix-outputs.js +0 -49
- package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +0 -16
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +0 -2
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +0 -97
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +0 -2
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +0 -29
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +0 -2
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +0 -45
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +0 -12
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +0 -67
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.d.ts +0 -2
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +0 -21
- package/src/native/nx.ohos-arm64.node +0 -0
- package/src/project-graph/plugins/internal-api.d.ts +0 -29
- package/src/project-graph/plugins/internal-api.js +0 -134
- package/src/project-graph/plugins/loader.d.ts +0 -24
- package/src/project-graph/plugins/loader.js +0 -220
- package/src/utils/app-root.d.ts +0 -8
- package/src/utils/app-root.js +0 -12
- package/src/utils/nx-plugin.deprecated.d.ts +0 -31
- package/src/utils/nx-plugin.deprecated.js +0 -20
- package/src/utils/powerpack.d.ts +0 -5
- package/src/utils/powerpack.js +0 -33
- package/src/utils/workspace-configuration-check.d.ts +0 -1
- package/src/utils/workspace-configuration-check.js +0 -36
|
@@ -5,7 +5,6 @@ exports.addHandler = addHandler;
|
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const ora = require("ora");
|
|
8
|
-
const angular_json_1 = require("../../adapter/angular-json");
|
|
9
8
|
const nx_json_1 = require("../../config/nx-json");
|
|
10
9
|
const child_process_2 = require("../../utils/child-process");
|
|
11
10
|
const fileutils_1 = require("../../utils/fileutils");
|
|
@@ -13,10 +12,11 @@ const logger_1 = require("../../utils/logger");
|
|
|
13
12
|
const output_1 = require("../../utils/output");
|
|
14
13
|
const package_manager_1 = require("../../utils/package-manager");
|
|
15
14
|
const handle_errors_1 = require("../../utils/handle-errors");
|
|
16
|
-
const plugins_1 = require("../../utils/plugins");
|
|
17
15
|
const versions_1 = require("../../utils/versions");
|
|
18
16
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
19
17
|
const add_nx_scripts_1 = require("../init/implementation/dot-nx/add-nx-scripts");
|
|
18
|
+
const semver_1 = require("semver");
|
|
19
|
+
const configure_plugins_1 = require("../init/configure-plugins");
|
|
20
20
|
function addHandler(options) {
|
|
21
21
|
return (0, handle_errors_1.handleErrors)(options.verbose, async () => {
|
|
22
22
|
output_1.output.addNewline();
|
|
@@ -33,9 +33,15 @@ async function installPackage(pkgName, version, nxJson) {
|
|
|
33
33
|
const spinner = ora(`Installing ${pkgName}@${version}...`);
|
|
34
34
|
spinner.start();
|
|
35
35
|
if ((0, fs_1.existsSync)('package.json')) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const pm = (0, package_manager_1.detectPackageManager)();
|
|
37
|
+
const pmv = (0, package_manager_1.getPackageManagerVersion)(pm);
|
|
38
|
+
const pmc = (0, package_manager_1.getPackageManagerCommand)(pm);
|
|
39
|
+
// if we explicitly specify latest in yarn berry, it won't resolve the version
|
|
40
|
+
const command = pm === 'yarn' && (0, semver_1.gte)(pmv, '2.0.0') && version === 'latest'
|
|
41
|
+
? `${pmc.addDev} ${pkgName}`
|
|
42
|
+
: `${pmc.addDev} ${pkgName}@${version}`;
|
|
43
|
+
await new Promise((resolve) => (0, child_process_1.exec)(command, {
|
|
44
|
+
windowsHide: false,
|
|
39
45
|
}, (error, stdout) => {
|
|
40
46
|
if (error) {
|
|
41
47
|
spinner.fail();
|
|
@@ -72,63 +78,30 @@ async function installPackage(pkgName, version, nxJson) {
|
|
|
72
78
|
spinner.succeed();
|
|
73
79
|
}
|
|
74
80
|
async function initializePlugin(pkgName, options, nxJson) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
const initGenerator = findInitGenerator(generators);
|
|
84
|
-
if (!initGenerator) {
|
|
85
|
-
output_1.output.log({
|
|
86
|
-
title: `No "init" generator found in ${pkgName}. Skipping initialization.`,
|
|
87
|
-
});
|
|
88
|
-
return;
|
|
81
|
+
let updatePackageScripts = false;
|
|
82
|
+
if (exports.coreNxPluginVersions.has(pkgName) &&
|
|
83
|
+
(options.updatePackageScripts ||
|
|
84
|
+
(options.updatePackageScripts === undefined &&
|
|
85
|
+
nxJson.useInferencePlugins !== false &&
|
|
86
|
+
process.env.NX_ADD_PLUGINS !== 'false'))) {
|
|
87
|
+
updatePackageScripts = true;
|
|
89
88
|
}
|
|
90
89
|
const spinner = ora(`Initializing ${pkgName}...`);
|
|
91
90
|
spinner.start();
|
|
92
91
|
try {
|
|
93
|
-
|
|
94
|
-
if (exports.coreNxPluginVersions.has(pkgName)) {
|
|
95
|
-
args.push(`--keepExistingVersions`);
|
|
96
|
-
if (options.updatePackageScripts ||
|
|
97
|
-
(options.updatePackageScripts === undefined &&
|
|
98
|
-
nxJson.useInferencePlugins !== false &&
|
|
99
|
-
process.env.NX_ADD_PLUGINS !== 'false')) {
|
|
100
|
-
args.push(`--updatePackageScripts`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (options.__overrides_unparsed__.length) {
|
|
104
|
-
args.push(...options.__overrides_unparsed__);
|
|
105
|
-
}
|
|
106
|
-
(0, child_process_2.runNxSync)(`g ${pkgName}:${initGenerator} ${args.join(' ')}`, {
|
|
107
|
-
stdio: [0, 1, 2],
|
|
108
|
-
});
|
|
92
|
+
await (0, configure_plugins_1.runPluginInitGenerator)(pkgName, workspace_root_1.workspaceRoot, updatePackageScripts, options.verbose);
|
|
109
93
|
}
|
|
110
94
|
catch (e) {
|
|
111
95
|
spinner.fail();
|
|
112
96
|
output_1.output.addNewline();
|
|
113
|
-
logger_1.logger.error(e);
|
|
114
97
|
output_1.output.error({
|
|
115
|
-
title: `Failed to initialize ${pkgName}
|
|
98
|
+
title: `Failed to initialize ${pkgName}`,
|
|
99
|
+
bodyLines: (0, configure_plugins_1.getFailedToInstallPluginErrorMessages)(e),
|
|
116
100
|
});
|
|
117
101
|
process.exit(1);
|
|
118
102
|
}
|
|
119
103
|
spinner.succeed();
|
|
120
104
|
}
|
|
121
|
-
function findInitGenerator(generators) {
|
|
122
|
-
if (generators['init']) {
|
|
123
|
-
return 'init';
|
|
124
|
-
}
|
|
125
|
-
const angularPluginInstalled = (0, angular_json_1.isAngularPluginInstalled)();
|
|
126
|
-
if (angularPluginInstalled && generators['ng-add']) {
|
|
127
|
-
return 'ng-add';
|
|
128
|
-
}
|
|
129
|
-
return Object.keys(generators).find((name) => generators[name].aliases?.includes('init') ||
|
|
130
|
-
(angularPluginInstalled && generators[name].aliases?.includes('ng-add')));
|
|
131
|
-
}
|
|
132
105
|
function parsePackageSpecifier(packageSpecifier) {
|
|
133
106
|
const i = packageSpecifier.lastIndexOf('@');
|
|
134
107
|
if (i <= 0) {
|
|
@@ -12,7 +12,6 @@ const project_graph_1 = require("../../project-graph/project-graph");
|
|
|
12
12
|
const project_graph_utils_1 = require("../../utils/project-graph-utils");
|
|
13
13
|
const affected_project_graph_1 = require("../../project-graph/affected/affected-project-graph");
|
|
14
14
|
const configuration_1 = require("../../config/configuration");
|
|
15
|
-
const workspace_configuration_check_1 = require("../../utils/workspace-configuration-check");
|
|
16
15
|
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
|
17
16
|
const graph_1 = require("../graph/graph");
|
|
18
17
|
const all_file_data_1 = require("../../utils/all-file-data");
|
|
@@ -22,13 +21,14 @@ async function affected(command, args, extraTargetDependencies = {}, extraOption
|
|
|
22
21
|
}) {
|
|
23
22
|
perf_hooks_1.performance.mark('code-loading:end');
|
|
24
23
|
perf_hooks_1.performance.measure('code-loading', 'init-local', 'code-loading:end');
|
|
25
|
-
(0, workspace_configuration_check_1.workspaceConfigurationCheck)();
|
|
26
24
|
const nxJson = (0, configuration_1.readNxJson)();
|
|
27
25
|
const { nxArgs, overrides } = (0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', {
|
|
28
26
|
printWarnings: command !== 'print-affected' && !args.plain && args.graph !== 'stdout',
|
|
29
27
|
}, nxJson);
|
|
30
28
|
await (0, connect_to_nx_cloud_1.connectToNxCloudIfExplicitlyAsked)(nxArgs);
|
|
31
|
-
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({
|
|
29
|
+
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({
|
|
30
|
+
exitOnError: true,
|
|
31
|
+
});
|
|
32
32
|
const projects = await getAffectedGraphNodes(nxArgs, projectGraph);
|
|
33
33
|
try {
|
|
34
34
|
switch (command) {
|
|
@@ -43,7 +43,7 @@ async function viewLogs() {
|
|
|
43
43
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
|
44
44
|
(0, child_process_1.execSync)(`${pmc.exec} nx-cloud upload-and-show-run-details`, {
|
|
45
45
|
stdio: [0, 1, 2],
|
|
46
|
-
windowsHide:
|
|
46
|
+
windowsHide: false,
|
|
47
47
|
});
|
|
48
48
|
if (!cloudUsed) {
|
|
49
49
|
output_1.output.note({
|
|
@@ -143,10 +143,6 @@ exports.examples = {
|
|
|
143
143
|
command: 'graph --focus=todos-feature-main',
|
|
144
144
|
description: 'Show the graph where every node is either an ancestor or a descendant of todos-feature-main',
|
|
145
145
|
},
|
|
146
|
-
{
|
|
147
|
-
command: 'graph --include=project-one,project-two',
|
|
148
|
-
description: 'Include project-one and project-two in the project graph',
|
|
149
|
-
},
|
|
150
146
|
{
|
|
151
147
|
command: 'graph --exclude=project-one,project-two',
|
|
152
148
|
description: 'Exclude project-one and project-two from the project graph',
|
|
@@ -34,7 +34,7 @@ async function nxExecCommand(args) {
|
|
|
34
34
|
NX_PROJECT_NAME: process.env.NX_TASK_TARGET_PROJECT,
|
|
35
35
|
NX_PROJECT_ROOT_PATH: projectGraph.nodes?.[process.env.NX_TASK_TARGET_PROJECT]?.data?.root,
|
|
36
36
|
},
|
|
37
|
-
windowsHide:
|
|
37
|
+
windowsHide: false,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
@@ -67,7 +67,7 @@ async function runScriptAsNxTarget(projectGraph, argv, nxArgs) {
|
|
|
67
67
|
cwd: projectGraph.nodes?.[projectName]?.data?.root
|
|
68
68
|
? (0, path_2.joinPathFragments)(workspace_root_1.workspaceRoot, projectGraph.nodes?.[projectName]?.data?.root)
|
|
69
69
|
: workspace_root_1.workspaceRoot,
|
|
70
|
-
windowsHide:
|
|
70
|
+
windowsHide: false,
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -81,7 +81,7 @@ function runTargetOnProject(scriptDefinition, targetName, project, projectName,
|
|
|
81
81
|
const command = `${pm.exec} nx run ${projectName}:\\\"${targetName}\\\" ${extraArgs.join(' ')}`;
|
|
82
82
|
(0, child_process_1.execSync)(command, {
|
|
83
83
|
stdio: 'inherit',
|
|
84
|
-
windowsHide:
|
|
84
|
+
windowsHide: false,
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
function readScriptArgV(overrides) {
|
|
@@ -35,6 +35,15 @@ function withFormatOptions(yargs) {
|
|
|
35
35
|
describe: 'Projects to format (comma/space delimited).',
|
|
36
36
|
type: 'string',
|
|
37
37
|
coerce: shared_options_1.parseCSV,
|
|
38
|
+
})
|
|
39
|
+
.option('sort-root-tsconfig-paths', {
|
|
40
|
+
describe: `Ensure the workspace's tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost.`,
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
/**
|
|
43
|
+
* TODO(v21): Stop sorting tsconfig paths by default, paths are now less common/important
|
|
44
|
+
* in Nx workspace setups, and the sorting causes comments to be lost.
|
|
45
|
+
*/
|
|
46
|
+
default: true,
|
|
38
47
|
})
|
|
39
48
|
.option('all', {
|
|
40
49
|
describe: 'Format all projects.',
|
|
@@ -34,12 +34,14 @@ async function format(command, args) {
|
|
|
34
34
|
const patterns = (await getPatterns({ ...args, ...nxArgs })).map(
|
|
35
35
|
// prettier removes one of the \
|
|
36
36
|
// prettier-ignore
|
|
37
|
-
(p) => `"${p.replace(/\$/g,
|
|
37
|
+
(p) => `"${p.replace(/\$/g, '\\\$')}"`);
|
|
38
38
|
// Chunkify the patterns array to prevent crashing the windows terminal
|
|
39
39
|
const chunkList = (0, chunkify_1.chunkify)(patterns);
|
|
40
40
|
switch (command) {
|
|
41
41
|
case 'write':
|
|
42
|
-
|
|
42
|
+
if (nxArgs.sortRootTsconfigPaths) {
|
|
43
|
+
sortTsConfig();
|
|
44
|
+
}
|
|
43
45
|
addRootConfigFiles(chunkList, nxArgs);
|
|
44
46
|
chunkList.forEach((chunk) => write(chunk));
|
|
45
47
|
break;
|
|
@@ -108,7 +110,9 @@ async function getPatterns(args) {
|
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
async function getPatternsFromApps(affectedFiles, allWorkspaceFiles, projectGraph) {
|
|
111
|
-
const graph = await (0, project_graph_1.createProjectGraphAsync)({
|
|
113
|
+
const graph = await (0, project_graph_1.createProjectGraphAsync)({
|
|
114
|
+
exitOnError: true,
|
|
115
|
+
});
|
|
112
116
|
const affectedGraph = await (0, affected_project_graph_1.filterAffected)(graph, (0, file_utils_1.calculateFileChanges)(affectedFiles, allWorkspaceFiles));
|
|
113
117
|
return getPatternsFromProjects(Object.keys(affectedGraph.nodes), projectGraph);
|
|
114
118
|
}
|
|
@@ -144,12 +148,12 @@ function write(patterns) {
|
|
|
144
148
|
const prettierPath = getPrettierPath();
|
|
145
149
|
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${regularPatterns.join(' ')}`, {
|
|
146
150
|
stdio: [0, 1, 2],
|
|
147
|
-
windowsHide:
|
|
151
|
+
windowsHide: false,
|
|
148
152
|
});
|
|
149
153
|
if (swcrcPatterns.length > 0) {
|
|
150
154
|
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${swcrcPatterns.join(' ')} --parser json`, {
|
|
151
155
|
stdio: [0, 1, 2],
|
|
152
|
-
windowsHide:
|
|
156
|
+
windowsHide: false,
|
|
153
157
|
});
|
|
154
158
|
}
|
|
155
159
|
}
|
|
@@ -160,7 +164,7 @@ async function check(patterns) {
|
|
|
160
164
|
}
|
|
161
165
|
const prettierPath = getPrettierPath();
|
|
162
166
|
return new Promise((resolve) => {
|
|
163
|
-
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8', windowsHide:
|
|
167
|
+
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8', windowsHide: false }, (error, stdout) => {
|
|
164
168
|
if (error) {
|
|
165
169
|
// The command failed so there are files with different formatting. Prettier writes them to stdout, newline separated.
|
|
166
170
|
resolve(stdout.trim().split('\n'));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsGenerateCommand = void 0;
|
|
4
|
-
const path_1 = require("../../utils/path");
|
|
5
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
|
6
5
|
exports.yargsGenerateCommand = {
|
|
7
6
|
command: 'generate <generator> [_..]',
|
|
@@ -11,7 +10,7 @@ exports.yargsGenerateCommand = {
|
|
|
11
10
|
handler: async (args) => {
|
|
12
11
|
// Remove the command from the args
|
|
13
12
|
args._ = args._.slice(1);
|
|
14
|
-
process.exit(await (await Promise.resolve().then(() => require('./generate'))).generate(
|
|
13
|
+
process.exit(await (await Promise.resolve().then(() => require('./generate'))).generate(args));
|
|
15
14
|
},
|
|
16
15
|
};
|
|
17
16
|
function withGenerateOptions(yargs) {
|
|
@@ -16,6 +16,6 @@ export declare function parseGeneratorString(value: string): {
|
|
|
16
16
|
generator: string;
|
|
17
17
|
};
|
|
18
18
|
export declare function printGenHelp(opts: GenerateOptions, schema: Schema, normalizedGeneratorName: string, aliases: string[]): void;
|
|
19
|
-
export declare function generate(
|
|
19
|
+
export declare function generate(args: {
|
|
20
20
|
[k: string]: any;
|
|
21
21
|
}): Promise<number>;
|
|
@@ -19,6 +19,7 @@ const workspace_root_1 = require("../../utils/workspace-root");
|
|
|
19
19
|
const calculate_default_project_name_1 = require("../../config/calculate-default-project-name");
|
|
20
20
|
const installed_plugins_1 = require("../../utils/plugins/installed-plugins");
|
|
21
21
|
const generator_utils_1 = require("./generator-utils");
|
|
22
|
+
const path_2 = require("../../utils/path");
|
|
22
23
|
function printChanges(fileChanges) {
|
|
23
24
|
fileChanges.forEach((f) => {
|
|
24
25
|
if (f.type === 'CREATE') {
|
|
@@ -206,7 +207,7 @@ function printGenHelp(opts, schema, normalizedGeneratorName, aliases) {
|
|
|
206
207
|
aliases,
|
|
207
208
|
});
|
|
208
209
|
}
|
|
209
|
-
async function generate(
|
|
210
|
+
async function generate(args) {
|
|
210
211
|
return (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
|
211
212
|
const nxJsonConfiguration = (0, configuration_1.readNxJson)();
|
|
212
213
|
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)();
|
|
@@ -226,6 +227,7 @@ async function generate(cwd, args) {
|
|
|
226
227
|
printGenHelp(opts, schema, normalizedGeneratorName, aliases);
|
|
227
228
|
return 0;
|
|
228
229
|
}
|
|
230
|
+
const cwd = (0, path_2.getCwd)();
|
|
229
231
|
const combinedOpts = await (0, params_1.combineOptionsForGenerator)(opts.generatorOptions, opts.collectionName, normalizedGeneratorName, projectsConfigurations, nxJsonConfiguration, schema, opts.interactive, (0, calculate_default_project_name_1.calculateDefaultProjectName)(cwd, workspace_root_1.workspaceRoot, projectsConfigurations, nxJsonConfiguration), (0, path_1.relative)(workspace_root_1.workspaceRoot, cwd), args.verbose);
|
|
230
232
|
if ((0, generator_utils_1.getGeneratorInformation)(opts.collectionName, normalizedGeneratorName, workspace_root_1.workspaceRoot, projectsConfigurations.projects).isNxGenerator) {
|
|
231
233
|
const host = new tree_1.FsTree(workspace_root_1.workspaceRoot, args.verbose, `generating (${opts.collectionName}:${normalizedGeneratorName})`);
|
|
@@ -6,6 +6,7 @@ const path_1 = require("path");
|
|
|
6
6
|
const schema_utils_1 = require("../../config/schema-utils");
|
|
7
7
|
const fileutils_1 = require("../../utils/fileutils");
|
|
8
8
|
const plugins_1 = require("../../project-graph/plugins");
|
|
9
|
+
const installation_directory_1 = require("../../utils/installation-directory");
|
|
9
10
|
function getGeneratorInformation(collectionName, generatorName, root, projects) {
|
|
10
11
|
try {
|
|
11
12
|
const { generatorsFilePath, generatorsJson, resolvedCollectionName, normalizedGeneratorName, } = readGeneratorsJson(collectionName, generatorName, root, projects);
|
|
@@ -13,14 +14,14 @@ function getGeneratorInformation(collectionName, generatorName, root, projects)
|
|
|
13
14
|
const generatorConfig = generatorsJson.generators?.[normalizedGeneratorName] ||
|
|
14
15
|
generatorsJson.schematics?.[normalizedGeneratorName];
|
|
15
16
|
const isNgCompat = !generatorsJson.generators?.[normalizedGeneratorName];
|
|
16
|
-
const schemaPath = (0, schema_utils_1.resolveSchema)(generatorConfig.schema, generatorsDir);
|
|
17
|
+
const schemaPath = (0, schema_utils_1.resolveSchema)(generatorConfig.schema, generatorsDir, collectionName, projects);
|
|
17
18
|
const schema = (0, fileutils_1.readJsonFile)(schemaPath);
|
|
18
19
|
if (!schema.properties || typeof schema.properties !== 'object') {
|
|
19
20
|
schema.properties = {};
|
|
20
21
|
}
|
|
21
22
|
generatorConfig.implementation =
|
|
22
23
|
generatorConfig.implementation || generatorConfig.factory;
|
|
23
|
-
const implementationFactory = (0, schema_utils_1.getImplementationFactory)(generatorConfig.implementation, generatorsDir);
|
|
24
|
+
const implementationFactory = (0, schema_utils_1.getImplementationFactory)(generatorConfig.implementation, generatorsDir, collectionName, projects);
|
|
24
25
|
const normalizedGeneratorConfiguration = {
|
|
25
26
|
...generatorConfig,
|
|
26
27
|
aliases: generatorConfig.aliases ?? [],
|
|
@@ -37,18 +38,22 @@ function getGeneratorInformation(collectionName, generatorName, root, projects)
|
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
catch (e) {
|
|
40
|
-
throw new Error(`Unable to resolve ${collectionName}:${generatorName}.\n${e.message}`);
|
|
41
|
+
throw new Error(`Unable to resolve ${collectionName}:${generatorName}.\n${process.env.NX_VERBOSE_LOGGING === 'true' ? e.stack : e.message}`);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
function readGeneratorsJson(collectionName, generator, root, projects) {
|
|
44
45
|
let generatorsFilePath;
|
|
45
46
|
if (collectionName.endsWith('.json')) {
|
|
46
47
|
generatorsFilePath = require.resolve(collectionName, {
|
|
47
|
-
paths: root
|
|
48
|
+
paths: root
|
|
49
|
+
? [...(0, installation_directory_1.getNxRequirePaths)(root), __dirname]
|
|
50
|
+
: [...(0, installation_directory_1.getNxRequirePaths)(), __dirname],
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
else {
|
|
51
|
-
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(collectionName, projects, root
|
|
54
|
+
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(collectionName, projects, root
|
|
55
|
+
? [...(0, installation_directory_1.getNxRequirePaths)(root), __dirname]
|
|
56
|
+
: [...(0, installation_directory_1.getNxRequirePaths)(), __dirname]);
|
|
52
57
|
const generatorsFile = packageJson.generators ?? packageJson.schematics;
|
|
53
58
|
if (!generatorsFile) {
|
|
54
59
|
throw new Error(`The "${collectionName}" package does not support Nx generators.`);
|
|
@@ -579,7 +579,7 @@ async function createTaskGraphClientResponse(pruneExternal = false) {
|
|
|
579
579
|
}
|
|
580
580
|
const nxJson = (0, configuration_1.readNxJson)();
|
|
581
581
|
perf_hooks_1.performance.mark('task graph generation:start');
|
|
582
|
-
const taskGraphs = getAllTaskGraphsForWorkspace(
|
|
582
|
+
const taskGraphs = getAllTaskGraphsForWorkspace(graph);
|
|
583
583
|
perf_hooks_1.performance.mark('task graph generation:end');
|
|
584
584
|
const planner = new native_1.HashPlanner(nxJson, (0, native_1.transferProjectGraph)((0, transform_objects_1.transformProjectGraphForRust)(graph)));
|
|
585
585
|
perf_hooks_1.performance.mark('task hash plan generation:start');
|
|
@@ -613,8 +613,7 @@ async function createExpandedTaskInputResponse(taskGraphClientResponse, depGraph
|
|
|
613
613
|
perf_hooks_1.performance.measure('task input static generation', 'task input static generation:start', 'task input static generation:end');
|
|
614
614
|
return response;
|
|
615
615
|
}
|
|
616
|
-
function getAllTaskGraphsForWorkspace(
|
|
617
|
-
const defaultDependencyConfigs = (0, create_task_graph_1.mapTargetDefaultsToDependencies)(nxJson.targetDefaults);
|
|
616
|
+
function getAllTaskGraphsForWorkspace(projectGraph) {
|
|
618
617
|
const taskGraphs = {};
|
|
619
618
|
const taskGraphErrors = {};
|
|
620
619
|
// TODO(cammisuli): improve performance here. Cache results or something.
|
|
@@ -624,7 +623,7 @@ function getAllTaskGraphsForWorkspace(nxJson, projectGraph) {
|
|
|
624
623
|
targets.forEach((target) => {
|
|
625
624
|
const taskId = createTaskId(projectName, target);
|
|
626
625
|
try {
|
|
627
|
-
taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(projectGraph,
|
|
626
|
+
taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(projectGraph, {}, [projectName], [target], undefined, {});
|
|
628
627
|
}
|
|
629
628
|
catch (err) {
|
|
630
629
|
taskGraphs[taskId] = {
|
|
@@ -639,7 +638,7 @@ function getAllTaskGraphsForWorkspace(nxJson, projectGraph) {
|
|
|
639
638
|
configurations.forEach((configuration) => {
|
|
640
639
|
const taskId = createTaskId(projectName, target, configuration);
|
|
641
640
|
try {
|
|
642
|
-
taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(projectGraph,
|
|
641
|
+
taskGraphs[taskId] = (0, create_task_graph_1.createTaskGraph)(projectGraph, {}, [projectName], [target], configuration, {});
|
|
643
642
|
}
|
|
644
643
|
catch (err) {
|
|
645
644
|
taskGraphs[taskId] = {
|
|
@@ -771,9 +770,7 @@ async function createJsonOutput(prunedGraph, rawGraph, projects, targets) {
|
|
|
771
770
|
graph: prunedGraph,
|
|
772
771
|
};
|
|
773
772
|
if (targets?.length) {
|
|
774
|
-
const
|
|
775
|
-
const defaultDependencyConfigs = (0, create_task_graph_1.mapTargetDefaultsToDependencies)(nxJson.targetDefaults);
|
|
776
|
-
const taskGraph = (0, create_task_graph_1.createTaskGraph)(rawGraph, defaultDependencyConfigs, projects, targets, undefined, {});
|
|
773
|
+
const taskGraph = (0, create_task_graph_1.createTaskGraph)(rawGraph, {}, projects, targets, undefined, {});
|
|
777
774
|
const hasher = (0, create_task_hasher_1.createTaskHasher)(rawGraph, (0, configuration_1.readNxJson)());
|
|
778
775
|
let tasks = Object.values(taskGraph.tasks);
|
|
779
776
|
const hashes = await hasher.hashTasks(tasks, taskGraph);
|
|
@@ -801,6 +798,6 @@ function getHelpTextFromTarget(projectName, targetName) {
|
|
|
801
798
|
throw new Error(`No help command found for ${projectName}:${targetName}`);
|
|
802
799
|
return (0, node_child_process_1.execSync)(command, {
|
|
803
800
|
cwd: target.options?.cwd ?? workspace_root_1.workspaceRoot,
|
|
804
|
-
windowsHide:
|
|
801
|
+
windowsHide: false,
|
|
805
802
|
}).toString();
|
|
806
803
|
}
|