├── .nvmrc
├── .bazelversion
├── tools
├── bazel
│ └── BUILD.bazel
└── ng_cli_schema_generator.bzl
├── .husky
├── pre-commit
├── commit-msg
└── prepare-commit-msg
├── modules
└── testing
│ └── builder
│ ├── projects
│ └── hello-world-app
│ │ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── app
│ │ │ ├── app.component.css
│ │ │ ├── app.component.ts
│ │ │ ├── app.module.server.ts
│ │ │ └── app.module.ts
│ │ ├── styles.css
│ │ ├── favicon.ico
│ │ ├── spectrum.png
│ │ ├── tsconfig.server.json
│ │ ├── tsconfig.app.json
│ │ ├── tsconfig.spec.json
│ │ ├── index.html
│ │ ├── typings.d.ts
│ │ ├── main.server.ts
│ │ └── main.ts
│ │ ├── .gitignore
│ │ ├── e2e
│ │ ├── tsconfig.e2e.json
│ │ ├── app.po.ts
│ │ └── app.e2e-spec.ts
│ │ ├── .editorconfig
│ │ └── tsconfig.json
│ ├── package.json
│ └── src
│ └── index.ts
├── tests
├── legacy-cli
│ ├── e2e
│ │ ├── assets
│ │ │ ├── 18.0-project
│ │ │ │ ├── src
│ │ │ │ │ ├── app
│ │ │ │ │ │ ├── app.component.css
│ │ │ │ │ │ ├── app.routes.ts
│ │ │ │ │ │ ├── app.config.ts
│ │ │ │ │ │ └── app.component.ts
│ │ │ │ │ ├── styles.css
│ │ │ │ │ ├── main.ts
│ │ │ │ │ └── index.html
│ │ │ │ ├── public
│ │ │ │ │ └── favicon.ico
│ │ │ │ ├── .editorconfig
│ │ │ │ ├── tsconfig.app.json
│ │ │ │ └── tsconfig.spec.json
│ │ │ ├── ssr-project-webpack
│ │ │ │ ├── src
│ │ │ │ │ ├── assets
│ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ ├── app
│ │ │ │ │ │ ├── app.component.css
│ │ │ │ │ │ ├── app-routing.module.ts
│ │ │ │ │ │ ├── app.component.ts
│ │ │ │ │ │ ├── app.module.server.ts
│ │ │ │ │ │ └── app.module.ts
│ │ │ │ │ ├── main.server.ts
│ │ │ │ │ ├── styles.css
│ │ │ │ │ ├── favicon.ico
│ │ │ │ │ ├── main.ts
│ │ │ │ │ └── index.html
│ │ │ │ ├── tsconfig.app.json
│ │ │ │ ├── tsconfig.server.json
│ │ │ │ └── tsconfig.spec.json
│ │ │ ├── schematic-boolean-option-negated
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ ├── collection.json
│ │ │ │ └── schema.json
│ │ │ ├── add-collection-dir
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ └── collection.json
│ │ │ ├── add-collection.tgz
│ │ │ ├── images
│ │ │ │ └── spectrum.png
│ │ │ ├── nested-schematic-dependency
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ └── collection.json
│ │ │ ├── add-collection-peer-bad
│ │ │ │ ├── index.js
│ │ │ │ ├── collection.json
│ │ │ │ └── package.json
│ │ │ ├── add-collection-peer-good
│ │ │ │ ├── index.js
│ │ │ │ ├── collection.json
│ │ │ │ └── package.json
│ │ │ ├── nested-schematic-main
│ │ │ │ ├── package.json
│ │ │ │ ├── index.js
│ │ │ │ └── collection.json
│ │ │ ├── schematic-allow-scripts
│ │ │ │ ├── package.json
│ │ │ │ ├── collection.json
│ │ │ │ └── schema.json
│ │ │ └── BUILD.bazel
│ │ ├── tests
│ │ │ ├── test
│ │ │ │ ├── test-include-glob.ts
│ │ │ │ └── test-fail-single-run.ts
│ │ │ ├── generate
│ │ │ │ ├── config
│ │ │ │ │ ├── type-browserslist.ts
│ │ │ │ │ └── type-karma.ts
│ │ │ │ ├── generate-error.ts
│ │ │ │ ├── library
│ │ │ │ │ ├── library-basic.ts
│ │ │ │ │ └── library-standalone.ts
│ │ │ │ ├── schematic-aliases.ts
│ │ │ │ ├── application
│ │ │ │ │ ├── application-zoneless-ng-module.ts
│ │ │ │ │ └── application-zoneless-standalone.ts
│ │ │ │ ├── directive
│ │ │ │ │ └── directive-basic.ts
│ │ │ │ └── help-output-no-duplicates.ts
│ │ │ ├── build
│ │ │ │ ├── config-file-fallback.ts
│ │ │ │ ├── project-name.ts
│ │ │ │ ├── library
│ │ │ │ │ ├── lib-consumption-full-aot.ts
│ │ │ │ │ ├── lib-consumption-partial-aot.ts
│ │ │ │ │ └── lib-consumption-sourcemaps.ts
│ │ │ │ └── esbuild-unsupported.ts
│ │ │ ├── commands
│ │ │ │ ├── add
│ │ │ │ │ ├── npm-config.ts
│ │ │ │ │ ├── add.ts
│ │ │ │ │ ├── add-version.ts
│ │ │ │ │ └── file.ts
│ │ │ │ ├── config
│ │ │ │ │ ├── config-set-serve-port.ts
│ │ │ │ │ ├── config-set-enum-check.ts
│ │ │ │ │ └── config-set-prefix.ts
│ │ │ │ ├── cache
│ │ │ │ │ ├── cache-clean.ts
│ │ │ │ │ └── cache-enable-disable.ts
│ │ │ │ ├── unknown-configuration.ts
│ │ │ │ ├── analytics
│ │ │ │ │ └── analytics-enable-disable.ts
│ │ │ │ ├── serve
│ │ │ │ │ └── preflight-request.ts
│ │ │ │ ├── ng-new-collection.ts
│ │ │ │ ├── help
│ │ │ │ │ └── help-hidden.ts
│ │ │ │ └── unknown-option.ts
│ │ │ ├── jest
│ │ │ │ └── basic.ts
│ │ │ ├── misc
│ │ │ │ ├── multiple-targets.ts
│ │ │ │ ├── nested-schematic-packages.ts
│ │ │ │ ├── update-git-clean.ts
│ │ │ │ ├── workspace-verification.ts
│ │ │ │ └── negated-boolean-options.ts
│ │ │ ├── vitest
│ │ │ │ └── component.ts
│ │ │ ├── basic
│ │ │ │ └── aot.ts
│ │ │ ├── i18n
│ │ │ │ └── ivy-localize-es2015-e2e.ts
│ │ │ ├── web-test-runner
│ │ │ │ └── basic.ts
│ │ │ └── BUILD.bazel
│ │ ├── ng-snapshot
│ │ │ └── BUILD.bazel
│ │ ├── setup
│ │ │ └── BUILD.bazel
│ │ ├── initialize
│ │ │ └── BUILD.bazel
│ │ └── utils
│ │ │ └── version.ts
│ └── tsconfig.json
├── schematics
│ └── update
│ │ └── packages
│ │ ├── update-base
│ │ └── package.json
│ │ ├── update-peer-dependencies-1
│ │ └── package.json
│ │ ├── update-migrations
│ │ ├── migrations.json
│ │ ├── package.json
│ │ └── v1_5.js
│ │ ├── update-peer-dependencies-angular-5
│ │ └── package.json
│ │ ├── update-peer-dependencies-2
│ │ └── package.json
│ │ ├── update-package-group-1
│ │ └── package.json
│ │ ├── update-package-group-2
│ │ └── package.json
│ │ ├── update-migrations-external
│ │ └── package.json
│ │ ├── update-peer-dependencies-angular-5-2
│ │ └── package.json
│ │ └── README.md
├── angular_devkit
│ ├── schematics
│ │ └── tools
│ │ │ └── file-system-engine-host
│ │ │ ├── extends-deep
│ │ │ └── collection.json
│ │ │ ├── file-tasks
│ │ │ ├── file-task.js
│ │ │ ├── collection.json
│ │ │ └── factory.ts
│ │ │ ├── extends-multiple
│ │ │ └── collection.json
│ │ │ ├── works
│ │ │ └── collection.json
│ │ │ ├── extends-basic-string
│ │ │ └── collection.json
│ │ │ ├── extends-circular
│ │ │ └── collection.json
│ │ │ ├── extends-basic
│ │ │ └── collection.json
│ │ │ ├── extends-replace
│ │ │ └── collection.json
│ │ │ ├── extends-circular-deep
│ │ │ └── collection.json
│ │ │ ├── extra-properties
│ │ │ └── collection.json
│ │ │ ├── null-factory.ts
│ │ │ ├── extends-circular-middle
│ │ │ └── collection.json
│ │ │ ├── extends-circular-multiple
│ │ │ └── collection.json
│ │ │ ├── aliases
│ │ │ └── collection.json
│ │ │ ├── invalid-aliases
│ │ │ └── collection.json
│ │ │ ├── aliases-many
│ │ │ └── collection.json
│ │ │ ├── aliases-dupe
│ │ │ └── collection.json
│ │ │ ├── invalid-aliases-2
│ │ │ └── collection.json
│ │ │ ├── hidden-schematics
│ │ │ └── collection.json
│ │ │ └── private-schematics
│ │ │ └── collection.json
│ └── core
│ │ └── json
│ │ └── schema
│ │ └── serializers
│ │ └── 0.schema.json
├── package.json
├── README.md
└── BUILD.bazel
├── packages
├── angular
│ ├── cli
│ │ ├── bin
│ │ │ └── package.json
│ │ ├── src
│ │ │ ├── commands
│ │ │ │ ├── test
│ │ │ │ │ └── long-description.md
│ │ │ │ ├── update
│ │ │ │ │ ├── schematic
│ │ │ │ │ │ └── collection.json
│ │ │ │ │ └── utilities
│ │ │ │ │ │ └── constants.ts
│ │ │ │ ├── add
│ │ │ │ │ └── long-description.md
│ │ │ │ └── mcp
│ │ │ │ │ ├── tools
│ │ │ │ │ └── onpush-zoneless-migration
│ │ │ │ │ │ └── types.ts
│ │ │ │ │ └── constants.ts
│ │ │ └── package-managers
│ │ │ │ └── index.ts
│ │ └── README.md
│ ├── ssr
│ │ ├── schematics
│ │ │ ├── package.json
│ │ │ ├── collection.json
│ │ │ └── ng-add
│ │ │ │ └── index.ts
│ │ ├── README.md
│ │ ├── index.ts
│ │ ├── node
│ │ │ ├── index.ts
│ │ │ ├── src
│ │ │ │ └── globals.d.ts
│ │ │ └── BUILD.bazel
│ │ └── third_party
│ │ │ └── beasties
│ │ │ └── index.d.ts
│ ├── pwa
│ │ ├── pwa
│ │ │ └── files
│ │ │ │ └── assets
│ │ │ │ └── icons
│ │ │ │ ├── icon-72x72.png
│ │ │ │ ├── icon-96x96.png
│ │ │ │ ├── icon-128x128.png
│ │ │ │ ├── icon-144x144.png
│ │ │ │ ├── icon-152x152.png
│ │ │ │ ├── icon-192x192.png
│ │ │ │ ├── icon-384x384.png
│ │ │ │ └── icon-512x512.png
│ │ └── collection.json
│ ├── build
│ │ ├── index.ts
│ │ ├── private
│ │ │ ├── BUILD.bazel
│ │ │ └── index.ts
│ │ ├── src
│ │ │ ├── builders
│ │ │ │ ├── karma
│ │ │ │ │ └── polyfills
│ │ │ │ │ │ ├── init_sourcemaps.js
│ │ │ │ │ │ ├── jasmine_global_cleanup.js
│ │ │ │ │ │ └── jasmine_global.js
│ │ │ │ ├── dev-server
│ │ │ │ │ └── output.ts
│ │ │ │ ├── unit-test
│ │ │ │ │ └── index.ts
│ │ │ │ ├── ng-packagr
│ │ │ │ │ └── index.ts
│ │ │ │ └── extract-i18n
│ │ │ │ │ └── index.ts
│ │ │ ├── utils
│ │ │ │ ├── index.ts
│ │ │ │ └── server-rendering
│ │ │ │ │ └── esm-in-memory-loader
│ │ │ │ │ ├── utils.ts
│ │ │ │ │ └── register-hooks.ts
│ │ │ └── tools
│ │ │ │ ├── angular
│ │ │ │ └── compilation
│ │ │ │ │ └── index.ts
│ │ │ │ ├── esbuild
│ │ │ │ └── stylesheets
│ │ │ │ │ └── css-language.ts
│ │ │ │ ├── babel
│ │ │ │ └── plugins
│ │ │ │ │ └── index.ts
│ │ │ │ └── vite
│ │ │ │ └── plugins
│ │ │ │ └── index.ts
│ │ └── README.md
│ └── create
│ │ ├── package.json
│ │ └── README.md
├── angular_devkit
│ ├── build_webpack
│ │ ├── test
│ │ │ ├── angular-app
│ │ │ │ ├── src
│ │ │ │ │ ├── assets
│ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ ├── app
│ │ │ │ │ │ ├── app.component.css
│ │ │ │ │ │ ├── app.component.ts
│ │ │ │ │ │ └── app.module.ts
│ │ │ │ │ ├── tsconfig.app.json
│ │ │ │ │ └── main.ts
│ │ │ │ └── tsconfig.json
│ │ │ └── basic-app
│ │ │ │ ├── src
│ │ │ │ └── main.js
│ │ │ │ └── tsconfig.json
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── index.ts
│ │ │ └── builders
│ │ │ ├── webpack
│ │ │ └── schema.json
│ │ │ └── webpack-dev-server
│ │ │ └── schema.json
│ ├── architect
│ │ ├── README.md
│ │ ├── builders
│ │ │ ├── noop-schema.json
│ │ │ ├── true.ts
│ │ │ └── false.ts
│ │ ├── index.ts
│ │ ├── testing
│ │ │ └── index.ts
│ │ ├── node
│ │ │ ├── test
│ │ │ │ ├── BUILD.bazel
│ │ │ │ └── jobs
│ │ │ │ │ └── add.ts
│ │ │ └── index.ts
│ │ ├── package.json
│ │ └── src
│ │ │ ├── index.ts
│ │ │ └── jobs
│ │ │ └── index.ts
│ ├── schematics_cli
│ │ ├── schematic
│ │ │ └── files
│ │ │ │ ├── src
│ │ │ │ ├── my-full-schematic
│ │ │ │ │ ├── files
│ │ │ │ │ │ ├── test__INDEX__
│ │ │ │ │ │ └── test2
│ │ │ │ │ └── schema.json
│ │ │ │ ├── my-schematic
│ │ │ │ │ └── index_spec.ts
│ │ │ │ └── my-other-schematic
│ │ │ │ │ └── index_spec.ts
│ │ │ │ ├── .npmignore.template
│ │ │ │ └── .gitignore.template
│ │ ├── blank
│ │ │ ├── project-files
│ │ │ │ ├── .npmignore.template
│ │ │ │ ├── src
│ │ │ │ │ └── collection.json
│ │ │ │ └── .gitignore.template
│ │ │ └── schematic-files
│ │ │ │ └── src
│ │ │ │ └── __name@dasherize__
│ │ │ │ ├── index.ts.template
│ │ │ │ └── index_spec.ts.template
│ │ └── collection.json
│ ├── schematics
│ │ ├── tasks
│ │ │ ├── package.json
│ │ │ ├── run-schematic
│ │ │ │ └── options.ts
│ │ │ ├── index.ts
│ │ │ └── repo-init
│ │ │ │ └── options.ts
│ │ ├── tools
│ │ │ └── package.json
│ │ ├── testing
│ │ │ ├── package.json
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── src
│ │ │ ├── workflow
│ │ │ │ └── index.ts
│ │ │ ├── engine
│ │ │ │ └── index.ts
│ │ │ ├── tree
│ │ │ │ └── empty.ts
│ │ │ ├── rules
│ │ │ │ └── url.ts
│ │ │ └── formats
│ │ │ │ └── index.ts
│ │ └── package.json
│ ├── core
│ │ ├── src
│ │ │ ├── workspace
│ │ │ │ ├── json
│ │ │ │ │ └── test
│ │ │ │ │ │ └── cases
│ │ │ │ │ │ ├── Empty.json
│ │ │ │ │ │ ├── ObjectRemoveMultiple.json
│ │ │ │ │ │ ├── Extensions1.json
│ │ │ │ │ │ ├── ProjectEmpty.json
│ │ │ │ │ │ ├── ObjectReplace2.json
│ │ │ │ │ │ ├── ObjectReplace3.json
│ │ │ │ │ │ ├── ArrayReplace2.json
│ │ │ │ │ │ ├── ObjectRemove.json
│ │ │ │ │ │ ├── ObjectReplace1.json
│ │ │ │ │ │ ├── Retain.json
│ │ │ │ │ │ ├── ArrayReplace1.json
│ │ │ │ │ │ ├── Extensions2.json
│ │ │ │ │ │ ├── ArrayPop.json
│ │ │ │ │ │ ├── AddArrayEmpty.json
│ │ │ │ │ │ ├── ArrayShift.json
│ │ │ │ │ │ ├── ArraySplice1.json
│ │ │ │ │ │ ├── ArrayDeleteInner.json
│ │ │ │ │ │ ├── ArrayDeleteLast.json
│ │ │ │ │ │ ├── ArrayDeleteZero.json
│ │ │ │ │ │ ├── ArrayIndexLast.json
│ │ │ │ │ │ ├── ArraySort.json
│ │ │ │ │ │ ├── AddArrayPush.json
│ │ │ │ │ │ ├── ArrayDeleteInnerAdd.json
│ │ │ │ │ │ ├── ArrayDeleteLastAdd.json
│ │ │ │ │ │ ├── ArrayIndexInner.json
│ │ │ │ │ │ ├── ArrayIndexZero.json
│ │ │ │ │ │ ├── ArrayPush.json
│ │ │ │ │ │ ├── ArrayUnshift.json
│ │ │ │ │ │ ├── AddProject1.json
│ │ │ │ │ │ ├── ArraySplice2.json
│ │ │ │ │ │ └── ArrayValues.json
│ │ │ │ └── index.ts
│ │ │ ├── json
│ │ │ │ ├── index.ts
│ │ │ │ └── schema
│ │ │ │ │ └── index.ts
│ │ │ ├── virtual-fs
│ │ │ │ └── index.ts
│ │ │ ├── logger
│ │ │ │ ├── index.ts
│ │ │ │ └── transform-logger.ts
│ │ │ ├── utils
│ │ │ │ ├── index.ts
│ │ │ │ └── priority-queue_spec.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ └── node
│ │ │ └── index.ts
│ ├── build_angular
│ │ ├── test
│ │ │ └── hello-world-lib
│ │ │ │ ├── projects
│ │ │ │ └── lib
│ │ │ │ │ ├── package.json
│ │ │ │ │ ├── ng-package.json
│ │ │ │ │ ├── tsconfig.lib.prod.json
│ │ │ │ │ ├── tsconfig.lib.json
│ │ │ │ │ ├── tsconfig.spec.json
│ │ │ │ │ └── src
│ │ │ │ │ ├── public-api.ts
│ │ │ │ │ └── lib
│ │ │ │ │ ├── lib.service.ts
│ │ │ │ │ └── lib.component.ts
│ │ │ │ └── tsconfig.json
│ │ ├── index.ts
│ │ ├── src
│ │ │ ├── testing
│ │ │ │ ├── test-utils.ts
│ │ │ │ └── index.ts
│ │ │ ├── transforms.ts
│ │ │ ├── utils
│ │ │ │ ├── package-version.ts
│ │ │ │ ├── default-progress.ts
│ │ │ │ ├── bundle-inline-options.ts
│ │ │ │ └── url.ts
│ │ │ ├── builders
│ │ │ │ ├── extract-i18n
│ │ │ │ │ ├── empty-loader.ts
│ │ │ │ │ └── index.ts
│ │ │ │ └── jest
│ │ │ │ │ ├── jest.config.mjs
│ │ │ │ │ └── tests
│ │ │ │ │ └── options.ts
│ │ │ └── tools
│ │ │ │ └── webpack
│ │ │ │ └── configs
│ │ │ │ └── index.ts
│ │ └── plugins
│ │ │ └── karma.ts
│ └── architect_cli
│ │ └── README.md
├── schematics
│ └── angular
│ │ ├── class
│ │ ├── files
│ │ │ ├── __name@dasherize__.__type__.ts.template
│ │ │ └── __name@dasherize__.__type__.spec.ts.template
│ │ └── index.ts
│ │ ├── enum
│ │ ├── files
│ │ │ └── __name@dasherize__.__type__.ts.template
│ │ └── index.ts
│ │ ├── tailwind
│ │ ├── files
│ │ │ └── .postcssrc.json.template
│ │ └── schema.json
│ │ ├── interface
│ │ ├── files
│ │ │ └── __name@dasherize__.__type__.ts.template
│ │ └── index.ts
│ │ ├── server
│ │ └── files
│ │ │ ├── server-builder
│ │ │ ├── ngmodule-src
│ │ │ │ ├── main.server.ts.template
│ │ │ │ └── app
│ │ │ │ │ └── app.module.server.ts.template
│ │ │ ├── standalone-src
│ │ │ │ ├── main.server.ts.template
│ │ │ │ └── app
│ │ │ │ │ └── app.config.server.ts.template
│ │ │ └── root
│ │ │ │ └── tsconfig.server.json.template
│ │ │ └── application-builder
│ │ │ ├── ngmodule-src
│ │ │ ├── main.server.ts.template
│ │ │ └── app
│ │ │ │ ├── app.routes.server.ts.template
│ │ │ │ └── app.module.server.ts.template
│ │ │ └── standalone-src
│ │ │ ├── app
│ │ │ ├── app.routes.server.ts.template
│ │ │ └── app.config.server.ts.template
│ │ │ └── main.server.ts.template
│ │ ├── application
│ │ └── files
│ │ │ ├── common-files
│ │ │ ├── src
│ │ │ │ ├── styles.__style__.template
│ │ │ │ └── index.html.template
│ │ │ ├── public
│ │ │ │ └── favicon.ico.template
│ │ │ └── tsconfig.app.json.template
│ │ │ ├── standalone-files
│ │ │ └── src
│ │ │ │ ├── app
│ │ │ │ ├── app.routes.ts.template
│ │ │ │ └── app.config.ts.template
│ │ │ │ └── main.ts.template
│ │ │ └── module-files
│ │ │ └── src
│ │ │ ├── main.ts.template
│ │ │ └── app
│ │ │ └── app__suffix__.ts.template
│ │ ├── component
│ │ └── files
│ │ │ └── __name@dasherize@if-flat__
│ │ │ ├── __name@dasherize__.__type@dasherize____ngext__.html.template
│ │ │ └── __name@dasherize__.__type@dasherize__.__style__.template
│ │ ├── workspace
│ │ └── files
│ │ │ ├── __dot__vscode
│ │ │ ├── extensions.json.template
│ │ │ ├── mcp.json.template
│ │ │ └── launch.json.template
│ │ │ ├── angular.json.template
│ │ │ └── __dot__editorconfig.template
│ │ ├── service
│ │ └── files
│ │ │ ├── __name@dasherize__.__type@dasherize__.ts.template
│ │ │ └── __name@dasherize__.__type@dasherize__.spec.ts.template
│ │ ├── web-worker
│ │ └── files
│ │ │ ├── worker
│ │ │ └── __name@dasherize__.worker.ts.template
│ │ │ └── worker-tsconfig
│ │ │ └── tsconfig.worker.json.template
│ │ ├── resolver
│ │ ├── functional-files
│ │ │ └── __name@dasherize____typeSeparator__resolver.ts.template
│ │ └── class-files
│ │ │ ├── __name@dasherize____typeSeparator__resolver.ts.template
│ │ │ └── __name@dasherize____typeSeparator__resolver.spec.ts.template
│ │ ├── library
│ │ └── files
│ │ │ ├── src
│ │ │ └── __entryFile__.ts.template
│ │ │ ├── ng-package.json.template
│ │ │ ├── package.json.template
│ │ │ ├── tsconfig.lib.prod.json.template
│ │ │ ├── tsconfig.spec.json.template
│ │ │ └── tsconfig.lib.json.template
│ │ ├── interceptor
│ │ ├── functional-files
│ │ │ └── __name@dasherize____typeSeparator__interceptor.ts.template
│ │ └── class-files
│ │ │ ├── __name@dasherize____typeSeparator__interceptor.ts.template
│ │ │ └── __name@dasherize____typeSeparator__interceptor.spec.ts.template
│ │ ├── config
│ │ └── files
│ │ │ ├── vitest-base.config.ts.template
│ │ │ └── .browserslistrc.template
│ │ ├── utility
│ │ ├── test
│ │ │ └── index.ts
│ │ ├── standalone
│ │ │ └── index.ts
│ │ ├── paths.ts
│ │ └── eol.ts
│ │ ├── directive
│ │ └── files
│ │ │ ├── __name@dasherize__.__type@dasherize__.ts.template
│ │ │ └── __name@dasherize__.__type@dasherize__.spec.ts.template
│ │ ├── e2e
│ │ └── files
│ │ │ ├── src
│ │ │ └── app.po.ts.template
│ │ │ └── tsconfig.json.template
│ │ ├── pipe
│ │ └── files
│ │ │ ├── __name@dasherize____typeSeparator__pipe.spec.ts.template
│ │ │ └── __name@dasherize____typeSeparator__pipe.ts.template
│ │ ├── guard
│ │ ├── implements-files
│ │ │ └── __name@dasherize____typeSeparator__guard.spec.ts.template
│ │ └── type-files
│ │ │ └── __name@dasherize____typeSeparator__guard.ts.template
│ │ ├── module
│ │ └── files
│ │ │ └── __name@dasherize@if-flat__
│ │ │ └── __name@dasherize__-routing__typeSeparator__module.ts.template
│ │ └── app-shell
│ │ └── schema.json
├── ngtools
│ └── webpack
│ │ ├── index.ts
│ │ └── src
│ │ ├── transformers
│ │ └── index.ts
│ │ ├── index.ts
│ │ └── ivy
│ │ └── index.ts
└── README.md
├── .prettierrc
├── docs
├── images
│ ├── angular-cli-logo.png
│ ├── run-configurations.png
│ └── angular-ecosystem-logos.png
└── README.md
├── tsconfig-build.json
├── tsconfig-test.json
├── scripts
├── templates
│ └── user-analytics-table.ejs
└── tsconfig.json
├── .ng-dev
├── format.mjs
├── config.mjs
├── github.mjs
├── pull-request.mjs
├── tsconfig.json
├── caretaker.mjs
└── commit-message.mjs
├── .github
├── codeql
│ └── config.yml
└── dependabot.yml
├── goldens
└── BUILD.bazel
├── .gitattributes
├── tsconfig-test-esm.json
├── .editorconfig
├── SECURITY.md
├── tsconfig-build-esm.json
├── .prettierignore
└── .npmrc
/.nvmrc:
--------------------------------------------------------------------------------
1 | 22.21.1
2 |
--------------------------------------------------------------------------------
/.bazelversion:
--------------------------------------------------------------------------------
1 | 8.5.0
2 |
--------------------------------------------------------------------------------
/tools/bazel/BUILD.bazel:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | pnpm -s ng-dev format staged;
2 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/angular/cli/bin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "commonjs"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | pnpm -s ng-dev commit-message pre-commit-validate --file $1;
2 |
--------------------------------------------------------------------------------
/packages/angular/ssr/schematics/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "commonjs"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/README.md:
--------------------------------------------------------------------------------
1 | # Angular Build Facade
2 |
3 | WIP
4 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.husky/prepare-commit-msg:
--------------------------------------------------------------------------------
1 | pnpm -s ng-dev commit-message restore-commit-message-draft $1 $2;
2 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/basic-app/src/main.js:
--------------------------------------------------------------------------------
1 | console.log('hello world');
2 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 100,
3 | "quoteProps": "preserve",
4 | "singleQuote": true
5 | }
6 |
--------------------------------------------------------------------------------
/packages/angular/ssr/README.md:
--------------------------------------------------------------------------------
1 | # Angular SSR
2 |
3 | Read the dev guide [here](https://angular.dev/guide/ssr).
4 |
--------------------------------------------------------------------------------
/docs/images/angular-cli-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/docs/images/angular-cli-logo.png
--------------------------------------------------------------------------------
/docs/images/run-configurations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/docs/images/run-configurations.png
--------------------------------------------------------------------------------
/packages/schematics/angular/class/files/__name@dasherize__.__type__.ts.template:
--------------------------------------------------------------------------------
1 | export class <%= classify(name) %> {
2 | }
3 |
--------------------------------------------------------------------------------
/packages/schematics/angular/enum/files/__name@dasherize__.__type__.ts.template:
--------------------------------------------------------------------------------
1 | export enum <%= classify(name) %> {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/index.js:
--------------------------------------------------------------------------------
1 | exports.default = (options) => console.log(options);
2 |
--------------------------------------------------------------------------------
/tsconfig-build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node"]
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/docs/images/angular-ecosystem-logos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/docs/images/angular-ecosystem-logos.png
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/src/my-full-schematic/files/test__INDEX__:
--------------------------------------------------------------------------------
1 |
2 | This is test #<%= INDEX %>.
3 |
--------------------------------------------------------------------------------
/packages/schematics/angular/tailwind/files/.postcssrc.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": {
3 | "@tailwindcss/postcss": {}
4 | }
5 | }
--------------------------------------------------------------------------------
/tsconfig-test.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jasmine"]
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.server.ts:
--------------------------------------------------------------------------------
1 | export { AppServerModule as default } from './app/app.module.server';
2 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/packages/schematics/angular/interface/files/__name@dasherize__.__type__.ts.template:
--------------------------------------------------------------------------------
1 | export interface <%= prefix %><%= classify(name) %> {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-dir/index.js:
--------------------------------------------------------------------------------
1 | exports.default = (options) => tree => tree.create(options.name || 'empty-file', '');
2 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/tests/legacy-cli/e2e/assets/add-collection.tgz
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/builders/noop-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "type": "object"
4 | }
5 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/.npmignore.template:
--------------------------------------------------------------------------------
1 | # Ignores TypeScript files, but keeps definitions.
2 | *.ts
3 | !*.d.ts
4 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/app/app.routes.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 |
3 | export const routes: Routes = [];
4 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/images/spectrum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/tests/legacy-cli/e2e/assets/images/spectrum.png
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/nested-schematic-dependency/index.js:
--------------------------------------------------------------------------------
1 | exports.default = (options) => tree => tree.create(options.name || 'empty-file', '');
2 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/blank/project-files/.npmignore.template:
--------------------------------------------------------------------------------
1 |
2 | # Ignores TypeScript files, but keeps definitions.
3 | *.ts
4 | !*.d.ts
5 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-peer-bad/index.js:
--------------------------------------------------------------------------------
1 | exports.default = (options) => tree => tree.create(options.name || 'empty-file-peer-bad', '');
2 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-peer-good/index.js:
--------------------------------------------------------------------------------
1 | exports.default = (options) => tree => tree.create(options.name || 'empty-file-peer-good', '');
2 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/server-builder/ngmodule-src/main.server.ts.template:
--------------------------------------------------------------------------------
1 | export { AppServerModule as default } from './app/app.module.server';
2 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-dir/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "empty-app",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json"
5 | }
6 |
--------------------------------------------------------------------------------
/tests/legacy-cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig-test.json",
3 | "compilerOptions": { "paths": {} },
4 | "exclude": ["e2e/assets/**"]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-72x72.png
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-96x96.png
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/tasks/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit/schematics/tasks",
3 | "main": "index.js",
4 | "typings": "index.d.ts"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/tools/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit/schematics/tools",
3 | "main": "index.js",
4 | "typings": "index.d.ts"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/common-files/src/styles.__style__.template:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize____ngext__.html.template:
--------------------------------------------------------------------------------
1 |
<%= dasherize(name) %> works!
2 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/application-builder/ngmodule-src/main.server.ts.template:
--------------------------------------------------------------------------------
1 | export { AppServerModule as default } from './app/app.module.server';
2 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/tests/legacy-cli/e2e/assets/18.0-project/public/favicon.ico
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/nested-schematic-main/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nested-main",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json"
5 | }
6 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-allow-scripts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "allow-scripts",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-128x128.png
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-144x144.png
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-152x152.png
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-192x192.png
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-384x384.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-384x384.png
--------------------------------------------------------------------------------
/packages/angular/pwa/pwa/files/assets/icons/icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/angular/pwa/pwa/files/assets/icons/icon-512x512.png
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/testing/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit/schematics/testing",
3 | "main": "index.js",
4 | "typings": "index.d.ts"
5 | }
6 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-base/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-base",
3 | "version": "1.1.0",
4 | "description": "Tests"
5 | }
6 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/modules/testing/builder/projects/hello-world-app/src/favicon.ico
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/standalone-files/src/app/app.routes.ts.template:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 |
3 | export const routes: Routes = [];
4 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/nested-schematic-dependency/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "empty-app-nested",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json"
5 | }
6 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/favicon.ico
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/spectrum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/modules/testing/builder/projects/hello-world-app/src/spectrum.png
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/Empty.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "projects": {}
5 | }
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/nested-schematic-main/index.js:
--------------------------------------------------------------------------------
1 | exports.default = (options) => require("@angular-devkit/schematics").externalSchematic('empty-app-nested', 'nested', {});
2 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-deep/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-deep",
3 | "extends": "extends-basic",
4 | "schematics": {}
5 | }
6 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "schematic-boolean-option",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ObjectRemoveMultiple.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "x-foo": {
4 | "is": ["good", "great", "awesome"]
5 | },
6 | "x-bar": 5,
7 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/blank/project-files/src/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3 | "schematics": {}
4 | }
5 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-peer-dependencies-1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-peer-dependencies-1",
3 | "version": "1.1.0",
4 | "description": "Tests"
5 | }
6 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/test/test-include-glob.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../utils/process';
2 |
3 | export default async function () {
4 | await ng('test', '--no-watch', `--include='**/*.spec.ts'`);
5 | }
6 |
--------------------------------------------------------------------------------
/tests/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "devDependencies": {
3 | "@types/tar-stream": "3.1.4",
4 | "@angular-devkit/schematics": "workspace:*",
5 | "tar-stream": "3.1.7",
6 | "tree-kill": "1.2.2"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/common-files/public/favicon.ico.template:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/angular/angular-cli/HEAD/packages/schematics/angular/application/files/common-files/public/favicon.ico.template
--------------------------------------------------------------------------------
/packages/schematics/angular/workspace/files/__dot__vscode/extensions.json.template:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3 | "recommendations": ["angular.ng-template"]
4 | }
5 |
--------------------------------------------------------------------------------
/scripts/templates/user-analytics-table.ejs:
--------------------------------------------------------------------------------
1 | <%
2 | %>| Name | Parameter | Type |
3 | |:---:|:---|:---|
4 | <% for (const { parameter, name, type } of data) {%>| <%= name %> | `<%= parameter %>` | `<%= type %>` |
5 | <%}%>
6 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/Extensions1.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {}
6 | }
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-dir/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "ng-add": {
4 | "factory": "./index.js",
5 | "description": "Add empty file to your application."
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/ng-snapshot/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "copy_to_bin")
2 |
3 | copy_to_bin(
4 | name = "ng-snapshot",
5 | srcs = ["package.json"],
6 | visibility = ["//visibility:public"],
7 | )
8 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/file-tasks/file-task.js:
--------------------------------------------------------------------------------
1 | function default_1() {
2 | return async () => {
3 | throw new Error('task exception');
4 | }
5 | }
6 |
7 | exports.default = default_1;
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-peer-bad/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "ng-add": {
4 | "factory": "./index.js",
5 | "description": "Add empty file to your application."
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-peer-good/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "ng-add": {
4 | "factory": "./index.js",
5 | "description": "Add empty file to your application."
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-migrations/migrations.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "1": {
4 | "factory": "./v1_5.js",
5 | "version": "1.5",
6 | "description": "Test."
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/.gitignore:
--------------------------------------------------------------------------------
1 | # Don't ignore node_modules, this project is not meant to be installed.
2 | # Also, ~ import path in styles does only looks in the first node_modules found.
3 | # /node_modules
4 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/src/my-full-schematic/files/test2:
--------------------------------------------------------------------------------
1 |
2 | <% if (name) { %>
3 | Hello <%= name %>, I'm a schematic.
4 | <% } else { %>
5 | Why don't you give me your name with --name?
6 | <% } %>
7 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-multiple/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-multiple",
3 | "extends": [
4 | "extends-basic",
5 | "extends-replace"
6 | ],
7 | "schematics": {}
8 | }
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/nested-schematic-dependency/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "nested": {
4 | "factory": "./index.js",
5 | "description": "Add empty file to your application."
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/config/type-browserslist.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../../utils/process';
2 |
3 | export default async function () {
4 | await ng('generate', 'config', 'browserslist');
5 | await ng('build');
6 | }
7 |
--------------------------------------------------------------------------------
/.ng-dev/format.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * Configuration for the `ng-dev format` command.
3 | *
4 | * @type { import("@angular/ng-dev").FormatConfig }
5 | */
6 | export const format = {
7 | 'prettier': true,
8 | 'buildifier': true,
9 | };
10 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-peer-bad/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "add-collection-peer-bad",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json",
5 | "peerDependencies": {
6 | "typescript": "2.x"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.ts.template:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable({
4 | providedIn: 'root',
5 | })
6 | export class <%= classifiedName %> {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/add-collection-peer-good/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "add-collection-peer-good",
3 | "version": "0.0.1",
4 | "schematics": "./collection.json",
5 | "peerDependencies": {
6 | "@angular/cli": "*"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lib",
3 | "version": "0.0.1",
4 | "peerDependencies": {
5 | "@angular/common": "^21.1.0-next",
6 | "@angular/core": "^21.1.0-next"
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/nested-schematic-main/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "test": {
4 | "factory": "./index.js",
5 | "description": "call an external schematic from nested package collection."
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.github/codeql/config.yml:
--------------------------------------------------------------------------------
1 | name: 'Angular CLI CodeQL config'
2 |
3 | query-filters:
4 | # TODO(josephperrott): reevaluate if these can be reenabled.
5 | - exclude:
6 | id: js/bad-code-sanitization
7 | - exclude:
8 | id: js/regex-injection
9 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/commands/test/long-description.md:
--------------------------------------------------------------------------------
1 | Takes the name of the project, as specified in the `projects` section of the `angular.json` workspace configuration file.
2 | When a project name is not supplied, it will execute for all projects.
3 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/works/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "works",
3 | "schematics": {
4 | "schematic1": {
5 | "description": "1",
6 | "factory": "../null-factory"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-migrations/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-migrations",
3 | "version": "1.6.0",
4 | "description": "Tests",
5 | "ng-update": {
6 | "migrations": "./migrations.json"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ProjectEmpty.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "projects": {
5 | "my-app": {
6 | "root": "projects/my-app"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.__style__.template:
--------------------------------------------------------------------------------
1 | <% if(displayBlock){ if(style != 'sass') { %>:host {
2 | display: block;
3 | }
4 | <% } else { %>\:host
5 | display: block;
6 | <% }} %>
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/file-tasks/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "file-tasks",
3 | "schematics": {
4 | "schematic-1": {
5 | "description": "1",
6 | "factory": "./factory"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/web-worker/files/worker/__name@dasherize__.worker.ts.template:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | addEventListener('message', ({ data }) => {
4 | const response = `worker response to ${data}`;
5 | postMessage(response);
6 | });
7 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowser } from '@angular/platform-browser';
2 | import { AppModule } from './app/app.module';
3 |
4 | platformBrowser().bootstrapModule(AppModule)
5 | .catch(err => console.error(err));
6 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../../../../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/lib",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | }
7 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/resolver/functional-files/__name@dasherize____typeSeparator__resolver.ts.template:
--------------------------------------------------------------------------------
1 | import { ResolveFn } from '@angular/router';
2 |
3 | export const <%= camelize(name) %>Resolver: ResolveFn = (route, state) => {
4 | return true;
5 | };
6 |
--------------------------------------------------------------------------------
/packages/schematics/angular/library/files/src/__entryFile__.ts.template:
--------------------------------------------------------------------------------
1 | /*
2 | * Public API Surface of <%= dasherize(name) %>
3 | */
4 |
5 | export * from './lib/<%= dasherize(name) %>';<% if (!standalone) { %>
6 | export * from './lib/<%= dasherize(name) %>-module';<% } %>
7 |
--------------------------------------------------------------------------------
/goldens/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | copy_to_bin(
6 | name = "public-api",
7 | srcs = glob([
8 | "public-api/**/*.md",
9 | ]),
10 | )
11 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-peer-dependencies-angular-5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-peer-dependencies-angular-5",
3 | "version": "1.0.0",
4 | "description": "Tests",
5 | "peerDependencies": {
6 | "@angular/core": "^5.0.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "copy_to_bin")
2 |
3 | copy_to_bin(
4 | name = "assets",
5 | srcs = glob(
6 | include = ["**"],
7 | exclude = ["BUILD.bazel"],
8 | ),
9 | visibility = ["//visibility:public"],
10 | )
11 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # JS and TS files must always use LF for tools to work
5 | *.js eol=lf
6 | *.ts eol=lf
7 | *.json eol=lf
8 | *.css eol=lf
9 | *.scss eol=lf
10 | *.less eol=lf
11 | *.html eol=lf
12 | *.svg eol=lf
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "compilerOptions": {
4 | "declarationMap": false
5 | },
6 | "angularCompilerOptions": {
7 | "compilationMode": "partial"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "es2022",
6 | "types": []
7 | },
8 | "exclude": ["test.ts", "**/*.spec.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ObjectReplace2.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {},
11 | "x-bar": 5,
12 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ObjectReplace3.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": null,
11 | "x-bar": 5,
12 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/interceptor/functional-files/__name@dasherize____typeSeparator__interceptor.ts.template:
--------------------------------------------------------------------------------
1 | import { HttpInterceptorFn } from '@angular/common/http';
2 |
3 | export const <%= camelize(name) %>Interceptor: HttpInterceptorFn = (req, next) => {
4 | return next(req);
5 | };
6 |
--------------------------------------------------------------------------------
/packages/schematics/angular/workspace/files/__dot__vscode/mcp.json.template:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://angular.dev/ai/mcp
3 | "mcpServers": {
4 | "angular-cli": {
5 | "command": "npx",
6 | "args": ["-y", "@angular/cli", "mcp"]
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular/ssr/schematics/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "ng-add": {
4 | "description": "Adds Angular SSR to the application without affecting any templates",
5 | "factory": "./ng-add/index",
6 | "schema": "./ng-add/schema.json"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/schematics/angular/config/files/vitest-base.config.ts.template:
--------------------------------------------------------------------------------
1 | // Learn more about Vitest configuration options at https://vitest.dev/config/
2 |
3 | import { defineConfig } from 'vitest/config';
4 |
5 | export default defineConfig({
6 | test: {
7 | // ...
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/application-builder/ngmodule-src/app/app.routes.server.ts.template:
--------------------------------------------------------------------------------
1 | import { RenderMode, ServerRoute } from '@angular/ssr';
2 |
3 | export const serverRoutes: ServerRoute[] = [
4 | {
5 | path: '**',
6 | renderMode: RenderMode.Prerender
7 | }
8 | ];
9 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/application-builder/standalone-src/app/app.routes.server.ts.template:
--------------------------------------------------------------------------------
1 | import { RenderMode, ServerRoute } from '@angular/ssr';
2 |
3 | export const serverRoutes: ServerRoute[] = [
4 | {
5 | path: '**',
6 | renderMode: RenderMode.Prerender
7 | }
8 | ];
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "test": {
4 | "factory": "./index.js",
5 | "schema": "./schema.json",
6 | "description": "test schematic that logs the options in the console."
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/.ng-dev/config.mjs:
--------------------------------------------------------------------------------
1 | export { commitMessage } from './commit-message.mjs';
2 | export { format } from './format.mjs';
3 | export { github } from './github.mjs';
4 | export { pullRequest } from './pull-request.mjs';
5 | export { release } from './release.mjs';
6 | export { caretaker } from './caretaker.mjs';
7 |
--------------------------------------------------------------------------------
/packages/angular/build/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/packages/angular/ssr/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './public_api';
10 |
--------------------------------------------------------------------------------
/packages/ngtools/webpack/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/packages/schematics/angular/library/files/ng-package.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "<%= relativePathToWorkspaceRoot %>/node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "<%= relativePathToWorkspaceRoot %>/<%= distRoot %>",
4 | "lib": {
5 | "entryFile": "src/<%= entryFile %>.ts"
6 | }
7 | }
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-peer-dependencies-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-peer-dependencies-2",
3 | "version": "1.1.0",
4 | "description": "Tests",
5 | "peerDependencies": {
6 | "@angular-devkit-tests/update-peer-dependencies-2": "1.0.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/angular/build/private/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | ts_project(
6 | name = "private",
7 | srcs = ["index.ts"],
8 | deps = [
9 | "//packages/angular/build",
10 | ],
11 | )
12 |
--------------------------------------------------------------------------------
/packages/angular/ssr/node/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './public_api';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-basic-string/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-basic-string",
3 | "extends": "works",
4 | "schematics": {
5 | "schematic2": {
6 | "description": "2",
7 | "factory": "../null-factory"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/angular/build/private/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from '../src/private';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/tests/README.md:
--------------------------------------------------------------------------------
1 | # `/tests` Folder
2 |
3 | Contains all e2e tests and test assets.
4 |
5 | ## `legacy-cli/`
6 |
7 | Contains all assets and all e2e tests from the legacy CLI repo.
8 |
9 | ## Others
10 |
11 | Other folders contain test assets related to the Package namespace folders matching their name.
12 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-circular/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-circular",
3 | "extends": "extends-circular",
4 | "schematics": {
5 | "schematic2": {
6 | "description": "2",
7 | "factory": "../null-factory"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es2018",
7 | "types": [
8 | "jasmine",
9 | "node"
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './src/index';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayReplace2.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": []
12 | },
13 | "x-bar": 5,
14 | }
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-basic/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-basic",
3 | "extends": [
4 | "works"
5 | ],
6 | "schematics": {
7 | "schematic2": {
8 | "description": "2",
9 | "factory": "../null-factory"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/main.ts:
--------------------------------------------------------------------------------
1 | import { bootstrapApplication } from '@angular/platform-browser';
2 | import { appConfig } from './app/app.config';
3 | import { AppComponent } from './app/app.component';
4 |
5 | bootstrapApplication(AppComponent, appConfig)
6 | .catch((err) => console.error(err));
7 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/tsconfig.server.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.app.json",
3 | "compilerOptions": {
4 | "outDir": "../dist-server",
5 | "baseUrl": "./",
6 | "types": ["@angular/localize", "node"]
7 | },
8 | "files": [
9 | "main.server.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/commands/update/schematic/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "update": {
4 | "factory": "./index",
5 | "schema": "./schema.json",
6 | "description": "Update one or multiple packages to versions, updating peer dependencies along the way."
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular/ssr/node/src/globals.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | declare const Zone: unknown | undefined;
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ObjectRemove.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-foo": {
10 | "is": ["good", "great", "awesome"]
11 | },
12 | "x-bar": 5,
13 | }
--------------------------------------------------------------------------------
/packages/angular/ssr/third_party/beasties/index.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.io/license
7 | */
8 |
9 | export { default } from 'beasties';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ObjectReplace1.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "replacement": true
12 | },
13 | "x-bar": 5,
14 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/class/files/__name@dasherize__.__type__.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { <%= classify(name) %> } from './<%= dasherize(name) %><%= type %>';
2 |
3 | describe('<%= classify(name) %>', () => {
4 | it('should create an instance', () => {
5 | expect(new <%= classify(name) %>()).toBeTruthy();
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/packages/schematics/angular/utility/test/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './create-app-module';
10 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-replace/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-replace",
3 | "extends": [
4 | "works"
5 | ],
6 | "schematics": {
7 | "schematic1": {
8 | "description": "replaced",
9 | "factory": "../null-factory"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/testing/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './schematic-test-runner';
10 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/standalone-files/src/main.ts.template:
--------------------------------------------------------------------------------
1 | import { bootstrapApplication } from '@angular/platform-browser';
2 | import { appConfig } from './app/app.config';
3 | import { App } from './app/app<%= suffix %>';
4 |
5 | bootstrapApplication(App, appConfig)
6 | .catch((err) => console.error(err));
7 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-circular-deep/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-circular-deep",
3 | "extends": "extends-circular-multiple",
4 | "schematics": {
5 | "schematic2": {
6 | "description": "2",
7 | "factory": "../null-factory"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/config/type-karma.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../../utils/process';
2 | import { useCIChrome } from '../../../utils/project';
3 |
4 | export default async function () {
5 | await ng('generate', 'config', 'karma');
6 | await useCIChrome('test-project');
7 | await ng('test', '--watch=false');
8 | }
9 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/Retain.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 10,
10 | "x-foo": {
11 | "is": ["good", "great", "awesome"]
12 | },
13 | "x-bar": 5,
14 | }
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "type": "object",
4 | "description": "test schematic that logs the options in the console.",
5 | "properties": {
6 | "noWatch": {
7 | "type": "boolean"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "declaration": true,
5 | "declarationMap": true,
6 | "inlineSources": true,
7 | "types": []
8 | },
9 | "exclude": [
10 | "**/*.spec.ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": [
6 | "jasmine"
7 | ]
8 | },
9 | "include": [
10 | "**/*.spec.ts",
11 | "**/*.d.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/node/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './cli-logger';
10 | export * from './host';
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayReplace1.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "value"
13 | ]
14 | },
15 | "x-bar": 5,
16 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/Extensions2.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "schematics": {
6 | "@schematics/angular:component": {
7 | "prefix": "app"
8 | }
9 | },
10 | "projects": {}
11 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.ts.template:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core';
2 |
3 | @Directive({
4 | selector: '[<%= selector %>]',<% if(!standalone) {%>
5 | standalone: false,<%}%>
6 | })
7 | export class <%= classifiedName %> {
8 |
9 | constructor() { }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extra-properties/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extra-properties",
3 | "schematics": {
4 | "schematic1": {
5 | "description": "1",
6 | "factory": "./factory",
7 | "extra": "extra-schematic"
8 | }
9 | },
10 | "extra": "extra-collection"
11 | }
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/.gitignore.template:
--------------------------------------------------------------------------------
1 | # Outputs
2 | src/**/*.js
3 | src/**/*.js.map
4 | src/**/*.d.ts
5 |
6 | # IDEs
7 | .idea/
8 | jsconfig.json
9 | .vscode/
10 |
11 | # Misc
12 | node_modules/
13 | npm-debug.log*
14 | yarn-error.log*
15 |
16 | # Mac OSX Finder files.
17 | **/.DS_Store
18 | .DS_Store
19 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-allow-scripts/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "test": {
4 | "factory": "./index.js",
5 | "schema": "./schema.json",
6 | "description": "test schematic that creates a directory with a local test package that should not run its post-install script"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": ["@angular/localize"]
6 | },
7 | "files": [
8 | "main.ts",
9 | "polyfills.ts"
10 | ],
11 | "include": [
12 | "**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/README.md:
--------------------------------------------------------------------------------
1 | # `/packages` Folder
2 |
3 | This folder is the root of all defined packages in this repository.
4 |
5 | Packages that are marked as `private: true` will not be published to NPM.
6 |
7 | This folder includes a directory for every scope in NPM, without the `@` sign. Then one folder
8 | per package, which contains the `package.json`.
9 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayPop.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great"
14 | ]
15 | },
16 | "x-bar": 5,
17 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/src/workflow/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './base';
10 | export * from './interface';
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/blank/project-files/.gitignore.template:
--------------------------------------------------------------------------------
1 |
2 | # Outputs
3 | src/**/*.js
4 | src/**/*.js.map
5 | src/**/*.d.ts
6 |
7 | # IDEs
8 | .idea/
9 | jsconfig.json
10 | .vscode/
11 |
12 | # Misc
13 | node_modules/
14 | npm-debug.log*
15 | yarn-error.log*
16 |
17 | # Mac OSX Finder files.
18 | **/.DS_Store
19 | .DS_Store
20 |
--------------------------------------------------------------------------------
/packages/schematics/angular/workspace/files/angular.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,<% if (packageManager) { %>
4 | "cli": {
5 | "packageManager": "<%= packageManager %>"
6 | },<% } %>
7 | "newProjectRoot": "<%= newProjectRoot %>",
8 | "projects": {
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/build/config-file-fallback.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../utils/process';
2 | import { moveFile } from '../../utils/fs';
3 |
4 | export default function () {
5 | return Promise.resolve()
6 | .then(() => ng('build'))
7 | .then(() => moveFile('angular.json', '.angular.json'))
8 | .then(() => ng('build'));
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/testing/test-utils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from '../../../../../modules/testing/builder/src';
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/transforms.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export type ExecutionTransformer = (input: T) => T | Promise;
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/AddArrayEmpty.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": ["good", "great", "awesome"]
12 | },
13 | "x-bar": 5,
14 | "x-array": [],
15 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayShift.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "great",
13 | "awesome"
14 | ]
15 | },
16 | "x-bar": 5,
17 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArraySplice1.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great"
14 | ]
15 | },
16 | "x-bar": 5,
17 | }
--------------------------------------------------------------------------------
/packages/schematics/angular/e2e/files/src/app.po.ts.template:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | async navigateTo(): Promise {
5 | return browser.get(browser.baseUrl);
6 | }
7 |
8 | async getTitleText(): Promise {
9 | return element(by.css('h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes } from '@angular/router';
3 |
4 | const routes: Routes = [];
5 |
6 | @NgModule({
7 | imports: [RouterModule.forRoot(routes)],
8 | exports: [RouterModule]
9 | })
10 | export class AppRoutingModule { }
11 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/add/npm-config.ts:
--------------------------------------------------------------------------------
1 | import { writeFile } from '../../../utils/fs';
2 | import { ng } from '../../../utils/process';
3 |
4 | export default async function () {
5 | // Works with before option
6 | await writeFile('.npmrc', `before=${new Date().toISOString()}`);
7 | await ng('add', '@angular/pwa', '--skip-confirmation');
8 | }
9 |
--------------------------------------------------------------------------------
/tsconfig-test-esm.json:
--------------------------------------------------------------------------------
1 | /**
2 | * Root tsconfig file for use building all Angular packages. Note there is no rootDir
3 | * and therefore any tsconfig in the package directory will need to define its own
4 | * rootDir.
5 | */
6 | {
7 | "extends": "./tsconfig-build-esm.json",
8 | "compilerOptions": {
9 | "types": ["node", "jasmine"]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # https://editorconfig.org
2 |
3 | root = true
4 |
5 | [*.ts]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 2
9 | insert_final_newline = true
10 | spaces_around_brackets = inside
11 | trim_trailing_whitespace = true
12 | quote_type = single
13 |
14 | [*.md]
15 | insert_final_newline = false
16 | trim_trailing_whitespace = true
17 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/plugins/karma.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | module.exports = require('../src/tools/webpack/plugins/karma/karma');
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayDeleteInner.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "awesome"
14 | ]
15 | },
16 | "x-bar": 5,
17 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayDeleteLast.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great"
14 | ]
15 | },
16 | "x-bar": 5,
17 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayDeleteZero.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "great",
13 | "awesome"
14 | ]
15 | },
16 | "x-bar": 5,
17 | }
--------------------------------------------------------------------------------
/packages/ngtools/webpack/src/transformers/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './elide_imports';
10 | export * from './replace_resources';
11 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | standalone: false,
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.css']
8 | })
9 | export class AppComponent {
10 | title = '20-ssr-project-webpack';
11 | }
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/generate-error.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../utils/process';
2 | import { deleteFile } from '../../utils/fs';
3 | import { expectToFail } from '../../utils/utils';
4 |
5 | export default function () {
6 | return deleteFile('angular.json').then(() =>
7 | expectToFail(() => ng('generate', 'class', 'hello')),
8 | );
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/commands/add/long-description.md:
--------------------------------------------------------------------------------
1 | Adds the npm package for a published library to your workspace, and configures
2 | the project in the current working directory to use that library, as specified by the library's schematic.
3 | For example, adding `@angular/pwa` configures your project for PWA support:
4 |
5 | ```bash
6 | ng add @angular/pwa
7 | ```
8 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/null-factory.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 | export default function () {
9 | return () => {};
10 | }
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/testing/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './testing-architect-host';
10 | export * from './test-project-host';
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/utils/package-version.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export const VERSION: string = require('../../package.json').version;
10 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/setup/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | ts_project(
6 | name = "setup",
7 | testonly = True,
8 | srcs = glob(["**/*.ts"]),
9 | deps = [
10 | "//:node_modules/@types/node",
11 | "//tests/legacy-cli/e2e/utils",
12 | ],
13 | )
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayIndexLast.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great",
14 | "value"
15 | ]
16 | },
17 | "x-bar": 5,
18 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArraySort.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "awesome",
13 | "good",
14 | "great"
15 | ]
16 | },
17 | "x-bar": 5,
18 | }
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-circular-middle/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-circular-middle",
3 | "extends": [
4 | "extends-multiple",
5 | "extends-circular-multiple"
6 | ],
7 | "schematics": {
8 | "schematic2": {
9 | "description": "2",
10 | "factory": "../null-factory"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/json/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as schema from './schema/index';
10 |
11 | export * from './utils';
12 | export { schema };
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/AddArrayPush.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": ["good", "great", "awesome"]
12 | },
13 | "x-bar": 5,
14 | "x-array": [
15 | "value"
16 | ],
17 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayDeleteInnerAdd.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "new",
14 | "awesome"
15 | ]
16 | },
17 | "x-bar": 5,
18 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayDeleteLastAdd.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great",
14 | "new"
15 | ]
16 | },
17 | "x-bar": 5,
18 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayIndexInner.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "value",
14 | "awesome"
15 | ]
16 | },
17 | "x-bar": 5,
18 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayIndexZero.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "value",
13 | "great",
14 | "awesome"
15 | ]
16 | },
17 | "x-bar": 5,
18 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/src/engine/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './engine';
10 | export * from './interface';
11 | export * from './schematic';
12 |
--------------------------------------------------------------------------------
/packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { <%= classify(name) %>Pipe } from './<%= dasherize(name) %><%= typeSeparator %>pipe';
2 |
3 | describe('<%= classify(name) %>Pipe', () => {
4 | it('create an instance', () => {
5 | const pipe = new <%= classify(name) %>Pipe();
6 | expect(pipe).toBeTruthy();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/extends-circular-multiple/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "extends-circular-multiple",
3 | "extends": [
4 | "extends-multiple",
5 | "extends-circular-middle"
6 | ],
7 | "schematics": {
8 | "schematic2": {
9 | "description": "2",
10 | "factory": "../null-factory"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular/build/src/builders/karma/polyfills/init_sourcemaps.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | // eslint-disable-next-line no-undef
10 | globalThis.sourceMapSupport?.install();
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/node/test/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | ts_project(
4 | name = "test_lib",
5 | srcs = glob(["**/*.ts"]),
6 | visibility = ["//packages/angular_devkit/architect/node:__pkg__"],
7 | deps = [
8 | "//:node_modules/@types/node",
9 | "//packages/angular_devkit/architect",
10 | ],
11 | )
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/builders/extract-i18n/empty-loader.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export default function () {
10 | return `export default '';`;
11 | }
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": []
7 | },
8 | "files": [
9 | "src/main.ts"
10 | ],
11 | "include": [
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-package-group-1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-package-group-1",
3 | "version": "1.2.0",
4 | "description": "Tests",
5 | "ng-update": {
6 | "packageGroup": {
7 | "@angular-devkit-tests/update-package-group-1": "",
8 | "@angular-devkit-tests/update-package-group-2": "^2"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-package-group-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-package-group-2",
3 | "version": "2.0.0",
4 | "description": "Tests",
5 | "ng-update": {
6 | "packageGroup": {
7 | "@angular-devkit-tests/update-package-group-1": "^1",
8 | "@angular-devkit-tests/update-package-group-2": ""
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.ng-dev/github.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * Github configuration for the ng-dev command. This repository is
3 | * used as remote for the merge script.
4 | *
5 | * @type { import("@angular/ng-dev").GithubConfig }
6 | */
7 | export const github = {
8 | owner: 'angular',
9 | name: 'angular-cli',
10 | mainBranchName: 'main',
11 | useNgDevAuthService: true,
12 | mergeMode: 'team-only',
13 | };
14 |
--------------------------------------------------------------------------------
/packages/angular/cli/README.md:
--------------------------------------------------------------------------------
1 | # Angular CLI - The CLI tool for Angular.
2 |
3 | The sources for this package are in the [Angular CLI](https://github.com/angular/angular-cli) repository. Please file issues and pull requests against that repository.
4 |
5 | Usage information and reference details can be found in repository [README](https://github.com/angular/angular-cli/blob/main/README.md) file.
6 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/virtual-fs/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as virtualFs from './host/index';
10 |
11 | export * from './path';
12 | export { virtualFs };
13 |
--------------------------------------------------------------------------------
/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "module": "Node16",
5 | "moduleResolution": "Node16",
6 | "erasableSyntaxOnly": true,
7 | "verbatimModuleSyntax": true,
8 | "rewriteRelativeImportExtensions": true,
9 | "noEmit": true,
10 | "types": []
11 | },
12 | "include": ["**/*.mts"],
13 | "exclude": []
14 | }
15 |
--------------------------------------------------------------------------------
/tests/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("@npm//:defs.bzl", "npm_link_all_packages")
2 |
3 | # Copyright Google Inc. All Rights Reserved.
4 | #
5 | # Use of this source code is governed by an MIT-style license that can be
6 | # found in the LICENSE file at https://angular.dev/license
7 | package(default_visibility = ["//visibility:public"])
8 |
9 | licenses(["notice"])
10 |
11 | npm_link_all_packages()
12 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/aliases/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aliases",
3 | "schematics": {
4 | "schematic1": {
5 | "aliases": ["alias1"],
6 | "description": "1",
7 | "factory": "../null-factory"
8 | },
9 | "schematic2": {
10 | "description": "2",
11 | "factory": "../null-factory"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/app/app.config.ts:
--------------------------------------------------------------------------------
1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2 | import { provideRouter } from '@angular/router';
3 |
4 | import { routes } from './app.routes';
5 |
6 | export const appConfig: ApplicationConfig = {
7 | providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
8 | };
9 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "@angular/localize"
8 | ]
9 | },
10 | "files": [
11 | "polyfills.ts"
12 | ],
13 | "include": [
14 | "**/*.spec.ts",
15 | "**/*.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayPush.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great",
14 | "awesome",
15 | "value"
16 | ]
17 | },
18 | "x-bar": 5,
19 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayUnshift.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "value",
13 | "good",
14 | "great",
15 | "awesome"
16 | ]
17 | },
18 | "x-bar": 5,
19 | }
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/schematic-allow-scripts/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "type": "object",
4 | "additionalProperties": false,
5 | "properties": {
6 | "allowScripts": {
7 | "type": "boolean"
8 | },
9 | "ignoreScripts": {
10 | "type": "boolean"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.server.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.app.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/server",
6 | "types": [
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/main.server.ts",
12 | "server.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "include": [
11 | "src/**/*.spec.ts",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/angular/build/README.md:
--------------------------------------------------------------------------------
1 | # Angular Build System for Applications and Libraries
2 |
3 | The sources for this package are in the [Angular CLI](https://github.com/angular/angular-cli) repository. Please file issues and pull requests against that repository.
4 |
5 | Usage information and reference details can be found in repository [README](https://github.com/angular/angular-cli/blob/main/README.md) file.
6 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/tools/webpack/configs/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './common';
10 | export * from './dev-server';
11 | export * from './styles';
12 |
--------------------------------------------------------------------------------
/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { <%= classifiedName %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>';
2 |
3 | describe('<%= classifiedName %>', () => {
4 | it('should create an instance', () => {
5 | const directive = new <%= classifiedName %>();
6 | expect(directive).toBeTruthy();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/config/config-set-serve-port.ts:
--------------------------------------------------------------------------------
1 | import { expectFileToMatch } from '../../../utils/fs';
2 | import { ng } from '../../../utils/process';
3 |
4 | export default function () {
5 | return Promise.resolve()
6 | .then(() => ng('config', 'projects.test-project.architect.serve.options.port', '1234'))
7 | .then(() => expectFileToMatch('angular.json', /"port": 1234/));
8 | }
9 |
--------------------------------------------------------------------------------
/packages/schematics/angular/library/files/package.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "name": "<%= dasherize(packageName) %>",
3 | "version": "0.0.1",
4 | "peerDependencies": {
5 | "@angular/common": "^<%= angularLatestVersion %>",
6 | "@angular/core": "^<%= angularLatestVersion %>"
7 | },
8 | "dependencies": {
9 | "tslib": "^<%= tsLibLatestVersion %>"
10 | },
11 | "sideEffects": false
12 | }
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | EighteenProject
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-migrations-external/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-migrations-external",
3 | "version": "1.6.0",
4 | "description": "Tests",
5 | "ng-update": {
6 | "migrations": "@angular-devkit-tests/update-migrations/migrations.json"
7 | },
8 | "dependencies": {
9 | "@angular-devkit-tests/update-migrations": "1.6.0"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/node/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as jobs from './jobs/job-registry';
10 |
11 | export * from './node-modules-architect-host';
12 |
13 | export { jobs };
14 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/invalid-aliases/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "invalid-aliases",
3 | "schematics": {
4 | "schematic1": {
5 | "aliases": ["schematic2"],
6 | "description": "1",
7 | "factory": "../null-factory"
8 | },
9 | "schematic2": {
10 | "description": "2",
11 | "factory": "../null-factory"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 17SsrProjectWebpack
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-migrations/v1_5.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | exports.default = function () {
10 | return function (tree) {
11 | tree.create('/version1_5', '');
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | Angular is part of Google [Open Source Software Vulnerability Reward Program](https://bughunters.google.com/about/rules/6521337925468160/google-open-source-software-vulnerability-reward-program-rules). For vulnerabilities in Angular, please submit your report [here](https://bughunters.google.com/report).
2 |
3 | For more information, check out [Angular's security policy](https://angular.dev/best-practices/security).
4 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HelloWorldApp
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './builders/webpack';
10 | export * from './builders/webpack-dev-server';
11 | export type { EmittedFiles } from './utils';
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/AddProject1.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": ["good", "great", "awesome"]
12 | },
13 | "x-bar": 5,
14 | "projects": {
15 | "new": {
16 | "root": "src7"
17 | }
18 | },
19 | }
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArraySplice2.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": [
12 | "good",
13 | "great",
14 | "value1",
15 | "value2",
16 | "awesome"
17 | ]
18 | },
19 | "x-bar": 5,
20 | }
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/aliases-many/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aliases-many",
3 | "schematics": {
4 | "schematic1": {
5 | "aliases": ["alias1", "alias2", "alias3"],
6 | "description": "1",
7 | "factory": "../null-factory"
8 | },
9 | "schematic2": {
10 | "description": "2",
11 | "factory": "../null-factory"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.ng-dev/pull-request.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * Configuration for the merge tool in `ng-dev`. This sets up the labels which
3 | * are respected by the merge script (e.g. the target labels).
4 | *
5 | * @type { import("@angular/ng-dev").PullRequestConfig }
6 | */
7 | export const pullRequest = {
8 | githubApiMerge: {
9 | default: 'auto',
10 | labels: [{ pattern: 'merge: squash commits', method: 'squash' }],
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | /* SystemJS module definition */
10 | declare var module: NodeModule;
11 | interface NodeModule {
12 | id: string;
13 | }
14 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterOutlet } from '@angular/router';
3 |
4 | @Component({
5 | selector: 'app-root',
6 | standalone: true,
7 | imports: [RouterOutlet],
8 | templateUrl: './app.component.html',
9 | styleUrl: './app.component.css'
10 | })
11 | export class AppComponent {
12 | title = 'eighteen-project';
13 | }
14 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 |
3 | updates:
4 | - package-ecosystem: 'npm'
5 | directory: '/'
6 | schedule:
7 | interval: 'daily'
8 | commit-message:
9 | prefix: 'build'
10 | labels:
11 | - 'area: build & ci'
12 | - 'target: patch'
13 | - 'action: merge'
14 | # Disable version updates
15 | # This does not affect security updates
16 | open-pull-requests-limit: 0
17 |
--------------------------------------------------------------------------------
/modules/testing/builder/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "devDependencies": {
3 | "@angular-devkit/core": "workspace:*",
4 | "@angular-devkit/architect": "workspace:*",
5 | "@angular/ssr": "workspace:*",
6 | "@angular-devkit/build-angular": "workspace:*",
7 | "browser-sync": "3.0.4",
8 | "@vitest/coverage-v8": "4.0.15",
9 | "jsdom": "27.3.0",
10 | "rxjs": "7.8.2",
11 | "vitest": "4.0.15"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/main.server.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { AppServerModule } from './app/app.module.server';
10 | export default AppServerModule;
11 | export { AppServerModule };
12 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/types.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export type MigrationResponse = {
10 | content: {
11 | type: 'text';
12 | text: string;
13 | }[];
14 | };
15 |
--------------------------------------------------------------------------------
/packages/angular/create/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular/create",
3 | "version": "0.0.0-PLACEHOLDER",
4 | "description": "Scaffold an Angular CLI workspace.",
5 | "keywords": [
6 | "angular",
7 | "angular-cli",
8 | "Angular CLI",
9 | "code generation",
10 | "schematics"
11 | ],
12 | "bin": "./src/index.js",
13 | "dependencies": {
14 | "@angular/cli": "0.0.0-PLACEHOLDER"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/utility/standalone/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { addRootImport, addRootProvider } from './rules';
10 | export type { PendingCode, CodeBlockCallback, CodeBlock } from './code_block';
11 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/src/tree/empty.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { HostTree } from './host-tree';
10 |
11 | export class EmptyTree extends HostTree {
12 | constructor() {
13 | super();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.ts.template:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: '<%= camelize(name) %>',<% if(!standalone) {%>
5 | standalone: false,<%}%>
6 | })
7 | export class <%= classify(name) %>Pipe implements PipeTransform {
8 |
9 | transform(value: unknown, ...args: unknown[]): unknown {
10 | return null;
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/build/project-name.ts:
--------------------------------------------------------------------------------
1 | import { silentNg } from '../../utils/process';
2 |
3 | export default async function () {
4 | // Named Development build
5 | await silentNg('build', 'test-project', '--configuration=development');
6 | await silentNg('build', '--configuration=development', 'test-project', '--no-progress');
7 | await silentNg('build', '--configuration=development', '--no-progress', 'test-project');
8 | }
9 |
--------------------------------------------------------------------------------
/packages/ngtools/webpack/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export {
10 | AngularWebpackLoaderPath,
11 | AngularWebpackPlugin,
12 | type AngularWebpackPluginOptions,
13 | imageDomains,
14 | default,
15 | } from './ivy';
16 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/aliases-dupe/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aliases-dupe",
3 | "schematics": {
4 | "schematic1": {
5 | "aliases": ["alias1", "alias2", "alias3", "alias1", "alias2"],
6 | "description": "1",
7 | "factory": "../null-factory"
8 | },
9 | "schematic2": {
10 | "description": "2",
11 | "factory": "../null-factory"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 | ij_typescript_use_double_quotes = false
14 |
15 | [*.md]
16 | max_line_length = off
17 | trim_trailing_whitespace = false
18 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/logger/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './indent';
10 | export * from './level';
11 | export * from './logger';
12 | export * from './null-logger';
13 | export * from './transform-logger';
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/json/test/cases/ArrayValues.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | // Comment
4 | "schematics": {
5 | "@angular/schematics:component": {
6 | "prefix": "abc"
7 | }
8 | },
9 | "x-baz": 1,
10 | "x-foo": {
11 | "is": ["good", "great", "awesome"]
12 | },
13 | "x-bar": 5,
14 | "x-array": [
15 | 5,
16 | "a",
17 | false,
18 | null,
19 | true,
20 | 9.9
21 | ],
22 | }
--------------------------------------------------------------------------------
/tests/angular_devkit/core/json/schema/serializers/0.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Person",
3 | "type": "object",
4 | "properties": {
5 | "firstName": {
6 | "type": "string"
7 | },
8 | "lastName": {
9 | "type": "string"
10 | },
11 | "age": {
12 | "description": "Age in years",
13 | "type": "integer",
14 | "minimum": 0
15 | }
16 | },
17 | "required": ["firstName", "lastName"]
18 | }
19 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/invalid-aliases-2/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "invalid-aliases-2",
3 | "schematics": {
4 | "schematic1": {
5 | "aliases": ["alias1"],
6 | "description": "1",
7 | "factory": "../null-factory"
8 | },
9 | "schematic2": {
10 | "aliases": ["alias1"],
11 | "description": "2",
12 | "factory": "../null-factory"
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/initialize/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | ts_project(
6 | name = "initialize",
7 | testonly = True,
8 | srcs = glob(["**/*.ts"]),
9 | data = [
10 | "//:config-files",
11 | ],
12 | deps = [
13 | "//:node_modules/@types/node",
14 | "//tests/legacy-cli/e2e/utils",
15 | ],
16 | )
17 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/cache/cache-clean.ts:
--------------------------------------------------------------------------------
1 | import { createDir, expectFileNotToExist, expectFileToExist } from '../../../utils/fs';
2 | import { ng } from '../../../utils/process';
3 |
4 | export default async function () {
5 | const cachePath = '.angular/cache';
6 | await createDir(cachePath);
7 | await expectFileToExist(cachePath);
8 |
9 | await ng('cache', 'clean');
10 | await expectFileNotToExist(cachePath);
11 | }
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/library/library-basic.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../../utils/process';
2 | import { useCIChrome } from '../../../utils/project';
3 |
4 | export default async function () {
5 | await ng('generate', 'library', 'lib-ngmodule', '--no-standalone');
6 | await useCIChrome('lib-ngmodule', 'projects/lib-ngmodule');
7 | await ng('test', 'lib-ngmodule', '--no-watch');
8 | await ng('build', 'lib-ngmodule');
9 | }
10 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { ServerModule } from '@angular/platform-server';
3 |
4 | import { AppModule } from './app.module';
5 | import { AppComponent } from './app.component';
6 |
7 | @NgModule({
8 | imports: [
9 | AppModule,
10 | ServerModule,
11 | ],
12 | bootstrap: [AppComponent],
13 | })
14 | export class AppServerModule {}
15 |
--------------------------------------------------------------------------------
/packages/angular/build/src/builders/karma/polyfills/jasmine_global_cleanup.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | // See: https://github.com/jasmine/jasmine/issues/2015
10 | (function () {
11 | 'use strict';
12 |
13 | delete window.toString;
14 | })();
15 |
--------------------------------------------------------------------------------
/packages/angular/build/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './normalize-asset-patterns';
10 | export * from './normalize-optimization';
11 | export * from './normalize-source-maps';
12 | export * from './load-proxy-config';
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/builders/true.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { type Builder, createBuilder } from '../src';
10 |
11 | const builder: Builder<{}> = createBuilder(() => ({ success: true }));
12 |
13 | export default builder;
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit/architect",
3 | "version": "0.0.0-EXPERIMENTAL-PLACEHOLDER",
4 | "description": "Angular Build Facade",
5 | "experimental": true,
6 | "main": "src/index.js",
7 | "typings": "src/index.d.ts",
8 | "dependencies": {
9 | "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
10 | "rxjs": "7.8.2"
11 | },
12 | "builders": "./builders/builders.json"
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | /*
10 | * Public API Surface of lib
11 | */
12 |
13 | export * from './lib/lib.service';
14 | export * from './lib/lib.component';
15 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/server-builder/standalone-src/main.server.ts.template:
--------------------------------------------------------------------------------
1 | import { BootstrapContext, bootstrapApplication } from '@angular/platform-browser';
2 | import { <%= appComponentName %> } from '<%= appComponentPath %>';
3 | import { config } from './app/app.config.server';
4 |
5 | const bootstrap = (context: BootstrapContext) =>
6 | bootstrapApplication(<%= appComponentName %>, config, context);
7 |
8 | export default bootstrap;
9 |
--------------------------------------------------------------------------------
/packages/schematics/angular/workspace/files/__dot__editorconfig.template:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 | ij_typescript_use_double_quotes = false
14 |
15 | [*.md]
16 | max_line_length = off
17 | trim_trailing_whitespace = false
18 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/jest/basic.ts:
--------------------------------------------------------------------------------
1 | import { applyJestBuilder } from '../../utils/jest';
2 | import { ng } from '../../utils/process';
3 |
4 | export default async function (): Promise {
5 | await applyJestBuilder();
6 |
7 | const { stderr } = await ng('test');
8 |
9 | if (!stderr.includes('Jest builder is currently EXPERIMENTAL')) {
10 | throw new Error(`No experimental notice in stderr.\nSTDERR:\n\n${stderr}`);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/src/my-full-schematic/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "$id": "MyFullSchematicsSchema",
4 | "title": "My Full Schematics Schema",
5 | "type": "object",
6 | "properties": {
7 | "index": {
8 | "type": "number",
9 | "default": 1
10 | },
11 | "name": {
12 | "type": "string"
13 | }
14 | },
15 | "required": ["name"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/common-files/src/index.html.template:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <%= utils.classify(name) %>
6 |
7 |
8 |
9 |
10 |
11 | <<%= selector %>><%= selector %>>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/application-builder/standalone-src/main.server.ts.template:
--------------------------------------------------------------------------------
1 | import { BootstrapContext, bootstrapApplication } from '@angular/platform-browser';
2 | import { <%= appComponentName %> } from '<%= appComponentPath %>';
3 | import { config } from './app/app.config.server';
4 |
5 | const bootstrap = (context: BootstrapContext) =>
6 | bootstrapApplication(<%= appComponentName %>, config, context);
7 |
8 | export default bootstrap;
9 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/library/library-standalone.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../../utils/process';
2 | import { useCIChrome } from '../../../utils/project';
3 |
4 | export default async function () {
5 | await ng('generate', 'library', 'lib-standalone', '--standalone');
6 | await useCIChrome('lib-standalone', 'projects/lib-standalone');
7 | await ng('test', 'lib-standalone', '--no-watch');
8 | await ng('build', 'lib-standalone');
9 | }
10 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/schematic-aliases.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../utils/process';
2 |
3 | export default async function () {
4 | const schematicNameVariation = [
5 | 'component',
6 | 'c',
7 | '@schematics/angular:component',
8 | '@schematics/angular:c',
9 | ];
10 |
11 | for (const schematic of schematicNameVariation) {
12 | await ng('generate', schematic, 'comp-name', '--display-block', '--dry-run');
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/workspace/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export * from './definitions';
10 | export { type WorkspaceHost, createWorkspaceHost } from './host';
11 | export { WorkspaceFormat, readWorkspace, writeWorkspace } from './core';
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/blank/schematic-files/src/__name@dasherize__/index.ts.template:
--------------------------------------------------------------------------------
1 | import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2 |
3 |
4 | // You don't have to export the function as default. You can also have more than one rule factory
5 | // per file.
6 | export function <%= camelize(name) %>(_options: any): Rule {
7 | return (tree: Tree, _context: SchematicContext) => {
8 | return tree;
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/misc/multiple-targets.ts:
--------------------------------------------------------------------------------
1 | import { expectFileToExist } from '../../utils/fs';
2 | import { ng } from '../../utils/process';
3 |
4 | export default async function () {
5 | await ng('generate', 'app', 'secondary-app');
6 | await ng('build', 'secondary-app', '--configuration=development');
7 | await expectFileToExist('dist/secondary-app/browser/index.html');
8 | await expectFileToExist('dist/secondary-app/browser/main.js');
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular/pwa/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "ng-add": {
4 | "factory": "./pwa",
5 | "description": "Update an application with PWA defaults.",
6 | "schema": "./pwa/schema.json",
7 | "private": true,
8 | "hidden": true
9 | },
10 | "pwa": {
11 | "factory": "./pwa",
12 | "description": "Update an application with PWA defaults.",
13 | "schema": "./pwa/schema.json"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/vitest/component.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { applyVitestBuilder } from '../../utils/vitest';
3 | import { ng } from '../../utils/process';
4 |
5 | export default async function (): Promise {
6 | await applyVitestBuilder();
7 | await ng('generate', 'component', 'my-comp');
8 |
9 | const { stdout } = await ng('test');
10 |
11 | assert.match(stdout, /2 passed/, 'Expected 2 tests to pass.');
12 | }
13 |
--------------------------------------------------------------------------------
/.ng-dev/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "resolveJsonModule": true,
5 | "allowJs": true,
6 | "rewriteRelativeImportExtensions": true,
7 | "erasableSyntaxOnly": true,
8 | "verbatimModuleSyntax": true,
9 | "module": "Node16",
10 | "moduleResolution": "Node16",
11 | "checkJs": true,
12 | "noEmit": true,
13 | "types": []
14 | },
15 | "include": ["**/*.mjs"],
16 | "exclude": []
17 | }
18 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/testing/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | // TODO: Consider using package.json imports field instead of relative path
10 | // after the switch to rules_js.
11 | export * from '../../../../../modules/testing/builder/src';
12 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/update-peer-dependencies-angular-5-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit-tests/update-peer-dependencies-angular-5-2",
3 | "version": "1.0.0",
4 | "description": "Tests",
5 | "peerDependencies": {
6 | "@angular/animations": ">= 1 < 5.0.0 || >= 5.0.0-rc.0 < 6.0.0",
7 | "@angular/compiler": ">= 1 < 5.0.0 || >= 5.0.0-rc.0 < 6.0.0",
8 | "@angular/platform-browser": ">= 1 < 5.0.0 || >= 5.0.0-rc.0 < 6.0.0"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/server-builder/standalone-src/app/app.config.server.ts.template:
--------------------------------------------------------------------------------
1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2 | import { provideServerRendering } from '@angular/ssr';
3 | import { appConfig } from './app.config';
4 |
5 | const serverConfig: ApplicationConfig = {
6 | providers: [
7 | provideServerRendering()
8 | ]
9 | };
10 |
11 | export const config = mergeApplicationConfig(appConfig, serverConfig);
12 |
--------------------------------------------------------------------------------
/.ng-dev/caretaker.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * The configuration for `ng-dev caretaker` commands.
3 | *
4 | * @type { import("@angular/ng-dev").CaretakerConfig }
5 | */
6 | export const caretaker = {
7 | githubQueries: [
8 | {
9 | name: 'Merge Queue',
10 | query: `is:pr is:open status:success label:"action: merge"`,
11 | },
12 | {
13 | name: 'Merge Assistance Queue',
14 | query: `is:pr is:open label:"action: merge-assistance"`,
15 | },
16 | ],
17 | };
18 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/tasks/run-schematic/options.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export const RunSchematicName = 'run-schematic';
10 |
11 | export interface RunSchematicTaskOptions {
12 | collection: string | null;
13 | name: string;
14 | options: T;
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/utils/version.ts:
--------------------------------------------------------------------------------
1 | import * as fs from 'node:fs';
2 | import * as semver from 'semver';
3 |
4 | export function readNgVersion(): string {
5 | const packageJson: any = JSON.parse(
6 | fs.readFileSync('./node_modules/@angular/core/package.json', 'utf8'),
7 | ) as { version: string };
8 | return packageJson['version'];
9 | }
10 |
11 | export function ngVersionMatches(range: string): boolean {
12 | return semver.satisfies(readNgVersion(), range);
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular/build/src/tools/angular/compilation/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { AngularCompilation, DiagnosticModes } from './angular-compilation';
10 | export { createAngularCompilation } from './factory';
11 | export { NoopCompilation } from './noop-compilation';
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/tasks/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { NodePackageInstallTask } from './package-manager/install-task';
10 | export { RepositoryInitializerTask } from './repo-init/init-task';
11 | export { RunSchematicTask } from './run-schematic/task';
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/unknown-configuration.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert';
2 | import { ng } from '../../utils/process';
3 | import { expectToFail } from '../../utils/utils';
4 |
5 | export default async function () {
6 | const error = await expectToFail(() => ng('build', '--configuration', 'invalid'));
7 | assert.match(
8 | error.message,
9 | /Configuration 'invalid' for target 'build' in project 'test-project' is not set in the workspace/,
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/src/builders/webpack/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "title": "Webpack Builder.",
4 | "description": "Webpack Builder schema for Architect.",
5 | "type": "object",
6 | "properties": {
7 | "webpackConfig": {
8 | "type": "string",
9 | "description": "The path to the Webpack configuration file."
10 | }
11 | },
12 | "additionalProperties": false,
13 | "required": ["webpackConfig"]
14 | }
15 |
--------------------------------------------------------------------------------
/.ng-dev/commit-message.mjs:
--------------------------------------------------------------------------------
1 | import { packages } from '../scripts/packages.mts';
2 |
3 | /**
4 | * The configuration for `ng-dev commit-message` commands.
5 | *
6 | * @type { import("@angular/ng-dev").CommitMessageConfig }
7 | */
8 | export const commitMessage = {
9 | maxLineLength: Infinity,
10 | minBodyLength: 0,
11 | minBodyLengthTypeExcludes: ['docs'],
12 | // Note: When changing this logic, also change the `contributing.ejs` file.
13 | scopes: packages.map(({ name }) => name),
14 | };
15 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/builders/jest/jest.config.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | // Empty config file, everything is specified via CLI options right now.
10 | // This file is used just so Jest doesn't accidentally inherit a custom user-specified Jest config.
11 | export default {};
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/utils/default-progress.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export function defaultProgress(progress: boolean | undefined): boolean {
10 | if (progress === undefined) {
11 | return process.stdout.isTTY === true;
12 | }
13 |
14 | return progress;
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/basic/aot.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { readFile } from 'node:fs/promises';
3 | import { ng } from '../../utils/process';
4 |
5 | /**
6 | * AOT builds should contain generated component factories
7 | */
8 | export default async function () {
9 | await ng('build', '--aot=true', '--configuration=development');
10 | const content = await readFile('dist/test-project/browser/main.js', 'utf-8');
11 | assert.match(content, /App_Factory/);
12 | }
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/analytics/analytics-enable-disable.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert';
2 | import { readFile } from '../../../utils/fs';
3 | import { ng } from '../../../utils/process';
4 |
5 | export default async function () {
6 | await ng('analytics', 'enable');
7 | assert.ok(JSON.parse(await readFile('angular.json')).cli.analytics);
8 |
9 | await ng('analytics', 'disable');
10 | assert.strictEqual(JSON.parse(await readFile('angular.json')).cli.analytics, false);
11 | }
12 |
--------------------------------------------------------------------------------
/packages/angular/ssr/schematics/ng-add/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { externalSchematic } from '@angular-devkit/schematics';
10 | import { Schema as SSROptions } from './schema';
11 |
12 | export default (options: SSROptions) => externalSchematic('@schematics/angular', 'ssr', options);
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as jobs from './jobs';
10 |
11 | export * from './api';
12 | export { Architect, type ScheduleOptions } from './architect';
13 | export { createBuilder, type Builder } from './create-builder';
14 |
15 | export { jobs };
16 |
--------------------------------------------------------------------------------
/packages/ngtools/webpack/src/ivy/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { angularWebpackLoader as default } from './loader';
10 | export { type AngularWebpackPluginOptions, AngularWebpackPlugin, imageDomains } from './plugin';
11 |
12 | export const AngularWebpackLoaderPath: string = __filename;
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/misc/nested-schematic-packages.ts:
--------------------------------------------------------------------------------
1 | import { copyAssets } from '../../utils/assets';
2 | import { expectFileToExist } from '../../utils/fs';
3 | import { ng } from '../../utils/process';
4 |
5 | export default async function () {
6 | await copyAssets('nested-schematic-main', 'nested');
7 | await copyAssets('nested-schematic-dependency', 'nested/node_modules/empty-app-nested');
8 |
9 | await ng('generate', './nested:test');
10 | await expectFileToExist('empty-file');
11 | }
12 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/main.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { platformBrowser } from '@angular/platform-browser';
10 |
11 | import { AppModule } from './app/app.module';
12 |
13 | platformBrowser()
14 | .bootstrapModule(AppModule)
15 | .catch(err => console.log(err));
16 |
--------------------------------------------------------------------------------
/packages/angular/build/src/utils/server-rendering/esm-in-memory-loader/utils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { join } from 'node:path';
10 | import { pathToFileURL } from 'node:url';
11 |
12 | export const IMPORT_EXEC_ARGV =
13 | '--import=' + pathToFileURL(join(__dirname, 'register-hooks.js')).href;
14 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/commands/update/utilities/constants.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | /**
10 | * Regular expression to match Angular packages.
11 | * Checks for packages starting with `@angular/` or `@nguniversal/`.
12 | */
13 | export const ANGULAR_PACKAGES_REGEXP = /^@(?:angular|nguniversal)\//;
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/builders/false.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { type Builder, createBuilder } from '../src';
10 |
11 | const builder: Builder<{}> = createBuilder(() => ({
12 | success: false,
13 | error: 'False builder always errors.',
14 | }));
15 |
16 | export default builder;
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/library/files/tsconfig.lib.prod.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "./tsconfig.lib.json",
5 | "compilerOptions": {
6 | "declarationMap": false
7 | },
8 | "angularCompilerOptions": {
9 | "compilationMode": "partial"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/add/add.ts:
--------------------------------------------------------------------------------
1 | import { expectFileToExist, expectFileToMatch, rimraf } from '../../../utils/fs';
2 | import { ng } from '../../../utils/process';
3 |
4 | export default async function () {
5 | await ng('add', '@angular-devkit-tests/ng-add-simple', '--skip-confirmation');
6 | await expectFileToMatch('package.json', /@angular-devkit-tests\/ng-add-simple/);
7 | await expectFileToExist('ng-add-test');
8 | await rimraf('node_modules/@angular-devkit-tests/ng-add-simple');
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/commands/mcp/constants.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export const k1 = '@angular/cli';
10 | export const at = 'gv2tkIHTOiWtI6Su96LXLQ==';
11 | export const iv = Buffer.from([
12 | 0x97, 0xf4, 0x62, 0x95, 0x3e, 0x12, 0x76, 0x84, 0x8a, 0x09, 0x4a, 0xc9, 0xeb, 0xa2, 0x84, 0x69,
13 | ]);
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/src/main.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { platformBrowser } from '@angular/platform-browser';
10 | import { AppModule } from './app/app.module';
11 |
12 | platformBrowser()
13 | .bootstrapModule(AppModule)
14 | .catch((err) => console.log(err));
15 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/basic-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "bundler",
9 | "experimentalDecorators": true,
10 | "target": "es2022",
11 | "module": "esnext",
12 | "lib": ["es2022", "dom"]
13 | },
14 | "angularCompilerOptions": {
15 | "disableTypeScriptVersionCheck": true
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/hidden-schematics/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hidden-schematics",
3 | "schematics": {
4 | "schematic-1": {
5 | "description": "1",
6 | "factory": "../null-factory"
7 | },
8 | "schematic-2": {
9 | "description": "2",
10 | "factory": "../null-factory"
11 | },
12 | "hidden-schematic": {
13 | "hidden": true,
14 | "description": "h",
15 | "factory": "../null-factory"
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/add/add-version.ts:
--------------------------------------------------------------------------------
1 | import { expectFileToExist, expectFileToMatch, rimraf } from '../../../utils/fs';
2 | import { ng } from '../../../utils/process';
3 |
4 | export default async function () {
5 | await ng('add', '@angular-devkit-tests/ng-add-simple@^1.0.0', '--skip-confirmation');
6 | await expectFileToMatch('package.json', /\/ng-add-simple.*\^1\.0\.0/);
7 | await expectFileToExist('ng-add-test');
8 | await rimraf('node_modules/@angular-devkit-tests/ng-add-simple');
9 | }
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/src/lib/lib.service.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Injectable } from '@angular/core';
10 |
11 | @Injectable()
12 | export class LibService {
13 |
14 | testEs2016() {
15 | return ['foo', 'bar'].includes('foo');
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/private-schematics/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "private-schematics",
3 | "schematics": {
4 | "schematic-1": {
5 | "description": "1",
6 | "factory": "../null-factory"
7 | },
8 | "schematic-2": {
9 | "description": "2",
10 | "factory": "../null-factory"
11 | },
12 | "private-schematic": {
13 | "private": true,
14 | "description": "h",
15 | "factory": "../null-factory"
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015-e2e.ts:
--------------------------------------------------------------------------------
1 | import { getGlobalVariable } from '../../utils/env';
2 | import { ng } from '../../utils/process';
3 | import { langTranslations, setupI18nConfig } from './setup';
4 |
5 | export default async function () {
6 | // Setup i18n tests and config.
7 | await setupI18nConfig();
8 |
9 | for (const { lang } of langTranslations) {
10 | // Execute Application E2E tests with dev server
11 | await ng('e2e', `--configuration=${lang}`, '--port=0');
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tools/ng_cli_schema_generator.bzl:
--------------------------------------------------------------------------------
1 | load("@aspect_rules_js//js:defs.bzl", "js_run_binary")
2 |
3 | def cli_json_schema(name, src, out, data = []):
4 | js_run_binary(
5 | name = name,
6 | outs = [out],
7 | tags = ["schema"],
8 | srcs = [src] + data,
9 | tool = "//tools:ng_cli_schema",
10 | progress_message = "Generating CLI interface from %s" % src,
11 | mnemonic = "NgCliJsonSchema",
12 | args = ["$(rootpath %s)" % src, "$(rootpath %s)" % out],
13 | )
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/utils/bundle-inline-options.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export interface InlineOptions {
10 | filename: string;
11 | code: string;
12 | map?: string;
13 | outputPath: string;
14 | missingTranslation?: 'warning' | 'error' | 'ignore';
15 | setLocale?: boolean;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/src/builders/webpack-dev-server/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "title": "Webpack Dev-Server Builder",
4 | "description": "Webpack Dev-Server Builder schema for Architect.",
5 | "type": "object",
6 | "properties": {
7 | "webpackConfig": {
8 | "type": "string",
9 | "description": "The path to the Webpack configuration file."
10 | }
11 | },
12 | "additionalProperties": false,
13 | "required": ["webpackConfig"]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/server-builder/ngmodule-src/app/app.module.server.ts.template:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { ServerModule } from '@angular/platform-server';
3 |
4 | import { <%= appModuleName %> } from '<%= appModulePath %>';
5 | import { <%= appComponentName %> } from '<%= appComponentPath %>';
6 |
7 | @NgModule({
8 | imports: [
9 | <%= appModuleName %>,
10 | ServerModule,
11 | ],
12 | bootstrap: [<%= appComponentName %>],
13 | })
14 | export class AppServerModule {}
15 |
--------------------------------------------------------------------------------
/tests/schematics/update/packages/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## Update Package Group packages
3 |
4 | * `update-package-group-1@1.0.0` -> `update-package-group2@^1`
5 | * `update-package-group-2@1.0.0` -> `update-package-group1@1.0.0`
6 | ----
7 |
8 | * `update-package-group-1@1.0.0` -> `update-package-group2@^1`
9 | * `update-package-group-2@1.1.0` -> `update-package-group1@1.0.0`
10 | ----
11 |
12 | * `update-package-group-1@1.2.0` -> `update-package-group2@^2`
13 | * `update-package-group-2@2.0.0` -> `update-package-group1@^1`
14 | ----
15 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "./tsconfig.json",
5 | "compilerOptions": {
6 | "outDir": "./out-tsc/app",
7 | "types": []
8 | },
9 | "files": [
10 | "src/main.ts"
11 | ],
12 | "include": [
13 | "src/**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/misc/update-git-clean.ts:
--------------------------------------------------------------------------------
1 | import { appendToFile } from '../../utils/fs';
2 | import { ng } from '../../utils/process';
3 | import { expectToFail } from '../../utils/utils';
4 |
5 | export default async function () {
6 | await appendToFile('src/main.ts', "console.log('changed');\n");
7 |
8 | const { message } = await expectToFail(() => ng('update', '@angular/cli'));
9 | if (!message || !message.includes('Repository is not clean.')) {
10 | throw new Error('Expected unclean repository');
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/test/test-fail-single-run.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../utils/process';
2 | import { writeFile } from '../../utils/fs';
3 | import { expectToFail } from '../../utils/utils';
4 |
5 | export default function () {
6 | // TODO(architect): Delete this test. It is now in devkit/build-angular.
7 |
8 | // Fails on single run with broken compilation.
9 | return writeFile('src/app.spec.ts', ' definitely not typescript
').then(() =>
10 | expectToFail(() => ng('test', '--watch=false')),
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/packages/angular/build/src/tools/esbuild/stylesheets/css-language.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { StylesheetLanguage } from './stylesheet-plugin-factory';
10 |
11 | export const CssStylesheetLanguage = Object.freeze({
12 | name: 'css',
13 | componentFilter: /^css;/,
14 | fileFilter: /\.css$/,
15 | });
16 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "schematics": {
3 | "blank": {
4 | "factory": "./blank/factory",
5 | "schema": "./blank/schema.json",
6 | "description": "Create an empty schematic project or add a blank schematic to the current project."
7 | },
8 | "schematic": {
9 | "factory": "./schematic/factory",
10 | "schema": "./schematic/schema.json",
11 | "description": "Create a Schematic template which can be built and published directly to NPM."
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/schematics/angular/web-worker/files/worker-tsconfig/tsconfig.worker.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | {
3 | "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/worker",
6 | "lib": [
7 | "es2018",
8 | "webworker"
9 | ],
10 | "types": []
11 | },
12 | "include": [
13 | "src/**/*.worker.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/web-test-runner/basic.ts:
--------------------------------------------------------------------------------
1 | import { noSilentNg } from '../../utils/process';
2 | import { applyWtrBuilder } from '../../utils/web-test-runner';
3 |
4 | export default async function () {
5 | // Temporary disabled due to failure.
6 | return;
7 |
8 | await applyWtrBuilder();
9 |
10 | const { stderr } = await noSilentNg('test');
11 |
12 | if (!stderr.includes('Web Test Runner builder is currently EXPERIMENTAL')) {
13 | throw new Error(`No experimental notice in stderr.\nSTDERR:\n\n${stderr}`);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/schematics/angular/utility/paths.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { join, relative } from 'node:path/posix';
10 |
11 | export function relativePathToWorkspaceRoot(projectRoot: string | undefined): string {
12 | if (!projectRoot) {
13 | return '.';
14 | }
15 |
16 | return relative(join('/', projectRoot), '/') || '.';
17 | }
18 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/18.0-project/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "./tsconfig.json",
5 | "compilerOptions": {
6 | "outDir": "./out-tsc/spec",
7 | "types": [
8 | "jasmine"
9 | ]
10 | },
11 | "include": [
12 | "src/**/*.spec.ts",
13 | "src/**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "bundler",
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "target": "es2022",
12 | "lib": ["es2022", "dom"]
13 | },
14 | "angularCompilerOptions": {
15 | "enableIvy": true,
16 | "disableTypeScriptVersionCheck": true
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/add/file.ts:
--------------------------------------------------------------------------------
1 | import { copyFile } from 'node:fs/promises';
2 | import { assetDir } from '../../../utils/assets';
3 | import { expectFileToExist } from '../../../utils/fs';
4 | import { ng } from '../../../utils/process';
5 |
6 | export default async function () {
7 | // Avoids ERR_PNPM_ENAMETOOLONG errors.
8 | const tarball = './add-collection.tgz';
9 | await copyFile(assetDir(tarball), tarball);
10 |
11 | await ng('add', tarball, '--name=blah', '--skip-confirmation');
12 | await expectFileToExist('blah');
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular/build/src/utils/server-rendering/esm-in-memory-loader/register-hooks.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { register } from 'node:module';
10 | import { pathToFileURL } from 'node:url';
11 | import { workerData } from 'node:worker_threads';
12 |
13 | register('./loader-hooks.js', { parentURL: pathToFileURL(__filename), data: workerData });
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/json/schema/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as transforms from './transforms';
10 |
11 | export * from './interface';
12 | export * from './pointer';
13 | export * from './registry';
14 | export * from './schema';
15 | export * from './visitor';
16 | export * from './utility';
17 |
18 | export { transforms };
19 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/src/lib/lib.component.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Component } from '@angular/core';
10 |
11 | @Component({
12 | selector: 'lib',
13 | template: `
14 |
15 | lib works!
16 |
17 | `,
18 | styles: []
19 | })
20 | export class LibComponent {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/packages/schematics/angular/class/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Rule } from '@angular-devkit/schematics';
10 | import { generateFromFiles } from '../utility/generate-from-files';
11 | import { Schema as ClassOptions } from './schema';
12 |
13 | export default function (options: ClassOptions): Rule {
14 | return generateFromFiles(options);
15 | }
16 |
--------------------------------------------------------------------------------
/packages/angular/cli/src/package-managers/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { createPackageManager } from './factory';
10 | export type { PackageManagerName } from './package-manager-descriptor';
11 | export { PackageManager } from './package-manager';
12 | export type * from './package-metadata';
13 | export type { InstalledPackage } from './package-tree';
14 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/module-files/src/main.ts.template:
--------------------------------------------------------------------------------
1 | <% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core';
2 | <% }%>import { platformBrowser } from '@angular/platform-browser';
3 | import { AppModule } from './app/app<%= typeSeparator %>module';
4 |
5 | platformBrowser().bootstrapModule(AppModule, {
6 | <% if(!zoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %>
7 | defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %>
8 | })
9 | .catch(err => console.error(err));
10 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as tags from './literals';
10 | import * as strings from './strings';
11 |
12 | export * from './object';
13 | export * from './template';
14 | export * from './partially-ordered-set';
15 | export * from './priority-queue';
16 | export * from './lang';
17 |
18 | export { tags, strings };
19 |
--------------------------------------------------------------------------------
/packages/schematics/angular/enum/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import type { Rule } from '@angular-devkit/schematics';
10 | import { generateFromFiles } from '../utility/generate-from-files';
11 | import type { Schema as EnumOptions } from './schema';
12 |
13 | export default function (options: EnumOptions): Rule {
14 | return generateFromFiles(options);
15 | }
16 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/application-builder/standalone-src/app/app.config.server.ts.template:
--------------------------------------------------------------------------------
1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2 | import { provideServerRendering, withRoutes } from '@angular/ssr';
3 | import { appConfig } from './app.config';
4 | import { serverRoutes } from './app.routes.server';
5 |
6 | const serverConfig: ApplicationConfig = {
7 | providers: [
8 | provideServerRendering(withRoutes(serverRoutes))
9 | ]
10 | };
11 |
12 | export const config = mergeApplicationConfig(appConfig, serverConfig);
13 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Component } from '@angular/core';
10 |
11 | @Component({
12 | selector: 'app-root',
13 | standalone: false,
14 | templateUrl: './app.component.html',
15 | styleUrls: ['./app.component.css'],
16 | })
17 | export class AppComponent {
18 | title = 'app';
19 | }
20 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/builders/jest/tests/options.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { JestBuilderOptions } from '../options';
10 |
11 | /** Default options to use for most tests. */
12 | export const BASE_OPTIONS = Object.freeze({
13 | include: ['**/*.spec.ts'],
14 | exclude: [],
15 | tsConfig: 'tsconfig.spec.json',
16 | });
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/interface/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Rule } from '@angular-devkit/schematics';
10 | import { generateFromFiles } from '../utility/generate-from-files';
11 | import { Schema as InterfaceOptions } from './schema';
12 |
13 | export default function (options: InterfaceOptions): Rule {
14 | return generateFromFiles(options);
15 | }
16 |
--------------------------------------------------------------------------------
/packages/schematics/angular/resolver/class-files/__name@dasherize____typeSeparator__resolver.ts.template:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import {
3 | Router, Resolve,
4 | RouterStateSnapshot,
5 | ActivatedRouteSnapshot
6 | } from '@angular/router';
7 | import { Observable, of } from 'rxjs';
8 |
9 | @Injectable({
10 | providedIn: 'root'
11 | })
12 | export class <%= classify(name) %>Resolver implements Resolve {
13 | resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable {
14 | return of(true);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Component } from '@angular/core';
10 |
11 | @Component({
12 | selector: 'app-root',
13 | standalone: false,
14 | templateUrl: './app.component.html',
15 | styleUrls: ['./app.component.css'],
16 | })
17 | export class AppComponent {
18 | title = 'app';
19 | }
20 |
--------------------------------------------------------------------------------
/packages/angular/build/src/builders/dev-server/output.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { BuilderOutput } from '@angular-devkit/architect';
10 |
11 | /**
12 | * @experimental Direct usage of this type is considered experimental.
13 | */
14 | export interface DevServerBuilderOutput extends BuilderOutput {
15 | baseUrl: string;
16 | port?: number;
17 | address?: string;
18 | }
19 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/src/rules/url.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { parse } from 'node:url';
10 | import { SchematicContext, Source } from '../engine/interface';
11 |
12 | export function url(urlString: string): Source {
13 | const url = parse(urlString);
14 |
15 | return (context: SchematicContext) => context.engine.createSourceFromUrl(url, context)(context);
16 | }
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/config/files/.browserslistrc.template:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # For Angular's browser support policy, please see:
6 | # https://angular.dev/reference/versions#browser-support
7 |
8 | # You can see what browsers were selected by your queries by running:
9 | # npx browserslist
10 |
11 | baseline widely available on <%= baselineDate %>
12 |
--------------------------------------------------------------------------------
/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { <%= classifiedName %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>';
4 |
5 | describe('<%= classifiedName %>', () => {
6 | let service: <%= classifiedName %>;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | service = TestBed.inject(<%= classifiedName %>);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(service).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # `/docs` Folder
2 |
3 | This folder is used for all documentation. It contains a number of subfolders with short
4 | descriptions here.
5 |
6 | ## `/docs/design`
7 |
8 | Design documents on GitHub, in Markdown format. The number of design documents available is limited.
9 |
10 | ## `/docs/process`
11 |
12 | Description of various caretaker and workflow processes.
13 |
14 | ## `/docs/specifications`
15 |
16 | Specifications for support of Angular CLI features. These are meant to be read directly on GitHub
17 | by developers of libraries who want to integrate with the Angular CLI.
18 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/utils/url.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export function urlJoin(...parts: string[]): string {
10 | const [p, ...rest] = parts;
11 |
12 | // Remove trailing slash from first part
13 | // Join all parts with `/`
14 | // Dedupe double slashes from path names
15 | return p.replace(/\/$/, '') + ('/' + rest.join('/')).replace(/\/\/+/g, '/');
16 | }
17 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { BrowserModule, provideClientHydration } from '@angular/platform-browser';
3 |
4 | import { AppRoutingModule } from './app-routing.module';
5 | import { AppComponent } from './app.component';
6 |
7 | @NgModule({
8 | declarations: [
9 | AppComponent
10 | ],
11 | imports: [
12 | BrowserModule,
13 | AppRoutingModule
14 | ],
15 | providers: [
16 | provideClientHydration()
17 | ],
18 | bootstrap: [AppComponent]
19 | })
20 | export class AppModule { }
21 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/misc/workspace-verification.ts:
--------------------------------------------------------------------------------
1 | import { deleteFile } from '../../utils/fs';
2 | import { ng } from '../../utils/process';
3 | import { expectToFail } from '../../utils/utils';
4 |
5 | export default function () {
6 | return (
7 | ng('generate', 'component', 'foo', '--dry-run')
8 | .then(() => deleteFile('angular.json'))
9 | // fails because it needs to be inside a project
10 | // without a workspace file
11 | .then(() => expectToFail(() => ng('generate', 'component', 'foo', '--dry-run')))
12 | .then(() => ng('version'))
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/tsconfig-build-esm.json:
--------------------------------------------------------------------------------
1 | /**
2 | * Root tsconfig file for use building all Angular packages. Note there is no rootDir
3 | * and therefore any tsconfig in the package directory will need to define its own
4 | * rootDir.
5 | */
6 | {
7 | "extends": "./tsconfig.json",
8 | "compilerOptions": {
9 | "module": "esnext",
10 | "target": "es2022",
11 | "lib": ["es2022"],
12 | // don't auto-discover @types/node, it results in a /// = createBuilder(execute);
15 |
16 | export default builder;
17 |
--------------------------------------------------------------------------------
/packages/angular/build/src/tools/babel/plugins/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { default as adjustStaticMembers } from './adjust-static-class-members';
10 | export { default as adjustTypeScriptEnums } from './adjust-typescript-enums';
11 | export { default as elideAngularMetadata } from './elide-angular-metadata';
12 | export { default as markTopLevelPure } from './pure-toplevel-functions';
13 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/src/builders/extract-i18n/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { createBuilder } from '@angular-devkit/architect';
10 | import { execute } from './builder';
11 | import type { Schema as ExtractI18nBuilderOptions } from './schema';
12 |
13 | export { ExtractI18nBuilderOptions, execute };
14 | export default createBuilder(execute);
15 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as json from './json/index';
10 | import * as logging from './logger/index';
11 | import * as workspaces from './workspace';
12 |
13 | export * from './exception';
14 | export * from './json/index';
15 | export * from './utils/index';
16 | export * from './virtual-fs/index';
17 |
18 | export { json, logging, workspaces };
19 |
--------------------------------------------------------------------------------
/packages/schematics/angular/guard/implements-files/__name@dasherize____typeSeparator__guard.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { <%= classify(name) %>Guard } from './<%= dasherize(name) %><%= typeSeparator %>guard';
4 |
5 | describe('<%= classify(name) %>Guard', () => {
6 | let guard: <%= classify(name) %>Guard;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | guard = TestBed.inject(<%= classify(name) %>Guard);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(guard).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/interceptor/class-files/__name@dasherize____typeSeparator__interceptor.ts.template:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import {
3 | HttpRequest,
4 | HttpHandler,
5 | HttpEvent,
6 | HttpInterceptor
7 | } from '@angular/common/http';
8 | import { Observable } from 'rxjs';
9 |
10 | @Injectable()
11 | export class <%= classify(name) %>Interceptor implements HttpInterceptor {
12 |
13 | constructor() {}
14 |
15 | intercept(request: HttpRequest, next: HttpHandler): Observable> {
16 | return next.handle(request);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/schematics/angular/e2e/files/tsconfig.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
5 | "compilerOptions": {
6 | "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/e2e",
7 | "module": "commonjs",
8 | "target": "es2019",
9 | "types": [
10 | "jasmine",
11 | "node"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/schematics/angular/module/files/__name@dasherize@if-flat__/__name@dasherize__-routing__typeSeparator__module.ts.template:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes } from '@angular/router';<% if (lazyRoute) { %>
3 | import { <%= classify(name) %> } from './<%= dasherize(name) %>';<% } %>
4 |
5 | const routes: Routes = [<% if (lazyRoute) { %>{ path: '', component: <%= classify(name) %> }<% } %>];
6 |
7 | @NgModule({
8 | imports: [RouterModule.for<%= routingScope %>(routes)],
9 | exports: [RouterModule]
10 | })
11 | export class <%= classify(name) %>RoutingModule { }
12 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/application/application-zoneless-ng-module.ts:
--------------------------------------------------------------------------------
1 | import { installWorkspacePackages } from '../../../utils/packages';
2 | import { ng } from '../../../utils/process';
3 | import { useCIChrome, useSha } from '../../../utils/project';
4 |
5 | export default async function () {
6 | await ng('generate', 'app', 'ngmodules', '--no-standalone', '--skip-install');
7 | await useSha();
8 | await installWorkspacePackages();
9 | await useCIChrome('ngmodules', 'projects/ngmodules');
10 | await ng('test', 'ngmodules', '--watch=false');
11 | await ng('build', 'ngmodules');
12 | }
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/application/application-zoneless-standalone.ts:
--------------------------------------------------------------------------------
1 | import { installWorkspacePackages } from '../../../utils/packages';
2 | import { ng } from '../../../utils/process';
3 | import { useCIChrome, useSha } from '../../../utils/project';
4 |
5 | export default async function () {
6 | await ng('generate', 'app', 'standalone', '--standalone', '--skip-install');
7 | await useSha();
8 | await installWorkspacePackages();
9 | await useCIChrome('standalone', 'projects/standalone');
10 | await ng('test', 'standalone', '--watch=false');
11 | await ng('build', 'standalone');
12 | }
13 |
--------------------------------------------------------------------------------
/packages/angular/build/src/builders/karma/polyfills/jasmine_global.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | // See: https://github.com/jasmine/jasmine/issues/2015
10 | (function () {
11 | 'use strict';
12 |
13 | // jasmine will ignore `window` unless it returns this specific (but uncommon)
14 | // value from toString().
15 | window.toString = function () {
16 | return '[object GjsGlobal]';
17 | };
18 | })();
19 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/src/jobs/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import * as strategy from './strategy';
10 |
11 | export * from './api';
12 | export * from './create-job-handler';
13 | export * from './exception';
14 | export * from './dispatcher';
15 | export * from './fallback-registry';
16 | export * from './simple-registry';
17 | export * from './simple-scheduler';
18 | export { strategy };
19 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | /bazel-out/
2 | /docs/design/analytics.md
3 | /dist-schema/
4 | /goldens/public-api
5 | /modules/testing/builder/projects/
6 | /packages/angular_devkit/build_angular/test/
7 | /packages/angular_devkit/core/src/workspace/json/test/
8 | /packages/angular_devkit/schematics_cli/blank/project-files/
9 | /packages/angular_devkit/schematics_cli/blank/schematic-files/
10 | /packages/angular_devkit/schematics_cli/schematic/files/
11 | /packages/schematics/angular/third_party/
12 | /README.md
13 | /CONTRIBUTING.md
14 | .yarn/
15 | dist/
16 | /tests/legacy-cli/e2e/assets/
17 | /tools/test/*.json
18 | pnpm-lock.yaml
19 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/utils/priority-queue_spec.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { PriorityQueue } from './priority-queue';
10 |
11 | describe('PriorityQueue', () => {
12 | it('adds an item', () => {
13 | const queue = new PriorityQueue((x, y) => x - y);
14 |
15 | queue.push(99);
16 |
17 | expect(queue.size).toBe(1);
18 | expect(queue.peek()).toBe(99);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | ts_project(
6 | name = "tests",
7 | testonly = True,
8 | srcs = glob(["**/*.ts"]),
9 | deps = [
10 | "//:node_modules/@types/express",
11 | "//:node_modules/@types/node",
12 | "//:node_modules/@types/semver",
13 | "//:node_modules/express",
14 | "//:node_modules/fast-glob",
15 | "//:node_modules/semver",
16 | "//:node_modules/undici",
17 | "//tests/legacy-cli/e2e/utils",
18 | ],
19 | )
20 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/serve/preflight-request.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { ngServe } from '../../../utils/project';
3 |
4 | export default async function () {
5 | const port = await ngServe();
6 | const result = await fetch(`http://localhost:${port}/main.js`, { method: 'OPTIONS' });
7 | const content = await result.blob();
8 |
9 | assert.strictEqual(content.size, 0, `Expected "size" to be "0" but got "${content.size}".`);
10 | assert.strictEqual(
11 | result.status,
12 | 204,
13 | `Expected "status" to be "204" but got "${result.status}".`,
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/modules/testing/builder/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export {
10 | BuilderHarness,
11 | type BuilderHarnessExecutionOptions,
12 | type BuilderHarnessExecutionResult,
13 | } from './builder-harness';
14 | export {
15 | type HarnessFileMatchers,
16 | JasmineBuilderHarness,
17 | describeBuilder,
18 | expectLog,
19 | expectNoLog,
20 | } from './jasmine-helpers';
21 | export * from './test-utils';
22 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_angular/test/hello-world-lib/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "bundler",
9 | "experimentalDecorators": true,
10 | "target": "es2015",
11 | "module": "es2022",
12 | "useDefineForClassFields": false,
13 | "lib": [
14 | "es2022",
15 | "dom"
16 | ]
17 | },
18 | "angularCompilerOptions": {
19 | "enableIvy": true,
20 | "disableTypeScriptVersionCheck": true
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/src/my-schematic/index_spec.ts:
--------------------------------------------------------------------------------
1 | import { Tree } from '@angular-devkit/schematics';
2 | import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
3 | import * as path from 'path';
4 |
5 | const collectionPath = path.join(__dirname, '../collection.json');
6 |
7 | describe('my-schematic', () => {
8 | it('works', async () => {
9 | const runner = new SchematicTestRunner('schematics', collectionPath);
10 | const tree = await runner.runSchematic('my-schematic', {}, Tree.empty());
11 |
12 | expect(tree.files).toEqual(['/hello']);
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/packages/schematics/angular/guard/type-files/__name@dasherize____typeSeparator__guard.ts.template:
--------------------------------------------------------------------------------
1 | import { <%= guardType %> } from '@angular/router';
2 |
3 | export const <%= camelize(name) %>Guard: <%= guardType %><% if (guardType === 'CanDeactivateFn') { %><% } %> = <%
4 | if (guardType === 'CanMatchFn') { %>(route, segments)<% }
5 | %><% if (guardType === 'CanActivateFn') { %>(route, state)<% }
6 | %><% if (guardType === 'CanActivateChildFn') { %>(childRoute, state)<% }
7 | %><% if (guardType === 'CanDeactivateFn') { %>(component, currentRoute, currentState, nextState)<% } %> => {
8 | return true;
9 | };
10 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/application-builder/ngmodule-src/app/app.module.server.ts.template:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { provideServerRendering, withRoutes } from '@angular/ssr';
3 | import { <%= appComponentName %> } from '<%= appComponentPath %>';
4 | import { <%= appModuleName %> } from '<%= appModulePath %>';
5 | import { serverRoutes } from './app.routes.server';
6 |
7 | @NgModule({
8 | imports: [<%= appModuleName %>],
9 | providers: [provideServerRendering(withRoutes(serverRoutes))],
10 | bootstrap: [<%= appComponentName %>],
11 | })
12 | export class AppServerModule {}
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/config/config-set-enum-check.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../../utils/process';
2 |
3 | export default async function () {
4 | // These tests require schema querying capabilities
5 | // .then(() => expectToFail(
6 | // () => ng('config', 'schematics.@schematics/angular.component.aaa', 'bbb')),
7 | // )
8 | // .then(() => expectToFail(() => ng(
9 | // 'config',
10 | // 'schematics.@schematics/angular.component.viewEncapsulation',
11 | // 'bbb',
12 | // )))
13 |
14 | await ng('config', 'schematics.@schematics/angular.component.viewEncapsulation', 'Emulated');
15 | }
16 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { browser, by, element } from 'protractor';
10 |
11 | export class AppPage {
12 | navigateTo(): Promise {
13 | return browser.get(browser.baseUrl) as Promise;
14 | }
15 |
16 | getTitleText(): Promise {
17 | return element(by.css('app-root h1')).getText() as Promise;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/schematics/angular/resolver/class-files/__name@dasherize____typeSeparator__resolver.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { <%= classify(name) %>Resolver } from './<%= dasherize(name) %><%= typeSeparator %>resolver';
4 |
5 | describe('<%= classify(name) %>Resolver', () => {
6 | let resolver: <%= classify(name) %>Resolver;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | resolver = TestBed.inject(<%= classify(name) %>Resolver);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(resolver).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@angular-devkit/schematics",
3 | "version": "0.0.0-PLACEHOLDER",
4 | "description": "Angular Schematics - Library",
5 | "main": "src/index.js",
6 | "typings": "src/index.d.ts",
7 | "keywords": [
8 | "blueprints",
9 | "scaffolding",
10 | "template",
11 | "tooling",
12 | "code generation",
13 | "schematics"
14 | ],
15 | "dependencies": {
16 | "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
17 | "jsonc-parser": "3.3.1",
18 | "magic-string": "0.30.21",
19 | "ora": "9.0.0",
20 | "rxjs": "7.8.2"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/common-files/tsconfig.app.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
5 | "compilerOptions": {
6 | "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/app",
7 | "types": []
8 | },
9 | "include": [
10 | "src/**/*.ts"
11 | ],
12 | "exclude": [
13 | "src/**/*.spec.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-aot.ts:
--------------------------------------------------------------------------------
1 | import { setTimeout } from 'node:timers/promises';
2 | import { ng } from '../../../utils/process';
3 | import { libraryConsumptionSetup } from './setup';
4 |
5 | export default async function () {
6 | await libraryConsumptionSetup();
7 |
8 | // Build library in full mode (development)
9 | await ng('build', 'my-lib', '--configuration=development');
10 |
11 | // Check that the e2e succeeds prod and non prod mode
12 | await ng('e2e', '--configuration=production');
13 | await setTimeout(500);
14 | await ng('e2e', '--configuration=development');
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-aot.ts:
--------------------------------------------------------------------------------
1 | import { setTimeout } from 'node:timers/promises';
2 | import { ng } from '../../../utils/process';
3 | import { libraryConsumptionSetup } from './setup';
4 |
5 | export default async function () {
6 | await libraryConsumptionSetup();
7 |
8 | // Build library in partial mode (production)
9 | await ng('build', 'my-lib', '--configuration=production');
10 |
11 | // Check that the e2e succeeds prod and non prod mode
12 | await ng('e2e', '--configuration=production');
13 | await setTimeout(500);
14 | await ng('e2e', '--configuration=development');
15 | }
16 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict = true
2 |
3 | # Disabling pnpm [hoisting](https://pnpm.io/npmrc#hoist) by setting `hoist=false` is recommended on
4 | # projects using rules_js so that pnpm outside of Bazel lays out a node_modules tree similar to what
5 | # rules_js lays out under Bazel (without a hidden node_modules/.pnpm/node_modules)
6 | hoist=false
7 |
8 | # Avoid pnpm auto-installing peer dependencies. We want to be explicit about our versions used
9 | # for peer dependencies, avoiding potential mismatches. In addition, it ensures we can continue
10 | # to rely on peer dependency placeholders substituted via Bazel.
11 | auto-install-peers=false
12 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/src/formats/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { schema } from '@angular-devkit/core';
10 | import { htmlSelectorFormat } from './html-selector';
11 | import { pathFormat } from './path';
12 |
13 | export { htmlSelectorFormat } from './html-selector';
14 | export { pathFormat } from './path';
15 |
16 | export const standardFormats: schema.SchemaFormat[] = [htmlSelectorFormat, pathFormat];
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template:
--------------------------------------------------------------------------------
1 | import { ApplicationConfig, provideBrowserGlobalErrorListeners<% if(!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
2 | import { provideRouter } from '@angular/router';
3 |
4 | import { routes } from './app.routes';<% } %>
5 |
6 | export const appConfig: ApplicationConfig = {
7 | providers: [
8 | provideBrowserGlobalErrorListeners(),<% if(!zoneless) { %>
9 | provideZoneChangeDetection({ eventCoalescing: true }),<% } %>
10 | <% if (routing) {%>provideRouter(routes)<% } %>
11 | ]
12 | };
13 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/directive/directive-basic.ts:
--------------------------------------------------------------------------------
1 | import { ng } from '../../../utils/process';
2 | import { join } from 'node:path';
3 | import { expectFileToExist } from '../../../utils/fs';
4 |
5 | export default function () {
6 | const directiveDir = join('src', 'app');
7 | return (
8 | ng('generate', 'directive', 'test-directive')
9 | .then(() => expectFileToExist(join(directiveDir, 'test-directive.ts')))
10 | .then(() => expectFileToExist(join(directiveDir, 'test-directive.spec.ts')))
11 |
12 | // Try to run the unit tests.
13 | .then(() => ng('test', '--watch=false'))
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/generate/help-output-no-duplicates.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { ng } from '../../utils/process';
3 |
4 | export default async function () {
5 | // Verify that there are no duplicate options
6 | const { stdout } = await ng('generate', 'component', '--help');
7 | const firstIndex = stdout.indexOf('--prefix');
8 |
9 | assert.ok(firstIndex >= 0, '--prefix was not part of the help output.');
10 | assert.strictEqual(
11 | firstIndex,
12 | stdout.lastIndexOf('--prefix'),
13 | '--prefix first and last index were different. Possible duplicate output!',
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/packages/schematics/angular/app-shell/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "$id": "SchematicsAngularAppShell",
4 | "title": "Angular AppShell Options Schema",
5 | "type": "object",
6 | "description": "Configures your project to generate an app-shell during build time.",
7 | "additionalProperties": false,
8 | "properties": {
9 | "project": {
10 | "type": "string",
11 | "description": "The name of the project where the app-shell should be generated.",
12 | "$default": {
13 | "$source": "projectName"
14 | }
15 | }
16 | },
17 | "required": ["project"]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/schematics/angular/tailwind/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema",
3 | "title": "Tailwind CSS Schematic",
4 | "type": "object",
5 | "properties": {
6 | "project": {
7 | "type": "string",
8 | "description": "The name of the project.",
9 | "$default": {
10 | "$source": "projectName"
11 | }
12 | },
13 | "skipInstall": {
14 | "description": "Skip the automatic installation of packages. You will need to manually install the dependencies later.",
15 | "type": "boolean",
16 | "default": false
17 | }
18 | },
19 | "required": ["project"]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/schematics/angular/workspace/files/__dot__vscode/launch.json.template:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3 | "version": "0.2.0",
4 | "configurations": [
5 | {
6 | "name": "ng serve",
7 | "type": "chrome",
8 | "request": "launch",
9 | "preLaunchTask": "npm: start",
10 | "url": "http://localhost:4200/"
11 | }<% if (!minimal) { %>,
12 | {
13 | "name": "ng test",
14 | "type": "chrome",
15 | "request": "launch",
16 | "preLaunchTask": "npm: test",
17 | "url": "http://localhost:9876/debug.html"
18 | }<% } %>
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/build/esbuild-unsupported.ts:
--------------------------------------------------------------------------------
1 | import { join } from 'node:path';
2 | import { execWithEnv } from '../../utils/process';
3 |
4 | export default async function () {
5 | // TODO(bazel): fails with bazel on windows
6 | if (process.platform.startsWith('win')) {
7 | return;
8 | }
9 |
10 | // Set the esbuild native binary path to a non-existent file to simulate a spawn error.
11 | // The build should still succeed by falling back to the WASM variant of esbuild.
12 | await execWithEnv('ng', ['build'], {
13 | ...process.env,
14 | 'ESBUILD_BINARY_PATH': join(__dirname, 'esbuild-bin-no-exist-xyz'),
15 | });
16 | }
17 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/ng-new-collection.ts:
--------------------------------------------------------------------------------
1 | import { execAndWaitForOutputToMatch } from '../../utils/process';
2 |
3 | export default async function () {
4 | const currentDirectory = process.cwd();
5 |
6 | try {
7 | process.chdir('..');
8 |
9 | // The below is a way to validate that the `--collection` option is being considered.
10 | await execAndWaitForOutputToMatch(
11 | 'ng',
12 | ['new', '--collection', 'invalid-schematic'],
13 | /Collection "invalid-schematic" cannot be resolved/,
14 | );
15 | } finally {
16 | // Change directory back
17 | process.chdir(currentDirectory);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/angular_devkit/build_webpack/test/angular-app/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { BrowserModule } from '@angular/platform-browser';
10 | import { NgModule } from '@angular/core';
11 |
12 | import { AppComponent } from './app.component';
13 |
14 | @NgModule({
15 | declarations: [AppComponent],
16 | imports: [BrowserModule],
17 | providers: [],
18 | bootstrap: [AppComponent],
19 | })
20 | export class AppModule {}
21 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/blank/schematic-files/src/__name@dasherize__/index_spec.ts.template:
--------------------------------------------------------------------------------
1 | import { Tree } from '@angular-devkit/schematics';
2 | import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
3 | import * as path from 'path';
4 |
5 | const collectionPath = path.join(__dirname, '../collection.json');
6 |
7 | describe('<%= dasherize(name) %>', () => {
8 | it('works', async () => {
9 | const runner = new SchematicTestRunner('schematics', collectionPath);
10 | const tree = await runner.runSchematic('<%= dasherize(name) %>', {}, Tree.empty());
11 |
12 | expect(tree.files).toEqual([]);
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics_cli/schematic/files/src/my-other-schematic/index_spec.ts:
--------------------------------------------------------------------------------
1 | import { Tree } from '@angular-devkit/schematics';
2 | import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
3 | import * as path from 'path';
4 |
5 | const collectionPath = path.join(__dirname, '../collection.json');
6 |
7 | describe('my-other-schematic', () => {
8 | it('works', async () => {
9 | const runner = new SchematicTestRunner('schematics', collectionPath);
10 | const tree = await runner.runSchematic('my-other-schematic', {}, Tree.empty());
11 |
12 | expect(tree.files.sort()).toEqual(['/allo', '/hola']);
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/config/config-set-prefix.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { ng } from '../../../utils/process';
3 | import { expectToFail } from '../../../utils/utils';
4 |
5 | export default function () {
6 | return Promise.resolve()
7 | .then(() => expectToFail(() => ng('config', 'schematics.@schematics/angular.component.prefix')))
8 | .then(() => ng('config', 'schematics.@schematics/angular.component.prefix', 'new-prefix'))
9 | .then(() => ng('config', 'schematics.@schematics/angular.component.prefix'))
10 | .then(({ stdout }) => {
11 | assert.match(stdout, /new-prefix/);
12 | });
13 | }
14 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/help/help-hidden.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { silentNg } from '../../../utils/process';
3 |
4 | export default async function () {
5 | const { stdout: stdoutNew } = await silentNg('--help');
6 | assert.doesNotMatch(
7 | stdoutNew,
8 | /(easter-egg)|(ng make-this-awesome)|(ng init)/,
9 | 'Expected to not match "(easter-egg)|(ng make-this-awesome)|(ng init)" in help output.',
10 | );
11 |
12 | const { stdout: ngGenerate } = await silentNg('--help', 'generate', 'component');
13 | assert.doesNotMatch(ngGenerate, /--path/, 'Expected to not match "--path" in help output.');
14 | }
15 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { AppPage } from './app.po';
10 |
11 | describe('hello-world-app App', () => {
12 | let page: AppPage;
13 |
14 | beforeEach(() => {
15 | page = new AppPage();
16 | });
17 |
18 | it('should display welcome message', async () => {
19 | page.navigateTo();
20 | expect(await page.getTitleText()).toEqual('Welcome to app!');
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/packages/angular_devkit/schematics/tasks/repo-init/options.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export const RepositoryInitializerName = 'repo-init';
10 |
11 | export interface RepositoryInitializerTaskFactoryOptions {
12 | rootDirectory?: string;
13 | }
14 |
15 | export interface RepositoryInitializerTaskOptions {
16 | workingDirectory?: string;
17 | commit?: boolean;
18 | message?: string;
19 | authorName?: string;
20 | authorEmail?: string;
21 | }
22 |
--------------------------------------------------------------------------------
/packages/schematics/angular/server/files/server-builder/root/tsconfig.server.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "./<%= tsConfigExtends %>",
5 | "compilerOptions": {
6 | "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/server",
7 | "types": [
8 | "node"<% if (hasLocalizePackage) { %>,
9 | "@angular/localize"<% } %>
10 | ]
11 | },
12 | "files": [
13 | "src/main.server.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/angular/build/src/builders/ng-packagr/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Builder, createBuilder } from '@angular-devkit/architect';
10 | import { execute } from './builder';
11 | import type { Schema as NgPackagrBuilderOptions } from './schema';
12 |
13 | export { type NgPackagrBuilderOptions, execute };
14 |
15 | const builder: Builder = createBuilder(execute);
16 |
17 | export default builder;
18 |
--------------------------------------------------------------------------------
/packages/angular/ssr/node/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | ts_project(
6 | name = "node",
7 | srcs = glob(
8 | [
9 | "*.ts",
10 | "src/**/*.ts",
11 | ],
12 | ),
13 | args = [
14 | "--types",
15 | "node",
16 | ],
17 | source_map = True,
18 | tsconfig = "//:build-tsconfig-esm",
19 | deps = [
20 | "//:node_modules/@angular/core",
21 | "//:node_modules/@angular/platform-server",
22 | "//:node_modules/@types/node",
23 | "//packages/angular/ssr",
24 | ],
25 | )
26 |
--------------------------------------------------------------------------------
/packages/schematics/angular/application/files/module-files/src/app/app__suffix__.ts.template:
--------------------------------------------------------------------------------
1 | import { Component, signal } from '@angular/core';
2 |
3 | @Component({
4 | selector: '<%= selector %>',<% if(inlineTemplate) { %>
5 | template: `
6 | Welcome to {{ title() }}!
7 |
8 | <% if (routing) {
9 | %><%
10 | } %>
11 | `,<% } else { %>
12 | templateUrl: './app<%= suffix %>.html',<% } %>
13 | standalone: false,<% if(inlineStyle) { %>
14 | styles: []<% } else { %>
15 | styleUrl: './app<%= suffix %>.<%= style %>'<% } %>
16 | })
17 | export class App {
18 | protected readonly title = signal('<%= name %>');
19 | }
20 |
--------------------------------------------------------------------------------
/packages/schematics/angular/library/files/tsconfig.spec.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
5 | "compilerOptions": {
6 | "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/spec",
7 | "types": [
8 | "<%= testTypesPackage %>"
9 | ]
10 | },
11 | "include": [
12 | "src/**/*.d.ts",
13 | "src/**/*<% if (standalone) { %>.spec<% } %>.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/misc/negated-boolean-options.ts:
--------------------------------------------------------------------------------
1 | import { copyAssets } from '../../utils/assets';
2 | import { execAndWaitForOutputToMatch } from '../../utils/process';
3 |
4 | export default async function () {
5 | await copyAssets('schematic-boolean-option-negated', 'schematic-boolean-option-negated');
6 |
7 | await execAndWaitForOutputToMatch(
8 | 'ng',
9 | ['generate', './schematic-boolean-option-negated:test', '--no-watch'],
10 | /noWatch: true/,
11 | );
12 |
13 | await execAndWaitForOutputToMatch(
14 | 'ng',
15 | ['generate', './schematic-boolean-option-negated:test', '--watch'],
16 | /noWatch: false/,
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "bundler",
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "skipLibCheck": true,
12 | "target": "es2022",
13 | "module": "es2022",
14 | "lib": [
15 | "es2022",
16 | "dom"
17 | ]
18 | },
19 | "angularCompilerOptions": {
20 | "enableIvy": true,
21 | "disableTypeScriptVersionCheck": true,
22 | "strictTemplates": true
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/angular/build/src/tools/vite/plugins/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export { createAngularMemoryPlugin } from './angular-memory-plugin';
10 | export { createRemoveIdPrefixPlugin } from './id-prefix-plugin';
11 | export { createAngularSetupMiddlewaresPlugin, ServerSsrMode } from './setup-middlewares-plugin';
12 | export { createAngularSsrTransformPlugin } from './ssr-transform-plugin';
13 | export { createAngularServerSideSSLPlugin } from './ssr-ssl-plugin';
14 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect/node/test/jobs/add.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { jobs } from '../../../index';
10 |
11 | // Export the job using a createJob. We use our own spec file here to do the job.
12 | export default jobs.createJobHandler(
13 | (input) => {
14 | return input.reduce((a, c) => a + c, 0);
15 | },
16 | {
17 | input: { items: { type: 'number' } },
18 | output: { type: 'number' },
19 | },
20 | );
21 |
--------------------------------------------------------------------------------
/packages/schematics/angular/library/files/tsconfig.lib.json.template:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3 | {
4 | "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
5 | "compilerOptions": {
6 | "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/lib",
7 | "declaration": true,
8 | "declarationMap": true,
9 | "types": []
10 | },
11 | "include": [
12 | "src/**/*.ts"
13 | ],
14 | "exclude": [
15 | "**/*.spec.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/cache/cache-enable-disable.ts:
--------------------------------------------------------------------------------
1 | import assert from 'node:assert/strict';
2 | import { readFile } from '../../../utils/fs';
3 | import { ng } from '../../../utils/process';
4 |
5 | export default async function () {
6 | await ng('cache', 'enable');
7 | assert.strictEqual(
8 | JSON.parse(await readFile('angular.json')).cli.cache.enabled,
9 | true,
10 | `Expected 'cli.cache.enable' to be true.`,
11 | );
12 |
13 | await ng('cache', 'disable');
14 | assert.strictEqual(
15 | JSON.parse(await readFile('angular.json')).cli.cache.enabled,
16 | false,
17 | `Expected 'cli.cache.enable' to be false.`,
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/angular/build/src/builders/extract-i18n/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Builder, createBuilder } from '@angular-devkit/architect';
10 | import { execute } from './builder';
11 | import type { Schema as ExtractI18nBuilderOptions } from './schema';
12 |
13 | export { ExtractI18nBuilderOptions, execute };
14 |
15 | const builder: Builder =
16 | createBuilder(execute);
17 |
18 | export default builder;
19 |
--------------------------------------------------------------------------------
/packages/angular/create/README.md:
--------------------------------------------------------------------------------
1 | # `@angular/create`
2 |
3 | ## Create an Angular CLI workspace
4 |
5 | Scaffold an Angular CLI workspace without needing to install the Angular CLI globally. All of the [ng new](https://angular.dev/cli/new) options and features are supported.
6 |
7 | ## Usage
8 |
9 | ### npm
10 |
11 | ```
12 | npm init @angular@latest [project-name] -- [...options]
13 | ```
14 |
15 | ### yarn
16 |
17 | ```
18 | yarn create @angular [project-name] [...options]
19 | ```
20 |
21 | ### pnpm
22 |
23 | ```
24 | pnpm create @angular [project-name] [...options]
25 | ```
26 |
27 | ### bun
28 |
29 | ```
30 | bun create @angular [project-name] [...options]
31 | ```
32 |
--------------------------------------------------------------------------------
/packages/angular_devkit/architect_cli/README.md:
--------------------------------------------------------------------------------
1 | # Architect CLI
2 |
3 | This package contains the executable for running an [Architect Builder](/packages/angular_devkit/architect/README.md).
4 |
5 | # Usage
6 |
7 | ```
8 | architect [project][:target][:configuration] [options, ...]
9 |
10 | Run a project target.
11 | If project/target/configuration are not specified, the workspace defaults will be used.
12 |
13 | Options:
14 | --help Show available options for project target.
15 | Shows this message instead when ran without the run argument.
16 |
17 |
18 | Any additional option is passed the target, overriding existing options.
19 | ```
20 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/app/app.module.server.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { NgModule } from '@angular/core';
10 | import { ServerModule } from '@angular/platform-server';
11 |
12 | import { AppModule } from './app.module';
13 | import { AppComponent } from './app.component';
14 |
15 | @NgModule({
16 | imports: [
17 | AppModule,
18 | ServerModule,
19 | ],
20 | bootstrap: [AppComponent],
21 | })
22 | export class AppServerModule {}
23 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/commands/unknown-option.ts:
--------------------------------------------------------------------------------
1 | import { execAndWaitForOutputToMatch, ng } from '../../utils/process';
2 | import { expectToFail } from '../../utils/utils';
3 |
4 | export default async function () {
5 | await expectToFail(() => ng('build', '--notanoption'));
6 |
7 | await execAndWaitForOutputToMatch(
8 | 'ng',
9 | ['build', '--notanoption'],
10 | /Unknown argument: notanoption/,
11 | );
12 |
13 | const ngGenerateArgs = ['generate', 'component', 'component-name', '--notanoption'];
14 | await expectToFail(() => ng(...ngGenerateArgs));
15 |
16 | await execAndWaitForOutputToMatch('ng', ngGenerateArgs, /Unknown argument: notanoption/);
17 | }
18 |
--------------------------------------------------------------------------------
/tests/angular_devkit/schematics/tools/file-system-engine-host/file-tasks/factory.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | // tslint:disable-next-line:no-implicit-dependencies
10 | import { SchematicContext, Tree } from '@angular-devkit/schematics';
11 |
12 | export default function () {
13 | return (_: Tree, context: SchematicContext) => {
14 | context.addTask({
15 | toConfiguration() {
16 | return { name: 'file-tasks/file-task.js' };
17 | },
18 | });
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/tests/legacy-cli/e2e/tests/build/library/lib-consumption-sourcemaps.ts:
--------------------------------------------------------------------------------
1 | import { expectFileToMatch } from '../../../utils/fs';
2 | import { ng } from '../../../utils/process';
3 | import { libraryConsumptionSetup } from './setup';
4 |
5 | export default async function () {
6 | await libraryConsumptionSetup();
7 |
8 | // Build library in full mode (development)
9 | await ng('build', 'my-lib', '--configuration=development');
10 |
11 | // Validate that sourcemaps for the library exists.
12 | await ng('build', '--configuration=development');
13 | await expectFileToMatch(
14 | 'dist/test-project/browser/main.js.map',
15 | 'projects/my-lib/src/lib/my-lib.ts',
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/modules/testing/builder/projects/hello-world-app/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { BrowserModule } from '@angular/platform-browser';
10 | import { NgModule } from '@angular/core';
11 |
12 |
13 | import { AppComponent } from './app.component';
14 |
15 |
16 | @NgModule({
17 | declarations: [
18 | AppComponent
19 | ],
20 | imports: [
21 | BrowserModule
22 | ],
23 | providers: [],
24 | bootstrap: [AppComponent]
25 | })
26 | export class AppModule { }
27 |
--------------------------------------------------------------------------------
/packages/angular_devkit/core/src/logger/transform-logger.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { Observable } from 'rxjs';
10 | import { LogEntry, Logger } from './logger';
11 |
12 | export class TransformLogger extends Logger {
13 | constructor(
14 | name: string,
15 | transform: (stream: Observable) => Observable,
16 | parent: Logger | null = null,
17 | ) {
18 | super(name, parent);
19 | this._observable = transform(this._observable);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/schematics/angular/interceptor/class-files/__name@dasherize____typeSeparator__interceptor.spec.ts.template:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { <%= classify(name) %>Interceptor } from './<%= dasherize(name) %><%= typeSeparator %>interceptor';
4 |
5 | describe('<%= classify(name) %>Interceptor', () => {
6 | beforeEach(() => TestBed.configureTestingModule({
7 | providers: [
8 | <%= classify(name) %>Interceptor
9 | ]
10 | }));
11 |
12 | it('should be created', () => {
13 | const interceptor: <%= classify(name) %>Interceptor = TestBed.inject(<%= classify(name) %>Interceptor);
14 | expect(interceptor).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/schematics/angular/utility/eol.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | import { EOL } from 'node:os';
10 |
11 | const CRLF = '\r\n';
12 | const LF = '\n';
13 |
14 | export function getEOL(content: string): string {
15 | const newlines = content.match(/(?:\r?\n)/g);
16 |
17 | if (newlines?.length) {
18 | const crlf = newlines.filter((l) => l === CRLF).length;
19 | const lf = newlines.length - crlf;
20 |
21 | return crlf > lf ? CRLF : LF;
22 | }
23 |
24 | return EOL;
25 | }
26 |
--------------------------------------------------------------------------------