Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

CLI tool for Angular

License

NotificationsYou must be signed in to change notification settings

levenleven/angular-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 READMEhere.

CircleCI branchDependency StatusdevDependency Status

License

GitHub forksGitHub stars

Quick Links

GitterContributingAngular CLI

The Goal of Angular CLI

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

The Goal of DevKit

DevKit's goal is to provide a large set of libraries that can be used to manage, develop, deploy andanalyze 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 usinggit.
  3. Make sure that you have Node 12.14 or 14.0 installed. See instructionshere.
  4. Make sure that you haveyarn installed; see instructionshere.
  5. Runyarn (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 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.

Debugging

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 theinspectlink 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.

Testing

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

Unit tests

  • 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.

End to end tests

  • 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.

IDE Specific Usage

Some additional tips for developing in specific IDEs.

Intellij IDEA / WebStorm

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 theRunbutton 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).

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 thebase 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 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.

Packages

This is a monorepo which contains many tools and packages:

Tools

ProjectPackageVersionLinks
Angular CLI@angular/clilatestREADMEsnapshot
Architect CLI@angular-devkit/architect-clilatestsnapshot
Schematics CLI@angular-devkit/schematics-clilatestsnapshot

Packages

ProjectPackageVersionLinks
Architect@angular-devkit/architectlatestREADMEsnapshot
Build Angular@angular-devkit/build-angularlatestREADMEsnapshot
Build Optimizer@angular-devkit/build-optimizerlatestREADMEsnapshot
Build Webpack@angular-devkit/build-webpacklatestREADMEsnapshot
Core@angular-devkit/corelatestREADMEsnapshot
Schematics@angular-devkit/schematicslatestREADMEsnapshot

Schematics

ProjectPackageVersionLinks
Angular PWA Schematics@angular/pwalatestsnapshot
Angular Schematics@schematics/angularlatestsnapshot

Misc

ProjectPackageVersionLinks
Webpack Angular Plugin@ngtools/webpacklatestsnapshot

About

CLI tool for Angular

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript95.6%
  • Starlark1.9%
  • JavaScript1.7%
  • EJS0.4%
  • HTML0.2%
  • Shell0.2%

[8]ページ先頭

©2009-2025 Movatter.jp