@ohos-ports/nx 19.8.4-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 +140 -0
- package/LICENSE +22 -0
- package/README.md +66 -0
- package/bin/init-local.d.ts +8 -0
- package/bin/init-local.js +183 -0
- package/bin/nx-cloud.d.ts +3 -0
- package/bin/nx-cloud.js +47 -0
- package/bin/nx.d.ts +2 -0
- package/bin/nx.js +226 -0
- package/bin/post-install.d.ts +1 -0
- package/bin/post-install.js +64 -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 +94 -0
- package/node_modules/@nrwl/tao/LICENSE +22 -0
- package/node_modules/@nrwl/tao/README.md +18 -0
- package/node_modules/@nrwl/tao/index.d.ts +1 -0
- package/node_modules/@nrwl/tao/index.js +7 -0
- package/node_modules/@nrwl/tao/package.json +41 -0
- package/node_modules/@nrwl/tao/src/commands/ngcli-adapter.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/commands/ngcli-adapter.js +5 -0
- package/node_modules/@nrwl/tao/src/shared/logger.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/shared/logger.js +5 -0
- package/node_modules/@nrwl/tao/src/shared/nx.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/shared/nx.js +5 -0
- package/node_modules/@nrwl/tao/src/shared/package-manager.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/shared/package-manager.js +5 -0
- package/node_modules/@nrwl/tao/src/shared/project-graph.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/shared/project-graph.js +5 -0
- package/node_modules/@nrwl/tao/src/shared/tree.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/shared/tree.js +5 -0
- package/node_modules/@nrwl/tao/src/utils/app-root.d.ts +1 -0
- package/node_modules/@nrwl/tao/src/utils/app-root.js +5 -0
- package/package.json +198 -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 +80 -0
- package/release/changelog-renderer/index.js +315 -0
- package/release/index.d.ts +4 -0
- package/release/index.js +12 -0
- package/schemas/nx-schema.json +819 -0
- package/schemas/project-schema.json +331 -0
- package/schemas/workspace-schema.json +185 -0
- package/src/adapter/angular-json.d.ts +10 -0
- package/src/adapter/angular-json.js +128 -0
- package/src/adapter/compat.d.ts +2 -0
- package/src/adapter/compat.js +143 -0
- package/src/adapter/decorate-cli.d.ts +1 -0
- package/src/adapter/decorate-cli.js +24 -0
- package/src/adapter/ngcli-adapter.d.ts +90 -0
- package/src/adapter/ngcli-adapter.js +854 -0
- package/src/adapter/rxjs-for-await.d.ts +109 -0
- package/src/adapter/rxjs-for-await.js +362 -0
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +2 -0
- package/src/command-line/activate-powerpack/activate-powerpack.js +34 -0
- package/src/command-line/activate-powerpack/command-object.d.ts +6 -0
- package/src/command-line/activate-powerpack/command-object.js +26 -0
- package/src/command-line/add/add.d.ts +3 -0
- package/src/command-line/add/add.js +150 -0
- package/src/command-line/add/command-object.d.ts +8 -0
- package/src/command-line/add/command-object.js +27 -0
- package/src/command-line/affected/affected.d.ts +10 -0
- package/src/command-line/affected/affected.js +88 -0
- package/src/command-line/affected/command-object.d.ts +6 -0
- package/src/command-line/affected/command-object.js +82 -0
- package/src/command-line/connect/command-object.d.ts +3 -0
- package/src/command-line/connect/command-object.js +32 -0
- package/src/command-line/connect/connect-to-nx-cloud.d.ts +12 -0
- package/src/command-line/connect/connect-to-nx-cloud.js +149 -0
- package/src/command-line/connect/view-logs.d.ts +1 -0
- package/src/command-line/connect/view-logs.js +55 -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 +26 -0
- package/src/command-line/deprecated/command-objects.d.ts +9 -0
- package/src/command-line/deprecated/command-objects.js +48 -0
- package/src/command-line/examples.d.ts +5 -0
- package/src/command-line/examples.js +379 -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 +142 -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 +195 -0
- package/src/command-line/generate/command-object.d.ts +2 -0
- package/src/command-line/generate/command-object.js +67 -0
- package/src/command-line/generate/generate.d.ts +21 -0
- package/src/command-line/generate/generate.js +262 -0
- package/src/command-line/generate/generator-utils.d.ts +18 -0
- package/src/command-line/generate/generator-utils.js +86 -0
- package/src/command-line/graph/command-object.d.ts +25 -0
- package/src/command-line/graph/command-object.js +75 -0
- package/src/command-line/graph/graph.d.ts +68 -0
- package/src/command-line/graph/graph.js +806 -0
- package/src/command-line/import/command-object.d.ts +2 -0
- package/src/command-line/import/command-object.js +44 -0
- package/src/command-line/import/import.d.ts +25 -0
- package/src/command-line/import/import.js +328 -0
- package/src/command-line/import/utils/merge-remote-source.d.ts +2 -0
- package/src/command-line/import/utils/merge-remote-source.js +14 -0
- package/src/command-line/import/utils/needs-install.d.ts +3 -0
- package/src/command-line/import/utils/needs-install.js +31 -0
- package/src/command-line/import/utils/prepare-source-repo.d.ts +2 -0
- package/src/command-line/import/utils/prepare-source-repo.js +27 -0
- package/src/command-line/init/command-object.d.ts +2 -0
- package/src/command-line/init/command-object.js +83 -0
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +6 -0
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +130 -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 +345 -0
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +6 -0
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +72 -0
- package/src/command-line/init/implementation/angular/index.d.ts +2 -0
- package/src/command-line/init/implementation/angular/index.js +125 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.d.ts +1 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.js +12 -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 +122 -0
- package/src/command-line/init/implementation/angular/standalone-workspace.d.ts +1 -0
- package/src/command-line/init/implementation/angular/standalone-workspace.js +175 -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 +8 -0
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +106 -0
- package/src/command-line/init/implementation/dot-nx/nxw.d.ts +1 -0
- package/src/command-line/init/implementation/dot-nx/nxw.js +117 -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 +21 -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 +18 -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 +17 -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 +20 -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 +30 -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 +16 -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 +22 -0
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts +1 -0
- package/src/command-line/init/implementation/react/tsconfig-setup.js +108 -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 +61 -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 +37 -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 +24 -0
- package/src/command-line/init/implementation/utils.d.ts +16 -0
- package/src/command-line/init/implementation/utils.js +205 -0
- package/src/command-line/init/init-v1.d.ts +11 -0
- package/src/command-line/init/init-v1.js +130 -0
- package/src/command-line/init/init-v2.d.ts +14 -0
- package/src/command-line/init/init-v2.js +239 -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 +44 -0
- package/src/command-line/login/command-object.d.ts +2 -0
- package/src/command-line/login/command-object.js +16 -0
- package/src/command-line/login/login.d.ts +5 -0
- package/src/command-line/login/login.js +16 -0
- package/src/command-line/logout/command-object.d.ts +2 -0
- package/src/command-line/logout/command-object.js +12 -0
- package/src/command-line/logout/logout.d.ts +4 -0
- package/src/command-line/logout/logout.js +13 -0
- package/src/command-line/migrate/command-object.d.ts +3 -0
- package/src/command-line/migrate/command-object.js +171 -0
- package/src/command-line/migrate/migrate.d.ts +114 -0
- package/src/command-line/migrate/migrate.js +1110 -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 +128 -0
- package/src/command-line/release/changelog.d.ts +34 -0
- package/src/command-line/release/changelog.js +997 -0
- package/src/command-line/release/command-object.d.ts +69 -0
- package/src/command-line/release/command-object.js +297 -0
- package/src/command-line/release/config/config.d.ts +54 -0
- package/src/command-line/release/config/config.js +864 -0
- package/src/command-line/release/config/conventional-commits.d.ts +2 -0
- package/src/command-line/release/config/conventional-commits.js +98 -0
- package/src/command-line/release/config/deep-merge-json.d.ts +1 -0
- package/src/command-line/release/config/deep-merge-json.js +28 -0
- package/src/command-line/release/config/filter-release-groups.d.ts +15 -0
- package/src/command-line/release/config/filter-release-groups.js +150 -0
- package/src/command-line/release/config/version-plans.d.ts +42 -0
- package/src/command-line/release/config/version-plans.js +220 -0
- package/src/command-line/release/index.d.ts +30 -0
- package/src/command-line/release/index.js +37 -0
- package/src/command-line/release/plan-check.d.ts +4 -0
- package/src/command-line/release/plan-check.js +169 -0
- package/src/command-line/release/plan.d.ts +4 -0
- package/src/command-line/release/plan.js +259 -0
- package/src/command-line/release/publish.d.ts +4 -0
- package/src/command-line/release/publish.js +164 -0
- package/src/command-line/release/release.d.ts +5 -0
- package/src/command-line/release/release.js +242 -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 +36 -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/generate-version-plan-content.d.ts +1 -0
- package/src/command-line/release/utils/generate-version-plan-content.js +20 -0
- package/src/command-line/release/utils/get-touched-projects-for-group.d.ts +7 -0
- package/src/command-line/release/utils/get-touched-projects-for-group.js +78 -0
- package/src/command-line/release/utils/git.d.ts +67 -0
- package/src/command-line/release/utils/git.js +407 -0
- package/src/command-line/release/utils/github.d.ts +31 -0
- package/src/command-line/release/utils/github.js +322 -0
- package/src/command-line/release/utils/launch-editor.d.ts +1 -0
- package/src/command-line/release/utils/launch-editor.js +46 -0
- package/src/command-line/release/utils/markdown.d.ts +6 -0
- package/src/command-line/release/utils/markdown.js +28 -0
- package/src/command-line/release/utils/print-changes.d.ts +6 -0
- package/src/command-line/release/utils/print-changes.js +61 -0
- package/src/command-line/release/utils/print-config.d.ts +7 -0
- package/src/command-line/release/utils/print-config.js +36 -0
- package/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -0
- package/src/command-line/release/utils/resolve-changelog-renderer.js +30 -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 +4 -0
- package/src/command-line/release/utils/resolve-semver-specifier.js +57 -0
- package/src/command-line/release/utils/semver.d.ts +11 -0
- package/src/command-line/release/utils/semver.js +58 -0
- package/src/command-line/release/utils/shared.d.ts +53 -0
- package/src/command-line/release/utils/shared.js +219 -0
- package/src/command-line/release/version.d.ts +60 -0
- package/src/command-line/release/version.js +463 -0
- package/src/command-line/repair/command-object.d.ts +2 -0
- package/src/command-line/repair/command-object.js +20 -0
- package/src/command-line/repair/repair.d.ts +3 -0
- package/src/command-line/repair/repair.js +36 -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 +57 -0
- package/src/command-line/report/report.js +303 -0
- package/src/command-line/reset/command-object.d.ts +8 -0
- package/src/command-line/reset/command-object.js +26 -0
- package/src/command-line/reset/reset.d.ts +2 -0
- package/src/command-line/reset/reset.js +131 -0
- package/src/command-line/run/command-object.d.ts +6 -0
- package/src/command-line/run/command-object.js +42 -0
- package/src/command-line/run/executor-utils.d.ts +7 -0
- package/src/command-line/run/executor-utils.js +86 -0
- package/src/command-line/run/run-one.d.ts +7 -0
- package/src/command-line/run/run-one.js +116 -0
- package/src/command-line/run/run.d.ts +51 -0
- package/src/command-line/run/run.js +179 -0
- package/src/command-line/run-many/command-object.d.ts +2 -0
- package/src/command-line/run-many/command-object.js +17 -0
- package/src/command-line/run-many/run-many.d.ts +10 -0
- package/src/command-line/run-many/run-many.js +92 -0
- package/src/command-line/show/command-object.d.ts +26 -0
- package/src/command-line/show/command-object.js +115 -0
- package/src/command-line/show/project.d.ts +2 -0
- package/src/command-line/show/project.js +60 -0
- package/src/command-line/show/projects.d.ts +2 -0
- package/src/command-line/show/projects.js +77 -0
- package/src/command-line/sync/command-object.d.ts +6 -0
- package/src/command-line/sync/command-object.js +20 -0
- package/src/command-line/sync/sync.d.ts +6 -0
- package/src/command-line/sync/sync.js +114 -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 +173 -0
- package/src/command-line/yargs-utils/documentation.d.ts +2 -0
- package/src/command-line/yargs-utils/documentation.js +11 -0
- package/src/command-line/yargs-utils/shared-options.d.ts +75 -0
- package/src/command-line/yargs-utils/shared-options.js +253 -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 +67 -0
- package/src/commands-runner/get-command-projects.d.ts +3 -0
- package/src/commands-runner/get-command-projects.js +18 -0
- package/src/config/calculate-default-project-name.d.ts +4 -0
- package/src/config/calculate-default-project-name.js +41 -0
- package/src/config/configuration.d.ts +8 -0
- package/src/config/configuration.js +17 -0
- package/src/config/misc-interfaces.d.ts +212 -0
- package/src/config/misc-interfaces.js +2 -0
- package/src/config/nx-json.d.ts +479 -0
- package/src/config/nx-json.js +39 -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 +58 -0
- package/src/config/task-graph.d.ts +104 -0
- package/src/config/task-graph.js +2 -0
- package/src/config/to-project-name.d.ts +5 -0
- package/src/config/to-project-name.js +12 -0
- package/src/config/workspace-json-project-json.d.ts +225 -0
- package/src/config/workspace-json-project-json.js +2 -0
- package/src/core/graph/environment.js +1 -0
- package/src/core/graph/favicon.ico +0 -0
- package/src/core/graph/index.html +30 -0
- package/src/core/graph/main.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 +68 -0
- package/src/daemon/client/client.d.ts +72 -0
- package/src/daemon/client/client.js +505 -0
- package/src/daemon/client/daemon-socket-messenger.d.ts +12 -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/is-on-daemon.d.ts +1 -0
- package/src/daemon/is-on-daemon.js +6 -0
- package/src/daemon/message-types/flush-sync-generator-changes-to-disk.d.ts +6 -0
- package/src/daemon/message-types/flush-sync-generator-changes-to-disk.js +11 -0
- package/src/daemon/message-types/force-shutdown.d.ts +5 -0
- package/src/daemon/message-types/force-shutdown.js +11 -0
- package/src/daemon/message-types/get-context-file-data.d.ts +5 -0
- package/src/daemon/message-types/get-context-file-data.js +11 -0
- package/src/daemon/message-types/get-files-in-directory.d.ts +6 -0
- package/src/daemon/message-types/get-files-in-directory.js +11 -0
- package/src/daemon/message-types/get-nx-workspace-files.d.ts +6 -0
- package/src/daemon/message-types/get-nx-workspace-files.js +11 -0
- package/src/daemon/message-types/get-registered-sync-generators.d.ts +5 -0
- package/src/daemon/message-types/get-registered-sync-generators.js +11 -0
- package/src/daemon/message-types/get-sync-generator-changes.d.ts +6 -0
- package/src/daemon/message-types/get-sync-generator-changes.js +11 -0
- package/src/daemon/message-types/glob.d.ts +7 -0
- package/src/daemon/message-types/glob.js +11 -0
- package/src/daemon/message-types/hash-glob.d.ts +7 -0
- package/src/daemon/message-types/hash-glob.js +11 -0
- package/src/daemon/message-types/task-history.d.ts +19 -0
- package/src/daemon/message-types/task-history.js +27 -0
- package/src/daemon/message-types/update-workspace-context.d.ts +8 -0
- package/src/daemon/message-types/update-workspace-context.js +11 -0
- package/src/daemon/server/file-watching/changed-projects.d.ts +10 -0
- package/src/daemon/server/file-watching/changed-projects.js +44 -0
- package/src/daemon/server/file-watching/file-watcher-sockets.d.ts +12 -0
- package/src/daemon/server/file-watching/file-watcher-sockets.js +66 -0
- package/src/daemon/server/handle-context-file-data.d.ts +2 -0
- package/src/daemon/server/handle-context-file-data.js +12 -0
- package/src/daemon/server/handle-flush-sync-generator-changes-to-disk.d.ts +2 -0
- package/src/daemon/server/handle-flush-sync-generator-changes-to-disk.js +11 -0
- package/src/daemon/server/handle-force-shutdown.d.ts +5 -0
- package/src/daemon/server/handle-force-shutdown.js +18 -0
- package/src/daemon/server/handle-get-files-in-directory.d.ts +2 -0
- package/src/daemon/server/handle-get-files-in-directory.js +12 -0
- package/src/daemon/server/handle-get-registered-sync-generators.d.ts +2 -0
- package/src/daemon/server/handle-get-registered-sync-generators.js +11 -0
- package/src/daemon/server/handle-get-sync-generator-changes.d.ts +2 -0
- package/src/daemon/server/handle-get-sync-generator-changes.js +19 -0
- package/src/daemon/server/handle-glob.d.ts +2 -0
- package/src/daemon/server/handle-glob.js +12 -0
- package/src/daemon/server/handle-hash-glob.d.ts +2 -0
- package/src/daemon/server/handle-hash-glob.js +12 -0
- package/src/daemon/server/handle-hash-tasks.d.ts +10 -0
- package/src/daemon/server/handle-hash-tasks.js +35 -0
- package/src/daemon/server/handle-nx-workspace-files.d.ts +2 -0
- package/src/daemon/server/handle-nx-workspace-files.js +12 -0
- package/src/daemon/server/handle-outputs-tracking.d.ts +15 -0
- package/src/daemon/server/handle-outputs-tracking.js +35 -0
- package/src/daemon/server/handle-process-in-background.d.ts +6 -0
- package/src/daemon/server/handle-process-in-background.js +32 -0
- package/src/daemon/server/handle-request-project-graph.d.ts +2 -0
- package/src/daemon/server/handle-request-project-graph.js +36 -0
- package/src/daemon/server/handle-request-shutdown.d.ts +5 -0
- package/src/daemon/server/handle-request-shutdown.js +27 -0
- package/src/daemon/server/handle-task-history.d.ts +13 -0
- package/src/daemon/server/handle-task-history.js +30 -0
- package/src/daemon/server/handle-update-workspace-context.d.ts +2 -0
- package/src/daemon/server/handle-update-workspace-context.js +11 -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 +93 -0
- package/src/daemon/server/plugins.d.ts +3 -0
- package/src/daemon/server/plugins.js +32 -0
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +24 -0
- package/src/daemon/server/project-graph-incremental-recomputation.js +300 -0
- package/src/daemon/server/server.d.ts +9 -0
- package/src/daemon/server/server.js +380 -0
- package/src/daemon/server/shutdown-utils.d.ts +17 -0
- package/src/daemon/server/shutdown-utils.js +89 -0
- package/src/daemon/server/start.d.ts +1 -0
- package/src/daemon/server/start.js +17 -0
- package/src/daemon/server/sync-generators.d.ts +13 -0
- package/src/daemon/server/sync-generators.js +357 -0
- package/src/daemon/server/watcher.d.ts +11 -0
- package/src/daemon/server/watcher.js +103 -0
- package/src/daemon/socket-utils.d.ts +12 -0
- package/src/daemon/socket-utils.js +55 -0
- package/src/daemon/tmp-dir.d.ts +12 -0
- package/src/daemon/tmp-dir.js +70 -0
- package/src/devkit-exports.d.ts +136 -0
- package/src/devkit-exports.js +142 -0
- package/src/devkit-internals.d.ts +26 -0
- package/src/devkit-internals.js +52 -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 +57 -0
- package/src/executors/run-commands/run-commands.impl.js +480 -0
- package/src/executors/run-commands/schema.json +184 -0
- package/src/executors/run-script/run-script.impl.d.ts +8 -0
- package/src/executors/run-script/run-script.impl.js +57 -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 +85 -0
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +14 -0
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +58 -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 +52 -0
- package/src/generators/testing-utils/create-tree.d.ts +5 -0
- package/src/generators/testing-utils/create-tree.js +10 -0
- package/src/generators/tree.d.ts +125 -0
- package/src/generators/tree.js +309 -0
- package/src/generators/utils/glob.d.ts +22 -0
- package/src/generators/utils/glob.js +51 -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 +58 -0
- package/src/generators/utils/project-configuration.d.ts +42 -0
- package/src/generators/utils/project-configuration.js +278 -0
- package/src/hasher/create-task-hasher.d.ts +4 -0
- package/src/hasher/create-task-hasher.js +15 -0
- package/src/hasher/file-hasher.d.ts +2 -0
- package/src/hasher/file-hasher.js +18 -0
- package/src/hasher/hash-task.d.ts +8 -0
- package/src/hasher/hash-task.js +85 -0
- package/src/hasher/native-task-hasher-impl.d.ts +18 -0
- package/src/hasher/native-task-hasher-impl.js +37 -0
- package/src/hasher/node-task-hasher-impl.d.ts +48 -0
- package/src/hasher/node-task-hasher-impl.js +449 -0
- package/src/hasher/task-hasher.d.ts +128 -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 +49 -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 +29 -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 +67 -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-2-0/move-default-base.d.ts +5 -0
- package/src/migrations/update-17-2-0/move-default-base.js +21 -0
- package/src/migrations/update-17-3-0/nx-release-path.d.ts +3 -0
- package/src/migrations/update-17-3-0/nx-release-path.js +47 -0
- package/src/migrations/update-17-3-0/update-nxw.d.ts +2 -0
- package/src/migrations/update-17-3-0/update-nxw.js +7 -0
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +2 -0
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +11 -0
- package/src/migrations/update-19-2-0/move-workspace-data-directory.d.ts +4 -0
- package/src/migrations/update-19-2-0/move-workspace-data-directory.js +33 -0
- package/src/migrations/update-19-2-4/set-project-name.d.ts +2 -0
- package/src/migrations/update-19-2-4/set-project-name.js +34 -0
- package/src/native/assert-supported-platform.d.ts +1 -0
- package/src/native/assert-supported-platform.js +38 -0
- package/src/native/browser.js +1 -0
- package/src/native/index.d.ts +282 -0
- package/src/native/index.js +94 -0
- package/src/native/native-bindings.js +405 -0
- package/src/native/native-file-cache-location.d.ts +1 -0
- package/src/native/native-file-cache-location.js +22 -0
- package/src/native/nx.openharmony-arm64.node +0 -0
- package/src/native/nx.wasi-browser.js +114 -0
- package/src/native/nx.wasi.cjs +145 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/native/transform-objects.d.ts +3 -0
- package/src/native/transform-objects.js +51 -0
- package/src/native/wasi-worker-browser.mjs +32 -0
- package/src/native/wasi-worker.mjs +63 -0
- package/src/nx-cloud/debug-logger.d.ts +1 -0
- package/src/nx-cloud/debug-logger.js +8 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +14 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +159 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +41 -0
- package/src/nx-cloud/models/onboarding-status.d.ts +1 -0
- package/src/nx-cloud/models/onboarding-status.js +2 -0
- package/src/nx-cloud/nx-cloud-tasks-runner-shell.d.ts +16 -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 +19 -0
- package/src/nx-cloud/update-manager.d.ts +19 -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/client.d.ts +10 -0
- package/src/nx-cloud/utilities/client.js +35 -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 +5 -0
- package/src/nx-cloud/utilities/get-cloud-options.js +23 -0
- package/src/nx-cloud/utilities/is-workspace-claimed.d.ts +1 -0
- package/src/nx-cloud/utilities/is-workspace-claimed.js +25 -0
- package/src/nx-cloud/utilities/onboarding.d.ts +5 -0
- package/src/nx-cloud/utilities/onboarding.js +28 -0
- package/src/nx-cloud/utilities/url-shorten.d.ts +10 -0
- package/src/nx-cloud/utilities/url-shorten.js +156 -0
- package/src/plugins/js/hasher/hasher.d.ts +5 -0
- package/src/plugins/js/hasher/hasher.js +51 -0
- package/src/plugins/js/index.d.ts +4 -0
- package/src/plugins/js/index.js +106 -0
- package/src/plugins/js/lock-file/lock-file.d.ts +34 -0
- package/src/plugins/js/lock-file/lock-file.js +211 -0
- package/src/plugins/js/lock-file/npm-parser.d.ts +7 -0
- package/src/plugins/js/lock-file/npm-parser.js +475 -0
- package/src/plugins/js/lock-file/pnpm-parser.d.ts +7 -0
- package/src/plugins/js/lock-file/pnpm-parser.js +466 -0
- package/src/plugins/js/lock-file/project-graph-pruning.d.ts +7 -0
- package/src/plugins/js/lock-file/project-graph-pruning.js +154 -0
- package/src/plugins/js/lock-file/utils/package-json.d.ts +10 -0
- package/src/plugins/js/lock-file/utils/package-json.js +33 -0
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +20 -0
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +854 -0
- package/src/plugins/js/lock-file/yarn-parser.d.ts +7 -0
- package/src/plugins/js/lock-file/yarn-parser.js +436 -0
- package/src/plugins/js/package-json/create-package-json.d.ts +29 -0
- package/src/plugins/js/package-json/create-package-json.js +247 -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 +28 -0
- package/src/plugins/js/project-graph/affected/npm-packages.d.ts +4 -0
- package/src/plugins/js/project-graph/affected/npm-packages.js +68 -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 +45 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +4 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +94 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.d.ts +4 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +88 -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 +155 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +59 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +296 -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 +31 -0
- package/src/plugins/js/utils/config.d.ts +2 -0
- package/src/plugins/js/utils/config.js +68 -0
- package/src/plugins/js/utils/register.d.ts +152 -0
- package/src/plugins/js/utils/register.js +343 -0
- package/src/plugins/js/utils/resolve-relative-to-dir.d.ts +5 -0
- package/src/plugins/js/utils/resolve-relative-to-dir.js +17 -0
- package/src/plugins/js/utils/typescript.d.ts +14 -0
- package/src/plugins/js/utils/typescript.js +97 -0
- package/src/plugins/js/versions.d.ts +1 -0
- package/src/plugins/js/versions.js +4 -0
- package/src/plugins/package-json/create-nodes.d.ts +20 -0
- package/src/plugins/package-json/create-nodes.js +187 -0
- package/src/plugins/package-json/index.d.ts +2 -0
- package/src/plugins/package-json/index.js +6 -0
- package/src/plugins/project-json/build-nodes/project-json.d.ts +6 -0
- package/src/plugins/project-json/build-nodes/project-json.js +45 -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 +82 -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 +3 -0
- package/src/project-graph/affected/locators/workspace-projects.js +74 -0
- package/src/project-graph/build-project-graph.d.ts +22 -0
- package/src/project-graph/build-project-graph.js +292 -0
- package/src/project-graph/error-types.d.ts +135 -0
- package/src/project-graph/error-types.js +305 -0
- package/src/project-graph/file-map-utils.d.ts +15 -0
- package/src/project-graph/file-map-utils.js +55 -0
- package/src/project-graph/file-utils.d.ts +30 -0
- package/src/project-graph/file-utils.js +179 -0
- package/src/project-graph/nx-deps-cache.d.ts +48 -0
- package/src/project-graph/nx-deps-cache.js +227 -0
- package/src/project-graph/operators.d.ts +12 -0
- package/src/project-graph/operators.js +114 -0
- package/src/project-graph/plugins/index.d.ts +3 -0
- package/src/project-graph/plugins/index.js +10 -0
- package/src/project-graph/plugins/internal-api.d.ts +29 -0
- package/src/project-graph/plugins/internal-api.js +134 -0
- package/src/project-graph/plugins/isolation/index.d.ts +3 -0
- package/src/project-graph/plugins/isolation/index.js +14 -0
- package/src/project-graph/plugins/isolation/messaging.d.ts +125 -0
- package/src/project-graph/plugins/isolation/messaging.js +46 -0
- package/src/project-graph/plugins/isolation/plugin-pool.d.ts +3 -0
- package/src/project-graph/plugins/isolation/plugin-pool.js +301 -0
- package/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -0
- package/src/project-graph/plugins/isolation/plugin-worker.js +158 -0
- package/src/project-graph/plugins/loader.d.ts +24 -0
- package/src/project-graph/plugins/loader.js +220 -0
- package/src/project-graph/plugins/public-api.d.ts +130 -0
- package/src/project-graph/plugins/public-api.js +4 -0
- package/src/project-graph/plugins/utils.d.ts +8 -0
- package/src/project-graph/plugins/utils.js +63 -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 +51 -0
- package/src/project-graph/project-graph.js +261 -0
- package/src/project-graph/utils/build-all-workspace-files.d.ts +2 -0
- package/src/project-graph/utils/build-all-workspace-files.js +14 -0
- package/src/project-graph/utils/find-project-for-path.d.ts +20 -0
- package/src/project-graph/utils/find-project-for-path.js +55 -0
- package/src/project-graph/utils/implicit-project-dependencies.d.ts +3 -0
- package/src/project-graph/utils/implicit-project-dependencies.js +18 -0
- package/src/project-graph/utils/normalize-project-nodes.d.ts +6 -0
- package/src/project-graph/utils/normalize-project-nodes.js +88 -0
- package/src/project-graph/utils/project-configuration-utils.d.ts +74 -0
- package/src/project-graph/utils/project-configuration-utils.js +781 -0
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +30 -0
- package/src/project-graph/utils/retrieve-workspace-files.js +88 -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 +64 -0
- package/src/tasks-runner/cache.js +399 -0
- package/src/tasks-runner/create-task-graph.d.ts +28 -0
- package/src/tasks-runner/create-task-graph.js +242 -0
- package/src/tasks-runner/default-tasks-runner.d.ts +26 -0
- package/src/tasks-runner/default-tasks-runner.js +62 -0
- package/src/tasks-runner/fork.d.ts +1 -0
- package/src/tasks-runner/fork.js +30 -0
- package/src/tasks-runner/forked-process-task-runner.d.ts +42 -0
- package/src/tasks-runner/forked-process-task-runner.js +405 -0
- package/src/tasks-runner/init-tasks-runner.d.ts +13 -0
- package/src/tasks-runner/init-tasks-runner.js +61 -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 +353 -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 +228 -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 +55 -0
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +13 -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 +73 -0
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +29 -0
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +106 -0
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +28 -0
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +97 -0
- package/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +17 -0
- package/src/tasks-runner/life-cycles/store-run-information-life-cycle.js +87 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +9 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +54 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +10 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +55 -0
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +14 -0
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.js +73 -0
- package/src/tasks-runner/life-cycles/task-results-life-cycle.d.ts +6 -0
- package/src/tasks-runner/life-cycles/task-results-life-cycle.js +17 -0
- package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +8 -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 +15 -0
- package/src/tasks-runner/pseudo-ipc.d.ts +48 -0
- package/src/tasks-runner/pseudo-ipc.js +140 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +45 -0
- package/src/tasks-runner/pseudo-terminal.js +168 -0
- package/src/tasks-runner/remove-old-cache-records.d.ts +1 -0
- package/src/tasks-runner/remove-old-cache-records.js +60 -0
- package/src/tasks-runner/run-command.d.ts +38 -0
- package/src/tasks-runner/run-command.js +590 -0
- package/src/tasks-runner/task-env.d.ts +20 -0
- package/src/tasks-runner/task-env.js +171 -0
- package/src/tasks-runner/task-graph-utils.d.ts +10 -0
- package/src/tasks-runner/task-graph-utils.js +88 -0
- package/src/tasks-runner/task-orchestrator.d.ts +53 -0
- package/src/tasks-runner/task-orchestrator.js +458 -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 +41 -0
- package/src/tasks-runner/tasks-schedule.js +192 -0
- package/src/tasks-runner/utils.d.ts +57 -0
- package/src/tasks-runner/utils.js +392 -0
- package/src/utils/ab-testing.d.ts +51 -0
- package/src/utils/ab-testing.js +112 -0
- package/src/utils/all-file-data.d.ts +2 -0
- package/src/utils/all-file-data.js +8 -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 +18 -0
- package/src/utils/cache-directory.d.ts +7 -0
- package/src/utils/cache-directory.js +71 -0
- package/src/utils/child-process.d.ts +18 -0
- package/src/utils/child-process.js +119 -0
- package/src/utils/chunkify.d.ts +11 -0
- package/src/utils/chunkify.js +44 -0
- package/src/utils/code-frames.d.ts +14 -0
- package/src/utils/code-frames.js +118 -0
- package/src/utils/collapse-expanded-outputs.d.ts +1 -0
- package/src/utils/collapse-expanded-outputs.js +40 -0
- package/src/utils/command-line-utils.d.ts +54 -0
- package/src/utils/command-line-utils.js +267 -0
- package/src/utils/consume-messages-from-socket.d.ts +1 -0
- package/src/utils/consume-messages-from-socket.js +21 -0
- package/src/utils/db-connection.d.ts +5 -0
- package/src/utils/db-connection.js +22 -0
- package/src/utils/default-base.d.ts +1 -0
- package/src/utils/default-base.js +17 -0
- package/src/utils/dotenv.d.ts +7 -0
- package/src/utils/dotenv.js +21 -0
- package/src/utils/exit-codes.d.ts +5 -0
- package/src/utils/exit-codes.js +19 -0
- package/src/utils/fileutils.d.ts +75 -0
- package/src/utils/fileutils.js +151 -0
- package/src/utils/find-matching-projects.d.ts +10 -0
- package/src/utils/find-matching-projects.js +210 -0
- package/src/utils/find-workspace-root.d.ts +11 -0
- package/src/utils/find-workspace-root.js +33 -0
- package/src/utils/get-package-name-from-import-path.d.ts +1 -0
- package/src/utils/get-package-name-from-import-path.js +17 -0
- package/src/utils/git-utils.d.ts +41 -0
- package/src/utils/git-utils.index-filter.d.ts +0 -0
- package/src/utils/git-utils.index-filter.js +21 -0
- package/src/utils/git-utils.js +259 -0
- package/src/utils/git-utils.tree-filter.d.ts +11 -0
- package/src/utils/git-utils.tree-filter.js +45 -0
- package/src/utils/globs.d.ts +3 -0
- package/src/utils/globs.js +18 -0
- package/src/utils/handle-errors.d.ts +1 -0
- package/src/utils/handle-errors.js +71 -0
- package/src/utils/ignore.d.ts +8 -0
- package/src/utils/ignore.js +75 -0
- package/src/utils/installation-directory.d.ts +2 -0
- package/src/utils/installation-directory.js +12 -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 +62 -0
- package/src/utils/legacy-task-history.d.ts +8 -0
- package/src/utils/legacy-task-history.js +87 -0
- package/src/utils/logger.d.ts +12 -0
- package/src/utils/logger.js +52 -0
- package/src/utils/nx-cloud-utils.d.ts +3 -0
- package/src/utils/nx-cloud-utils.js +18 -0
- package/src/utils/nx-plugin.deprecated.d.ts +31 -0
- package/src/utils/nx-plugin.deprecated.js +20 -0
- package/src/utils/object-sort.d.ts +1 -0
- package/src/utils/object-sort.js +9 -0
- package/src/utils/output.d.ts +71 -0
- package/src/utils/output.js +240 -0
- package/src/utils/package-json.d.ts +103 -0
- package/src/utils/package-json.js +173 -0
- package/src/utils/package-manager.d.ts +100 -0
- package/src/utils/package-manager.js +404 -0
- package/src/utils/params.d.ts +137 -0
- package/src/utils/params.js +664 -0
- package/src/utils/path.d.ts +19 -0
- package/src/utils/path.js +37 -0
- package/src/utils/perf-logging.d.ts +1 -0
- package/src/utils/perf-logging.js +13 -0
- package/src/utils/plugins/core-plugins.d.ts +6 -0
- package/src/utils/plugins/core-plugins.js +109 -0
- package/src/utils/plugins/index.d.ts +4 -0
- package/src/utils/plugins/index.js +13 -0
- package/src/utils/plugins/installed-plugins.d.ts +5 -0
- package/src/utils/plugins/installed-plugins.js +76 -0
- package/src/utils/plugins/local-plugins.d.ts +4 -0
- package/src/utils/plugins/local-plugins.js +30 -0
- package/src/utils/plugins/output.d.ts +6 -0
- package/src/utils/plugins/output.js +111 -0
- package/src/utils/plugins/plugin-capabilities.d.ts +14 -0
- package/src/utils/plugins/plugin-capabilities.js +77 -0
- package/src/utils/powerpack.d.ts +5 -0
- package/src/utils/powerpack.js +33 -0
- package/src/utils/print-help.d.ts +11 -0
- package/src/utils/print-help.js +264 -0
- package/src/utils/project-graph-utils.d.ts +13 -0
- package/src/utils/project-graph-utils.js +73 -0
- package/src/utils/promised-based-queue.d.ts +6 -0
- package/src/utils/promised-based-queue.js +43 -0
- package/src/utils/serializable-error.d.ts +4 -0
- package/src/utils/serializable-error.js +33 -0
- package/src/utils/serialize-overrides-into-command-line.d.ts +3 -0
- package/src/utils/serialize-overrides-into-command-line.js +42 -0
- package/src/utils/serialize-target.d.ts +1 -0
- package/src/utils/serialize-target.js +6 -0
- package/src/utils/split-target.d.ts +3 -0
- package/src/utils/split-target.js +48 -0
- package/src/utils/strip-indents.d.ts +14 -0
- package/src/utils/strip-indents.js +23 -0
- package/src/utils/sync-generators.d.ts +64 -0
- package/src/utils/sync-generators.js +353 -0
- package/src/utils/task-history.d.ts +17 -0
- package/src/utils/task-history.js +51 -0
- package/src/utils/update-nxw.d.ts +2 -0
- package/src/utils/update-nxw.js +11 -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 +36 -0
- package/src/utils/workspace-context.d.ts +19 -0
- package/src/utils/workspace-context.js +103 -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,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nxFileMap = exports.nxProjectGraph = void 0;
|
|
4
|
+
exports.ensureCacheDirectory = ensureCacheDirectory;
|
|
5
|
+
exports.readFileMapCache = readFileMapCache;
|
|
6
|
+
exports.readProjectGraphCache = readProjectGraphCache;
|
|
7
|
+
exports.createProjectFileMapCache = createProjectFileMapCache;
|
|
8
|
+
exports.writeCache = writeCache;
|
|
9
|
+
exports.shouldRecomputeWholeGraph = shouldRecomputeWholeGraph;
|
|
10
|
+
exports.extractCachedFileData = extractCachedFileData;
|
|
11
|
+
const node_fs_1 = require("node:fs");
|
|
12
|
+
const path_1 = require("path");
|
|
13
|
+
const perf_hooks_1 = require("perf_hooks");
|
|
14
|
+
const cache_directory_1 = require("../utils/cache-directory");
|
|
15
|
+
const fileutils_1 = require("../utils/fileutils");
|
|
16
|
+
const versions_1 = require("../utils/versions");
|
|
17
|
+
exports.nxProjectGraph = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'project-graph.json');
|
|
18
|
+
exports.nxFileMap = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'file-map.json');
|
|
19
|
+
function ensureCacheDirectory() {
|
|
20
|
+
try {
|
|
21
|
+
if (!(0, node_fs_1.existsSync)(cache_directory_1.workspaceDataDirectory)) {
|
|
22
|
+
(0, node_fs_1.mkdirSync)(cache_directory_1.workspaceDataDirectory, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
/*
|
|
27
|
+
* @jeffbcross: Node JS docs recommend against checking for existence of directory immediately before creating it.
|
|
28
|
+
* Instead, just try to create the directory and handle the error.
|
|
29
|
+
*
|
|
30
|
+
* We ran into race conditions when running scripts concurrently, where multiple scripts were
|
|
31
|
+
* arriving here simultaneously, checking for directory existence, then trying to create the directory simultaneously.
|
|
32
|
+
*
|
|
33
|
+
* In this case, we're creating the directory. If the operation failed, we ensure that the directory
|
|
34
|
+
* exists before continuing (or raise an exception).
|
|
35
|
+
*/
|
|
36
|
+
if (!(0, fileutils_1.directoryExists)(cache_directory_1.workspaceDataDirectory)) {
|
|
37
|
+
throw new Error(`Failed to create directory: ${cache_directory_1.workspaceDataDirectory}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function readFileMapCache() {
|
|
42
|
+
perf_hooks_1.performance.mark('read cache:start');
|
|
43
|
+
ensureCacheDirectory();
|
|
44
|
+
let data = null;
|
|
45
|
+
try {
|
|
46
|
+
if ((0, fileutils_1.fileExists)(exports.nxFileMap)) {
|
|
47
|
+
data = (0, fileutils_1.readJsonFile)(exports.nxFileMap);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.log(`Error reading '${exports.nxFileMap}'. Continue the process without the cache.`);
|
|
52
|
+
console.log(error);
|
|
53
|
+
}
|
|
54
|
+
perf_hooks_1.performance.mark('read cache:end');
|
|
55
|
+
perf_hooks_1.performance.measure('read cache', 'read cache:start', 'read cache:end');
|
|
56
|
+
return data ?? null;
|
|
57
|
+
}
|
|
58
|
+
function readProjectGraphCache() {
|
|
59
|
+
perf_hooks_1.performance.mark('read project-graph:start');
|
|
60
|
+
ensureCacheDirectory();
|
|
61
|
+
let data = null;
|
|
62
|
+
try {
|
|
63
|
+
if ((0, fileutils_1.fileExists)(exports.nxProjectGraph)) {
|
|
64
|
+
data = (0, fileutils_1.readJsonFile)(exports.nxProjectGraph);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.log(`Error reading '${exports.nxProjectGraph}'. Continue the process without the cache.`);
|
|
69
|
+
console.log(error);
|
|
70
|
+
}
|
|
71
|
+
perf_hooks_1.performance.mark('read project-graph:end');
|
|
72
|
+
perf_hooks_1.performance.measure('read cache', 'read project-graph:start', 'read project-graph:end');
|
|
73
|
+
return data ?? null;
|
|
74
|
+
}
|
|
75
|
+
function createProjectFileMapCache(nxJson, packageJsonDeps, fileMap, tsConfig) {
|
|
76
|
+
const nxJsonPlugins = getNxJsonPluginsData(nxJson, packageJsonDeps);
|
|
77
|
+
const newValue = {
|
|
78
|
+
version: '6.0',
|
|
79
|
+
nxVersion: versions_1.nxVersion,
|
|
80
|
+
deps: packageJsonDeps, // TODO(v19): We can remove this in favor of nxVersion
|
|
81
|
+
// compilerOptions may not exist, especially for package-based repos
|
|
82
|
+
pathMappings: tsConfig?.compilerOptions?.paths || {},
|
|
83
|
+
nxJsonPlugins,
|
|
84
|
+
pluginsConfig: nxJson?.pluginsConfig,
|
|
85
|
+
fileMap,
|
|
86
|
+
};
|
|
87
|
+
return newValue;
|
|
88
|
+
}
|
|
89
|
+
function writeCache(cache, projectGraph) {
|
|
90
|
+
perf_hooks_1.performance.mark('write cache:start');
|
|
91
|
+
let retry = 1;
|
|
92
|
+
let done = false;
|
|
93
|
+
do {
|
|
94
|
+
// write first to a unique temporary filename and then do a
|
|
95
|
+
// rename of the file to the correct filename
|
|
96
|
+
// this is to avoid any problems with half-written files
|
|
97
|
+
// in case of crash and/or partially written files due
|
|
98
|
+
// to multiple parallel processes reading and writing this file
|
|
99
|
+
const unique = (Math.random().toString(16) + '0000000').slice(2, 10);
|
|
100
|
+
const tmpProjectGraphPath = `${exports.nxProjectGraph}~${unique}`;
|
|
101
|
+
const tmpFileMapPath = `${exports.nxFileMap}~${unique}`;
|
|
102
|
+
try {
|
|
103
|
+
(0, fileutils_1.writeJsonFile)(tmpProjectGraphPath, projectGraph);
|
|
104
|
+
(0, node_fs_1.renameSync)(tmpProjectGraphPath, exports.nxProjectGraph);
|
|
105
|
+
(0, fileutils_1.writeJsonFile)(tmpFileMapPath, cache);
|
|
106
|
+
(0, node_fs_1.renameSync)(tmpFileMapPath, exports.nxFileMap);
|
|
107
|
+
done = true;
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
if (err instanceof Error) {
|
|
111
|
+
console.log(`ERROR (${retry}) when writing \n${err.message}\n${err.stack}`);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.log(`ERROR (${retry}) unknown error when writing ${exports.nxProjectGraph} and ${exports.nxFileMap}`);
|
|
115
|
+
}
|
|
116
|
+
++retry;
|
|
117
|
+
}
|
|
118
|
+
} while (!done && retry < 5);
|
|
119
|
+
perf_hooks_1.performance.mark('write cache:end');
|
|
120
|
+
perf_hooks_1.performance.measure('write cache', 'write cache:start', 'write cache:end');
|
|
121
|
+
}
|
|
122
|
+
function shouldRecomputeWholeGraph(cache, packageJsonDeps, projects, nxJson, tsConfig) {
|
|
123
|
+
if (cache.version !== '6.0') {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
if (cache.nxVersion !== versions_1.nxVersion) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
// we have a cached project that is no longer present
|
|
130
|
+
const cachedNodes = Object.keys(cache.fileMap.projectFileMap);
|
|
131
|
+
if (cachedNodes.some((p) => projects[p] === undefined)) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
// a path mapping for an existing project has changed
|
|
135
|
+
if (Object.keys(cache.pathMappings).some((t) => {
|
|
136
|
+
const cached = cache.pathMappings && cache.pathMappings[t]
|
|
137
|
+
? JSON.stringify(cache.pathMappings[t])
|
|
138
|
+
: undefined;
|
|
139
|
+
const notCached = tsConfig?.compilerOptions?.paths && tsConfig?.compilerOptions?.paths[t]
|
|
140
|
+
? JSON.stringify(tsConfig.compilerOptions.paths[t])
|
|
141
|
+
: undefined;
|
|
142
|
+
return cached !== notCached;
|
|
143
|
+
})) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
// a new plugin has been added
|
|
147
|
+
if (JSON.stringify(getNxJsonPluginsData(nxJson, packageJsonDeps)) !==
|
|
148
|
+
JSON.stringify(cache.nxJsonPlugins)) {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
if (JSON.stringify(nxJson?.pluginsConfig) !==
|
|
152
|
+
JSON.stringify(cache.pluginsConfig)) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
/*
|
|
158
|
+
This can only be invoked when the list of projects is either the same
|
|
159
|
+
or new projects have been added, so every project in the cache has a corresponding
|
|
160
|
+
project in fileMap
|
|
161
|
+
*/
|
|
162
|
+
function extractCachedFileData(fileMap, c) {
|
|
163
|
+
const filesToProcess = {
|
|
164
|
+
nonProjectFiles: [],
|
|
165
|
+
projectFileMap: {},
|
|
166
|
+
};
|
|
167
|
+
const cachedFileData = {
|
|
168
|
+
nonProjectFiles: {},
|
|
169
|
+
projectFileMap: {},
|
|
170
|
+
};
|
|
171
|
+
const currentProjects = Object.keys(fileMap.projectFileMap).filter((name) => fileMap.projectFileMap[name].length > 0);
|
|
172
|
+
currentProjects.forEach((p) => {
|
|
173
|
+
processProjectNode(p, c.fileMap.projectFileMap, cachedFileData.projectFileMap, filesToProcess.projectFileMap, fileMap);
|
|
174
|
+
});
|
|
175
|
+
processNonProjectFiles(c.fileMap.nonProjectFiles, fileMap.nonProjectFiles, filesToProcess.nonProjectFiles, cachedFileData.nonProjectFiles);
|
|
176
|
+
return {
|
|
177
|
+
filesToProcess,
|
|
178
|
+
cachedFileData,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function processNonProjectFiles(cachedFiles, nonProjectFiles, filesToProcess, cachedFileData) {
|
|
182
|
+
const cachedHashMap = new Map(cachedFiles.map((f) => [f.file, f]));
|
|
183
|
+
for (const f of nonProjectFiles) {
|
|
184
|
+
const cachedFile = cachedHashMap.get(f.file);
|
|
185
|
+
if (!cachedFile || cachedFile.hash !== f.hash) {
|
|
186
|
+
filesToProcess.push(f);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
cachedFileData[f.file] = cachedFile;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function processProjectNode(projectName, cachedFileMap, cachedFileData, filesToProcess, { projectFileMap }) {
|
|
194
|
+
if (!cachedFileMap[projectName]) {
|
|
195
|
+
filesToProcess[projectName] = projectFileMap[projectName];
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const fileDataFromCache = {};
|
|
199
|
+
for (let f of cachedFileMap[projectName]) {
|
|
200
|
+
fileDataFromCache[f.file] = f;
|
|
201
|
+
}
|
|
202
|
+
if (!cachedFileData[projectName]) {
|
|
203
|
+
cachedFileData[projectName] = {};
|
|
204
|
+
}
|
|
205
|
+
for (let f of projectFileMap[projectName]) {
|
|
206
|
+
const fromCache = fileDataFromCache[f.file];
|
|
207
|
+
if (fromCache && fromCache.hash == f.hash) {
|
|
208
|
+
cachedFileData[projectName][f.file] = fromCache;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
if (!filesToProcess[projectName]) {
|
|
212
|
+
filesToProcess[projectName] = [];
|
|
213
|
+
}
|
|
214
|
+
filesToProcess[projectName].push(f);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function getNxJsonPluginsData(nxJson, packageJsonDeps) {
|
|
219
|
+
return (nxJson?.plugins || []).map((p) => {
|
|
220
|
+
const [plugin, options] = typeof p === 'string' ? [p] : [p.plugin, p.options];
|
|
221
|
+
return {
|
|
222
|
+
name: plugin,
|
|
223
|
+
version: packageJsonDeps[plugin],
|
|
224
|
+
options,
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProjectGraph, ProjectGraphExternalNode, ProjectGraphProjectNode } from '../config/project-graph';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a new project graph where all the edges are reversed.
|
|
4
|
+
*
|
|
5
|
+
* For instance, if project A depends on B, in the reversed graph
|
|
6
|
+
* B will depend on A.
|
|
7
|
+
*/
|
|
8
|
+
export declare function reverse(graph: ProjectGraph): ProjectGraph;
|
|
9
|
+
export declare function filterNodes(predicate?: (n: ProjectGraphProjectNode) => boolean): (p: ProjectGraph) => ProjectGraph;
|
|
10
|
+
export declare function isNpmProject(project: ProjectGraphProjectNode | ProjectGraphExternalNode): project is ProjectGraphExternalNode;
|
|
11
|
+
export declare const pruneExternalNodes: (p: ProjectGraph) => ProjectGraph;
|
|
12
|
+
export declare function withDeps(original: ProjectGraph, subsetNodes: ProjectGraphProjectNode[]): ProjectGraph;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pruneExternalNodes = void 0;
|
|
4
|
+
exports.reverse = reverse;
|
|
5
|
+
exports.filterNodes = filterNodes;
|
|
6
|
+
exports.isNpmProject = isNpmProject;
|
|
7
|
+
exports.withDeps = withDeps;
|
|
8
|
+
const reverseMemo = new Map();
|
|
9
|
+
/**
|
|
10
|
+
* Returns a new project graph where all the edges are reversed.
|
|
11
|
+
*
|
|
12
|
+
* For instance, if project A depends on B, in the reversed graph
|
|
13
|
+
* B will depend on A.
|
|
14
|
+
*/
|
|
15
|
+
function reverse(graph) {
|
|
16
|
+
const resultFromMemo = reverseMemo.get(graph);
|
|
17
|
+
if (resultFromMemo) {
|
|
18
|
+
return resultFromMemo;
|
|
19
|
+
}
|
|
20
|
+
const result = {
|
|
21
|
+
...graph,
|
|
22
|
+
nodes: { ...graph.nodes },
|
|
23
|
+
externalNodes: { ...graph.externalNodes },
|
|
24
|
+
dependencies: {},
|
|
25
|
+
};
|
|
26
|
+
Object.keys(graph.nodes).forEach((n) => (result.dependencies[n] = []));
|
|
27
|
+
// we need to keep external node's reverse dependencies to trace our route back
|
|
28
|
+
if (graph.externalNodes) {
|
|
29
|
+
Object.keys(graph.externalNodes).forEach((n) => (result.dependencies[n] = []));
|
|
30
|
+
}
|
|
31
|
+
Object.values(graph.dependencies).forEach((byProject) => {
|
|
32
|
+
byProject.forEach((dep) => {
|
|
33
|
+
const dependency = result.dependencies[dep.target];
|
|
34
|
+
if (dependency) {
|
|
35
|
+
dependency.push({
|
|
36
|
+
type: dep.type,
|
|
37
|
+
source: dep.target,
|
|
38
|
+
target: dep.source,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
reverseMemo.set(graph, result);
|
|
44
|
+
reverseMemo.set(result, graph);
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
function filterNodes(predicate) {
|
|
48
|
+
return (original) => {
|
|
49
|
+
const graph = { nodes: {}, dependencies: {} };
|
|
50
|
+
const added = new Set();
|
|
51
|
+
Object.values(original.nodes).forEach((n) => {
|
|
52
|
+
if (!predicate || predicate(n)) {
|
|
53
|
+
graph.nodes[n.name] = n;
|
|
54
|
+
graph.dependencies[n.name] = [];
|
|
55
|
+
added.add(n.name);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.values(original.dependencies).forEach((ds) => {
|
|
59
|
+
ds.forEach((d) => {
|
|
60
|
+
if (added.has(d.source) && added.has(d.target)) {
|
|
61
|
+
graph.dependencies[d.source].push(d);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
return graph;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function isNpmProject(project) {
|
|
69
|
+
return project?.type === 'npm';
|
|
70
|
+
}
|
|
71
|
+
exports.pruneExternalNodes = filterNodes();
|
|
72
|
+
function withDeps(original, subsetNodes) {
|
|
73
|
+
const res = { nodes: {}, dependencies: {} };
|
|
74
|
+
const visitedNodes = [];
|
|
75
|
+
const visitedEdges = [];
|
|
76
|
+
Object.values(subsetNodes).forEach(recurNodes);
|
|
77
|
+
Object.values(subsetNodes).forEach(recurEdges);
|
|
78
|
+
return res;
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
function recurNodes(node) {
|
|
81
|
+
if (visitedNodes.indexOf(node.name) > -1)
|
|
82
|
+
return;
|
|
83
|
+
res.nodes[node.name] = node;
|
|
84
|
+
if (!res.dependencies[node.name]) {
|
|
85
|
+
res.dependencies[node.name] = [];
|
|
86
|
+
}
|
|
87
|
+
visitedNodes.push(node.name);
|
|
88
|
+
original.dependencies[node.name].forEach((n) => {
|
|
89
|
+
if (original.nodes[n.target]) {
|
|
90
|
+
recurNodes(original.nodes[n.target]);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function recurEdges(node) {
|
|
95
|
+
if (visitedEdges.indexOf(node.name) > -1)
|
|
96
|
+
return;
|
|
97
|
+
visitedEdges.push(node.name);
|
|
98
|
+
const ds = original.dependencies[node.name];
|
|
99
|
+
ds.forEach((n) => {
|
|
100
|
+
if (!original.nodes[n.target]) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (!res.dependencies[n.source]) {
|
|
104
|
+
res.dependencies[n.source] = [];
|
|
105
|
+
}
|
|
106
|
+
res.dependencies[n.source].push(n);
|
|
107
|
+
});
|
|
108
|
+
ds.forEach((n) => {
|
|
109
|
+
if (original.nodes[n.target]) {
|
|
110
|
+
recurEdges(original.nodes[n.target]);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNodesFromFiles = exports.registerPluginTSTranspiler = exports.readPluginPackageJson = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./public-api"), exports);
|
|
6
|
+
var loader_1 = require("./loader");
|
|
7
|
+
Object.defineProperty(exports, "readPluginPackageJson", { enumerable: true, get: function () { return loader_1.readPluginPackageJson; } });
|
|
8
|
+
Object.defineProperty(exports, "registerPluginTSTranspiler", { enumerable: true, get: function () { return loader_1.registerPluginTSTranspiler; } });
|
|
9
|
+
var utils_1 = require("./utils");
|
|
10
|
+
Object.defineProperty(exports, "createNodesFromFiles", { enumerable: true, get: function () { return utils_1.createNodesFromFiles; } });
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PluginConfiguration } from '../../config/nx-json';
|
|
2
|
+
import { NxPluginV1 } from '../../utils/nx-plugin.deprecated';
|
|
3
|
+
import { CreateDependencies, CreateDependenciesContext, CreateMetadata, CreateMetadataContext, CreateNodesContextV2, CreateNodesResult, NxPluginV2 } from './public-api';
|
|
4
|
+
import { ProjectGraph, ProjectGraphProcessor } from '../../config/project-graph';
|
|
5
|
+
export declare class LoadedNxPlugin {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly createNodes?: [
|
|
8
|
+
filePattern: string,
|
|
9
|
+
fn: (matchedFiles: string[], context: CreateNodesContextV2) => Promise<Array<readonly [plugin: string, file: string, result: CreateNodesResult]>>
|
|
10
|
+
];
|
|
11
|
+
readonly createDependencies?: (context: CreateDependenciesContext) => ReturnType<CreateDependencies>;
|
|
12
|
+
readonly createMetadata?: (graph: ProjectGraph, context: CreateMetadataContext) => ReturnType<CreateMetadata>;
|
|
13
|
+
readonly processProjectGraph?: ProjectGraphProcessor;
|
|
14
|
+
readonly options?: unknown;
|
|
15
|
+
readonly include?: string[];
|
|
16
|
+
readonly exclude?: string[];
|
|
17
|
+
constructor(plugin: NormalizedPlugin, pluginDefinition: PluginConfiguration);
|
|
18
|
+
}
|
|
19
|
+
export type CreateNodesResultWithContext = CreateNodesResult & {
|
|
20
|
+
file: string;
|
|
21
|
+
pluginName: string;
|
|
22
|
+
};
|
|
23
|
+
export type NormalizedPlugin = NxPluginV2 & Pick<NxPluginV1, 'processProjectGraph'>;
|
|
24
|
+
export declare const nxPluginCache: Map<unknown, [
|
|
25
|
+
Promise<LoadedNxPlugin>,
|
|
26
|
+
() => void
|
|
27
|
+
]>;
|
|
28
|
+
export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<readonly [LoadedNxPlugin[], () => void]>;
|
|
29
|
+
export declare function getDefaultPlugins(root: string): Promise<string[]>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file contains the bits and bobs of the internal API for loading and interacting with Nx plugins.
|
|
3
|
+
// For the public API, used by plugin authors, see `./public-api.ts`.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.nxPluginCache = exports.LoadedNxPlugin = void 0;
|
|
6
|
+
exports.loadNxPlugins = loadNxPlugins;
|
|
7
|
+
exports.getDefaultPlugins = getDefaultPlugins;
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
|
10
|
+
const angular_json_1 = require("../../adapter/angular-json");
|
|
11
|
+
const isolation_1 = require("./isolation");
|
|
12
|
+
const loader_1 = require("./loader");
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
const error_types_1 = require("../error-types");
|
|
15
|
+
const native_1 = require("../../native");
|
|
16
|
+
class LoadedNxPlugin {
|
|
17
|
+
constructor(plugin, pluginDefinition) {
|
|
18
|
+
this.name = plugin.name;
|
|
19
|
+
if (typeof pluginDefinition !== 'string') {
|
|
20
|
+
this.options = pluginDefinition.options;
|
|
21
|
+
this.include = pluginDefinition.include;
|
|
22
|
+
this.exclude = pluginDefinition.exclude;
|
|
23
|
+
}
|
|
24
|
+
if (plugin.createNodes && !plugin.createNodesV2) {
|
|
25
|
+
this.createNodes = [
|
|
26
|
+
plugin.createNodes[0],
|
|
27
|
+
(configFiles, context) => (0, utils_1.createNodesFromFiles)(plugin.createNodes[1], configFiles, this.options, context).then((results) => results.map((r) => [this.name, r[0], r[1]])),
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
if (plugin.createNodesV2) {
|
|
31
|
+
this.createNodes = [
|
|
32
|
+
plugin.createNodesV2[0],
|
|
33
|
+
async (configFiles, context) => {
|
|
34
|
+
const result = await plugin.createNodesV2[1](configFiles, this.options, context);
|
|
35
|
+
return result.map((r) => [this.name, r[0], r[1]]);
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
if (this.createNodes) {
|
|
40
|
+
const inner = this.createNodes[1];
|
|
41
|
+
this.createNodes[1] = async (...args) => {
|
|
42
|
+
performance.mark(`${plugin.name}:createNodes - start`);
|
|
43
|
+
try {
|
|
44
|
+
return await inner(...args);
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
if ((0, error_types_1.isAggregateCreateNodesError)(e)) {
|
|
48
|
+
throw e;
|
|
49
|
+
}
|
|
50
|
+
// The underlying plugin errored out. We can't know any partial results.
|
|
51
|
+
throw new error_types_1.AggregateCreateNodesError([[null, e]], []);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
performance.mark(`${plugin.name}:createNodes - end`);
|
|
55
|
+
performance.measure(`${plugin.name}:createNodes`, `${plugin.name}:createNodes - start`, `${plugin.name}:createNodes - end`);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (plugin.createDependencies) {
|
|
60
|
+
this.createDependencies = (context) => plugin.createDependencies(this.options, context);
|
|
61
|
+
}
|
|
62
|
+
if (plugin.createMetadata) {
|
|
63
|
+
this.createMetadata = (graph, context) => plugin.createMetadata(graph, this.options, context);
|
|
64
|
+
}
|
|
65
|
+
this.processProjectGraph = plugin.processProjectGraph;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.LoadedNxPlugin = LoadedNxPlugin;
|
|
69
|
+
// Short lived cache (cleared between cmd runs)
|
|
70
|
+
// holding resolved nx plugin objects.
|
|
71
|
+
// Allows loaded plugins to not be reloaded when
|
|
72
|
+
// referenced multiple times.
|
|
73
|
+
exports.nxPluginCache = new Map();
|
|
74
|
+
function isIsolationEnabled() {
|
|
75
|
+
// Explicitly enabled, regardless of further conditions
|
|
76
|
+
if (process.env.NX_ISOLATE_PLUGINS === 'true') {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
if (
|
|
80
|
+
// Explicitly disabled
|
|
81
|
+
process.env.NX_ISOLATE_PLUGINS === 'false' ||
|
|
82
|
+
// Isolation is disabled on WASM builds currently.
|
|
83
|
+
native_1.IS_WASM) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
// Default value
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
|
|
90
|
+
performance.mark('loadNxPlugins:start');
|
|
91
|
+
const loadingMethod = isIsolationEnabled()
|
|
92
|
+
? isolation_1.loadNxPluginInIsolation
|
|
93
|
+
: loader_1.loadNxPlugin;
|
|
94
|
+
plugins = await normalizePlugins(plugins, root);
|
|
95
|
+
const result = new Array(plugins?.length);
|
|
96
|
+
const cleanupFunctions = [];
|
|
97
|
+
await Promise.all(plugins.map(async (plugin, idx) => {
|
|
98
|
+
const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root);
|
|
99
|
+
result[idx] = loadedPluginPromise;
|
|
100
|
+
cleanupFunctions.push(cleanup);
|
|
101
|
+
}));
|
|
102
|
+
const ret = [
|
|
103
|
+
await Promise.all(result),
|
|
104
|
+
() => {
|
|
105
|
+
for (const fn of cleanupFunctions) {
|
|
106
|
+
fn();
|
|
107
|
+
}
|
|
108
|
+
if (loader_1.unregisterPluginTSTranspiler) {
|
|
109
|
+
(0, loader_1.unregisterPluginTSTranspiler)();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
performance.mark('loadNxPlugins:end');
|
|
114
|
+
performance.measure('loadNxPlugins', 'loadNxPlugins:start', 'loadNxPlugins:end');
|
|
115
|
+
return ret;
|
|
116
|
+
}
|
|
117
|
+
async function normalizePlugins(plugins, root) {
|
|
118
|
+
plugins ??= [];
|
|
119
|
+
return [
|
|
120
|
+
...plugins,
|
|
121
|
+
// Most of the nx core node plugins go on the end, s.t. it overwrites any other plugins
|
|
122
|
+
...(await getDefaultPlugins(root)),
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
async function getDefaultPlugins(root) {
|
|
126
|
+
return [
|
|
127
|
+
(0, path_1.join)(__dirname, '../../plugins/js'),
|
|
128
|
+
...((0, angular_json_1.shouldMergeAngularProjects)(root, false)
|
|
129
|
+
? [(0, path_1.join)(__dirname, '../../adapter/angular-json')]
|
|
130
|
+
: []),
|
|
131
|
+
(0, path_1.join)(__dirname, '../../plugins/package-json'),
|
|
132
|
+
(0, path_1.join)(__dirname, '../../plugins/project-json/build-nodes/project-json'),
|
|
133
|
+
];
|
|
134
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadNxPluginInIsolation = loadNxPluginInIsolation;
|
|
4
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
|
5
|
+
const plugin_pool_1 = require("./plugin-pool");
|
|
6
|
+
async function loadNxPluginInIsolation(plugin, root = workspace_root_1.workspaceRoot) {
|
|
7
|
+
const [loadingPlugin, cleanup] = await (0, plugin_pool_1.loadRemoteNxPlugin)(plugin, root);
|
|
8
|
+
return [
|
|
9
|
+
loadingPlugin,
|
|
10
|
+
() => {
|
|
11
|
+
cleanup();
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ProjectGraph, ProjectGraphProcessorContext } from '../../../config/project-graph';
|
|
2
|
+
import { PluginConfiguration } from '../../../config/nx-json';
|
|
3
|
+
import { CreateDependenciesContext, CreateMetadataContext, CreateNodesContextV2 } from '../public-api';
|
|
4
|
+
import { LoadedNxPlugin } from '../internal-api';
|
|
5
|
+
import { Serializable } from 'child_process';
|
|
6
|
+
import { Socket } from 'net';
|
|
7
|
+
export interface PluginWorkerLoadMessage {
|
|
8
|
+
type: 'load';
|
|
9
|
+
payload: {
|
|
10
|
+
plugin: PluginConfiguration;
|
|
11
|
+
root: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface PluginWorkerLoadResult {
|
|
15
|
+
type: 'load-result';
|
|
16
|
+
payload: {
|
|
17
|
+
name: string;
|
|
18
|
+
include?: string[];
|
|
19
|
+
exclude?: string[];
|
|
20
|
+
createNodesPattern: string;
|
|
21
|
+
hasCreateDependencies: boolean;
|
|
22
|
+
hasProcessProjectGraph: boolean;
|
|
23
|
+
hasCreateMetadata: boolean;
|
|
24
|
+
success: true;
|
|
25
|
+
} | {
|
|
26
|
+
success: false;
|
|
27
|
+
error: Error;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface PluginWorkerCreateNodesMessage {
|
|
31
|
+
type: 'createNodes';
|
|
32
|
+
payload: {
|
|
33
|
+
configFiles: string[];
|
|
34
|
+
context: CreateNodesContextV2;
|
|
35
|
+
tx: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface PluginWorkerCreateNodesResult {
|
|
39
|
+
type: 'createNodesResult';
|
|
40
|
+
payload: {
|
|
41
|
+
success: true;
|
|
42
|
+
result: Awaited<ReturnType<LoadedNxPlugin['createNodes'][1]>>;
|
|
43
|
+
tx: string;
|
|
44
|
+
} | {
|
|
45
|
+
success: false;
|
|
46
|
+
error: Error;
|
|
47
|
+
tx: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface PluginCreateDependenciesMessage {
|
|
51
|
+
type: 'createDependencies';
|
|
52
|
+
payload: {
|
|
53
|
+
context: CreateDependenciesContext;
|
|
54
|
+
tx: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface PluginCreateMetadataMessage {
|
|
58
|
+
type: 'createMetadata';
|
|
59
|
+
payload: {
|
|
60
|
+
graph: ProjectGraph;
|
|
61
|
+
context: CreateMetadataContext;
|
|
62
|
+
tx: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface PluginCreateDependenciesResult {
|
|
66
|
+
type: 'createDependenciesResult';
|
|
67
|
+
payload: {
|
|
68
|
+
dependencies: ReturnType<LoadedNxPlugin['createDependencies']>;
|
|
69
|
+
success: true;
|
|
70
|
+
tx: string;
|
|
71
|
+
} | {
|
|
72
|
+
success: false;
|
|
73
|
+
error: Error;
|
|
74
|
+
tx: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface PluginCreateMetadataResult {
|
|
78
|
+
type: 'createMetadataResult';
|
|
79
|
+
payload: {
|
|
80
|
+
metadata: ReturnType<LoadedNxPlugin['createMetadata']>;
|
|
81
|
+
success: true;
|
|
82
|
+
tx: string;
|
|
83
|
+
} | {
|
|
84
|
+
success: false;
|
|
85
|
+
error: Error;
|
|
86
|
+
tx: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface PluginWorkerProcessProjectGraphMessage {
|
|
90
|
+
type: 'processProjectGraph';
|
|
91
|
+
payload: {
|
|
92
|
+
graph: ProjectGraph;
|
|
93
|
+
ctx: ProjectGraphProcessorContext;
|
|
94
|
+
tx: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface PluginWorkerProcessProjectGraphResult {
|
|
98
|
+
type: 'processProjectGraphResult';
|
|
99
|
+
payload: {
|
|
100
|
+
graph: ProjectGraph;
|
|
101
|
+
success: true;
|
|
102
|
+
tx: string;
|
|
103
|
+
} | {
|
|
104
|
+
success: false;
|
|
105
|
+
error: Error;
|
|
106
|
+
tx: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface PluginWorkerShutdownMessage {
|
|
110
|
+
type: 'shutdown';
|
|
111
|
+
payload: {};
|
|
112
|
+
}
|
|
113
|
+
export type PluginWorkerMessage = PluginWorkerLoadMessage | PluginWorkerShutdownMessage | PluginWorkerCreateNodesMessage | PluginCreateDependenciesMessage | PluginWorkerProcessProjectGraphMessage | PluginCreateMetadataMessage;
|
|
114
|
+
export type PluginWorkerResult = PluginWorkerLoadResult | PluginWorkerCreateNodesResult | PluginCreateDependenciesResult | PluginWorkerProcessProjectGraphResult | PluginCreateMetadataResult;
|
|
115
|
+
export declare function isPluginWorkerMessage(message: Serializable): message is PluginWorkerMessage;
|
|
116
|
+
export declare function isPluginWorkerResult(message: Serializable): message is PluginWorkerResult;
|
|
117
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
118
|
+
type MessageHandlerReturn<T extends PluginWorkerMessage | PluginWorkerResult> = T extends PluginWorkerResult ? MaybePromise<PluginWorkerMessage | void> : MaybePromise<PluginWorkerResult | void>;
|
|
119
|
+
export declare function consumeMessage<T extends PluginWorkerMessage | PluginWorkerResult>(socket: Socket, raw: T, handlers: {
|
|
120
|
+
[K in T['type']]: (payload: Extract<T, {
|
|
121
|
+
type: K;
|
|
122
|
+
}>['payload']) => MessageHandlerReturn<T>;
|
|
123
|
+
}): Promise<void>;
|
|
124
|
+
export declare function sendMessageOverSocket(socket: Socket, message: PluginWorkerMessage | PluginWorkerResult): void;
|
|
125
|
+
export {};
|