155 Commits

Author SHA1 Message Date
Charles Lyding
8874ef430a refactor(@angular-devkit/core): add generic type to Promise constructors
This is in preparation to support TypeScript 4.1.  Within TypeScript 4.1 constructed Promises must specify the resolved type.
2020-11-05 08:31:35 +01:00
Alan Agius
32581ef078 refactor(@angular-devkit/core): deprecate json parser
Use 3rd party JSON parsers such as `jsonc-parser` instead.
2020-11-05 08:31:02 +01:00
Charles Lyding
ae899935f6 refactor(@angular-devkit/core): remove unneeded clean utility function use
The reduce call can be used to directly filter undefined elements.
2020-10-26 10:13:59 -04:00
Charles Lyding
83c91204ed fix(@angular-devkit/core): allow prompt providers to access property types
This allows prompt providers to adjust their logic based on the type of property requested.
2020-10-21 16:37:11 +02:00
Alan Agius
c5a1b21f7c refactor(@angular-devkit/core): remove unused NgBuildBuildEventLog from NgCliAnalyticsDimensions 2020-10-07 13:18:30 -04:00
Charles Lyding
660f214f9a fix(@angular-devkit/core): remove deprecated isObservable function
BREAKING CHANGE:
Deprecated `isObservable` function removed.  As an alternative, use `isObservable` from the `rxjs` package.
NOTE: This change does not affect application development.
2020-10-07 13:18:15 -04:00
Alan Agius
db5c7776ac test(@angular-devkit/core): remove unused benchmark tests 2020-10-07 10:20:54 -04:00
Alan Agius
1b8fabfcc3 feat(@angular-devkit/core): add basic support for oneOf/anyOf to addUndefinedDefaults transformer 2020-09-25 20:32:35 +02:00
Joey Perrott
25aa2d5929 refactor: remove usages of the term whitelist 2020-09-24 00:07:10 +03:00
Keen Yee Liau
297fc923ab build: remove experimental build event protocol 2020-09-11 13:24:38 -04:00
Alan Agius
6d43e320b6 refactor(@angular-devkit/core): remove deprecated terminal utils
BREAKING CHANGE:

Deprecated `@angular-devkit/core` terminal API has been removed. Use 3rd party packages like chalk, colors or ansi-colors instead.

**Note:** this changes doesn't effect application developers
2020-09-10 20:19:33 +02:00
Charles Lyding
8036c1c7f0 fix(@angular-devkit/core): allow property remove with workspace API
Removal changes were previously being improperly recorded with the wrong parent.  A property can now be directly removed by setting the value to undefined or by using the delete operator.
2020-08-31 11:58:28 +01:00
Charles Lyding
df70c7a857 refactor(@angular-devkit/core): remove experimental workspace API
BREAKING CHANGE:
The experimental workspace API has been removed from `@angular-devkit/core`.  This API was no longer used by the Angular CLI and was replaced with the stable workspace API also found within `@angular-devkit/core`. This change does not affect project code and is related to tooling infrastructure only.
2020-08-28 08:53:38 +01:00
Charles Lyding
3de6f48094 refactor(@angular-devkit/core): adjust types to support strict mode 2020-08-21 16:09:10 -04:00
Doug Parker
423cfcf93a refactor(@angular-devkit/core): fix strict types in experimental.
Most of the problems here come from return-only generics. A greater redesign of these core types is necessary to properly fix all the typing issues. However, all these types seem to be exported publicly. In the interest of not introducing any breaking changes, most of these fixes were just casting types to `unknown` or replacing generics with the maximally-allowed type (`JsonValue`).
2020-08-20 20:36:02 -04:00
Keen Yee Liau
5f78698024 fix(@angular-devkit/core): strict typings for json, logger, and virtual-fs
This commit fixes typings errors after "strict: true" is enabled in
tsconfig.json for the json, logger, and virtual-fs subpackages in
`@angular-devkit/core`.
2020-08-20 20:19:40 +02:00
Charles Lyding
7045cee223 refactor(@angular-devkit/core): allow creation of a host from a non-observable source 2020-08-19 16:00:33 +02:00
santoshyadavdev
dfef55e3f7 refactor(@angular-devkit/core): remove any types 2020-08-18 16:32:42 +02:00
Alan Agius
3258267776 style(@angular-devkit/core): fix formatting 2020-08-17 18:18:24 +02:00
Alan Agius
797bcf9944 feat(@angular-devkit/core): add useXDeprecatedProvider to SchemaRegistry
Use the new provider to record usage of options which have the `x-deprecated` keyword.
2020-08-17 18:18:24 +02:00
JoostK
876df758f9 fix(@angular-devkit/core): avoid RxJS performance penalty in sync fs calls 2020-08-16 21:00:51 +02:00
Alan Agius
ba81decdd9 refactor(@angular-devkit/core): remove unused imports 2020-08-15 15:36:20 +02:00
Charles Lyding
9cd796b124 feat(@angular-devkit/build-angular): support multiple translation files per locale
This change implements the capability to specify multiple translation files per locale. The specified translation files for each locale will be merged prior to localization. The Angular configuration file has been updated to allow for both a single path string or an array of path strings when specifying the translations for each locale. If the same message identifier is present in multiple translation files, a warning will currently be issued and the last file with the duplicate message identifier will take precedence.

