- Notifications
You must be signed in to change notification settings - Fork0
levenleven/angular-cli
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the home of the DevKit and the Angular CLI code. You can find the Angular CLI specific READMEhere.
Gitter | Contributing | Angular CLI |
---|
The Angular CLI creates, manages, builds and test your Angular projects. It's built on top of theAngular DevKit.
DevKit's goal is to provide a large set of libraries that can be used to manage, develop, deploy andanalyze your code.
To get started locally, follow these instructions:
- If you haven't done it already,make a fork of this repo.
- Clone to your local computer using
git
. - Make sure that you have Node 12.14 or 14.0 installed. See instructionshere.
- Make sure that you have
yarn
installed; see instructionshere. - Run
yarn
(no arguments) from the root of your clone of this project to install dependencies.
To make a local build:
yarn build --local
This generates a number of tarballs in thedist/
directory. To actually usethe locally built tools, switch to another repository reproducing the specificissue you want to fix (or just generate a local repo withng new
). Theninstall 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 localbuild and include any local changes. When using the CLI, it will automaticallycheck 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 anyng
commandin the example project will automatically find and use the local build of theCLI.
Note: If you are testingng update
, be aware that installing all the tarballswill also update the framework (@angular/core
) to the latest version. In thiscase, simply install the CLI alone withnpm install -D ${CLI_REPO}/dist/_angular_cli.tgz
, that way the rest of theproject remains to be upgraded withng update
.
To debug an invocation of the CLI,build and install the CLI for an exampleproject, then run the desiredng
commandas:
node --inspect-brk node_modules/.bin/ng ...
This will trigger a breakpoint as the CLI starts up. You can connect to thisusing the supported mechanisms for your IDE, but the simplest option is to openChrome to chrome://inspect and then click on theinspect
link for thenode_modules/.bin/ng
Node target.
Unfortunately, the CLI dynamicallyrequire()
's other files mid-execution, sothe 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 easiestworkaround is to use thedebugger;
statement to stop execution in the file youare interested in, and then you should be able to step around and set breakpointsas expected.
There are two different test suites which can be run locally:
- Run all tests:
yarn bazel test //packages/...
- Run a subset of the tests, use the full Bazel target example:
yarn bazel test //packages/schematics/angular:angular_test
- For a complete list of test targets use the following Bazel query:
yarn bazel query "tests(//packages/...)"
You can find more info about debuggingtests with Bazel in the docs.
- Run:
node tests/legacy-cli/run_e2e.js
- Run a subset of the 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, seeIDE Specific Usage for asimpler debug story.
When debugging a specific test, changedescribe()
orit()
tofdescribe()
andfit()
to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.
Some additional tips for developing in specific IDEs.
To load the project in Intellij products, simplyOpen
the repository folder.DonotImport Project
, because that will overwrite the existingconfiguration.
Once opened, the editor should automatically detect run configurations in theworkspace. Use the drop down to choose which one to run and then click theRun
button to start it. When executing a debug target, make sure to click theDebug
icon to automatically attach the debugger (if you clickRun
, Node willwait forever for a debugger to attach).
Adding a package to this repository means running two separate commands:
schematics devkit:package PACKAGE_NAME
. This will update the.monorepo
file, and create thebase files for the new package (package.json, src/index, etc).devkit-admin templates
. This will update the README and all other template files that mighthave 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.
This is a monorepo which contains many tools and packages:
Project | Package | Version | Links |
---|---|---|---|
Angular CLI | @angular/cli | ||
Architect CLI | @angular-devkit/architect-cli | ||
Schematics CLI | @angular-devkit/schematics-cli |
Project | Package | Version | Links |
---|---|---|---|
Architect | @angular-devkit/architect | ||
Build Angular | @angular-devkit/build-angular | ||
Build Optimizer | @angular-devkit/build-optimizer | ||
Build Webpack | @angular-devkit/build-webpack | ||
Core | @angular-devkit/core | ||
Schematics | @angular-devkit/schematics |
Project | Package | Version | Links |
---|---|---|---|
Angular PWA Schematics | @angular/pwa | ||
Angular Schematics | @schematics/angular |
Project | Package | Version | Links |
---|---|---|---|
Webpack Angular Plugin | @ngtools/webpack |
About
CLI tool for Angular
Resources
License
Stars
Watchers
Forks
Packages0
Languages
- TypeScript95.6%
- Starlark1.9%
- JavaScript1.7%
- EJS0.4%
- HTML0.2%
- Shell0.2%