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`.
BREAKING CHANGE
Deprecated `SchematicTestRunner.runSchematic` and `SchematicTestRunner.runExternalSchematic` have been removed. Use `SchematicTestRunner.runSchematicAsync` or `SchematicTestRunner.runExternalSchematicAsync` instead.
Note: this change only effects direct `@angular-devkit/schematics` users and not the application developers.
BREAKING CHANGE
Deprecated and outdated optimization passes class fold and import tslib have been removed.
Note: This change only effects direct @angular-devkit/schematics users and not the application developers.
Contains fixes related to the symlink behaviour inside of bazel. Without it, webpack needs to be configured to be aware of symlinks and preserve the paths.
BREAKING CHANGE
Deprecated `FileSystemHost` has been removed. Use `Host` directly instead.
Note: this change only effects direct `@angular-devkit/schematics` users and not the application developers.
Current output:
```
kamik@RED-X1C6 MINGW64 /d/sandbox/latest-app (master)
$ ng update @angular/cli --next --force
Using package manager: 'yarn'
Collecting installed dependencies...
Found 30 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-angular" has a missing peer dependency of "@angular/localize" @ "^9.0.0-next.11".
Updating package.json with dependency @angular/cli @ "9.0.0-next.15" (was "9.0.0-next.14")...
Updating package.json with dependency @angular-devkit/build-angular @ "0.900.0-next.15" (was "0.900.0-next.14")...
Updating package.json with dependency typescript @ "3.6.4" (was "3.5.3")...
UPDATE package.json (1353 bytes)
warning @angular-devkit/build-angular@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/build-optimizer@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @ngtools/webpack@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/architect@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/build-webpack@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/core@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular/cli@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @schematics/update@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/schematics@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @schematics/angular@9.0.0-next.15: The engine "pnpm" appears to be invalid.
Compiling @angular/animations : es2015 as esm2015
Compiling @angular/compiler/testing : es2015 as esm2015
Compiling @angular/core : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/animations/browser : es2015 as esm2015
Compiling @angular/animations/browser/testing : es2015 as esm2015
Compiling @angular/core/testing : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/common/testing : es2015 as esm2015
Compiling @angular/platform-browser/testing : es2015 as esm2015
Compiling @angular/platform-browser/animations : es2015 as esm2015
Compiling @angular/common/http : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling @angular/forms : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Compiling @angular/common/http/testing : es2015 as esm2015
Compiling @angular/router/testing : es2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
```
New success output:
```
kamik@RED-X1C6 MINGW64 /d/sandbox/latest-app (master)
$ ng update @angular/cli --next --force
Using package manager: 'yarn'
Collecting installed dependencies...
Found 30 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-angular" has a missing peer dependency of "@angular/localize" @ "^9.0.0-next.11".
Updating package.json with dependency @angular/cli @ "9.0.0-next.15" (was "9.0.0-next.14")...
Updating package.json with dependency @angular-devkit/build-angular @ "0.900.0-next.15" (was "0.900.0-next.14")...
Updating package.json with dependency typescript @ "3.6.4" (was "3.5.3")...
UPDATE package.json (1353 bytes)
Installing packages...
Packages installed successfully.
```
New error output:
```
kamik@RED-X1C6 MINGW64 /d/sandbox/latest-app (master)
$ ng update @angular/cli --next --force
Using package manager: 'yarn'
Collecting installed dependencies...
Found 30 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-angular" has a missing peer dependency of "@angular/localize" @ "^9.0.0-next.11".
Updating package.json with dependency @angular/cli @ "9.0.0-next.15" (was "9.0.0-next.14")...
Updating package.json with dependency @angular-devkit/build-angular @ "0.900.0-next.15" (was "0.900.0-next.14")...
Updating package.json with dependency typescript @ "3.6.4" (was "3.5.3")...
UPDATE package.json (1353 bytes)
Installing packages...
warning @angular-devkit/build-angular@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/architect@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/build-optimizer@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @ngtools/webpack@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/core@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/build-webpack@0.900.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular/cli@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @schematics/angular@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @angular-devkit/schematics@9.0.0-next.15: The engine "pnpm" appears to be invalid.
warning @schematics/update@0.900.0-next.15: The engine "pnpm" appears to be invalid.
Compiling @angular/animations : es2015 as esm2015
Compiling @angular/compiler/testing : es2015 as esm2015
Compiling @angular/core : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/animations/browser : es2015 as esm2015
Compiling @angular/animations/browser/testing : es2015 as esm2015
Compiling @angular/core/testing : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/common/testing : es2015 as esm2015
Compiling @angular/platform-browser/testing : es2015 as esm2015
Compiling @angular/platform-browser/animations : es2015 as esm2015
Compiling @angular/common/http : es2015 as esm2015
Compiling @angular/forms : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Compiling @angular/common/http/testing : es2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
Compiling @angular/router/testing : es2015 as esm2015
Package install failed, see above.
```
BREAKING CHANGE:
Removed several deprecated APIs:
- EngineHost `listSchematics` has been removed in favour of `listSchematicNames`.
- `FileSystemSink` - Use the new virtualFs.Host classes from `@angular-devkit/core`.
- `optimize` function has been remove as trees are automaticlly optimized.
- `DryRunSink` deprecated constructor that allowed to provide a directory path has been removed. Provide a `virtualFs.Host` instead.
With this change we now check if the current CLI version is the latest published version. If it is not, we install a temporary version to run the `ng update` with.
* 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`
* refactor(@angular-devkit/architect): use standard node resolution methods where possible
* refactor(@angular-devkit/core): use standard node resolution methods where possible
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.
* feat(@angular-devkit/core): support resetting a memory host
* fix(@ngtools/webpack): cleanup more resources after modules are loaded
Followup to #12994
Fix#14986
This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.
We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.
Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.
An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
Node.js versions prior to 11 used an unstable sort for arrays with a length greater than 10. This caused the prompt order of a schematic with more than 10 prompts to be inconsistent with the content of the file and the same schematic with several of the prompts removed. Since priorities were never fully implemented and property dependencies will most likely be used at a higher level instead, the underlying elements have been removed with this change.
Fixes#14402
Schematics context now have an (optional) analytics field that, if set,
should be used to report usage. This can be set even in some cases where
analytics is disabled (to a noop analytics).
Currently, all third-party schematic developers are forced to use and directly depend on `rxjs` if any logic is asynchronous. Doing so can can also add overhead and unneeded complexity for organizations that have chosen to standardize on async/await usage. This change allows such parties to rely on native promise support if desired.
The new API has been described in this design doc:
https://docs.google.com/document/d/1SpN_2XEooI9_CPjqspAcNEBjVY874OWPZqOenjuF0qo/view
This first drafts add support for the API (given some deep imports). It is
still in draft mode but is committed to make it available to people to
start testing and moving their own builders.
This API rebuilds (not backward compatible) the Architect API package. To
use it people will need to import "@angular-devkit/architect/src/index2"
to start using it. A reference builder will be added in the next commit.
There are 2 pieces missing from this commit that will be added in the
same PR; 1) the architect-host and CLI to test, and 2) a reference
builder moved from the old API to the new one. These will be part of
the same PR.
Finally, there are missing tests in this package, but everything tested
manually and automatically works so far. Test coverage will be added
before the package is considered finished.
Due to a desire to keep architect, our tests and the scope of this PR
limited and keep the two APIs separated, every clashing files will
have a "2" suffix added to it. Once all builders have been moved and
we are sure everything works, all those files will be moved to their
final destination and the old API will be removed, in one PR.