Closes #18276
2020-08-13 12:23:59 +02:00
Keen Yee Liau
fa9136a971 build: minor fixes for google3 sync
This commit makes a few minor changes to enable syncing the CLI repository
into google3.

1. mark pkg_tar and pkg_npm as external
2. remove dependencies (marked as comment) which are stale in google3
3. remove TS files generated from JSON schema in BUILD files since these
   files are compiled and added to the g3 codebase at sync time
4. Some minor typing changes
5. Remove duplicate licenses
6. mark dependencies which are not available in g3 as external
7. Immediately type the result of JSON.parse() as required by g3 linter.
   Otherwise, the type defaults to `any`.
2020-07-24 22:52:22 +02:00
Alan Agius
05588fcee1 refactor: clean up unused code and imports 2020-07-24 08:01:52 +02:00
Alan Agius
a785d51a60 test: make CoreSchemaRegistry test green again
`http://json.schemastore.org/tslint` has moved permanently to `https://json.schemastore.org/tslint` which is causing this test to fail

(cherry picked from commit bb7f2699e7cc535698d8a5120680776d22e36df1)
2020-05-27 11:25:17 +02:00
Alan Agius
9914125564 build: fix typescript 3.9 compilation 2020-04-27 11:06:24 -07:00
Alan Agius
4e9fe35845 fix(@angular-devkit/core): workspace reader spread/rest operator usage with falsy values
Spread and Rest uses `[[GetOwnProperty]]`. Previously, properties with falsy values were being removed when using the spread operator due to an incorrect check.

https://tc39.es/proposal-object-rest-spread/#AbstractOperations-CopyDataProperties

Fixes #17021
2020-04-21 12:43:58 -07:00
Filipe Silva
62272ad925 build: fix bazel tests to run on windows 2020-04-07 09:07:19 -07:00
Charles Lyding
f0bada1925 fix(@angular/cli): allow for private use language subtags
Fixes:  #17163
2020-03-16 21:44:42 -07:00
Schneider
2c10cf80f6 docs: fix typos in multiple files 2020-02-24 12:42:22 -08:00
Sachin Grover
764b977de4 fix(@angular/cli): expand locale pattern in all schemas for all cases
Fixes: #17032
2020-02-24 12:39:35 -08:00
Charles Lyding
7b54164e48 fix(@angular/cli): expand locale pattern in workspace schema
Fixes: #16935
2020-02-11 08:45:36 -08:00
Alan Agius
2432b86758 build: update fast-json-stable-stringify to 2.1 2020-01-02 11:42:44 -08:00
Charles Lyding
c37eaeec43 fix(@angular-devkit/build-angular): augment base HREF when localizing
All locale i18n options now support an object form which allows a base HREF to be defined for the locale.  Each locale can now optionally define a custom base HREF that will be combined with the base HREF defined for the build configuration.  By default if the shorthand form for the locale is used or the field is not present in the longhand form, the locale code will be used as the base HREF.  To disable automatic augmentation a base HREF value of an empty string (`""`) can be used.  This will prevent anything from being added to the existing base HREF.

