Skip to content
CLI tool for Angular
TypeScript Starlark JavaScript HTML Shell CSS
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci ci: Use node v10.20 for node v10 e2e test May 8, 2020
.github ci: update required status checks Apr 30, 2020
.idea refactor(@angular/cli): exclude .yarn directory from IntelliJ IDEs se… May 6, 2020
.yarn build: update to yarn 1.22.4 Apr 22, 2020
benchmark/aio build: workaround yarn tgz bug Sep 10, 2018
bin build: terminate process with non zero error code when build fails Jan 11, 2019
docs docs: add primary-secondary pairs and update calendar link May 15, 2020
etc refactor(@angular-devkit/schematics): remove deprecated sync test hel… May 5, 2020
integration/angular_cli fix(@schematics/angular): remove node typings from tsconfig.spec.json May 27, 2020
lib build: version from git tag which consists two or more digits Apr 8, 2020
packages build: update sass to version 1.26.7 May 29, 2020
scripts test: revive legacy unit test script May 18, 2020
tests build: update angular packages May 28, 2020
third_party refactor: use BUILD.bazel instead of BUILD Apr 7, 2020
tools build: add rbe_ubuntu1604-angular docker permissions Apr 30, 2020
.bazelignore build: update bazel dependencies and configuration (#15291) Aug 12, 2019
.bazelrc build: run tests depending on webdriver-manager locally Apr 30, 2020
.bazelversion build: use @bazel/bazelisk Apr 30, 2020
.editorconfig style: update editorconfig website url (#12923) Nov 14, 2018
.gitattributes style: add .gitattributes file (#13086) Nov 30, 2018
.gitignore refactor(@angular/cli): update Intellij/Webstorm settings Nov 19, 2019
.mailmap build: add Alan to the mailmap file Jan 18, 2019
.monorepo.json docs: add Architect CLI to the "Tooling" section Jun 6, 2019
.nvmrc build: update nvm node version to 10.13 Jan 2, 2020
.prettierignore build: add golden API to prettierignore Mar 5, 2019
.prettierrc build: integrate prettier code formatting Jun 20, 2019
.yarnrc build: update to yarn 1.22.4 Apr 22, 2020
BUILD.bazel refactor: rename toplevel BUILD to BUILD.bazel Apr 30, 2020
CONTRIBUTING.md docs: add "PR action: merge" label (#16413) Dec 13, 2019
Dockerfile ci: use puppeteer Jan 14, 2019
LICENSE build: move devkit repo back to angular-cli Jun 6, 2018
README.md docs(@angular/cli): Adds developer documentation. Nov 14, 2019
WORKSPACE build: update bazel packages May 29, 2020
package.json build: update bazel packages May 29, 2020
renovate.json ci: disable separate renovate PRs for devDependencies and dependencies Apr 6, 2020
tsconfig-test.json build: remove generation of inline sourcemaps Mar 25, 2019
tsconfig.json test(@angular/cli): add npm_integration_test Apr 30, 2020
tslint.json test(@angular-devkit/build-angular): build and test with Bazel Apr 30, 2020
yarn.lock build: update bazel packages May 29, 2020

README.md

Angular CLI

Development tools and libraries specialized for Angular

This is the home of the DevKit and the Angular CLI code. You can find the Angular CLI specific README here.

CircleCI branch Dependency Status devDependency Status

License

GitHub forks GitHub stars

Quick Links

Gitter Contributing Angular CLI

The Goal of Angular CLI

The Angular CLI creates, manages, builds and test your Angular projects. It's built on top of the Angular DevKit.

The Goal of DevKit

DevKit's goal is to provide a large set of libraries that can be used to manage, develop, deploy and analyze your code.

Getting Started - Local Development

Installation

To get started locally, follow these instructions:

  1. If you haven't done it already, make a fork of this repo.
  2. Clone to your local computer using git.
  3. Make sure that you have Node 10.13 or later installed. See instructions here.
  4. Make sure that you have yarn installed; see instructions here.
  5. Run yarn (no arguments) from the root of your clone of this project to install dependencies.

Building and Installing the CLI

To make a local build:

yarn build --local

This generates a number of tarballs in the dist/ directory. To actually use the locally built tools, switch to another repository reproducing the specific issue you want to fix (or just generate a local repo with ng new). Then install the locally built packages:

cd "${EXAMPLE_ANGULAR_PROJECT_REPO}"
npm install -D ${CLI_REPO}/dist/*.tgz

Builds of this example project will use tooling created from the previous local build and include any local changes. When using the CLI, it will automatically check for a local install and use that if present. This means you can just run:

npm install -g @angular/cli

to get a global install of the latest CLI release. Then running any ng command in the example project will automatically find and use the local build of the CLI.

Note: If you are testing ng update, be aware that installing all the tarballs will also update the framework (@angular/core) to the latest version. In this case, simply install the CLI alone with npm install -D ${CLI_REPO}/dist/_angular_cli.tgz, that way the rest of the project remains to be upgraded with ng update.

Debugging

To debug an invocation of the CLI, build and install the CLI for an example project, then run the desired ng command as:

node --inspect-brk node_modules/.bin/ng ...

This will trigger a breakpoint as the CLI starts up. You can connect to this using the supported mechanisms for your IDE, but the simplest option is to open Chrome to chrome://inspect and then click on the inspect link for the node_modules/.bin/ng Node target.

Unfortunately, the CLI dynamically require()'s other files mid-execution, so the debugger is not aware of all the source code files before hand. As a result, it is tough to put breakpoints on files before the CLI loads them. The easiest workaround is to use the debugger; statement to stop execution in the file you are interested in, and then you should be able to step around and set breakpoints as expected.

Testing

There are three different test suites which can be run locally:

  • Unit tests
    • Run: yarn test --full
    • Debug: yarn debug:test --full
  • Large tests
    • Run: yarn test-large --full
    • Debug: yarn debug:test-large --full
  • End to end tests
    • Run: node tests/legacy-cli/run_e2e.js
    • Run subset of tests: node tests/legacy-cli/run_e2e.js tests/legacy-cli/e2e/tests/i18n/ivy-localize-*

When running the debug commands, Node will stop and wait for a debugger to attach. You can attach your IDE to the debugger to stop on breakpoints and step through the code. Also see IDE Specific Usage for a simpler debug story.

When debugging a specific test, change describe() or it() to fdescribe() and fit() to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.

IDE Specific Usage

Some additional tips for developing in specific IDEs.

Intellij IDEA / WebStorm

To load the project in Intellij products, simply Open the repository folder. Do not Import Project, because that will overwrite the existing configuration.

Once opened, the editor should automatically detect run configurations in the workspace. Use the drop down to choose which one to run and then click the Run button to start it. When executing a debug target, make sure to click the Debug icon to automatically attach the debugger (if you click Run, Node will wait forever for a debugger to attach).

Intellij IDEA run configurations

Creating New Packages

Adding a package to this repository means running two separate commands:

  1. schematics devkit:package PACKAGE_NAME. This will update the .monorepo file, and create the base files for the new package (package.json, src/index, etc).
  2. devkit-admin templates. This will update the README and all other template files that might have changed when adding a new package.

For private packages, you will need to add a "private": true key to your package.json manually. This will require re-running the template admin script.

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 NgPackagr @angular-devkit/build-ng-packagr latest README snapshot
Build Optimizer @angular-devkit/build-optimizer 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
Schematics Schematics @schematics/schematics latest snapshot
Package Update Schematics @schematics/update latest snapshot

Misc

Project Package Version Links
Webpack Angular Plugin @ngtools/webpack latest snapshot
You can’t perform that action at this time.