127 Commits

Author SHA1 Message Date
Tom Sullivan
6c6ae08ec7 fix(@angular/cli): Determine relative paths correctly
As `git status --porcelain` always shows paths relative to the top
level, fetch the top level path in `checkCleanGit` and properly
determine whether any modified files are actually within the
Angular workspace root.
2019-10-17 14:14:07 -07:00
Alan Agius
cf349433ab fix(@angular/cli): ng update log messages printed twice
After the logs are printing to console clean the logs queue.

Fixes #15839
2019-10-15 11:23:16 -07:00
Alan Agius
d133ba68c0 feat(@angular/cli): add support for ng-add packages that should not be saved as dependencies
With this change the CLI offers a way for a package authors to specify if during `ng add` the package should be saved as a `dependencies`, `devDependencies` or not saved at all.

Such config needs to be specified in `package.json`

Example:
```json
  "ng-add": {
    "save": false
  }
```

Possible values are;
- false - Don't add the package to `package.json`
- true - Add the package to the `dependencies`
- `dependencies` - Add the package to the `dependencies`
- `devDependencies` - Add the package to the `devDependencies`

Closes #12003 , closes #15764 and closes #13237
2019-10-14 13:40:31 -07:00
Alan Agius
c3169ae7d2 New i18n schema (#15760)
* feat(@angular-devkit/core): update schema to support new i18n options

"projects": {
  "my-app": {
    "projectType": "application",
    "schematics": {},
    "root": "",
    "i18n": {
      "sourceLocale": "en-US",
      "locales": {
        "fr": "src/locale/messages.fr.xlf"
      }
    },
    "sourceRoot": "src",
    ...
  }
}

* feat(@angular-devkit/build-angular): add new i18n options to browser and server builders

With this change we add `translateLocales` as new options for i18n in browser and server builders.

We also deprecate the following options;
* i18nLocale
* i18nFormat
* i18nFile

* feat(@angular-devkit/build-angular): deprecate `i18nFormat` and `i18nLocale` options of `extract-i18n` builder

Option `i18nFormat` has been deprecated in favor of `format` and `i18nLocale` option has been deprecated in favor of the `sourceLocale` sub option of the `i18n` project level option.

* feat(@angular/cli): add alias of `i18n-extract` for `x18n` command

* refactor: rename `translateLocales` to `localize`
2019-10-10 12:39:00 -07:00
Keen Yee Liau
ebc92c2125 refactor(@angular/cli): Simplify retrival of collection name 2019-10-03 14:42:35 -07:00
Keen Yee Liau
0662a8d774 build: g3 sync for packages/schematics and packages/angular
Fix all build errors in g3
2019-10-03 14:29:07 -07:00
Charles Lyding
0abeadbc10 refactor(@angular/cli): use canonical npm logic to determine update package version 2019-09-19 14:41:04 -07:00
Charles
ace02f6c2a feat(@angular/cli): create commits per migration during update (#15611) 2019-09-17 08:35:18 -07:00
Charles Lyding
2565077dbe fix(@angular/cli): correctly account for linked packages in update
Fixes #15511
Fixes #15294
2019-09-11 10:10:48 -07:00
Alan Agius
26dd51221a style: collapse if statements (#15449) 2019-08-27 10:25:14 -07:00
Charles
891fe527d7 feat(@angular/cli): update with migrate only creates commit per migration (#15414)
* feat(@angular/cli): update with migrate only creates commit per migration

* refactor(@angular/cli): simplify update command schematic execution
2019-08-26 11:48:43 -07:00
Judy Bogart
fe3d597c0e Add deploy command doc (#15402)
* docs: add deploy command doc

* docs: fix json example

* docs: add link to cli builder doc

* docs: remove link

* docs: restore link
2019-08-22 10:14:38 -07:00
Judy Bogart
08d7d0298c docs: remove app from app project 2019-08-21 15:21:49 -07:00
Judy Bogart
3c69e34b2f docs: ng add configures project in cwd 2019-08-21 15:21:49 -07:00
Charles Lyding
b630317b4b refactor(@angular/cli): convert workspace access to async
This is in preparation for conversion from the experimental workspace API to the stable workspace API.
2019-08-16 09:32:04 -07:00
mgechev
5df50bacbe feat(@angular/cli): implement deploy command 2019-07-30 21:07:50 -07:00
Judy Bogart
b5924febb2 Document possible values of analytics command (#15039)
* docs: add possible values to ref doc for analytics command

* docs: add ci value
2019-07-15 16:31:08 -07:00
Alan
3d1d225dd2 fix(@angular/cli): add verbose option to update and add
At the moment there is no way to turn on the verbose logging for `ng update` and `ng add`. This is useful for use so that when users report issues such as npmrc is not read we can see the lookup locations.

This also removes some reduncant that were being provided in `executeSchematic`.

Related to https://github.com/angular/angular-cli/issues/14993
2019-07-10 04:15:05 +08:00
Alan
70a4cbe306 style: enable no-debugger and no-console tslint rules 2019-06-27 09:28:35 -07:00
cexbrayat
3e95474d1f feat(@angular/cli): ng doc uses angular core version by default
Follow-up to #14788 that allowed `ng doc --version 6`.
This commit enhances the doc command to use the current Angular version of the project by default, if no version is provided explicitely.

Fixes #12365
2019-06-27 09:18:32 -07:00
cexbrayat
371bd6194a fix(@angular/cli): validate version in doc command
As the JSON Schema validation is minimum in the CLI, we have to also validate in code.
This PR:
- updates the JSON Schema to use `number` and `enum` instead of `integer` and `const` that are not supported.
- adds validation in the doc command implementation
- adds error reporting if the version is not valid
- fixes a typo in an error message in the parser
2019-06-24 17:30:44 -07:00
Charles Lyding
c4313f55e4 refactor(@angular/cli): unify color handling and support 2019-06-24 17:27:59 -07:00
cexbrayat
3cd0931eb7 fix(@angular/cli): correct git branch in ng version
When testing a local CLI build with `npm link @angular/cli`, if you run `ng version`,
you currently see:

    Angular CLI: local (v8.1.0-beta.2+24.3bb67d8.with-local-changes, branch: version)

if the Git branch is `fix/version`.

Whit this PR, `ng version` now displays the proper Git branch name:

    Angular CLI: local (v8.1.0-beta.2+24.3bb67d8.with-local-changes, branch: fix/version)
2019-06-19 17:06:52 -07:00
Lakhyari
58599e125e feat(@angular/cli): ng doc accepts a version flag
With this commit, we can now specify a `version`
for the `ng doc` command

    ng doc --version 6
    ng doc -v 6

and this will open `v6.angular.io` instead of `angular.io`.
The default domain is still used
if no version is specified.

Refs #12365
2019-06-17 11:02:56 -07:00
Charles Lyding
dea6bb317b fix(@angular/cli): only enable CLI 1.x update handling when no new config
Fixes #14703
2019-06-11 14:23:04 -07:00
Judy Bogart
dc117324ac docs: differentiate lib build from app build 2019-06-11 10:23:43 -07:00
Charles Lyding
09149fe5e4 fix(@angular/cli): allow update when git is unclean outside the workspace 2019-06-11 09:53:56 -07:00
Charles Lyding
ed4baa4884 fix(@angular/cli): avoid updating when package is already up to date
Fixes #14647
2019-06-06 14:24:36 -07:00
Charles Lyding
2d27cb4671 fix(@angular/cli): resolve update migrations from referenced package root
This ensures that migration fields that reference other packages use the package version specified in the migrating package's dependencies and not the version that a package manager happens to hoist to the root of the workspace.
2019-06-06 14:22:02 -07:00
Charles Lyding
aceaacde50 fix(@angular/cli): provide an option to update dirty repositories 2019-05-30 13:55:14 -07:00
Alan Agius
757d8df3e6 fix(@angular/cli): ng config doesn't parse positional array
Fixes #14516
2019-05-28 21:01:13 +02:00
Alan Agius
db344641f4 fix(@angular/cli): ng generate --help shows the wrong collection
At the moment, collectionName and schematicCollections are not set in various schematics command which result in fallbacking to the hardcoded default collectionName https://github.com/angular/angular-cli/blob/master/packages/angular/cli/models/schematic-command.ts#L79

Hence, this will result in incorrect information being present when using the `--help`, `--list`.

Fixes #14519
2019-05-28 20:57:21 +02:00
Charles Lyding
b336cc7798 fix(@angular/cli): ensure git repository is clean before updates
If not asking for update status then this change checks for a clean git repository before proceeding.  This allows the user to easily reset any changes from the update and avoid any developer code changes from being mixed with update changes.
2019-05-23 19:13:41 +02:00
Charles Lyding
8f0b3eb09a fix(@angular/cli): show error when using x18n command on Node.js 12.0
Node.js 12.0 contains a defect which will cause the command to crash.  This is due to the locale support in Node.js 12.0 (ICU).  ref: https://github.com/nodejs/node/issues/27379
2019-05-22 10:02:13 +02:00
Alan
8e3efaf70b docs: update project description to full application instead of app 2019-05-21 09:09:42 -04:00
Alex Eagle
ec731f0454 docs: don't reference next.angular.io
When we cut a release, this moves to angular.io.
Use v8.angular.io in places where angular.io is currently a 404.

Fixes https://github.com/angular/angular/issues/30407
2019-05-21 09:08:40 -04:00
Charles Lyding
b7fc6125e5 fix(@angular/cli): improve error handling of update command
This adds extensive option checking and error handling with the goal to catch user errors as early in the process as possible.  Bad option combinations and/or values will result in actionable information and stop the process before network access and processing occurs.
2019-05-15 14:34:03 -07:00
Keen Yee Liau
ff2600b417 fix(@angular/cli): @bazel/* are not shown in ng version
Update `ng version` to show versions for @bazel/* packages to help users
report meaningful errors when they opt in to Bazel.
2019-05-15 14:15:03 -07:00
Captain Caius
c652ec7456 docs: describe prod flag more explicitly 2019-05-10 15:06:50 -07:00
Charles Lyding
7a72f2fb17 refactor(@angular/cli): avoid aggressive eager command loading
Currently, upon execution `ng` will load all description files AND code for all available commands.  This requires a large amount of unnecessary file access and processing since only at most one command will be executed.  This change limits the loading to only command being executed in the common case and a subset of commands in the event an alias is used.  The help command now loads all commands during its execution which is needed to gather command description information.  Further improvements are possible by only loading the necessary metadata instead of the execution code (and its dependencies) as well.
This change allows for savings of ~250ms per execution.

Examples:
Before -- `./node_modules/.bin/ng version  0.99s user 0.17s system 113% cpu 1.020 total`
After -- `./node_modules/.bin/ng version  0.70s user 0.13s system 110% cpu 0.749 total`

Before -- `./node_modules/.bin/ng g c a  1.91s user 0.30s system 111% cpu 1.996 total`
After -- `./node_modules/.bin/ng g c a  1.62s user 0.27s system 110% cpu 1.715 total`
2019-05-10 15:04:32 -07:00
Judy Bogart
5b3ee079d7 docs: edit reference doc for update command 2019-05-07 16:23:54 -06:00
Tiago Temporin
9805e8428d feat(@angular/cli): implement --registry for ng add (#14285)
Closes 14189
2019-05-07 12:34:27 -06:00
Alex Eagle
f5c41e5754 build: Resolve ng generate aliases before logging analytics 2019-04-17 13:40:58 -07:00
Judy Bogart
d2a343a405 docs: add cli usage analytics doc 2019-04-16 14:32:06 -07:00
Filipe Silva
5ec27db6bc feat(@angular/cli): verify Angular version is supported 2019-04-15 11:31:34 -07:00
Alan Agius
fe98024146 docs: align several experimental text and update ng new explanation 2019-04-10 08:44:53 -07:00
Andriy Pyvovarchuk
50cce668cc refactor: replace deprecated package opn with open 2019-04-01 10:53:12 -07:00
Charles Lyding
cfa1649fdd refactor(@angular/cli): use standard node resolution methods where possible 2019-03-30 18:36:22 -07:00
Hans Larsen
2ffbdfa86a build: add a validation script for the analytics.md tables
Also added enums to update when changing dimensions.
2019-03-28 13:28:41 -07:00
Hans Larsen
55471770db refactor: use dimensions for some values instead of metrics
This is after a discussion with someone internal. Metrics are good
for sums but not for comparisons and search/filtering.
2019-03-28 13:28:41 -07:00