@angular/cli 22.2.1 → 22.3.0-next.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/bin/ng.js +7 -10
- package/bin/version.js +98 -0
- package/index.d.ts +19 -0
- package/lib/chunk-5AASRQKS.js +85 -0
- package/lib/chunk-A2VIYA2E.js +165 -0
- package/lib/chunk-CAZUOCTC.js +225 -0
- package/lib/chunk-DHWVZMLH.js +206 -0
- package/lib/chunk-FZ5GFCWU.js +483 -0
- package/lib/chunk-G7TRU43D.js +42 -0
- package/lib/chunk-GHUUJYOY.js +40 -0
- package/lib/chunk-JBLF2TH3.js +267 -0
- package/lib/chunk-Q67GOPL7.js +380 -0
- package/lib/chunk-SN4KY4Z3.js +24 -0
- package/lib/chunk-XFL2J3CJ.js +24 -0
- package/lib/chunk-XG3HVNIL.js +59 -0
- package/lib/chunk-YM7ILCS5.js +2573 -0
- package/lib/cli/index.js +353 -105
- package/lib/cli-4CMZ6KMR.js +48 -0
- package/lib/cli-4Q7DGTBA.js +33 -0
- package/lib/cli-6AHY7ADW.js +96 -0
- package/lib/cli-A5UAJDO6.js +135 -0
- package/lib/cli-ACLGUIBI.js +2531 -0
- package/lib/cli-BQRFWIMG.js +35 -0
- package/lib/cli-CWICUPZW.js +42 -0
- package/lib/cli-DWQUM3M2.js +29 -0
- package/lib/cli-L4TM4JH3.js +88 -0
- package/lib/cli-LYBZEMDR.js +96 -0
- package/lib/cli-PDCEX7HQ.js +605 -0
- package/lib/cli-PJVTDBQM.js +51 -0
- package/lib/cli-PRIRL3WP.js +185 -0
- package/lib/cli-PU5VH7JB.js +189 -0
- package/lib/cli-QUH44NUB.js +68 -0
- package/lib/cli-VVITNTBC.js +50 -0
- package/lib/cli-XM4L4PP4.js +1651 -0
- package/lib/cli-Y2ECUR33.js +33 -0
- package/lib/cli-YDSMJOSO.js +182 -0
- package/lib/color-SJPGXZVA.js +8 -0
- package/lib/config/schema.json +204 -0
- package/lib/config-QXK7SSVG.js +22 -0
- package/lib/init.js +91 -180
- package/package.json +20 -15
- package/lib/cli/index.d.ts +0 -11
- package/lib/cli/index.js.map +0 -1
- package/lib/config/workspace-schema.d.ts +0 -1025
- package/lib/config/workspace-schema.js +0 -131
- package/lib/config/workspace-schema.js.map +0 -1
- package/lib/init.d.ts +0 -8
- package/lib/init.js.map +0 -1
- package/src/analytics/analytics-collector.d.ts +0 -35
- package/src/analytics/analytics-collector.js +0 -195
- package/src/analytics/analytics-collector.js.map +0 -1
- package/src/analytics/analytics-parameters.d.ts +0 -101
- package/src/analytics/analytics-parameters.js +0 -107
- package/src/analytics/analytics-parameters.js.map +0 -1
- package/src/analytics/analytics.d.ts +0 -27
- package/src/analytics/analytics.js +0 -183
- package/src/analytics/analytics.js.map +0 -1
- package/src/command-builder/architect-base-command-module.d.ts +0 -30
- package/src/command-builder/architect-base-command-module.js +0 -244
- package/src/command-builder/architect-base-command-module.js.map +0 -1
- package/src/command-builder/architect-command-module.d.ts +0 -28
- package/src/command-builder/architect-command-module.js +0 -218
- package/src/command-builder/architect-command-module.js.map +0 -1
- package/src/command-builder/command-module.d.ts +0 -73
- package/src/command-builder/command-module.js +0 -260
- package/src/command-builder/command-module.js.map +0 -1
- package/src/command-builder/command-runner.d.ts +0 -9
- package/src/command-builder/command-runner.js +0 -202
- package/src/command-builder/command-runner.js.map +0 -1
- package/src/command-builder/definitions.d.ts +0 -41
- package/src/command-builder/definitions.js +0 -20
- package/src/command-builder/definitions.js.map +0 -1
- package/src/command-builder/schematics-command-module.d.ts +0 -41
- package/src/command-builder/schematics-command-module.js +0 -408
- package/src/command-builder/schematics-command-module.js.map +0 -1
- package/src/command-builder/utilities/command.d.ts +0 -13
- package/src/command-builder/utilities/command.js +0 -39
- package/src/command-builder/utilities/command.js.map +0 -1
- package/src/command-builder/utilities/json-help.d.ts +0 -37
- package/src/command-builder/utilities/json-help.js +0 -92
- package/src/command-builder/utilities/json-help.js.map +0 -1
- package/src/command-builder/utilities/json-schema.d.ts +0 -64
- package/src/command-builder/utilities/json-schema.js +0 -349
- package/src/command-builder/utilities/json-schema.js.map +0 -1
- package/src/command-builder/utilities/normalize-options-middleware.d.ts +0 -18
- package/src/command-builder/utilities/normalize-options-middleware.js +0 -37
- package/src/command-builder/utilities/normalize-options-middleware.js.map +0 -1
- package/src/command-builder/utilities/schematic-engine-host.d.ts +0 -15
- package/src/command-builder/utilities/schematic-engine-host.js +0 -179
- package/src/command-builder/utilities/schematic-engine-host.js.map +0 -1
- package/src/command-builder/utilities/schematic-workflow.d.ts +0 -14
- package/src/command-builder/utilities/schematic-workflow.js +0 -70
- package/src/command-builder/utilities/schematic-workflow.js.map +0 -1
- package/src/commands/add/cli.d.ts +0 -41
- package/src/commands/add/cli.js +0 -705
- package/src/commands/add/cli.js.map +0 -1
- package/src/commands/add/long-description.md +0 -7
- package/src/commands/analytics/cli.d.ts +0 -16
- package/src/commands/analytics/cli.js +0 -34
- package/src/commands/analytics/cli.js.map +0 -1
- package/src/commands/analytics/info/cli.d.ts +0 -16
- package/src/commands/analytics/info/cli.js +0 -25
- package/src/commands/analytics/info/cli.js.map +0 -1
- package/src/commands/analytics/long-description.md +0 -20
- package/src/commands/analytics/settings/cli.d.ts +0 -35
- package/src/commands/analytics/settings/cli.js +0 -54
- package/src/commands/analytics/settings/cli.js.map +0 -1
- package/src/commands/build/cli.d.ts +0 -16
- package/src/commands/build/cli.js +0 -21
- package/src/commands/build/cli.js.map +0 -1
- package/src/commands/build/long-description.md +0 -18
- package/src/commands/cache/clean/cli.d.ts +0 -17
- package/src/commands/cache/clean/cli.js +0 -32
- package/src/commands/cache/clean/cli.js.map +0 -1
- package/src/commands/cache/cli.d.ts +0 -17
- package/src/commands/cache/cli.js +0 -36
- package/src/commands/cache/cli.js.map +0 -1
- package/src/commands/cache/info/cli.d.ts +0 -20
- package/src/commands/cache/info/cli.js +0 -139
- package/src/commands/cache/info/cli.js.map +0 -1
- package/src/commands/cache/long-description.md +0 -53
- package/src/commands/cache/settings/cli.d.ts +0 -27
- package/src/commands/cache/settings/cli.js +0 -41
- package/src/commands/cache/settings/cli.js.map +0 -1
- package/src/commands/cache/utilities.d.ts +0 -11
- package/src/commands/cache/utilities.js +0 -90
- package/src/commands/cache/utilities.js.map +0 -1
- package/src/commands/command-config.d.ts +0 -17
- package/src/commands/command-config.js +0 -116
- package/src/commands/command-config.js.map +0 -1
- package/src/commands/completion/cli.d.ts +0 -16
- package/src/commands/completion/cli.js +0 -61
- package/src/commands/completion/cli.js.map +0 -1
- package/src/commands/completion/long-description.md +0 -67
- package/src/commands/config/cli.d.ts +0 -24
- package/src/commands/config/cli.js +0 -150
- package/src/commands/config/cli.js.map +0 -1
- package/src/commands/config/long-description.md +0 -13
- package/src/commands/deploy/cli.d.ts +0 -17
- package/src/commands/deploy/cli.js +0 -38
- package/src/commands/deploy/cli.js.map +0 -1
- package/src/commands/deploy/long-description.md +0 -22
- package/src/commands/e2e/cli.d.ts +0 -18
- package/src/commands/e2e/cli.js +0 -42
- package/src/commands/e2e/cli.js.map +0 -1
- package/src/commands/extract-i18n/cli.d.ts +0 -17
- package/src/commands/extract-i18n/cli.js +0 -48
- package/src/commands/extract-i18n/cli.js.map +0 -1
- package/src/commands/generate/cli.d.ts +0 -47
- package/src/commands/generate/cli.js +0 -189
- package/src/commands/generate/cli.js.map +0 -1
- package/src/commands/lint/cli.d.ts +0 -17
- package/src/commands/lint/cli.js +0 -25
- package/src/commands/lint/cli.js.map +0 -1
- package/src/commands/lint/long-description.md +0 -20
- package/src/commands/make-this-awesome/cli.d.ts +0 -17
- package/src/commands/make-this-awesome/cli.js +0 -36
- package/src/commands/make-this-awesome/cli.js.map +0 -1
- package/src/commands/mcp/cli.d.ts +0 -21
- package/src/commands/mcp/cli.js +0 -74
- package/src/commands/mcp/cli.js.map +0 -1
- package/src/commands/mcp/constants.d.ts +0 -10
- package/src/commands/mcp/constants.js +0 -16
- package/src/commands/mcp/constants.js.map +0 -1
- package/src/commands/mcp/devserver.d.ts +0 -85
- package/src/commands/mcp/devserver.js +0 -109
- package/src/commands/mcp/devserver.js.map +0 -1
- package/src/commands/mcp/host.d.ts +0 -103
- package/src/commands/mcp/host.js +0 -270
- package/src/commands/mcp/host.js.map +0 -1
- package/src/commands/mcp/mcp-server.d.ts +0 -38
- package/src/commands/mcp/mcp-server.js +0 -176
- package/src/commands/mcp/mcp-server.js.map +0 -1
- package/src/commands/mcp/resources/ai-tutor.md +0 -822
- package/src/commands/mcp/resources/best-practices.md +0 -59
- package/src/commands/mcp/resources/instructions.d.ts +0 -9
- package/src/commands/mcp/resources/instructions.js +0 -26
- package/src/commands/mcp/resources/instructions.js.map +0 -1
- package/src/commands/mcp/shared-options.d.ts +0 -12
- package/src/commands/mcp/shared-options.js +0 -22
- package/src/commands/mcp/shared-options.js.map +0 -1
- package/src/commands/mcp/tools/ai-tutor.d.ts +0 -12
- package/src/commands/mcp/tools/ai-tutor.js +0 -59
- package/src/commands/mcp/tools/ai-tutor.js.map +0 -1
- package/src/commands/mcp/tools/best-practices.d.ts +0 -13
- package/src/commands/mcp/tools/best-practices.js +0 -196
- package/src/commands/mcp/tools/best-practices.js.map +0 -1
- package/src/commands/mcp/tools/devserver/devserver-start.d.ts +0 -32
- package/src/commands/mcp/tools/devserver/devserver-start.js +0 -110
- package/src/commands/mcp/tools/devserver/devserver-start.js.map +0 -1
- package/src/commands/mcp/tools/devserver/devserver-stop.d.ts +0 -31
- package/src/commands/mcp/tools/devserver/devserver-stop.js +0 -69
- package/src/commands/mcp/tools/devserver/devserver-stop.js.map +0 -1
- package/src/commands/mcp/tools/devserver/devserver-wait-for-build.d.ts +0 -41
- package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js +0 -105
- package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js.map +0 -1
- package/src/commands/mcp/tools/doc-search.d.ts +0 -21
- package/src/commands/mcp/tools/doc-search.js +0 -307
- package/src/commands/mcp/tools/doc-search.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.d.ts +0 -17
- package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js +0 -62
- package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.d.ts +0 -12
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js +0 -70
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.d.ts +0 -12
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js +0 -60
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +0 -15
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +0 -238
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.d.ts +0 -9
- package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js +0 -14
- package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.d.ts +0 -36
- package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js +0 -135
- package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/types.d.ts +0 -13
- package/src/commands/mcp/tools/onpush-zoneless-migration/types.js +0 -10
- package/src/commands/mcp/tools/onpush-zoneless-migration/types.js.map +0 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +0 -16
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +0 -215
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +0 -1
- package/src/commands/mcp/tools/projects.d.ts +0 -48
- package/src/commands/mcp/tools/projects.js +0 -541
- package/src/commands/mcp/tools/projects.js.map +0 -1
- package/src/commands/mcp/tools/run-target/build-target-strategy.d.ts +0 -14
- package/src/commands/mcp/tools/run-target/build-target-strategy.js +0 -53
- package/src/commands/mcp/tools/run-target/build-target-strategy.js.map +0 -1
- package/src/commands/mcp/tools/run-target/generic-target-strategy.d.ts +0 -14
- package/src/commands/mcp/tools/run-target/generic-target-strategy.js +0 -63
- package/src/commands/mcp/tools/run-target/generic-target-strategy.js.map +0 -1
- package/src/commands/mcp/tools/run-target/options-serializer.d.ts +0 -13
- package/src/commands/mcp/tools/run-target/options-serializer.js +0 -41
- package/src/commands/mcp/tools/run-target/options-serializer.js.map +0 -1
- package/src/commands/mcp/tools/run-target/run-target.d.ts +0 -34
- package/src/commands/mcp/tools/run-target/run-target.js +0 -69
- package/src/commands/mcp/tools/run-target/run-target.js.map +0 -1
- package/src/commands/mcp/tools/run-target/strategy.d.ts +0 -15
- package/src/commands/mcp/tools/run-target/strategy.js +0 -10
- package/src/commands/mcp/tools/run-target/strategy.js.map +0 -1
- package/src/commands/mcp/tools/run-target/types.d.ts +0 -39
- package/src/commands/mcp/tools/run-target/types.js +0 -41
- package/src/commands/mcp/tools/run-target/types.js.map +0 -1
- package/src/commands/mcp/tools/run-target/unit-test-strategy.d.ts +0 -14
- package/src/commands/mcp/tools/run-target/unit-test-strategy.js +0 -56
- package/src/commands/mcp/tools/run-target/unit-test-strategy.js.map +0 -1
- package/src/commands/mcp/tools/tool-registry.d.ts +0 -40
- package/src/commands/mcp/tools/tool-registry.js +0 -40
- package/src/commands/mcp/tools/tool-registry.js.map +0 -1
- package/src/commands/mcp/utils.d.ts +0 -25
- package/src/commands/mcp/utils.js +0 -44
- package/src/commands/mcp/utils.js.map +0 -1
- package/src/commands/mcp/workspace-utils.d.ts +0 -55
- package/src/commands/mcp/workspace-utils.js +0 -181
- package/src/commands/mcp/workspace-utils.js.map +0 -1
- package/src/commands/new/cli.d.ts +0 -27
- package/src/commands/new/cli.js +0 -76
- package/src/commands/new/cli.js.map +0 -1
- package/src/commands/new/long-description.md +0 -15
- package/src/commands/run/cli.d.ts +0 -25
- package/src/commands/run/cli.js +0 -89
- package/src/commands/run/cli.js.map +0 -1
- package/src/commands/run/long-description.md +0 -10
- package/src/commands/serve/cli.d.ts +0 -16
- package/src/commands/serve/cli.js +0 -20
- package/src/commands/serve/cli.js.map +0 -1
- package/src/commands/test/cli.d.ts +0 -16
- package/src/commands/test/cli.js +0 -21
- package/src/commands/test/cli.js.map +0 -1
- package/src/commands/test/long-description.md +0 -2
- package/src/commands/update/cli.d.ts +0 -50
- package/src/commands/update/cli.js +0 -586
- package/src/commands/update/cli.js.map +0 -1
- package/src/commands/update/long-description.md +0 -22
- package/src/commands/update/update-resolver.d.ts +0 -75
- package/src/commands/update/update-resolver.js +0 -918
- package/src/commands/update/update-resolver.js.map +0 -1
- package/src/commands/update/utilities/cli-version.d.ts +0 -48
- package/src/commands/update/utilities/cli-version.js +0 -196
- package/src/commands/update/utilities/cli-version.js.map +0 -1
- package/src/commands/update/utilities/constants.d.ts +0 -12
- package/src/commands/update/utilities/constants.js +0 -16
- package/src/commands/update/utilities/constants.js.map +0 -1
- package/src/commands/update/utilities/git.d.ts +0 -36
- package/src/commands/update/utilities/git.js +0 -148
- package/src/commands/update/utilities/git.js.map +0 -1
- package/src/commands/update/utilities/migration.d.ts +0 -32
- package/src/commands/update/utilities/migration.js +0 -271
- package/src/commands/update/utilities/migration.js.map +0 -1
- package/src/commands/version/cli.d.ts +0 -36
- package/src/commands/version/cli.js +0 -117
- package/src/commands/version/cli.js.map +0 -1
- package/src/commands/version/version-info.d.ts +0 -46
- package/src/commands/version/version-info.js +0 -101
- package/src/commands/version/version-info.js.map +0 -1
- package/src/package-managers/discovery.d.ts +0 -23
- package/src/package-managers/discovery.js +0 -104
- package/src/package-managers/discovery.js.map +0 -1
- package/src/package-managers/error.d.ts +0 -43
- package/src/package-managers/error.js +0 -41
- package/src/package-managers/error.js.map +0 -1
- package/src/package-managers/factory.d.ts +0 -30
- package/src/package-managers/factory.js +0 -137
- package/src/package-managers/factory.js.map +0 -1
- package/src/package-managers/host.d.ts +0 -86
- package/src/package-managers/host.js +0 -91
- package/src/package-managers/host.js.map +0 -1
- package/src/package-managers/index.d.ts +0 -13
- package/src/package-managers/index.js +0 -17
- package/src/package-managers/index.js.map +0 -1
- package/src/package-managers/logger.d.ts +0 -27
- package/src/package-managers/logger.js +0 -10
- package/src/package-managers/logger.js.map +0 -1
- package/src/package-managers/package-manager-descriptor.d.ts +0 -269
- package/src/package-managers/package-manager-descriptor.js +0 -210
- package/src/package-managers/package-manager-descriptor.js.map +0 -1
- package/src/package-managers/package-manager.d.ts +0 -200
- package/src/package-managers/package-manager.js +0 -720
- package/src/package-managers/package-manager.js.map +0 -1
- package/src/package-managers/package-metadata.d.ts +0 -91
- package/src/package-managers/package-metadata.js +0 -10
- package/src/package-managers/package-metadata.js.map +0 -1
- package/src/package-managers/package-tree.d.ts +0 -23
- package/src/package-managers/package-tree.js +0 -10
- package/src/package-managers/package-tree.js.map +0 -1
- package/src/package-managers/parsers.d.ts +0 -167
- package/src/package-managers/parsers.js +0 -674
- package/src/package-managers/parsers.js.map +0 -1
- package/src/utilities/color.d.ts +0 -23
- package/src/utilities/color.js +0 -41
- package/src/utilities/color.js.map +0 -1
- package/src/utilities/completion.d.ts +0 -30
- package/src/utilities/completion.js +0 -270
- package/src/utilities/completion.js.map +0 -1
- package/src/utilities/config.d.ts +0 -38
- package/src/utilities/config.js +0 -368
- package/src/utilities/config.js.map +0 -1
- package/src/utilities/environment-options.d.ts +0 -25
- package/src/utilities/environment-options.js +0 -60
- package/src/utilities/environment-options.js.map +0 -1
- package/src/utilities/eol.d.ts +0 -20
- package/src/utilities/eol.js +0 -35
- package/src/utilities/eol.js.map +0 -1
- package/src/utilities/error.d.ts +0 -18
- package/src/utilities/error.js +0 -41
- package/src/utilities/error.js.map +0 -1
- package/src/utilities/find-up.d.ts +0 -21
- package/src/utilities/find-up.js +0 -67
- package/src/utilities/find-up.js.map +0 -1
- package/src/utilities/json-file.d.ts +0 -24
- package/src/utilities/json-file.js +0 -179
- package/src/utilities/json-file.js.map +0 -1
- package/src/utilities/log-file.d.ts +0 -13
- package/src/utilities/log-file.js +0 -28
- package/src/utilities/log-file.js.map +0 -1
- package/src/utilities/memoize.d.ts +0 -15
- package/src/utilities/memoize.js +0 -64
- package/src/utilities/memoize.js.map +0 -1
- package/src/utilities/node-version.d.ts +0 -21
- package/src/utilities/node-version.js +0 -65
- package/src/utilities/node-version.js.map +0 -1
- package/src/utilities/prettier.d.ts +0 -19
- package/src/utilities/prettier.js +0 -105
- package/src/utilities/prettier.js.map +0 -1
- package/src/utilities/project.d.ts +0 -8
- package/src/utilities/project.js +0 -81
- package/src/utilities/project.js.map +0 -1
- package/src/utilities/prompt.d.ts +0 -17
- package/src/utilities/prompt.js +0 -90
- package/src/utilities/prompt.js.map +0 -1
- package/src/utilities/tty.d.ts +0 -16
- package/src/utilities/tty.js +0 -23
- package/src/utilities/tty.js.map +0 -1
- package/src/utilities/version.d.ts +0 -16
- package/src/utilities/version.js +0 -26
- package/src/utilities/version.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CommandModuleError,
|
|
3
|
+
CommandScope
|
|
4
|
+
} from "./chunk-YM7ILCS5.js";
|
|
5
|
+
|
|
6
|
+
// packages/angular/cli/src/command-builder/utilities/command.js
|
|
7
|
+
var demandCommandFailureMessage = `You need to specify a command before moving on. Use '--help' to view the available commands.`;
|
|
8
|
+
function addCommandModuleToYargs(commandModule, context) {
|
|
9
|
+
const cmd = new commandModule(context);
|
|
10
|
+
const { args: { options: { jsonHelp } }, workspace } = context;
|
|
11
|
+
const describe = jsonHelp ? cmd.fullDescribe : cmd.describe;
|
|
12
|
+
context.yargsInstance.command({
|
|
13
|
+
command: cmd.command,
|
|
14
|
+
aliases: cmd.aliases,
|
|
15
|
+
describe: (
|
|
16
|
+
// We cannot add custom fields in help, such as long command description which is used in AIO.
|
|
17
|
+
// Therefore, we get around this by adding a complex object as a string which we later parse when generating the help files.
|
|
18
|
+
typeof describe === "object" ? JSON.stringify(describe) : describe
|
|
19
|
+
),
|
|
20
|
+
deprecated: cmd.deprecated,
|
|
21
|
+
builder: (argv) => {
|
|
22
|
+
const isInvalidScope = !jsonHelp && (cmd.scope === CommandScope.In && !workspace || cmd.scope === CommandScope.Out && workspace);
|
|
23
|
+
if (isInvalidScope) {
|
|
24
|
+
throw new CommandModuleError(`This command is not available when running the Angular CLI ${workspace ? "inside" : "outside"} a workspace.`);
|
|
25
|
+
}
|
|
26
|
+
return cmd.builder(argv);
|
|
27
|
+
},
|
|
28
|
+
handler: (args) => cmd.handler(args)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
demandCommandFailureMessage,
|
|
34
|
+
addCommandModuleToYargs
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* @license
|
|
38
|
+
* Copyright Google LLC All Rights Reserved.
|
|
39
|
+
*
|
|
40
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
41
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
42
|
+
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// packages/angular/cli/src/utilities/color.js
|
|
2
|
+
import { WriteStream } from "node:tty";
|
|
3
|
+
import { styleText } from "node:util";
|
|
4
|
+
var colors = Object.freeze({
|
|
5
|
+
black: (text) => styleText("black", text),
|
|
6
|
+
blue: (text) => styleText("blue", text),
|
|
7
|
+
bold: (text) => styleText("bold", text),
|
|
8
|
+
cyan: (text) => styleText("cyan", text),
|
|
9
|
+
dim: (text) => styleText("dim", text),
|
|
10
|
+
gray: (text) => styleText("gray", text),
|
|
11
|
+
green: (text) => styleText("green", text),
|
|
12
|
+
italic: (text) => styleText("italic", text),
|
|
13
|
+
magenta: (text) => styleText("magenta", text),
|
|
14
|
+
red: (text) => styleText("red", text),
|
|
15
|
+
underline: (text) => styleText("underline", text),
|
|
16
|
+
white: (text) => styleText("white", text),
|
|
17
|
+
yellow: (text) => styleText("yellow", text)
|
|
18
|
+
});
|
|
19
|
+
function supportColor(stream = process.stdout) {
|
|
20
|
+
if (stream instanceof WriteStream) {
|
|
21
|
+
return stream.hasColors();
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
return WriteStream.prototype.hasColors();
|
|
25
|
+
} catch {
|
|
26
|
+
return process.env["FORCE_COLOR"] !== void 0 && process.env["FORCE_COLOR"] !== "0";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
colors,
|
|
32
|
+
supportColor
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright Google LLC All Rights Reserved.
|
|
37
|
+
*
|
|
38
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
39
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
40
|
+
*/
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import {
|
|
2
|
+
colors
|
|
3
|
+
} from "./chunk-GHUUJYOY.js";
|
|
4
|
+
import {
|
|
5
|
+
assertIsError
|
|
6
|
+
} from "./chunk-FZ5GFCWU.js";
|
|
7
|
+
|
|
8
|
+
// packages/angular/cli/src/command-builder/utilities/schematic-engine-host.js
|
|
9
|
+
import { SchematicsException } from "@angular-devkit/schematics";
|
|
10
|
+
import { NodeModulesEngineHost } from "@angular-devkit/schematics/tools";
|
|
11
|
+
import { parse as parseJson } from "jsonc-parser";
|
|
12
|
+
import { readFileSync } from "node:fs";
|
|
13
|
+
import { Module, createRequire } from "node:module";
|
|
14
|
+
import { dirname, resolve } from "node:path";
|
|
15
|
+
import { Script } from "node:vm";
|
|
16
|
+
var schematicRedirectVariable = process.env["NG_SCHEMATIC_REDIRECT"]?.toLowerCase();
|
|
17
|
+
function shouldWrapSchematic(schematicFile, schematicEncapsulation) {
|
|
18
|
+
switch (schematicRedirectVariable) {
|
|
19
|
+
case "0":
|
|
20
|
+
case "false":
|
|
21
|
+
case "off":
|
|
22
|
+
case "none":
|
|
23
|
+
return false;
|
|
24
|
+
case "all":
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
const normalizedSchematicFile = schematicFile.replace(/\\/g, "/");
|
|
28
|
+
if (normalizedSchematicFile.includes("node_modules/@angular/cli/") && !normalizedSchematicFile.includes("node_modules/@angular/cli/node_modules/")) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (normalizedSchematicFile.includes("@angular/pwa")) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const isFirstParty = /\/node_modules\/@(?:angular|schematics|nguniversal)\//.test(normalizedSchematicFile);
|
|
35
|
+
return schematicEncapsulation ?? isFirstParty;
|
|
36
|
+
}
|
|
37
|
+
var SchematicEngineHost = class extends NodeModulesEngineHost {
|
|
38
|
+
_resolveReferenceString(refString, parentPath, collectionDescription) {
|
|
39
|
+
const [path, name] = refString.split("#", 2);
|
|
40
|
+
const fullPath = path[0] === "." ? resolve(parentPath ?? process.cwd(), path) : path;
|
|
41
|
+
const referenceRequire = createRequire(import.meta.url);
|
|
42
|
+
const schematicFile = referenceRequire.resolve(fullPath, { paths: [parentPath] });
|
|
43
|
+
if (shouldWrapSchematic(schematicFile, collectionDescription?.encapsulation)) {
|
|
44
|
+
const schematicPath = dirname(schematicFile);
|
|
45
|
+
const moduleCache = /* @__PURE__ */ new Map();
|
|
46
|
+
const factoryInitializer = wrap(schematicFile, schematicPath, moduleCache, name || "default");
|
|
47
|
+
const factory = factoryInitializer();
|
|
48
|
+
if (!factory || typeof factory !== "function") {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return { ref: factory, path: schematicPath };
|
|
52
|
+
}
|
|
53
|
+
return super._resolveReferenceString(refString, parentPath, collectionDescription);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var legacyModules = {
|
|
57
|
+
"@schematics/angular/utility/config": {
|
|
58
|
+
getWorkspace(host) {
|
|
59
|
+
const path = "/.angular.json";
|
|
60
|
+
const data = host.read(path);
|
|
61
|
+
if (!data) {
|
|
62
|
+
throw new SchematicsException(`Could not find (${path})`);
|
|
63
|
+
}
|
|
64
|
+
return parseJson(data.toString(), [], { allowTrailingComma: true });
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"@schematics/angular/utility/project": {
|
|
68
|
+
buildDefaultPath(project) {
|
|
69
|
+
const root = project.sourceRoot ? `/${project.sourceRoot}/` : `/${project.root}/src/`;
|
|
70
|
+
return `${root}${project.projectType === "application" ? "app" : "lib"}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
|
|
75
|
+
const hostRequire = createRequire(import.meta.url);
|
|
76
|
+
const schematicRequire = createRequire(schematicFile);
|
|
77
|
+
const customRequire = function(id) {
|
|
78
|
+
if (legacyModules[id]) {
|
|
79
|
+
return legacyModules[id];
|
|
80
|
+
} else if (id.startsWith("schematics:")) {
|
|
81
|
+
const builtinId = id.slice(11);
|
|
82
|
+
const builtinModule = loadBuiltinModule(builtinId);
|
|
83
|
+
if (!builtinModule) {
|
|
84
|
+
throw new Error(`Unknown schematics built-in module '${id}' requested from schematic '${schematicFile}'`);
|
|
85
|
+
}
|
|
86
|
+
return builtinModule;
|
|
87
|
+
} else if (id.startsWith("@angular-devkit/") || id.startsWith("@schematics/")) {
|
|
88
|
+
if (id.startsWith("@angular-devkit/core")) {
|
|
89
|
+
try {
|
|
90
|
+
return schematicRequire(id);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
assertIsError(e);
|
|
93
|
+
if (e.code !== "MODULE_NOT_FOUND") {
|
|
94
|
+
throw e;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return hostRequire(id);
|
|
99
|
+
} else if (id.startsWith(".") || id.startsWith("@angular/cdk")) {
|
|
100
|
+
const modulePath = schematicRequire.resolve(id);
|
|
101
|
+
const cachedModule = moduleCache.get(modulePath);
|
|
102
|
+
if (cachedModule) {
|
|
103
|
+
return cachedModule;
|
|
104
|
+
}
|
|
105
|
+
if (!/[/\\]node_modules[/\\]@schematics[/\\]angular[/\\]third_party[/\\]/.test(modulePath) && !modulePath.endsWith(".json")) {
|
|
106
|
+
const wrappedModule = wrap(modulePath, dirname(modulePath), moduleCache)();
|
|
107
|
+
moduleCache.set(modulePath, wrappedModule);
|
|
108
|
+
return wrappedModule;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return schematicRequire(id);
|
|
112
|
+
};
|
|
113
|
+
const schematicCode = readFileSync(schematicFile, "utf8");
|
|
114
|
+
const script = new Script(Module.wrap(schematicCode), {
|
|
115
|
+
filename: schematicFile,
|
|
116
|
+
lineOffset: 1
|
|
117
|
+
});
|
|
118
|
+
const schematicModule = new Module(schematicFile);
|
|
119
|
+
const moduleFactory = script.runInThisContext();
|
|
120
|
+
return () => {
|
|
121
|
+
moduleFactory(schematicModule.exports, customRequire, schematicModule, schematicFile, schematicDirectory);
|
|
122
|
+
return exportName ? schematicModule.exports[exportName] : schematicModule.exports;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function loadBuiltinModule(id) {
|
|
126
|
+
return void 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// packages/angular/cli/src/utilities/prettier.js
|
|
130
|
+
import { execFile } from "node:child_process";
|
|
131
|
+
import { readFile } from "node:fs/promises";
|
|
132
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
133
|
+
import { dirname as dirname2, join } from "node:path";
|
|
134
|
+
import { promisify } from "node:util";
|
|
135
|
+
var execFileAsync = promisify(execFile);
|
|
136
|
+
var prettierCliPath;
|
|
137
|
+
var MAX_COMMAND_LINE_LENGTH = 32e3;
|
|
138
|
+
function batchFilesByArgumentLength(files, baseLength, maxLength) {
|
|
139
|
+
const batches = [];
|
|
140
|
+
let batch = [];
|
|
141
|
+
let length = baseLength;
|
|
142
|
+
for (const file of files) {
|
|
143
|
+
const fileLength = file.length + (file.includes(" ") ? 3 : 1);
|
|
144
|
+
if (batch.length > 0 && length + fileLength > maxLength) {
|
|
145
|
+
batches.push(batch);
|
|
146
|
+
batch = [];
|
|
147
|
+
length = baseLength;
|
|
148
|
+
}
|
|
149
|
+
batch.push(file);
|
|
150
|
+
length += fileLength;
|
|
151
|
+
}
|
|
152
|
+
if (batch.length > 0) {
|
|
153
|
+
batches.push(batch);
|
|
154
|
+
}
|
|
155
|
+
return batches;
|
|
156
|
+
}
|
|
157
|
+
async function formatFiles(cwd, files) {
|
|
158
|
+
if (!files.size) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (prettierCliPath === void 0) {
|
|
162
|
+
try {
|
|
163
|
+
const prettierPath = createRequire2(cwd + "/").resolve("prettier/package.json");
|
|
164
|
+
const prettierPackageJson = JSON.parse(await readFile(prettierPath, "utf-8"));
|
|
165
|
+
prettierCliPath = join(dirname2(prettierPath), prettierPackageJson.bin);
|
|
166
|
+
} catch {
|
|
167
|
+
prettierCliPath = null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (!prettierCliPath) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const baseArgs = [
|
|
174
|
+
prettierCliPath,
|
|
175
|
+
"--write",
|
|
176
|
+
"--no-error-on-unmatched-pattern",
|
|
177
|
+
"--ignore-unknown"
|
|
178
|
+
];
|
|
179
|
+
const baseLength = [process.execPath, ...baseArgs].reduce((total, arg) => total + arg.length + (arg.includes(" ") ? 3 : 1), 0);
|
|
180
|
+
const errors = [];
|
|
181
|
+
for (const batch of batchFilesByArgumentLength(files, baseLength, MAX_COMMAND_LINE_LENGTH)) {
|
|
182
|
+
try {
|
|
183
|
+
await execFileAsync(process.execPath, [...baseArgs, ...batch], {
|
|
184
|
+
cwd,
|
|
185
|
+
shell: false
|
|
186
|
+
});
|
|
187
|
+
} catch (error) {
|
|
188
|
+
errors.push(error instanceof Error ? error.message : String(error));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (errors.length > 0) {
|
|
192
|
+
throw new Error(errors.join("\n"));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// packages/angular/cli/src/command-builder/utilities/schematic-workflow.js
|
|
197
|
+
function removeLeadingSlash(value) {
|
|
198
|
+
return value[0] === "/" ? value.slice(1) : value;
|
|
199
|
+
}
|
|
200
|
+
function subscribeToWorkflow(workflow, logger) {
|
|
201
|
+
const files = /* @__PURE__ */ new Set();
|
|
202
|
+
let error = false;
|
|
203
|
+
let logs = [];
|
|
204
|
+
const reporterSubscription = workflow.reporter.subscribe((event) => {
|
|
205
|
+
const eventPath = removeLeadingSlash(event.path);
|
|
206
|
+
switch (event.kind) {
|
|
207
|
+
case "error":
|
|
208
|
+
error = true;
|
|
209
|
+
logger.error(`ERROR! ${eventPath} ${event.description == "alreadyExist" ? "already exists" : "does not exist"}.`);
|
|
210
|
+
break;
|
|
211
|
+
case "update":
|
|
212
|
+
logs.push(
|
|
213
|
+
// TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution.
|
|
214
|
+
`${colors.cyan("UPDATE")} ${eventPath} (${event.content.length} bytes)`
|
|
215
|
+
);
|
|
216
|
+
files.add(eventPath);
|
|
217
|
+
break;
|
|
218
|
+
case "create":
|
|
219
|
+
logs.push(
|
|
220
|
+
// TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution.
|
|
221
|
+
`${colors.green("CREATE")} ${eventPath} (${event.content.length} bytes)`
|
|
222
|
+
);
|
|
223
|
+
files.add(eventPath);
|
|
224
|
+
break;
|
|
225
|
+
case "delete":
|
|
226
|
+
logs.push(`${colors.yellow("DELETE")} ${eventPath}`);
|
|
227
|
+
files.add(eventPath);
|
|
228
|
+
break;
|
|
229
|
+
case "rename": {
|
|
230
|
+
const newFilename = removeLeadingSlash(event.to);
|
|
231
|
+
logs.push(`${colors.blue("RENAME")} ${eventPath} => ${newFilename}`);
|
|
232
|
+
files.add(newFilename);
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
const lifecycleSubscription = workflow.lifeCycle.subscribe((event) => {
|
|
238
|
+
if (event.kind == "end" || event.kind == "post-tasks-start") {
|
|
239
|
+
if (!error) {
|
|
240
|
+
logs.forEach((log) => logger.info(log));
|
|
241
|
+
}
|
|
242
|
+
logs = [];
|
|
243
|
+
error = false;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
return {
|
|
247
|
+
files,
|
|
248
|
+
error,
|
|
249
|
+
unsubscribe: () => {
|
|
250
|
+
reporterSubscription.unsubscribe();
|
|
251
|
+
lifecycleSubscription.unsubscribe();
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export {
|
|
257
|
+
formatFiles,
|
|
258
|
+
SchematicEngineHost,
|
|
259
|
+
subscribeToWorkflow
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* @license
|
|
263
|
+
* Copyright Google LLC All Rights Reserved.
|
|
264
|
+
*
|
|
265
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
266
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
267
|
+
*/
|