For common scenarios, the shorthand form will result in the preferred and recommended outcome of each built locale variant of the application containing a defined base HREF  containing the locale code.
2019-12-04 08:14:16 -08:00
Alan Agius
ca4bdcac84 fix(@angular-devkit/core): retain order of types set in allOf, anyOf and oneOf when parsing schema
With this change we retain the order of types are declared in the schema.
Ex:
```json
"oneOf": [
  {
    "type": "boolean"
  },
  {
    "type": "string",
    "description": "The name of the migration to run."
  }
]
```

Currently this will result in:
```js
{ type: "string", types: ["string", "boolean"] }
```

This is because we use the order of types from the `allTypes` contant variable.a3a657f7e7/packages/angular_devkit/core/src/json/schema/utility.ts (L12)

Now this will result in:
```js
{ type: "boolean", types: ["boolean", "string"] };
```

The CLI parser will iterate over each type and will set a value of true if `--migrate-only` option is provided.

Related test in the CLL parser

1d105eb569/packages/angular/cli/models/parser_spec.ts (L34)

1d105eb569/packages/angular/cli/models/parser_spec.ts (L132-L138)
2019-11-15 10:43:07 -08:00
Charles Lyding
7e7248d9aa fix(@angular-devkit/core): allow multiselect list defaults
Fixes #16104
2019-11-12 11:53:14 -08:00
Alan Agius
613f7dbcd4 refactor(@angular-devkit/core): deprecate old terminal and resolve APIs 2019-10-22 13:26:52 -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
vikerman
2303a045ee feat(@angular-devkit/build-angular): add analytics for ivy/non-ivy builds
Look for `ngComponentDef` or `ngModuleDef` in the webpack analytics plugin
to report back whether the current build is built with Ivy enabled.
2019-10-02 12:06:38 -07:00
Keen Yee Liau
8497d9ac7b build: use import instead of require for fast-json-stable-stringify 2019-10-02 11:21:10 -07:00
Keen Yee Liau
5a2a055c4d build: g3 sync for angular_devkit
Fix all build errors in g3
2019-10-01 13:15:50 -07:00
Charles Lyding
08aa5c615e fix(@angular-devkit/core): json visitors should only set writable properties 2019-09-26 10:00:35 -07:00
Charles Lyding
2a689ff3ca feat(@angular-devkit/core): auto discover multiselect schema prompt types
If a prompt is present on a schema property and the type is an array with a set of enum values, then the prompt type is a list with multiselect capabilites.  This eliminates the need to specify the longhand form for typical multiselect prompts.
2019-09-11 10:08:23 -07:00
Alan Agius
26dd51221a style: collapse if statements (#15449) 2019-08-27 10:25:14 -07:00
Alan Agius
a6fbee6865 style: add no-invalid-await and prefer-promise-shorthand lint rules (#15450)
Add these two lint rules for a better code quality and readability
2019-08-27 10:24:58 -07:00
Charles
7f6ba9e001 fix(@angular-devkit/core): track workspace targets with no original collection (#15413)
Fixes #15403
2019-08-23 11:37:06 -07:00
Charles
b0b3212719 fix(@ngtools/webpack): cleanup more resources after modules are loaded (#15292)
* feat(@angular-devkit/core): support resetting a memory host

* fix(@ngtools/webpack): cleanup more resources after modules are loaded

Followup to #12994
2019-08-12 10:26:19 -07:00
Alan Agius
6f0e7bf437 fix(@angular-devkit/core): add schema defaults when value is undefined
Related to https://github.com/angular/angular-cli/pull/15207#discussion_r309175463
2019-08-02 13:41:45 -07:00
vikerman
5ef0846214 fix(@angular-devkit/architect): one more fix for newest version of rxjs 2019-07-02 12:46:30 -07:00