@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,192 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
export class ExternalObject<T> {
|
|
7
|
+
readonly '': {
|
|
8
|
+
readonly '': unique symbol
|
|
9
|
+
[K: symbol]: T
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Expands the given entries into a list of existing directories and files.
|
|
14
|
+
* This is used for copying outputs to and from the cache
|
|
15
|
+
*/
|
|
16
|
+
export function expandOutputs(directory: string, entries: Array<string>): Array<string>
|
|
17
|
+
/**
|
|
18
|
+
* Expands the given outputs into a list of existing files.
|
|
19
|
+
* This is used when hashing outputs
|
|
20
|
+
*/
|
|
21
|
+
export function getFilesForOutputs(directory: string, entries: Array<string>): Array<string>
|
|
22
|
+
export function remove(src: string): void
|
|
23
|
+
export function copy(src: string, dest: string): void
|
|
24
|
+
export function runCommand(command: string, commandDir?: string | undefined | null, jsEnv?: Record<string, string> | undefined | null, quiet?: boolean | undefined | null): ChildProcess
|
|
25
|
+
/**
|
|
26
|
+
* This allows us to run a pseudoterminal with a fake node ipc channel
|
|
27
|
+
* this makes it possible to be backwards compatible with the old implementation
|
|
28
|
+
*/
|
|
29
|
+
export function nxFork(id: string, forkScript: string, psuedoIpcPath: string, commandDir: string | undefined | null, jsEnv: Record<string, string> | undefined | null, quiet: boolean): ChildProcess
|
|
30
|
+
export function hashArray(input: Array<string>): string
|
|
31
|
+
export function hashFile(file: string): string | null
|
|
32
|
+
export function findImports(projectFileMap: Record<string, Array<string>>): Array<ImportResult>
|
|
33
|
+
/**
|
|
34
|
+
* Transfer the project graph from the JS world to the Rust world, so that we can pass the project graph via memory quicker
|
|
35
|
+
* This wont be needed once the project graph is created in Rust
|
|
36
|
+
*/
|
|
37
|
+
export function transferProjectGraph(projectGraph: ProjectGraph): ExternalObject<ProjectGraph>
|
|
38
|
+
export interface ExternalNodeData {
|
|
39
|
+
version: string
|
|
40
|
+
hash?: string
|
|
41
|
+
}
|
|
42
|
+
export interface ExternalNode {
|
|
43
|
+
version: string
|
|
44
|
+
hash?: string
|
|
45
|
+
}
|
|
46
|
+
export interface Target {
|
|
47
|
+
executor?: string
|
|
48
|
+
inputs?: Array<JsInputs>
|
|
49
|
+
outputs?: Array<string>
|
|
50
|
+
options?: string
|
|
51
|
+
configurations?: string
|
|
52
|
+
}
|
|
53
|
+
export interface Project {
|
|
54
|
+
root: string
|
|
55
|
+
namedInputs?: Record<string, Array<JsInputs>>
|
|
56
|
+
tags?: Array<string>
|
|
57
|
+
targets: Record<string, Target>
|
|
58
|
+
}
|
|
59
|
+
export interface ProjectGraph {
|
|
60
|
+
nodes: Record<string, Project>
|
|
61
|
+
dependencies: Record<string, Array<string>>
|
|
62
|
+
externalNodes: Record<string, ExternalNode>
|
|
63
|
+
}
|
|
64
|
+
export interface HashDetails {
|
|
65
|
+
value: string
|
|
66
|
+
details: Record<string, string>
|
|
67
|
+
}
|
|
68
|
+
export interface HasherOptions {
|
|
69
|
+
selectivelyHashTsConfig: boolean
|
|
70
|
+
}
|
|
71
|
+
export interface Task {
|
|
72
|
+
id: string
|
|
73
|
+
target: TaskTarget
|
|
74
|
+
outputs: Array<string>
|
|
75
|
+
projectRoot?: string
|
|
76
|
+
}
|
|
77
|
+
export interface TaskTarget {
|
|
78
|
+
project: string
|
|
79
|
+
target: string
|
|
80
|
+
configuration?: string
|
|
81
|
+
}
|
|
82
|
+
export interface TaskGraph {
|
|
83
|
+
roots: Array<string>
|
|
84
|
+
tasks: Record<string, Task>
|
|
85
|
+
dependencies: Record<string, Array<string>>
|
|
86
|
+
}
|
|
87
|
+
export interface FileData {
|
|
88
|
+
file: string
|
|
89
|
+
hash: string
|
|
90
|
+
}
|
|
91
|
+
export interface InputsInput {
|
|
92
|
+
input: string
|
|
93
|
+
dependencies?: boolean
|
|
94
|
+
projects?: string | Array<string>
|
|
95
|
+
}
|
|
96
|
+
export interface FileSetInput {
|
|
97
|
+
fileset: string
|
|
98
|
+
}
|
|
99
|
+
export interface RuntimeInput {
|
|
100
|
+
runtime: string
|
|
101
|
+
}
|
|
102
|
+
export interface EnvironmentInput {
|
|
103
|
+
env: string
|
|
104
|
+
}
|
|
105
|
+
export interface ExternalDependenciesInput {
|
|
106
|
+
externalDependencies: Array<string>
|
|
107
|
+
}
|
|
108
|
+
export interface DepsOutputsInput {
|
|
109
|
+
dependentTasksOutputFiles: string
|
|
110
|
+
transitive?: boolean
|
|
111
|
+
}
|
|
112
|
+
/** Stripped version of the NxJson interface for use in rust */
|
|
113
|
+
export interface NxJson {
|
|
114
|
+
namedInputs?: Record<string, Array<JsInputs>>
|
|
115
|
+
}
|
|
116
|
+
export const enum EventType {
|
|
117
|
+
delete = 'delete',
|
|
118
|
+
update = 'update',
|
|
119
|
+
create = 'create'
|
|
120
|
+
}
|
|
121
|
+
export interface WatchEvent {
|
|
122
|
+
path: string
|
|
123
|
+
type: EventType
|
|
124
|
+
}
|
|
125
|
+
/** Public NAPI error codes that are for Node */
|
|
126
|
+
export const enum WorkspaceErrors {
|
|
127
|
+
ParseError = 'ParseError',
|
|
128
|
+
Generic = 'Generic'
|
|
129
|
+
}
|
|
130
|
+
export interface NxWorkspaceFiles {
|
|
131
|
+
projectFileMap: ProjectFiles
|
|
132
|
+
globalFiles: Array<FileData>
|
|
133
|
+
externalReferences?: NxWorkspaceFilesExternals
|
|
134
|
+
}
|
|
135
|
+
export interface NxWorkspaceFilesExternals {
|
|
136
|
+
projectFiles: ExternalObject<ProjectFiles>
|
|
137
|
+
globalFiles: ExternalObject<Array<FileData>>
|
|
138
|
+
allWorkspaceFiles: ExternalObject<Array<FileData>>
|
|
139
|
+
}
|
|
140
|
+
export interface UpdatedWorkspaceFiles {
|
|
141
|
+
fileMap: FileMap
|
|
142
|
+
externalReferences: NxWorkspaceFilesExternals
|
|
143
|
+
}
|
|
144
|
+
export interface FileMap {
|
|
145
|
+
projectFileMap: ProjectFiles
|
|
146
|
+
nonProjectFiles: Array<FileData>
|
|
147
|
+
}
|
|
148
|
+
export function testOnlyTransferFileMap(projectFiles: Record<string, Array<FileData>>, nonProjectFiles: Array<FileData>): NxWorkspaceFilesExternals
|
|
149
|
+
export class ChildProcess {
|
|
150
|
+
kill(): void
|
|
151
|
+
onExit(callback: (message: string) => void): void
|
|
152
|
+
onOutput(callback: (message: string) => void): void
|
|
153
|
+
}
|
|
154
|
+
export class ImportResult {
|
|
155
|
+
file: string
|
|
156
|
+
sourceProject: string
|
|
157
|
+
dynamicImportExpressions: Array<string>
|
|
158
|
+
staticImportExpressions: Array<string>
|
|
159
|
+
}
|
|
160
|
+
export class HashPlanner {
|
|
161
|
+
constructor(nxJson: NxJson, projectGraph: ExternalObject<ProjectGraph>)
|
|
162
|
+
getPlans(taskIds: Array<string>, taskGraph: TaskGraph): Record<string, string[]>
|
|
163
|
+
getPlansReference(taskIds: Array<string>, taskGraph: TaskGraph): JsExternal
|
|
164
|
+
}
|
|
165
|
+
export class TaskHasher {
|
|
166
|
+
constructor(workspaceRoot: string, projectGraph: ExternalObject<ProjectGraph>, projectFileMap: ExternalObject<ProjectFiles>, allWorkspaceFiles: ExternalObject<Array<FileData>>, tsConfig: Buffer, tsConfigPaths: Record<string, Array<string>>, options?: HasherOptions | undefined | null)
|
|
167
|
+
hashPlans(hashPlans: ExternalObject<Record<string, Array<HashInstruction>>>, jsEnv: Record<string, string>): NapiDashMap
|
|
168
|
+
}
|
|
169
|
+
export class Watcher {
|
|
170
|
+
origin: string
|
|
171
|
+
/**
|
|
172
|
+
* Creates a new Watcher instance.
|
|
173
|
+
* Will always ignore the following directories:
|
|
174
|
+
* * .git/
|
|
175
|
+
* * node_modules/
|
|
176
|
+
* * .nx/
|
|
177
|
+
*/
|
|
178
|
+
constructor(origin: string, additionalGlobs?: Array<string> | undefined | null, useIgnore?: boolean | undefined | null)
|
|
179
|
+
watch(callback: (err: string | null, events: WatchEvent[]) => void): void
|
|
180
|
+
stop(): Promise<void>
|
|
181
|
+
}
|
|
182
|
+
export class WorkspaceContext {
|
|
183
|
+
workspaceRoot: string
|
|
184
|
+
constructor(workspaceRoot: string, cacheDir: string)
|
|
185
|
+
getWorkspaceFiles(projectRootMap: Record<string, string>): NxWorkspaceFiles
|
|
186
|
+
glob(globs: Array<string>, exclude?: Array<string> | undefined | null): Array<string>
|
|
187
|
+
hashFilesMatchingGlob(globs: Array<string>, exclude?: Array<string> | undefined | null): string
|
|
188
|
+
incrementalUpdate(updatedFiles: Array<string>, deletedFiles: Array<string>): Record<string, string>
|
|
189
|
+
updateProjectFiles(projectRootMappings: ProjectRootMappings, projectFiles: ExternalObject<ProjectFiles>, globalFiles: ExternalObject<Array<FileData>>, updatedFiles: Record<string, string>, deletedFiles: Array<string>): UpdatedWorkspaceFiles
|
|
190
|
+
allFileData(): Array<FileData>
|
|
191
|
+
getFilesInDirectory(directory: string): Array<string>
|
|
192
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
const { existsSync, readFileSync } = require('fs')
|
|
2
|
+
const { join } = require('path')
|
|
3
|
+
|
|
4
|
+
const { platform, arch } = process
|
|
5
|
+
|
|
6
|
+
let nativeBinding = null
|
|
7
|
+
let localFileExisted = false
|
|
8
|
+
let loadError = null
|
|
9
|
+
|
|
10
|
+
function isMusl() {
|
|
11
|
+
// For Node 10
|
|
12
|
+
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
13
|
+
try {
|
|
14
|
+
const lddPath = require('child_process').execSync('which ldd').toString().trim();
|
|
15
|
+
return readFileSync(lddPath, 'utf8').includes('musl')
|
|
16
|
+
} catch (e) {
|
|
17
|
+
return true
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
const { glibcVersionRuntime } = process.report.getReport().header
|
|
21
|
+
return !glibcVersionRuntime
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
switch (platform) {
|
|
26
|
+
case 'android':
|
|
27
|
+
switch (arch) {
|
|
28
|
+
case 'arm64':
|
|
29
|
+
localFileExisted = existsSync(join(__dirname, 'nx.android-arm64.node'))
|
|
30
|
+
try {
|
|
31
|
+
if (localFileExisted) {
|
|
32
|
+
nativeBinding = require('./nx.android-arm64.node')
|
|
33
|
+
} else {
|
|
34
|
+
nativeBinding = require('@nx/nx-android-arm64')
|
|
35
|
+
}
|
|
36
|
+
} catch (e) {
|
|
37
|
+
loadError = e
|
|
38
|
+
}
|
|
39
|
+
break
|
|
40
|
+
case 'arm':
|
|
41
|
+
localFileExisted = existsSync(join(__dirname, 'nx.android-arm-eabi.node'))
|
|
42
|
+
try {
|
|
43
|
+
if (localFileExisted) {
|
|
44
|
+
nativeBinding = require('./nx.android-arm-eabi.node')
|
|
45
|
+
} else {
|
|
46
|
+
nativeBinding = require('@nx/nx-android-arm-eabi')
|
|
47
|
+
}
|
|
48
|
+
} catch (e) {
|
|
49
|
+
loadError = e
|
|
50
|
+
}
|
|
51
|
+
break
|
|
52
|
+
default:
|
|
53
|
+
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
54
|
+
}
|
|
55
|
+
break
|
|
56
|
+
case 'win32':
|
|
57
|
+
switch (arch) {
|
|
58
|
+
case 'x64':
|
|
59
|
+
localFileExisted = existsSync(
|
|
60
|
+
join(__dirname, 'nx.win32-x64-msvc.node')
|
|
61
|
+
)
|
|
62
|
+
try {
|
|
63
|
+
if (localFileExisted) {
|
|
64
|
+
nativeBinding = require('./nx.win32-x64-msvc.node')
|
|
65
|
+
} else {
|
|
66
|
+
nativeBinding = require('@nx/nx-win32-x64-msvc')
|
|
67
|
+
}
|
|
68
|
+
} catch (e) {
|
|
69
|
+
loadError = e
|
|
70
|
+
}
|
|
71
|
+
break
|
|
72
|
+
case 'ia32':
|
|
73
|
+
localFileExisted = existsSync(
|
|
74
|
+
join(__dirname, 'nx.win32-ia32-msvc.node')
|
|
75
|
+
)
|
|
76
|
+
try {
|
|
77
|
+
if (localFileExisted) {
|
|
78
|
+
nativeBinding = require('./nx.win32-ia32-msvc.node')
|
|
79
|
+
} else {
|
|
80
|
+
nativeBinding = require('@nx/nx-win32-ia32-msvc')
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {
|
|
83
|
+
loadError = e
|
|
84
|
+
}
|
|
85
|
+
break
|
|
86
|
+
case 'arm64':
|
|
87
|
+
localFileExisted = existsSync(
|
|
88
|
+
join(__dirname, 'nx.win32-arm64-msvc.node')
|
|
89
|
+
)
|
|
90
|
+
try {
|
|
91
|
+
if (localFileExisted) {
|
|
92
|
+
nativeBinding = require('./nx.win32-arm64-msvc.node')
|
|
93
|
+
} else {
|
|
94
|
+
nativeBinding = require('@nx/nx-win32-arm64-msvc')
|
|
95
|
+
}
|
|
96
|
+
} catch (e) {
|
|
97
|
+
loadError = e
|
|
98
|
+
}
|
|
99
|
+
break
|
|
100
|
+
default:
|
|
101
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
102
|
+
}
|
|
103
|
+
break
|
|
104
|
+
case 'darwin':
|
|
105
|
+
localFileExisted = existsSync(join(__dirname, 'nx.darwin-universal.node'))
|
|
106
|
+
try {
|
|
107
|
+
if (localFileExisted) {
|
|
108
|
+
nativeBinding = require('./nx.darwin-universal.node')
|
|
109
|
+
} else {
|
|
110
|
+
nativeBinding = require('@nx/nx-darwin-universal')
|
|
111
|
+
}
|
|
112
|
+
break
|
|
113
|
+
} catch {}
|
|
114
|
+
switch (arch) {
|
|
115
|
+
case 'x64':
|
|
116
|
+
localFileExisted = existsSync(join(__dirname, 'nx.darwin-x64.node'))
|
|
117
|
+
try {
|
|
118
|
+
if (localFileExisted) {
|
|
119
|
+
nativeBinding = require('./nx.darwin-x64.node')
|
|
120
|
+
} else {
|
|
121
|
+
nativeBinding = require('@nx/nx-darwin-x64')
|
|
122
|
+
}
|
|
123
|
+
} catch (e) {
|
|
124
|
+
loadError = e
|
|
125
|
+
}
|
|
126
|
+
break
|
|
127
|
+
case 'arm64':
|
|
128
|
+
localFileExisted = existsSync(
|
|
129
|
+
join(__dirname, 'nx.darwin-arm64.node')
|
|
130
|
+
)
|
|
131
|
+
try {
|
|
132
|
+
if (localFileExisted) {
|
|
133
|
+
nativeBinding = require('./nx.darwin-arm64.node')
|
|
134
|
+
} else {
|
|
135
|
+
nativeBinding = require('@nx/nx-darwin-arm64')
|
|
136
|
+
}
|
|
137
|
+
} catch (e) {
|
|
138
|
+
loadError = e
|
|
139
|
+
}
|
|
140
|
+
break
|
|
141
|
+
default:
|
|
142
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
143
|
+
}
|
|
144
|
+
break
|
|
145
|
+
case 'freebsd':
|
|
146
|
+
if (arch !== 'x64') {
|
|
147
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
148
|
+
}
|
|
149
|
+
localFileExisted = existsSync(join(__dirname, 'nx.freebsd-x64.node'))
|
|
150
|
+
try {
|
|
151
|
+
if (localFileExisted) {
|
|
152
|
+
nativeBinding = require('./nx.freebsd-x64.node')
|
|
153
|
+
} else {
|
|
154
|
+
nativeBinding = require('@nx/nx-freebsd-x64')
|
|
155
|
+
}
|
|
156
|
+
} catch (e) {
|
|
157
|
+
loadError = e
|
|
158
|
+
}
|
|
159
|
+
break
|
|
160
|
+
case 'linux':
|
|
161
|
+
switch (arch) {
|
|
162
|
+
case 'x64':
|
|
163
|
+
if (isMusl()) {
|
|
164
|
+
localFileExisted = existsSync(
|
|
165
|
+
join(__dirname, 'nx.linux-x64-musl.node')
|
|
166
|
+
)
|
|
167
|
+
try {
|
|
168
|
+
if (localFileExisted) {
|
|
169
|
+
nativeBinding = require('./nx.linux-x64-musl.node')
|
|
170
|
+
} else {
|
|
171
|
+
nativeBinding = require('@nx/nx-linux-x64-musl')
|
|
172
|
+
}
|
|
173
|
+
} catch (e) {
|
|
174
|
+
loadError = e
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
localFileExisted = existsSync(
|
|
178
|
+
join(__dirname, 'nx.linux-x64-gnu.node')
|
|
179
|
+
)
|
|
180
|
+
try {
|
|
181
|
+
if (localFileExisted) {
|
|
182
|
+
nativeBinding = require('./nx.linux-x64-gnu.node')
|
|
183
|
+
} else {
|
|
184
|
+
nativeBinding = require('@nx/nx-linux-x64-gnu')
|
|
185
|
+
}
|
|
186
|
+
} catch (e) {
|
|
187
|
+
loadError = e
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
break
|
|
191
|
+
case 'arm64':
|
|
192
|
+
if (isMusl()) {
|
|
193
|
+
localFileExisted = existsSync(
|
|
194
|
+
join(__dirname, 'nx.linux-arm64-musl.node')
|
|
195
|
+
)
|
|
196
|
+
try {
|
|
197
|
+
if (localFileExisted) {
|
|
198
|
+
nativeBinding = require('./nx.linux-arm64-musl.node')
|
|
199
|
+
} else {
|
|
200
|
+
nativeBinding = require('@nx/nx-linux-arm64-musl')
|
|
201
|
+
}
|
|
202
|
+
} catch (e) {
|
|
203
|
+
loadError = e
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
localFileExisted = existsSync(
|
|
207
|
+
join(__dirname, 'nx.linux-arm64-gnu.node')
|
|
208
|
+
)
|
|
209
|
+
try {
|
|
210
|
+
if (localFileExisted) {
|
|
211
|
+
nativeBinding = require('./nx.linux-arm64-gnu.node')
|
|
212
|
+
} else {
|
|
213
|
+
nativeBinding = require('@nx/nx-linux-arm64-gnu')
|
|
214
|
+
}
|
|
215
|
+
} catch (e) {
|
|
216
|
+
loadError = e
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
break
|
|
220
|
+
case 'arm':
|
|
221
|
+
localFileExisted = existsSync(
|
|
222
|
+
join(__dirname, 'nx.linux-arm-gnueabihf.node')
|
|
223
|
+
)
|
|
224
|
+
try {
|
|
225
|
+
if (localFileExisted) {
|
|
226
|
+
nativeBinding = require('./nx.linux-arm-gnueabihf.node')
|
|
227
|
+
} else {
|
|
228
|
+
nativeBinding = require('@nx/nx-linux-arm-gnueabihf')
|
|
229
|
+
}
|
|
230
|
+
} catch (e) {
|
|
231
|
+
loadError = e
|
|
232
|
+
}
|
|
233
|
+
break
|
|
234
|
+
default:
|
|
235
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
236
|
+
}
|
|
237
|
+
break
|
|
238
|
+
case 'openharmony':
|
|
239
|
+
switch (arch) {
|
|
240
|
+
case 'arm64':
|
|
241
|
+
localFileExisted = existsSync(
|
|
242
|
+
join(__dirname, 'nx.openharmony-arm64.node')
|
|
243
|
+
)
|
|
244
|
+
try {
|
|
245
|
+
if (localFileExisted) {
|
|
246
|
+
nativeBinding = require('./nx.openharmony-arm64.node')
|
|
247
|
+
} else {
|
|
248
|
+
nativeBinding = require('@ohos-ports/nx-openharmony-arm64')
|
|
249
|
+
}
|
|
250
|
+
} catch (e) {
|
|
251
|
+
loadError = e
|
|
252
|
+
}
|
|
253
|
+
break
|
|
254
|
+
default:
|
|
255
|
+
throw new Error(`Unsupported architecture on openharmony: ${arch}`)
|
|
256
|
+
}
|
|
257
|
+
break
|
|
258
|
+
default:
|
|
259
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (!nativeBinding) {
|
|
263
|
+
if (loadError) {
|
|
264
|
+
throw loadError
|
|
265
|
+
}
|
|
266
|
+
throw new Error(`Failed to load native binding`)
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const { expandOutputs, getFilesForOutputs, remove, copy, ChildProcess, runCommand, nxFork, hashArray, hashFile, ImportResult, findImports, transferProjectGraph, HashPlanner, TaskHasher, EventType, Watcher, WorkspaceContext, WorkspaceErrors, testOnlyTransferFileMap } = nativeBinding
|
|
270
|
+
|
|
271
|
+
module.exports.expandOutputs = expandOutputs
|
|
272
|
+
module.exports.getFilesForOutputs = getFilesForOutputs
|
|
273
|
+
module.exports.remove = remove
|
|
274
|
+
module.exports.copy = copy
|
|
275
|
+
module.exports.ChildProcess = ChildProcess
|
|
276
|
+
module.exports.runCommand = runCommand
|
|
277
|
+
module.exports.nxFork = nxFork
|
|
278
|
+
module.exports.hashArray = hashArray
|
|
279
|
+
module.exports.hashFile = hashFile
|
|
280
|
+
module.exports.ImportResult = ImportResult
|
|
281
|
+
module.exports.findImports = findImports
|
|
282
|
+
module.exports.transferProjectGraph = transferProjectGraph
|
|
283
|
+
module.exports.HashPlanner = HashPlanner
|
|
284
|
+
module.exports.TaskHasher = TaskHasher
|
|
285
|
+
module.exports.EventType = EventType
|
|
286
|
+
module.exports.Watcher = Watcher
|
|
287
|
+
module.exports.WorkspaceContext = WorkspaceContext
|
|
288
|
+
module.exports.WorkspaceErrors = WorkspaceErrors
|
|
289
|
+
module.exports.testOnlyTransferFileMap = testOnlyTransferFileMap
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformProjectGraphForRust = void 0;
|
|
4
|
+
function transformProjectGraphForRust(graph) {
|
|
5
|
+
const dependencies = {};
|
|
6
|
+
const nodes = {};
|
|
7
|
+
const externalNodes = {};
|
|
8
|
+
for (const [projectName, projectNode] of Object.entries(graph.nodes)) {
|
|
9
|
+
const targets = {};
|
|
10
|
+
for (const [targetName, targetConfig] of Object.entries(projectNode.data.targets ?? {})) {
|
|
11
|
+
targets[targetName] = {
|
|
12
|
+
executor: targetConfig.executor,
|
|
13
|
+
inputs: targetConfig.inputs,
|
|
14
|
+
outputs: targetConfig.outputs,
|
|
15
|
+
options: JSON.stringify(targetConfig.options),
|
|
16
|
+
configurations: JSON.stringify(targetConfig.configurations),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
nodes[projectName] = {
|
|
20
|
+
root: projectNode.data.root,
|
|
21
|
+
namedInputs: projectNode.data.namedInputs,
|
|
22
|
+
targets,
|
|
23
|
+
tags: projectNode.data.tags,
|
|
24
|
+
};
|
|
25
|
+
if (graph.dependencies[projectName]) {
|
|
26
|
+
dependencies[projectName] = [];
|
|
27
|
+
for (const dep of graph.dependencies[projectName]) {
|
|
28
|
+
dependencies[projectName].push(dep.target);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (const [projectName, externalNode] of Object.entries(graph.externalNodes ?? {})) {
|
|
33
|
+
externalNodes[projectName] = {
|
|
34
|
+
hash: externalNode.data.hash,
|
|
35
|
+
version: externalNode.data.version,
|
|
36
|
+
};
|
|
37
|
+
if (graph.dependencies[projectName]) {
|
|
38
|
+
dependencies[projectName] = [];
|
|
39
|
+
for (const dep of graph.dependencies[projectName]) {
|
|
40
|
+
dependencies[projectName].push(dep.target);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
nodes,
|
|
46
|
+
externalNodes,
|
|
47
|
+
dependencies,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.transformProjectGraphForRust = transformProjectGraphForRust;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function debugLog(...args: any[]): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.debugLog = void 0;
|
|
4
|
+
function debugLog(...args) {
|
|
5
|
+
if (process.env['NX_VERBOSE_LOGGING'] === 'true') {
|
|
6
|
+
console.log('[NX CLOUD]', ...args);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.debugLog = debugLog;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tree } from '../../../generators/tree';
|
|
2
|
+
interface ConnectToNxCloudOptions {
|
|
3
|
+
analytics: boolean;
|
|
4
|
+
installationSource: string;
|
|
5
|
+
hideFormatLogs?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function connectToNxCloud(tree: Tree, schema: ConnectToNxCloudOptions): Promise<() => void>;
|
|
8
|
+
export default connectToNxCloud;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectToNxCloud = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const node_url_1 = require("node:url");
|
|
6
|
+
const output_1 = require("../../../utils/output");
|
|
7
|
+
const json_1 = require("../../../generators/utils/json");
|
|
8
|
+
const nx_json_1 = require("../../../generators/utils/nx-json");
|
|
9
|
+
const format_changed_files_with_prettier_if_available_1 = require("../../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
|
10
|
+
function printCloudConnectionDisabledMessage() {
|
|
11
|
+
output_1.output.error({
|
|
12
|
+
title: `Connections to Nx Cloud are disabled for this workspace`,
|
|
13
|
+
bodyLines: [
|
|
14
|
+
`This was an intentional decision by someone on your team.`,
|
|
15
|
+
`Nx Cloud cannot and will not be enabled.`,
|
|
16
|
+
``,
|
|
17
|
+
`To allow connections to Nx Cloud again, remove the 'neverConnectToCloud'`,
|
|
18
|
+
`property in nx.json.`,
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function getRootPackageName(tree) {
|
|
23
|
+
let packageJson;
|
|
24
|
+
try {
|
|
25
|
+
packageJson = (0, json_1.readJson)(tree, 'package.json');
|
|
26
|
+
}
|
|
27
|
+
catch (e) { }
|
|
28
|
+
return packageJson?.name ?? 'my-workspace';
|
|
29
|
+
}
|
|
30
|
+
function removeTrailingSlash(apiUrl) {
|
|
31
|
+
return apiUrl[apiUrl.length - 1] === '/'
|
|
32
|
+
? apiUrl.substr(0, apiUrl.length - 1)
|
|
33
|
+
: apiUrl;
|
|
34
|
+
}
|
|
35
|
+
function getNxInitDate() {
|
|
36
|
+
try {
|
|
37
|
+
const nxInitIso = (0, child_process_1.execSync)('git log --diff-filter=A --follow --format=%aI -- nx.json | tail -1', { stdio: 'pipe' })
|
|
38
|
+
.toString()
|
|
39
|
+
.trim();
|
|
40
|
+
const nxInitDate = new Date(nxInitIso);
|
|
41
|
+
return nxInitDate.toISOString();
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function createNxCloudWorkspace(workspaceName, installationSource, nxInitDate) {
|
|
48
|
+
const apiUrl = removeTrailingSlash(process.env.NX_CLOUD_API || process.env.NRWL_API || `https://cloud.nx.app`);
|
|
49
|
+
const response = await require('axios').post(`${apiUrl}/nx-cloud/create-org-and-workspace`, {
|
|
50
|
+
workspaceName,
|
|
51
|
+
installationSource,
|
|
52
|
+
nxInitDate,
|
|
53
|
+
});
|
|
54
|
+
if (response.data.message) {
|
|
55
|
+
throw new Error(response.data.message);
|
|
56
|
+
}
|
|
57
|
+
return response.data;
|
|
58
|
+
}
|
|
59
|
+
function printSuccessMessage(url) {
|
|
60
|
+
let host = 'nx.app';
|
|
61
|
+
try {
|
|
62
|
+
host = new node_url_1.URL(url).host;
|
|
63
|
+
}
|
|
64
|
+
catch (e) { }
|
|
65
|
+
output_1.output.note({
|
|
66
|
+
title: `Remote caching via Nx Cloud has been enabled`,
|
|
67
|
+
bodyLines: [
|
|
68
|
+
`In addition to the caching, Nx Cloud provides config-free distributed execution,`,
|
|
69
|
+
`UI for viewing complex runs and GitHub integration. Learn more at https://nx.app`,
|
|
70
|
+
``,
|
|
71
|
+
`Your workspace is currently unclaimed. Run details from unclaimed workspaces can be viewed on ${host} by anyone`,
|
|
72
|
+
`with the link. Claim your workspace at the following link to restrict access.`,
|
|
73
|
+
``,
|
|
74
|
+
`${url}`,
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function addNxCloudOptionsToNxJson(tree, nxJson, token) {
|
|
79
|
+
nxJson ??= {
|
|
80
|
+
extends: 'nx/presets/npm.json',
|
|
81
|
+
};
|
|
82
|
+
nxJson.nxCloudAccessToken = token;
|
|
83
|
+
const overrideUrl = process.env.NX_CLOUD_API || process.env.NRWL_API;
|
|
84
|
+
if (overrideUrl) {
|
|
85
|
+
nxJson.nxCloudUrl = overrideUrl;
|
|
86
|
+
}
|
|
87
|
+
(0, nx_json_1.updateNxJson)(tree, nxJson);
|
|
88
|
+
}
|
|
89
|
+
async function connectToNxCloud(tree, schema) {
|
|
90
|
+
const nxJson = (0, nx_json_1.readNxJson)(tree);
|
|
91
|
+
if (nxJson?.neverConnectToCloud) {
|
|
92
|
+
return () => {
|
|
93
|
+
printCloudConnectionDisabledMessage();
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// TODO: Change to using loading light client when that is enabled by default
|
|
98
|
+
const r = await createNxCloudWorkspace(getRootPackageName(tree), schema.installationSource, getNxInitDate());
|
|
99
|
+
addNxCloudOptionsToNxJson(tree, nxJson, r.token);
|
|
100
|
+
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree, {
|
|
101
|
+
silent: schema.hideFormatLogs,
|
|
102
|
+
});
|
|
103
|
+
return () => printSuccessMessage(r.url);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.connectToNxCloud = connectToNxCloud;
|
|
107
|
+
exports.default = connectToNxCloud;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"id": "NxCloudInit",
|
|
4
|
+
"title": "Add Nx Cloud Configuration to the workspace",
|
|
5
|
+
"description": "Connect a workspace to Nx Cloud.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"cli": "nx",
|
|
8
|
+
"properties": {
|
|
9
|
+
"analytics": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"description": "Anonymously store hashed machine ID for task runs",
|
|
12
|
+
"default": false
|
|
13
|
+
},
|
|
14
|
+
"installationSource": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Name of Nx Cloud installation invoker (ex. user, add-nx-to-monorepo, create-nx-workspace, nx-upgrade",
|
|
17
|
+
"default": "user"
|
|
18
|
+
},
|
|
19
|
+
"hideFormatLogs": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "Hide formatting logs",
|
|
22
|
+
"x-priority": "internal"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": []
|
|
27
|
+
}
|