Alan Agius 366cabc66c feat(@angular/cli): add support for multiple schematics collections
The `schematicCollections` can be placed under the `cli` option in the global `.angular.json` configuration, at the root or at project level in `angular.json` .

```jsonc
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "cli": {
    "schematicCollections": ["@schematics/angular", "@angular/material"]
  }
  // ...
}
```

**Rationale**
When this option is not configured and a user would like to run a schematic which is not part of `@schematics/angular`,
the collection name needs to be provided to `ng generate` command in the form of `[collection-name:schematic-name]`. This make the `ng generate` command too verbose for repeated usages.

This is where `schematicCollections` comes handle. When adding `@angular/material` to the list of `schematicCollections`, the generate command will try to locate the schematic in the specified collections.

```
ng generate navigation
```

is equivalent to:

```
ng generate @angular/material:navigation
```

**Conflicting schematic names**
When multiple collections have a schematic with the same name. Both `ng generate` and `ng new` will run the first schematic matched based on the ordering (as specified) of `schematicCollections`.

DEPRECATED:

The `defaultCollection` workspace option has been deprecated in favor of `schematicCollections`.

Before
```json
"defaultCollection": "@angular/material"
```

After
```json
"schematicCollections": ["@angular/material"]
```

Closes #12157
2022-03-22 09:37:57 -07:00
2021-11-12 10:59:11 +00:00
2022-02-18 08:10:40 -05:00
2019-01-18 11:58:02 -08:00
2022-01-31 11:36:53 -08:00
2022-01-16 19:41:34 +00:00
2021-11-12 10:59:11 +00:00
2022-01-31 11:36:53 -08:00
2021-04-28 16:05:49 -07:00
2022-03-21 13:17:43 -07:00

Angular CLI - The CLI tool for Angular.


Angular CLI logo

The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold,
and maintain Angular applications directly from a command shell.

cli.angular.io

Contributing Guidelines · Submit an Issue · Blog

CI status   Discord conversation


Documentation

Get started with Angular CLI, learn the fundamentals and explore advanced topics on our documentation website.

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules and more.

Want to Help?

Want to report a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.

Code of Conduct

Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.

Developer Guide

Read through our developer guide to learn about how to build and test the Angular CLI locally.

Community

Join the conversation and help the community.

Packages

This is a monorepo which contains many tools and packages:

Tools

Project Package Version Links
Angular CLI @angular/cli latest README snapshot
Architect CLI @angular-devkit/architect-cli latest snapshot
Schematics CLI @angular-devkit/schematics-cli latest snapshot

Packages

Project Package Version Links
Architect @angular-devkit/architect latest README snapshot
Build Angular @angular-devkit/build-angular latest README snapshot
Build Webpack @angular-devkit/build-webpack latest README snapshot
Core @angular-devkit/core latest README snapshot
Schematics @angular-devkit/schematics latest README snapshot

Schematics

Project Package Version Links
Angular PWA Schematics @angular/pwa latest snapshot
Angular Schematics @schematics/angular latest snapshot

Misc

Project Package Version Links
Webpack Angular Plugin @ngtools/webpack latest snapshot

Love Angular CLI? Give our repo a star ⬆️.

Description
CLI tool for Angular
Readme 234 MiB
Languages
TypeScript 95%
Starlark 2.3%
JavaScript 1.3%
HTML 1%
EJS 0.3%