nx 13.9.3 → 13.10.0-beta.2
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/bin/init-local.d.ts +2 -0
- package/bin/init-local.js +123 -0
- package/bin/init-local.js.map +1 -0
- package/{src/cli/run-cli.d.ts → bin/init.d.ts} +0 -0
- package/bin/init.js +13 -0
- package/bin/init.js.map +1 -0
- package/bin/nx.js +8 -8
- package/bin/nx.js.map +1 -1
- package/{src/compat/compat.d.ts → bin/run-executor.d.ts} +0 -0
- package/{src/cli/run-cli.js → bin/run-executor.js} +11 -3
- package/bin/run-executor.js.map +1 -0
- package/package.json +26 -11
- package/src/adapter/compat.d.ts +1 -0
- package/src/{compat → adapter}/compat.js +1 -1
- package/src/adapter/compat.js.map +1 -0
- package/src/{cli → adapter}/decorate-cli.d.ts +0 -0
- package/src/{cli → adapter}/decorate-cli.js +0 -0
- package/src/adapter/decorate-cli.js.map +1 -0
- package/src/{commands → adapter}/ngcli-adapter.d.ts +4 -11
- package/src/{commands → adapter}/ngcli-adapter.js +13 -37
- package/src/adapter/ngcli-adapter.js.map +1 -0
- package/src/cli/index.d.ts +0 -3
- package/src/cli/index.js +0 -74
- package/src/cli/index.js.map +1 -1
- package/src/command-line/affected.d.ts +3 -0
- package/src/command-line/affected.js +117 -0
- package/src/command-line/affected.js.map +1 -0
- package/src/command-line/connect-to-nx-cloud.d.ts +2 -0
- package/src/command-line/connect-to-nx-cloud.js +79 -0
- package/src/command-line/connect-to-nx-cloud.js.map +1 -0
- package/src/command-line/daemon.d.ts +2 -0
- package/src/command-line/daemon.js +23 -0
- package/src/command-line/daemon.js.map +1 -0
- package/src/command-line/dep-graph.d.ts +24 -0
- package/src/command-line/dep-graph.js +371 -0
- package/src/command-line/dep-graph.js.map +1 -0
- package/src/command-line/examples.d.ts +5 -0
- package/src/command-line/examples.js +283 -0
- package/src/command-line/examples.js.map +1 -0
- package/src/command-line/format.d.ts +7 -0
- package/src/command-line/format.js +205 -0
- package/src/command-line/format.js.map +1 -0
- package/src/command-line/generate.d.ts +17 -0
- package/src/{commands → command-line}/generate.js +42 -63
- package/src/command-line/generate.js.map +1 -0
- package/src/command-line/lint.d.ts +1 -0
- package/src/command-line/lint.js +33 -0
- package/src/command-line/lint.js.map +1 -0
- package/src/command-line/list.d.ts +13 -0
- package/src/command-line/list.js +41 -0
- package/src/command-line/list.js.map +1 -0
- package/src/{commands → command-line}/migrate.d.ts +6 -2
- package/src/{commands → command-line}/migrate.js +21 -58
- package/src/command-line/migrate.js.map +1 -0
- package/src/command-line/nx-commands.d.ts +9 -0
- package/src/command-line/nx-commands.js +607 -0
- package/src/command-line/nx-commands.js.map +1 -0
- package/src/command-line/print-affected.d.ts +6 -0
- package/src/command-line/print-affected.js +82 -0
- package/src/command-line/print-affected.js.map +1 -0
- package/src/command-line/report.d.ts +17 -0
- package/src/command-line/report.js +125 -0
- package/src/command-line/report.js.map +1 -0
- package/src/command-line/reset.d.ts +1 -0
- package/src/command-line/reset.js +20 -0
- package/src/command-line/reset.js.map +1 -0
- package/src/command-line/run-many.d.ts +3 -0
- package/src/command-line/run-many.js +61 -0
- package/src/command-line/run-many.js.map +1 -0
- package/src/command-line/run-one.d.ts +3 -0
- package/src/command-line/run-one.js +111 -0
- package/src/command-line/run-one.js.map +1 -0
- package/src/{commands → command-line}/run.d.ts +12 -7
- package/src/{commands → command-line}/run.js +15 -63
- package/src/command-line/run.js.map +1 -0
- package/src/command-line/utils.d.ts +51 -0
- package/src/command-line/utils.js +272 -0
- package/src/command-line/utils.js.map +1 -0
- package/src/command-line/workspace-generators.d.ts +1 -0
- package/src/command-line/workspace-generators.js +151 -0
- package/src/command-line/workspace-generators.js.map +1 -0
- package/src/command-line/workspace-integrity-checks.d.ts +11 -0
- package/src/command-line/workspace-integrity-checks.js +60 -0
- package/src/command-line/workspace-integrity-checks.js.map +1 -0
- package/src/core/affected-project-graph/affected-project-graph-models.d.ts +11 -0
- package/src/core/affected-project-graph/affected-project-graph-models.js +3 -0
- package/src/core/affected-project-graph/affected-project-graph-models.js.map +1 -0
- package/src/core/affected-project-graph/affected-project-graph.d.ts +5 -0
- package/src/core/affected-project-graph/affected-project-graph.js +88 -0
- package/src/core/affected-project-graph/affected-project-graph.js.map +1 -0
- package/src/core/affected-project-graph/index.d.ts +2 -0
- package/src/core/affected-project-graph/index.js +6 -0
- package/src/core/affected-project-graph/index.js.map +1 -0
- package/src/core/affected-project-graph/locators/implicit-json-changes.d.ts +4 -0
- package/src/core/affected-project-graph/locators/implicit-json-changes.js +54 -0
- package/src/core/affected-project-graph/locators/implicit-json-changes.js.map +1 -0
- package/src/core/affected-project-graph/locators/npm-packages.d.ts +4 -0
- package/src/core/affected-project-graph/locators/npm-packages.js +35 -0
- package/src/core/affected-project-graph/locators/npm-packages.js.map +1 -0
- package/src/core/affected-project-graph/locators/tsconfig-json-changes.d.ts +4 -0
- package/src/core/affected-project-graph/locators/tsconfig-json-changes.js +64 -0
- package/src/core/affected-project-graph/locators/tsconfig-json-changes.js.map +1 -0
- package/src/core/affected-project-graph/locators/workspace-json-changes.d.ts +4 -0
- package/src/core/affected-project-graph/locators/workspace-json-changes.js +48 -0
- package/src/core/affected-project-graph/locators/workspace-json-changes.js.map +1 -0
- package/src/core/affected-project-graph/locators/workspace-projects.d.ts +3 -0
- package/src/core/affected-project-graph/locators/workspace-projects.js +40 -0
- package/src/core/affected-project-graph/locators/workspace-projects.js.map +1 -0
- package/src/core/assert-workspace-validity.d.ts +2 -0
- package/src/core/assert-workspace-validity.js +72 -0
- package/src/core/assert-workspace-validity.js.map +1 -0
- package/src/core/dep-graph/3rdpartylicenses.txt +732 -0
- package/src/core/dep-graph/index.html +16 -0
- package/src/core/dep-graph/main.esm.js +2 -0
- package/src/core/dep-graph/main.esm.js.LICENSE.txt +39 -0
- package/src/core/dep-graph/polyfills.esm.js +1 -0
- package/src/core/dep-graph/runtime.esm.js +1 -0
- package/src/core/dep-graph/styles.css +3 -0
- package/src/core/file-map-utils.d.ts +9 -0
- package/src/core/file-map-utils.js +80 -0
- package/src/core/file-map-utils.js.map +1 -0
- package/src/core/file-utils.d.ts +41 -0
- package/src/core/file-utils.js +168 -0
- package/src/core/file-utils.js.map +1 -0
- package/src/core/hasher/file-hasher-base.d.ts +12 -0
- package/src/core/hasher/file-hasher-base.js +68 -0
- package/src/core/hasher/file-hasher-base.js.map +1 -0
- package/src/core/hasher/file-hasher.d.ts +2 -0
- package/src/core/hasher/file-hasher.js +22 -0
- package/src/core/hasher/file-hasher.js.map +1 -0
- package/src/core/hasher/git-based-file-hasher.d.ts +10 -0
- package/src/core/hasher/git-based-file-hasher.js +50 -0
- package/src/core/hasher/git-based-file-hasher.js.map +1 -0
- package/src/core/hasher/git-hasher.d.ts +7 -0
- package/src/core/hasher/git-hasher.js +134 -0
- package/src/core/hasher/git-hasher.js.map +1 -0
- package/src/core/hasher/hasher.d.ts +60 -0
- package/src/core/hasher/hasher.js +362 -0
- package/src/core/hasher/hasher.js.map +1 -0
- package/src/core/hasher/hashing-impl.d.ts +5 -0
- package/src/core/hasher/hashing-impl.js +23 -0
- package/src/core/hasher/hashing-impl.js.map +1 -0
- package/src/core/hasher/node-based-file-hasher.d.ts +7 -0
- package/src/core/hasher/node-based-file-hasher.js +78 -0
- package/src/core/hasher/node-based-file-hasher.js.map +1 -0
- package/src/core/normalize-nx-json.d.ts +8 -0
- package/src/core/normalize-nx-json.js +32 -0
- package/src/core/normalize-nx-json.js.map +1 -0
- package/src/core/nx-deps/nx-deps-cache.d.ts +41 -0
- package/src/core/nx-deps/nx-deps-cache.js +164 -0
- package/src/core/nx-deps/nx-deps-cache.js.map +1 -0
- package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.d.ts +6 -0
- package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.js +19 -0
- package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.js.map +1 -0
- package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +3 -0
- package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.js +76 -0
- package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.js.map +1 -0
- package/src/core/project-graph/build-dependencies/explicit-project-dependencies.d.ts +3 -0
- package/src/core/project-graph/build-dependencies/explicit-project-dependencies.js +27 -0
- package/src/core/project-graph/build-dependencies/explicit-project-dependencies.js.map +1 -0
- package/src/core/project-graph/build-dependencies/implicit-project-dependencies.d.ts +3 -0
- package/src/core/project-graph/build-dependencies/implicit-project-dependencies.js +20 -0
- package/src/core/project-graph/build-dependencies/implicit-project-dependencies.js.map +1 -0
- package/src/core/project-graph/build-dependencies/index.d.ts +3 -0
- package/src/core/project-graph/build-dependencies/index.js +7 -0
- package/src/core/project-graph/build-dependencies/index.js.map +1 -0
- package/src/core/project-graph/build-dependencies/typescript-import-locator.d.ts +11 -0
- package/src/core/project-graph/build-dependencies/typescript-import-locator.js +114 -0
- package/src/core/project-graph/build-dependencies/typescript-import-locator.js.map +1 -0
- package/src/core/project-graph/build-nodes/index.d.ts +2 -0
- package/src/core/project-graph/build-nodes/index.js +6 -0
- package/src/core/project-graph/build-nodes/index.js.map +1 -0
- package/src/core/project-graph/build-nodes/npm-packages.d.ts +2 -0
- package/src/core/project-graph/build-nodes/npm-packages.js +22 -0
- package/src/core/project-graph/build-nodes/npm-packages.js.map +1 -0
- package/src/core/project-graph/build-nodes/workspace-projects.d.ts +3 -0
- package/src/core/project-graph/build-nodes/workspace-projects.js +49 -0
- package/src/core/project-graph/build-nodes/workspace-projects.js.map +1 -0
- package/src/core/project-graph/build-project-graph.d.ts +9 -0
- package/src/core/project-graph/build-project-graph.js +233 -0
- package/src/core/project-graph/build-project-graph.js.map +1 -0
- package/src/core/project-graph/daemon/cache.d.ts +6 -0
- package/src/core/project-graph/daemon/cache.js +56 -0
- package/src/core/project-graph/daemon/cache.js.map +1 -0
- package/src/core/project-graph/daemon/client/client.d.ts +26 -0
- package/src/core/project-graph/daemon/client/client.js +200 -0
- package/src/core/project-graph/daemon/client/client.js.map +1 -0
- package/src/core/project-graph/daemon/client/exec-is-server-available.d.ts +1 -0
- package/src/core/project-graph/daemon/client/exec-is-server-available.js +13 -0
- package/src/core/project-graph/daemon/client/exec-is-server-available.js.map +1 -0
- package/src/core/project-graph/daemon/client/generate-help-output.d.ts +1 -0
- package/src/core/project-graph/daemon/client/generate-help-output.js +31 -0
- package/src/core/project-graph/daemon/client/generate-help-output.js.map +1 -0
- package/src/core/project-graph/daemon/server/logger.d.ts +18 -0
- package/src/core/project-graph/daemon/server/logger.js +38 -0
- package/src/core/project-graph/daemon/server/logger.js.map +1 -0
- package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.d.ts +8 -0
- package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js +191 -0
- package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js.map +1 -0
- package/src/core/project-graph/daemon/server/server.d.ts +4 -0
- package/src/core/project-graph/daemon/server/server.js +236 -0
- package/src/core/project-graph/daemon/server/server.js.map +1 -0
- package/src/core/project-graph/daemon/server/shutdown-utils.d.ts +12 -0
- package/src/core/project-graph/daemon/server/shutdown-utils.js +32 -0
- package/src/core/project-graph/daemon/server/shutdown-utils.js.map +1 -0
- package/src/core/project-graph/daemon/server/start.d.ts +1 -0
- package/src/core/project-graph/daemon/server/start.js +19 -0
- package/src/core/project-graph/daemon/server/start.js.map +1 -0
- package/src/core/project-graph/daemon/server/stop.d.ts +1 -0
- package/src/core/project-graph/daemon/server/stop.js +19 -0
- package/src/core/project-graph/daemon/server/stop.js.map +1 -0
- package/src/core/project-graph/daemon/server/watcher.d.ts +12 -0
- package/src/core/project-graph/daemon/server/watcher.js +158 -0
- package/src/core/project-graph/daemon/server/watcher.js.map +1 -0
- package/src/core/project-graph/daemon/socket-utils.d.ts +15 -0
- package/src/core/project-graph/daemon/socket-utils.js +38 -0
- package/src/core/project-graph/daemon/socket-utils.js.map +1 -0
- package/src/core/project-graph/daemon/tmp-dir.d.ts +6 -0
- package/src/core/project-graph/daemon/tmp-dir.js +37 -0
- package/src/core/project-graph/daemon/tmp-dir.js.map +1 -0
- package/src/core/project-graph/operators.d.ts +20 -0
- package/src/core/project-graph/operators.js +125 -0
- package/src/core/project-graph/operators.js.map +1 -0
- package/src/core/project-graph/project-graph-builder.d.ts +38 -0
- package/src/core/project-graph/project-graph-builder.js +164 -0
- package/src/core/project-graph/project-graph-builder.js.map +1 -0
- package/src/core/project-graph/project-graph-worker.d.ts +1 -0
- package/src/core/project-graph/project-graph-worker.js +19 -0
- package/src/core/project-graph/project-graph-worker.js.map +1 -0
- package/src/core/project-graph/project-graph.d.ts +37 -0
- package/src/core/project-graph/project-graph.js +188 -0
- package/src/core/project-graph/project-graph.js.map +1 -0
- package/src/core/shared-interfaces.d.ts +11 -0
- package/src/core/shared-interfaces.js +3 -0
- package/src/core/shared-interfaces.js.map +1 -0
- package/src/core/target-project-locator.d.ts +36 -0
- package/src/core/target-project-locator.js +164 -0
- package/src/core/target-project-locator.js.map +1 -0
- package/src/shared/nx.d.ts +2 -1
- package/src/shared/tree.js +1 -1
- package/src/shared/tree.js.map +1 -1
- package/src/shared/workspace.d.ts +8 -6
- package/src/shared/workspace.js +21 -20
- package/src/shared/workspace.js.map +1 -1
- package/src/tasks-runner/batch/batch-messages.d.ts +24 -0
- package/src/tasks-runner/batch/batch-messages.js +9 -0
- package/src/tasks-runner/batch/batch-messages.js.map +1 -0
- package/src/tasks-runner/batch/run-batch.d.ts +1 -0
- package/src/tasks-runner/batch/run-batch.js +57 -0
- package/src/tasks-runner/batch/run-batch.js.map +1 -0
- package/src/tasks-runner/cache.d.ts +40 -0
- package/src/tasks-runner/cache.js +284 -0
- package/src/tasks-runner/cache.js.map +1 -0
- package/src/tasks-runner/default-tasks-runner.d.ts +19 -0
- package/src/tasks-runner/default-tasks-runner.js +48 -0
- package/src/tasks-runner/default-tasks-runner.js.map +1 -0
- package/src/tasks-runner/forked-process-task-runner.d.ts +36 -0
- package/src/tasks-runner/forked-process-task-runner.js +259 -0
- package/src/tasks-runner/forked-process-task-runner.js.map +1 -0
- package/src/tasks-runner/life-cycle.d.ts +43 -0
- package/src/tasks-runner/life-cycle.js +72 -0
- package/src/tasks-runner/life-cycle.js.map +1 -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 +349 -0
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js.map +1 -0
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts +25 -0
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +231 -0
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js.map +1 -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 +19 -0
- package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js.map +1 -0
- package/src/tasks-runner/life-cycles/pretty-time.d.ts +4 -0
- package/src/tasks-runner/life-cycles/pretty-time.js +75 -0
- package/src/tasks-runner/life-cycles/pretty-time.js.map +1 -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 +110 -0
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js.map +1 -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 +97 -0
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js.map +1 -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 +67 -0
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.js.map +1 -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 +33 -0
- package/src/tasks-runner/life-cycles/task-timings-life-cycle.js.map +1 -0
- package/src/tasks-runner/remove-old-cache-records.d.ts +1 -0
- package/src/tasks-runner/remove-old-cache-records.js +62 -0
- package/src/tasks-runner/remove-old-cache-records.js.map +1 -0
- package/src/tasks-runner/reporter.d.ts +14 -0
- package/src/tasks-runner/reporter.js +11 -0
- package/src/tasks-runner/reporter.js.map +1 -0
- package/src/tasks-runner/run-command.d.ts +22 -0
- package/src/tasks-runner/run-command.js +352 -0
- package/src/tasks-runner/run-command.js.map +1 -0
- package/src/tasks-runner/task-graph-creator.d.ts +13 -0
- package/src/tasks-runner/task-graph-creator.js +71 -0
- package/src/tasks-runner/task-graph-creator.js.map +1 -0
- package/src/tasks-runner/task-orchestrator.d.ts +38 -0
- package/src/tasks-runner/task-orchestrator.js +299 -0
- package/src/tasks-runner/task-orchestrator.js.map +1 -0
- package/src/tasks-runner/tasks-runner-v2.d.ts +19 -0
- package/src/tasks-runner/tasks-runner-v2.js +42 -0
- package/src/tasks-runner/tasks-runner-v2.js.map +1 -0
- package/src/tasks-runner/tasks-runner.d.ts +45 -0
- package/src/tasks-runner/tasks-runner.js +15 -0
- package/src/tasks-runner/tasks-runner.js.map +1 -0
- package/src/tasks-runner/tasks-schedule.d.ts +33 -0
- package/src/tasks-runner/tasks-schedule.js +130 -0
- package/src/tasks-runner/tasks-schedule.js.map +1 -0
- package/src/tasks-runner/utils.d.ts +32 -0
- package/src/tasks-runner/utils.js +234 -0
- package/src/tasks-runner/utils.js.map +1 -0
- package/src/utils/app-root.d.ts +9 -0
- package/src/utils/app-root.js +10 -1
- package/src/utils/app-root.js.map +1 -1
- package/src/utils/cache-directory.d.ts +4 -0
- package/src/utils/cache-directory.js +37 -0
- package/src/utils/cache-directory.js.map +1 -0
- package/src/utils/default-base.d.ts +1 -0
- package/src/utils/default-base.js +16 -0
- package/src/utils/default-base.js.map +1 -0
- package/src/utils/fileutils.d.ts +4 -0
- package/src/utils/fileutils.js +38 -1
- package/src/utils/fileutils.js.map +1 -1
- package/src/{cli → utils}/find-workspace-root.d.ts +5 -2
- package/src/{cli → utils}/find-workspace-root.js +0 -0
- package/src/utils/find-workspace-root.js.map +1 -0
- package/src/{cli/is_ci.d.ts → utils/is-ci.d.ts} +0 -0
- package/src/{cli/is_ci.js → utils/is-ci.js} +2 -1
- package/src/utils/is-ci.js.map +1 -0
- package/src/utils/json-diff.d.ts +17 -0
- package/src/utils/json-diff.js +112 -0
- package/src/utils/json-diff.js.map +1 -0
- package/src/{shared → utils}/logger.d.ts +0 -0
- package/src/{shared → utils}/logger.js +0 -0
- package/src/utils/logger.js.map +1 -0
- package/src/{shared → utils}/nx-plugin.d.ts +12 -3
- package/src/utils/nx-plugin.js +162 -0
- package/src/utils/nx-plugin.js.map +1 -0
- package/src/{cli → utils}/output.d.ts +17 -14
- package/src/utils/output.js +170 -0
- package/src/utils/output.js.map +1 -0
- package/src/{shared → utils}/package-json.d.ts +2 -2
- package/src/{shared → utils}/package-json.js +0 -0
- package/src/utils/package-json.js.map +1 -0
- package/src/{shared → utils}/package-manager.d.ts +0 -0
- package/src/{shared → utils}/package-manager.js +0 -0
- package/src/utils/package-manager.js.map +1 -0
- package/src/{shared → utils}/params.d.ts +5 -4
- package/src/{shared → utils}/params.js +0 -0
- package/src/utils/params.js.map +1 -0
- package/src/utils/path.d.ts +8 -0
- package/src/utils/path.js +22 -0
- package/src/utils/path.js.map +1 -0
- package/src/utils/perf-logging.d.ts +1 -0
- package/src/utils/perf-logging.js +12 -0
- package/src/utils/perf-logging.js.map +1 -0
- package/src/utils/plugins/community-plugins.d.ts +3 -0
- package/src/utils/plugins/community-plugins.js +47 -0
- package/src/utils/plugins/community-plugins.js.map +1 -0
- package/src/utils/plugins/core-plugins.d.ts +3 -0
- package/src/utils/plugins/core-plugins.js +80 -0
- package/src/utils/plugins/core-plugins.js.map +1 -0
- package/src/utils/plugins/index.d.ts +4 -0
- package/src/utils/plugins/index.js +16 -0
- package/src/utils/plugins/index.js.map +1 -0
- package/src/utils/plugins/installed-plugins.d.ts +3 -0
- package/src/utils/plugins/installed-plugins.js +55 -0
- package/src/utils/plugins/installed-plugins.js.map +1 -0
- package/src/utils/plugins/models.d.ts +31 -0
- package/src/{cli/workspace.js → utils/plugins/models.js} +1 -1
- package/src/utils/plugins/models.js.map +1 -0
- package/src/utils/plugins/plugin-capabilities.d.ts +3 -0
- package/src/utils/plugins/plugin-capabilities.js +81 -0
- package/src/utils/plugins/plugin-capabilities.js.map +1 -0
- package/src/utils/plugins/shared.d.ts +1 -0
- package/src/utils/plugins/shared.js +9 -0
- package/src/utils/plugins/shared.js.map +1 -0
- package/src/utils/print-help.d.ts +10 -0
- package/src/utils/print-help.js +46 -0
- package/src/utils/print-help.js.map +1 -0
- package/src/utils/project-graph-utils.d.ts +12 -0
- package/src/utils/project-graph-utils.js +96 -0
- package/src/utils/project-graph-utils.js.map +1 -0
- package/src/utils/register.d.ts +1 -1
- package/src/utils/register.js +14 -9
- package/src/utils/register.js.map +1 -1
- package/src/utils/strip-indents.d.ts +14 -0
- package/src/utils/strip-indents.js +25 -0
- package/src/utils/strip-indents.js.map +1 -0
- package/src/utils/strip-source-code.d.ts +2 -0
- package/src/utils/strip-source-code.js +85 -0
- package/src/utils/strip-source-code.js.map +1 -0
- package/src/utils/typescript.d.ts +11 -0
- package/src/utils/typescript.js +70 -0
- package/src/utils/typescript.js.map +1 -0
- package/src/utils/version-utils.d.ts +1 -0
- package/src/utils/version-utils.js +19 -0
- package/src/utils/version-utils.js.map +1 -0
- package/src/utils/versions.d.ts +8 -0
- package/src/utils/versions.js +12 -0
- package/src/utils/versions.js.map +1 -0
- package/tasks-runners/default.d.ts +1 -0
- package/tasks-runners/default.js +6 -0
- package/tasks-runners/default.js.map +1 -0
- package/src/cli/decorate-cli.js.map +0 -1
- package/src/cli/find-workspace-root.js.map +0 -1
- package/src/cli/init-local.d.ts +0 -2
- package/src/cli/init-local.js +0 -109
- package/src/cli/init-local.js.map +0 -1
- package/src/cli/is_ci.js.map +0 -1
- package/src/cli/output.js +0 -129
- package/src/cli/output.js.map +0 -1
- package/src/cli/parse-run-one-options.d.ts +0 -6
- package/src/cli/parse-run-one-options.js +0 -139
- package/src/cli/parse-run-one-options.js.map +0 -1
- package/src/cli/run-cli.js.map +0 -1
- package/src/cli/workspace.d.ts +0 -4
- package/src/cli/workspace.js.map +0 -1
- package/src/commands/generate.d.ts +0 -15
- package/src/commands/generate.js.map +0 -1
- package/src/commands/help.d.ts +0 -1
- package/src/commands/help.js +0 -34
- package/src/commands/help.js.map +0 -1
- package/src/commands/migrate.js.map +0 -1
- package/src/commands/ngcli-adapter.js.map +0 -1
- package/src/commands/run.js.map +0 -1
- package/src/compat/compat.js.map +0 -1
- package/src/shared/logger.js.map +0 -1
- package/src/shared/nx-plugin.js +0 -53
- package/src/shared/nx-plugin.js.map +0 -1
- package/src/shared/package-json.js.map +0 -1
- package/src/shared/package-manager.js.map +0 -1
- package/src/shared/params.js.map +0 -1
- package/src/shared/print-help.d.ts +0 -2
- package/src/shared/print-help.js +0 -32
- package/src/shared/print-help.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listCorePlugins = exports.fetchCorePlugins = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
5
|
+
const output_1 = require("../output");
|
|
6
|
+
function fetchCorePlugins() {
|
|
7
|
+
const corePlugins = [
|
|
8
|
+
{
|
|
9
|
+
name: '@nrwl/angular',
|
|
10
|
+
capabilities: 'generators',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: '@nrwl/cypress',
|
|
14
|
+
capabilities: 'executors,generators',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: '@nrwl/express',
|
|
18
|
+
capabilities: 'executors,generators',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: '@nrwl/jest',
|
|
22
|
+
capabilities: 'executors,generators',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: '@nrwl/linter',
|
|
26
|
+
capabilities: 'executors',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: '@nrwl/nest',
|
|
30
|
+
capabilities: 'executors,generators',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: '@nrwl/next',
|
|
34
|
+
capabilities: 'executors,generators',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: '@nrwl/node',
|
|
38
|
+
capabilities: 'executors,generators',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: '@nrwl/nx-plugin',
|
|
42
|
+
capabilities: 'executors,generators',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: '@nrwl/react',
|
|
46
|
+
capabilities: 'executors,generators',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: '@nrwl/js',
|
|
50
|
+
capabilities: 'executors,generators',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: '@nrwl/storybook',
|
|
54
|
+
capabilities: 'executors,generators',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: '@nrwl/web',
|
|
58
|
+
capabilities: 'executors,generators',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: '@nrwl/workspace',
|
|
62
|
+
capabilities: 'executors,generators',
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
return corePlugins;
|
|
66
|
+
}
|
|
67
|
+
exports.fetchCorePlugins = fetchCorePlugins;
|
|
68
|
+
function listCorePlugins(installedPlugins, corePlugins) {
|
|
69
|
+
const alsoAvailable = corePlugins.filter((p) => !installedPlugins.has(p.name));
|
|
70
|
+
if (alsoAvailable.length) {
|
|
71
|
+
output_1.output.log({
|
|
72
|
+
title: `Also available:`,
|
|
73
|
+
bodyLines: alsoAvailable.map((p) => {
|
|
74
|
+
return `${chalk.bold(p.name)} (${p.capabilities})`;
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.listCorePlugins = listCorePlugins;
|
|
80
|
+
//# sourceMappingURL=core-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-plugins.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/plugins/core-plugins.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,sCAAmC;AAGnC,SAAgB,gBAAgB;IAC9B,MAAM,WAAW,GAAiB;QAChC;YACE,IAAI,EAAE,eAAe;YACrB,YAAY,EAAE,YAAY;SAC3B;QACD;YACE,IAAI,EAAE,eAAe;YACrB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,eAAe;YACrB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,cAAc;YACpB,YAAY,EAAE,WAAW;SAC1B;QACD;YACE,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,aAAa;YACnB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,WAAW;YACjB,YAAY,EAAE,sBAAsB;SACrC;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,YAAY,EAAE,sBAAsB;SACrC;KACF,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC;AA5DD,4CA4DC;AAED,SAAgB,eAAe,CAC7B,gBAAiD,EACjD,WAAyB;IAEzB,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CACrC,CAAC;IAEF,IAAI,aAAa,CAAC,MAAM,EAAE;QACxB,eAAM,CAAC,GAAG,CAAC;YACT,KAAK,EAAE,iBAAiB;YACxB,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACjC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,CAAC;YACrD,CAAC,CAAC;SACH,CAAC,CAAC;KACJ;AACH,CAAC;AAhBD,0CAgBC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { fetchCommunityPlugins, listCommunityPlugins, } from './community-plugins';
|
|
2
|
+
export { fetchCorePlugins, listCorePlugins } from './core-plugins';
|
|
3
|
+
export { getInstalledPluginsFromPackageJson, listInstalledPlugins, } from './installed-plugins';
|
|
4
|
+
export { getPluginCapabilities, listPluginCapabilities, } from './plugin-capabilities';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listPluginCapabilities = exports.getPluginCapabilities = exports.listInstalledPlugins = exports.getInstalledPluginsFromPackageJson = exports.listCorePlugins = exports.fetchCorePlugins = exports.listCommunityPlugins = exports.fetchCommunityPlugins = void 0;
|
|
4
|
+
var community_plugins_1 = require("./community-plugins");
|
|
5
|
+
Object.defineProperty(exports, "fetchCommunityPlugins", { enumerable: true, get: function () { return community_plugins_1.fetchCommunityPlugins; } });
|
|
6
|
+
Object.defineProperty(exports, "listCommunityPlugins", { enumerable: true, get: function () { return community_plugins_1.listCommunityPlugins; } });
|
|
7
|
+
var core_plugins_1 = require("./core-plugins");
|
|
8
|
+
Object.defineProperty(exports, "fetchCorePlugins", { enumerable: true, get: function () { return core_plugins_1.fetchCorePlugins; } });
|
|
9
|
+
Object.defineProperty(exports, "listCorePlugins", { enumerable: true, get: function () { return core_plugins_1.listCorePlugins; } });
|
|
10
|
+
var installed_plugins_1 = require("./installed-plugins");
|
|
11
|
+
Object.defineProperty(exports, "getInstalledPluginsFromPackageJson", { enumerable: true, get: function () { return installed_plugins_1.getInstalledPluginsFromPackageJson; } });
|
|
12
|
+
Object.defineProperty(exports, "listInstalledPlugins", { enumerable: true, get: function () { return installed_plugins_1.listInstalledPlugins; } });
|
|
13
|
+
var plugin_capabilities_1 = require("./plugin-capabilities");
|
|
14
|
+
Object.defineProperty(exports, "getPluginCapabilities", { enumerable: true, get: function () { return plugin_capabilities_1.getPluginCapabilities; } });
|
|
15
|
+
Object.defineProperty(exports, "listPluginCapabilities", { enumerable: true, get: function () { return plugin_capabilities_1.listPluginCapabilities; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/plugins/index.ts"],"names":[],"mappings":";;;AAAA,yDAG6B;AAF3B,0HAAA,qBAAqB,OAAA;AACrB,yHAAA,oBAAoB,OAAA;AAEtB,+CAAmE;AAA1D,gHAAA,gBAAgB,OAAA;AAAE,+GAAA,eAAe,OAAA;AAC1C,yDAG6B;AAF3B,uIAAA,kCAAkC,OAAA;AAClC,yHAAA,oBAAoB,OAAA;AAEtB,6DAG+B;AAF7B,4HAAA,qBAAqB,OAAA;AACrB,6HAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CommunityPlugin, CorePlugin, PluginCapabilities } from './models';
|
|
2
|
+
export declare function getInstalledPluginsFromPackageJson(workspaceRoot: string, corePlugins: CorePlugin[], communityPlugins?: CommunityPlugin[]): Map<string, PluginCapabilities>;
|
|
3
|
+
export declare function listInstalledPlugins(installedPlugins: Map<string, PluginCapabilities>): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listInstalledPlugins = exports.getInstalledPluginsFromPackageJson = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
5
|
+
const output_1 = require("../output");
|
|
6
|
+
const plugin_capabilities_1 = require("./plugin-capabilities");
|
|
7
|
+
const shared_1 = require("./shared");
|
|
8
|
+
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
9
|
+
function getInstalledPluginsFromPackageJson(workspaceRoot, corePlugins, communityPlugins = []) {
|
|
10
|
+
const packageJson = (0, fileutils_1.readJsonFile)(`${workspaceRoot}/package.json`);
|
|
11
|
+
const plugins = new Set([
|
|
12
|
+
...corePlugins.map((p) => p.name),
|
|
13
|
+
...communityPlugins.map((p) => p.name),
|
|
14
|
+
...Object.keys(packageJson.dependencies || {}),
|
|
15
|
+
...Object.keys(packageJson.devDependencies || {}),
|
|
16
|
+
]);
|
|
17
|
+
return new Map(Array.from(plugins)
|
|
18
|
+
.filter((name) => {
|
|
19
|
+
try {
|
|
20
|
+
// Check for `package.json` existence instead of requiring the module itself
|
|
21
|
+
// because malformed entries like `main`, may throw false exceptions.
|
|
22
|
+
require.resolve(`${name}/package.json`, { paths: [workspaceRoot] });
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch (_a) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
.sort()
|
|
30
|
+
.map((name) => [
|
|
31
|
+
name,
|
|
32
|
+
(0, plugin_capabilities_1.getPluginCapabilities)(workspaceRoot, name),
|
|
33
|
+
])
|
|
34
|
+
.filter(([, x]) => x && !!(x.generators || x.executors)));
|
|
35
|
+
}
|
|
36
|
+
exports.getInstalledPluginsFromPackageJson = getInstalledPluginsFromPackageJson;
|
|
37
|
+
function listInstalledPlugins(installedPlugins) {
|
|
38
|
+
const bodyLines = [];
|
|
39
|
+
for (const [, p] of installedPlugins) {
|
|
40
|
+
const capabilities = [];
|
|
41
|
+
if ((0, shared_1.hasElements)(p.executors)) {
|
|
42
|
+
capabilities.push('executors');
|
|
43
|
+
}
|
|
44
|
+
if ((0, shared_1.hasElements)(p.generators)) {
|
|
45
|
+
capabilities.push('generators');
|
|
46
|
+
}
|
|
47
|
+
bodyLines.push(`${chalk.bold(p.name)} (${capabilities.join()})`);
|
|
48
|
+
}
|
|
49
|
+
output_1.output.log({
|
|
50
|
+
title: `Installed plugins:`,
|
|
51
|
+
bodyLines: bodyLines,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
exports.listInstalledPlugins = listInstalledPlugins;
|
|
55
|
+
//# sourceMappingURL=installed-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installed-plugins.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/plugins/installed-plugins.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,sCAAmC;AAEnC,+DAA8D;AAC9D,qCAAuC;AACvC,sDAAsD;AAEtD,SAAgB,kCAAkC,CAChD,aAAqB,EACrB,WAAyB,EACzB,mBAAsC,EAAE;IAExC,MAAM,WAAW,GAAG,IAAA,wBAAY,EAAC,GAAG,aAAa,eAAe,CAAC,CAAC;IAElE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;QACtB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACjC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtC,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,C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,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KAClE;IAED,eAAM,CAAC,GAAG,CAAC;QACT,KAAK,EAAE,oBAAoB;QAC3B,SAAS,EAAE,SAAS;KACrB,CAAC,CAAC;AACL,CAAC;AApBD,oDAoBC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface PluginGenerator {
|
|
2
|
+
factory: string;
|
|
3
|
+
schema: string;
|
|
4
|
+
description: string;
|
|
5
|
+
aliases: string;
|
|
6
|
+
hidden: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PluginExecutor {
|
|
9
|
+
implementation: string;
|
|
10
|
+
schema: string;
|
|
11
|
+
description: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PluginCapabilities {
|
|
14
|
+
name: string;
|
|
15
|
+
executors: {
|
|
16
|
+
[name: string]: PluginExecutor;
|
|
17
|
+
};
|
|
18
|
+
generators: {
|
|
19
|
+
[name: string]: PluginGenerator;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface CorePlugin {
|
|
23
|
+
name: string;
|
|
24
|
+
capabilities: 'executors' | 'generators' | 'executors,generators';
|
|
25
|
+
link?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CommunityPlugin {
|
|
28
|
+
name: string;
|
|
29
|
+
url: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/plugins/models.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listPluginCapabilities = exports.getPluginCapabilities = void 0;
|
|
4
|
+
const app_root_1 = require("nx/src/utils/app-root");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const output_1 = require("../output");
|
|
8
|
+
const shared_1 = require("./shared");
|
|
9
|
+
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
10
|
+
const package_manager_1 = require("../package-manager");
|
|
11
|
+
function tryGetCollection(packageJsonPath, collectionFile, propName) {
|
|
12
|
+
if (!collectionFile) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const collectionFilePath = (0, path_1.join)((0, path_1.dirname)(packageJsonPath), collectionFile);
|
|
17
|
+
return (0, fileutils_1.readJsonFile)(collectionFilePath)[propName];
|
|
18
|
+
}
|
|
19
|
+
catch (_a) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function getPluginCapabilities(workspaceRoot, pluginName) {
|
|
24
|
+
try {
|
|
25
|
+
const packageJsonPath = require.resolve(`${pluginName}/package.json`, {
|
|
26
|
+
paths: [workspaceRoot],
|
|
27
|
+
});
|
|
28
|
+
const packageJson = (0, fileutils_1.readJsonFile)(packageJsonPath);
|
|
29
|
+
return {
|
|
30
|
+
name: pluginName,
|
|
31
|
+
generators: tryGetCollection(packageJsonPath, packageJson.generators, 'generators') ||
|
|
32
|
+
tryGetCollection(packageJsonPath, packageJson.schematics, 'schematics'),
|
|
33
|
+
executors: tryGetCollection(packageJsonPath, packageJson.executors, 'executors') ||
|
|
34
|
+
tryGetCollection(packageJsonPath, packageJson.builders, 'builders'),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (_a) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.getPluginCapabilities = getPluginCapabilities;
|
|
42
|
+
function listPluginCapabilities(pluginName) {
|
|
43
|
+
const plugin = getPluginCapabilities(app_root_1.appRootPath, pluginName);
|
|
44
|
+
if (!plugin) {
|
|
45
|
+
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
|
46
|
+
output_1.output.note({
|
|
47
|
+
title: `${pluginName} is not currently installed`,
|
|
48
|
+
bodyLines: [
|
|
49
|
+
`Use "${pmc.addDev} ${pluginName}" to install the plugin.`,
|
|
50
|
+
`After that, use "${pmc.exec} nx g ${pluginName}:init" to add the required peer deps and initialize the plugin.`,
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const hasBuilders = (0, shared_1.hasElements)(plugin.executors);
|
|
56
|
+
const hasGenerators = (0, shared_1.hasElements)(plugin.generators);
|
|
57
|
+
if (!hasBuilders && !hasGenerators) {
|
|
58
|
+
output_1.output.warn({ title: `No capabilities found in ${pluginName}` });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const bodyLines = [];
|
|
62
|
+
if (hasGenerators) {
|
|
63
|
+
bodyLines.push(chalk.bold(chalk.green('GENERATORS')));
|
|
64
|
+
bodyLines.push('');
|
|
65
|
+
bodyLines.push(...Object.keys(plugin.generators).map((name) => `${chalk.bold(name)} : ${plugin.generators[name].description}`));
|
|
66
|
+
if (hasBuilders) {
|
|
67
|
+
bodyLines.push('');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (hasBuilders) {
|
|
71
|
+
bodyLines.push(chalk.bold(chalk.green('EXECUTORS/BUILDERS')));
|
|
72
|
+
bodyLines.push('');
|
|
73
|
+
bodyLines.push(...Object.keys(plugin.executors).map((name) => `${chalk.bold(name)} : ${plugin.executors[name].description}`));
|
|
74
|
+
}
|
|
75
|
+
output_1.output.log({
|
|
76
|
+
title: `Capabilities in ${plugin.name}:`,
|
|
77
|
+
bodyLines,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.listPluginCapabilities = listPluginCapabilities;
|
|
81
|
+
//# sourceMappingURL=plugin-capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-capabilities.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/plugins/plugin-capabilities.ts"],"names":[],"mappings":";;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AAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAC9D,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnB,SAAS,CAAC,IAAI,CACZ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAClC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CACxE,CACF,CAAC;KACH;IAED,eAAM,CAAC,GAAG,CAAC;QACT,KAAK,EAAE,mBAAmB,MAAM,CAAC,IAAI,GAAG;QACxC,SAAS;KACV,CAAC,CAAC;AACL,CAAC;AArDD,wDAqDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasElements(obj: any): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Lifted in part from https://github.com/nrwl/angular-console
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.hasElements = void 0;
|
|
5
|
+
function hasElements(obj) {
|
|
6
|
+
return obj && Object.values(obj).length > 0;
|
|
7
|
+
}
|
|
8
|
+
exports.hasElements = hasElements;
|
|
9
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/plugins/shared.ts"],"names":[],"mappings":";AAAA,8DAA8D;;;AAE9D,SAAgB,WAAW,CAAC,GAAQ;IAClC,OAAO,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9C,CAAC;AAFD,kCAEC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printHelp = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
5
|
+
const logger_1 = require("./logger");
|
|
6
|
+
function formatOption(name, description) {
|
|
7
|
+
return ` --${`${name} `.substr(0, 22)}${description}`;
|
|
8
|
+
}
|
|
9
|
+
function printHelp(header, schema, meta) {
|
|
10
|
+
const allPositional = Object.keys(schema.properties).filter((key) => {
|
|
11
|
+
const p = schema.properties[key];
|
|
12
|
+
return p['$default'] && p['$default']['$source'] === 'argv';
|
|
13
|
+
});
|
|
14
|
+
const positional = allPositional.length > 0 ? ` [${allPositional[0]}]` : '';
|
|
15
|
+
const args = Object.keys(schema.properties)
|
|
16
|
+
.map((name) => {
|
|
17
|
+
const d = schema.properties[name];
|
|
18
|
+
const def = d.default ? ` (default: ${d.default})` : '';
|
|
19
|
+
return formatOption(name, `${d.description}${def}`);
|
|
20
|
+
})
|
|
21
|
+
.join('\n');
|
|
22
|
+
const missingFlags = meta.mode === 'generate'
|
|
23
|
+
? formatOption('dry-run', 'Preview the changes without updating files')
|
|
24
|
+
: formatOption('skip-nx-cache', 'Skip the use of Nx cache.');
|
|
25
|
+
let linkDescription = null;
|
|
26
|
+
// we need to generalize link generation so it works for non-party-class plugins as well
|
|
27
|
+
if (meta.mode === 'generate' && meta.plugin.startsWith('@nrwl/')) {
|
|
28
|
+
linkDescription = generateLink(meta.plugin, meta.entity, 'generators');
|
|
29
|
+
}
|
|
30
|
+
else if (meta.mode === 'run' && meta.plugin.startsWith('@nrwl/')) {
|
|
31
|
+
linkDescription = generateLink(meta.plugin, meta.entity, 'executors');
|
|
32
|
+
}
|
|
33
|
+
logger_1.logger.info((0, logger_1.stripIndent)(`
|
|
34
|
+
${chalk.bold(`${header + positional} [options,...]`)}
|
|
35
|
+
|
|
36
|
+
${chalk.bold('Options')}:
|
|
37
|
+
${args}
|
|
38
|
+
${missingFlags}${linkDescription}
|
|
39
|
+
`));
|
|
40
|
+
}
|
|
41
|
+
exports.printHelp = printHelp;
|
|
42
|
+
function generateLink(plugin, entity, type) {
|
|
43
|
+
const link = `https://nx.dev/packages/${plugin.substring(6)}/${type}/${entity}`;
|
|
44
|
+
return chalk.bold(`\n\nFind more information and examples at ${link}`);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=print-help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-help.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/print-help.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAC/B,qCAA+C;AAE/C,SAAS,YAAY,CAAC,IAAY,EAAE,WAAmB;IACrD,OAAO,OAAO,GAAG,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC;AAC7E,CAAC;AAED,SAAgB,SAAS,CACvB,MAAc,EACd,MAAc,EACd,IAEmD;IAEnD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QAClE,MAAM,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;SACxC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,OAA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,KAAK,CAAC,IAAI,CAAC,6CAA6C,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProjectGraph, ProjectGraphProjectNode } from '../shared/project-graph';
|
|
2
|
+
import { TargetConfiguration } from '../shared/workspace';
|
|
3
|
+
export declare function projectHasTarget(project: ProjectGraphProjectNode, target: string): any;
|
|
4
|
+
export declare function projectHasTargetAndConfiguration(project: ProjectGraphProjectNode, target: string, configuration: string): any;
|
|
5
|
+
export declare function mergeNpmScriptsWithTargets(projectRoot: string, targets: any): Record<string, TargetConfiguration>;
|
|
6
|
+
export declare function getSourceDirOfDependentProjects(projectName: string, projectGraph?: ProjectGraph<any>): string[];
|
|
7
|
+
/**
|
|
8
|
+
* Finds the project node name by a file that lives within it's src root
|
|
9
|
+
* @param projRelativeDirPath directory path relative to the workspace root
|
|
10
|
+
* @param projectGraph
|
|
11
|
+
*/
|
|
12
|
+
export declare function getProjectNameFromDirPath(projRelativeDirPath: string, projectGraph?: ProjectGraph<any>): any;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectNameFromDirPath = exports.getSourceDirOfDependentProjects = exports.mergeNpmScriptsWithTargets = exports.projectHasTargetAndConfiguration = exports.projectHasTarget = void 0;
|
|
4
|
+
const package_json_1 = require("nx/src/utils/package-json");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
7
|
+
const path_2 = require("nx/src/utils/path");
|
|
8
|
+
const project_graph_1 = require("../core/project-graph/project-graph");
|
|
9
|
+
function projectHasTarget(project, target) {
|
|
10
|
+
return project.data && project.data.targets && project.data.targets[target];
|
|
11
|
+
}
|
|
12
|
+
exports.projectHasTarget = projectHasTarget;
|
|
13
|
+
function projectHasTargetAndConfiguration(project, target, configuration) {
|
|
14
|
+
return (projectHasTarget(project, target) &&
|
|
15
|
+
project.data.targets[target].configurations &&
|
|
16
|
+
project.data.targets[target].configurations[configuration]);
|
|
17
|
+
}
|
|
18
|
+
exports.projectHasTargetAndConfiguration = projectHasTargetAndConfiguration;
|
|
19
|
+
function mergeNpmScriptsWithTargets(projectRoot, targets) {
|
|
20
|
+
try {
|
|
21
|
+
const { scripts, nx } = (0, fileutils_1.readJsonFile)((0, path_1.join)(projectRoot, 'package.json'));
|
|
22
|
+
const res = {};
|
|
23
|
+
// handle no scripts
|
|
24
|
+
Object.keys(scripts || {}).forEach((script) => {
|
|
25
|
+
res[script] = (0, package_json_1.buildTargetFromScript)(script, nx);
|
|
26
|
+
});
|
|
27
|
+
return Object.assign(Object.assign({}, res), (targets || {}));
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
return targets;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.mergeNpmScriptsWithTargets = mergeNpmScriptsWithTargets;
|
|
34
|
+
function getSourceDirOfDependentProjects(projectName, projectGraph = (0, project_graph_1.readCachedProjectGraph)()) {
|
|
35
|
+
if (!projectGraph.nodes[projectName]) {
|
|
36
|
+
throw new Error(`Couldn't find project "${projectName}" in this Nx workspace`);
|
|
37
|
+
}
|
|
38
|
+
const nodeNames = findAllProjectNodeDependencies(projectName, projectGraph);
|
|
39
|
+
return nodeNames.map((nodeName) => projectGraph.nodes[nodeName].data.sourceRoot);
|
|
40
|
+
}
|
|
41
|
+
exports.getSourceDirOfDependentProjects = getSourceDirOfDependentProjects;
|
|
42
|
+
/**
|
|
43
|
+
* Finds the project node name by a file that lives within it's src root
|
|
44
|
+
* @param projRelativeDirPath directory path relative to the workspace root
|
|
45
|
+
* @param projectGraph
|
|
46
|
+
*/
|
|
47
|
+
function getProjectNameFromDirPath(projRelativeDirPath, projectGraph = (0, project_graph_1.readCachedProjectGraph)()) {
|
|
48
|
+
let parentNodeName = null;
|
|
49
|
+
for (const [nodeName, node] of Object.entries(projectGraph.nodes)) {
|
|
50
|
+
const normalizedRootPath = (0, path_2.normalizePath)(node.data.root);
|
|
51
|
+
const normalizedProjRelPath = (0, path_2.normalizePath)(projRelativeDirPath);
|
|
52
|
+
const relativePath = (0, path_1.relative)(normalizedRootPath, normalizedProjRelPath);
|
|
53
|
+
const isMatch = relativePath && !relativePath.startsWith('..');
|
|
54
|
+
if (isMatch || normalizedRootPath === normalizedProjRelPath) {
|
|
55
|
+
parentNodeName = nodeName;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!parentNodeName) {
|
|
60
|
+
throw new Error(`Could not find any project containing the file "${projRelativeDirPath}" among it's project files`);
|
|
61
|
+
}
|
|
62
|
+
return parentNodeName;
|
|
63
|
+
}
|
|
64
|
+
exports.getProjectNameFromDirPath = getProjectNameFromDirPath;
|
|
65
|
+
/**
|
|
66
|
+
* Find all internal project dependencies.
|
|
67
|
+
* All the external (npm) dependencies will be filtered out
|
|
68
|
+
* @param {string} parentNodeName
|
|
69
|
+
* @param {ProjectGraph} projectGraph
|
|
70
|
+
* @returns {string[]}
|
|
71
|
+
*/
|
|
72
|
+
function findAllProjectNodeDependencies(parentNodeName, projectGraph = (0, project_graph_1.readCachedProjectGraph)()) {
|
|
73
|
+
const dependencyNodeNames = new Set();
|
|
74
|
+
collectDependentProjectNodesNames(projectGraph, dependencyNodeNames, parentNodeName);
|
|
75
|
+
return Array.from(dependencyNodeNames);
|
|
76
|
+
}
|
|
77
|
+
// Recursively get all the dependencies of the node
|
|
78
|
+
function collectDependentProjectNodesNames(nxDeps, dependencyNodeNames, parentNodeName) {
|
|
79
|
+
const dependencies = nxDeps.dependencies[parentNodeName];
|
|
80
|
+
if (!dependencies) {
|
|
81
|
+
// no dependencies for the given node, so silently return,
|
|
82
|
+
// as we probably wouldn't want to throw here
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
for (const dependency of dependencies) {
|
|
86
|
+
const dependencyName = dependency.target;
|
|
87
|
+
// we're only intersted in project dependencies, not npm
|
|
88
|
+
if (dependencyName.startsWith('npm:')) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
dependencyNodeNames.add(dependencyName);
|
|
92
|
+
// Get the dependencies of the dependencies
|
|
93
|
+
collectDependentProjectNodesNames(nxDeps, dependencyNodeNames, dependencyName);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=project-graph-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-graph-utils.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/project-graph-utils.ts"],"names":[],"mappings":";;;AAAA,4DAA+E;AAC/E,+BAAsC;AAGtC,sDAAsD;AACtD,4CAAkD;AAClD,uEAA6E;AAE7E,SAAgB,gBAAgB,CAC9B,OAAgC,EAChC,MAAc;IAEd,OAAO,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC;AALD,4CAKC;AAED,SAAgB,gCAAgC,CAC9C,OAAgC,EAChC,MAAc,EACd,aAAqB;IAErB,OAAO,CACL,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,cAAc;QAC3C,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAC3D,CAAC;AACJ,CAAC;AAVD,4EAUC;AAED,SAAgB,0BAA0B,CACxC,WAAmB,EACnB,OAAO;IAEP,IAAI;QACF,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,GAAgB,IAAA,wBAAY,EAC/C,IAAA,WAAI,EAAC,WAAW,EAAE,cAAc,CAAC,CAClC,CAAC;QACF,MAAM,GAAG,GAAwC,EAAE,CAAC;QACpD,oBAAoB;QACpB,MAAM,CAAC,IAAI,CAA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the root of their project and the fundamentals will still work (but
|
|
7
7
|
* workspace path mapping will not, for example).
|
|
8
8
|
*/
|
|
9
|
-
export declare const registerTsProject: (path: string, configFilename?: string) =>
|
|
9
|
+
export declare const registerTsProject: (path: string, configFilename?: string) => () => void;
|
package/src/utils/register.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerTsProject = void 0;
|
|
4
|
-
const read_default_tsconfig_1 = require("@swc-node/register/read-default-tsconfig");
|
|
5
|
-
const register_1 = require("@swc-node/register/register");
|
|
6
4
|
const path_1 = require("path");
|
|
7
5
|
/**
|
|
8
6
|
* Optionally, if swc-node and tsconfig-paths are available in the current workspace, apply the require
|
|
@@ -13,24 +11,31 @@ const path_1 = require("path");
|
|
|
13
11
|
* workspace path mapping will not, for example).
|
|
14
12
|
*/
|
|
15
13
|
const registerTsProject = (path, configFilename = 'tsconfig.json') => {
|
|
14
|
+
// These are requires to prevent it from registering when it shouldn't
|
|
15
|
+
const { register } = require('@swc-node/register/register');
|
|
16
|
+
const { readDefaultTsConfig, } = require('@swc-node/register/read-default-tsconfig');
|
|
16
17
|
try {
|
|
17
|
-
const
|
|
18
|
-
|
|
18
|
+
const tsConfigPath = (0, path_1.join)(path, configFilename);
|
|
19
|
+
const tsConfig = readDefaultTsConfig(tsConfigPath);
|
|
20
|
+
register(tsConfig);
|
|
19
21
|
/**
|
|
20
22
|
* Load the ts config from the source project
|
|
21
23
|
*/
|
|
22
24
|
const tsconfigPaths = require('tsconfig-paths');
|
|
23
|
-
const tsConfigResult = tsconfigPaths.loadConfig(
|
|
25
|
+
const tsConfigResult = tsconfigPaths.loadConfig(tsConfigPath);
|
|
24
26
|
/**
|
|
25
27
|
* Register the custom workspace path mappings with node so that workspace libraries
|
|
26
28
|
* can be imported and used within project
|
|
27
29
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (tsConfigResult.resultType === 'success') {
|
|
31
|
+
return tsconfigPaths.register({
|
|
32
|
+
baseUrl: tsConfigResult.absoluteBaseUrl,
|
|
33
|
+
paths: tsConfigResult.paths,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
catch (err) { }
|
|
38
|
+
return () => { };
|
|
34
39
|
};
|
|
35
40
|
exports.registerTsProject = registerTsProject;
|
|
36
41
|
//# sourceMappingURL=register.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/register.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/register.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B;;;;;;;GAOG;AACI,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,cAAc,GAAG,eAAe,EAChC,EAAE;IACF,sEAAsE;IACtE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5D,MAAM,EACJ,mBAAmB,GACpB,GAAG,OAAO,CAAC,0CAA0C,CAAC,CAAC;IAExD,IAAI;QACF,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACnD,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEnB;;WAEG;QACH,MAAM,aAAa,GAAoC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACjF,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC9D;;;WAGG;QACH,IAAI,cAAc,CAAC,UAAU,KAAK,SAAS,EAAE;YAC3C,OAAO,aAAa,CAAC,QAAQ,CAAC;gBAC5B,OAAO,EAAE,cAAc,CAAC,eAAe;gBACvC,KAAK,EAAE,cAAc,CAAC,KAAK;aAC5B,CAAC,CAAC;SACJ;KACF;IAAC,OAAO,GAAG,EAAE,GAAE;IAChB,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;AAClB,CAAC,CAAC;AAhCW,QAAA,iBAAiB,qBAgC5B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes indents, which is useful for printing warning and messages.
|
|
3
|
+
*
|
|
4
|
+
* Example:
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* stripIndents`
|
|
8
|
+
* Options:
|
|
9
|
+
* - option1
|
|
10
|
+
* - option2
|
|
11
|
+
* `
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function stripIndents(strings: TemplateStringsArray, ...values: any[]): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripIndents = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Removes indents, which is useful for printing warning and messages.
|
|
6
|
+
*
|
|
7
|
+
* Example:
|
|
8
|
+
*
|
|
9
|
+
* ```typescript
|
|
10
|
+
* stripIndents`
|
|
11
|
+
* Options:
|
|
12
|
+
* - option1
|
|
13
|
+
* - option2
|
|
14
|
+
* `
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function stripIndents(strings, ...values) {
|
|
18
|
+
return String.raw(strings, ...values)
|
|
19
|
+
.split('\n')
|
|
20
|
+
.map((line) => line.trim())
|
|
21
|
+
.join('\n')
|
|
22
|
+
.trim();
|
|
23
|
+
}
|
|
24
|
+
exports.stripIndents = stripIndents;
|
|
25
|
+
//# sourceMappingURL=strip-indents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-indents.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/strip-indents.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,SAAgB,YAAY,CAC1B,OAA6B,EAC7B,GAAG,MAAa;IAEhB,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;SAClC,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,IAAI,CAAC,IAAI,CAAC;SACV,IAAI,EAAE,CAAC;AACZ,CAAC;AATD,oCASC"}
|