129 Commits

Author SHA1 Message Date
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
Renovate Bot
8959be622f build: update ora to version 4.0.5 2020-07-20 11:46:04 +01:00
Renovate Bot
51a159d1c9 build: update rxjs to version 6.6.0 2020-07-02 11:00:00 +02:00
Charles Lyding
31c1c75bf9 refactor(@angular-devkit/schematics): remove deprecated sync test helpers
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.
2020-05-05 10:50:57 -07:00
Greg Magolan
be3d063422 build: exclude nested node_modules laid out by yarn workspaces from all globs 2020-04-30 15:12:46 -07:00
Filipe Silva
b51cf8d1e6 build: use ts_library macro with common defaults 2020-04-30 15:12:46 -07:00
Filipe Silva
9a28114f6b test: remove non-bazel test setup 2020-04-30 15:12:46 -07:00
Filipe Silva
eceb5cdaa6 build: use rules_nodejs 1.6.0 features
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.
2020-04-30 15:12:46 -07:00
Keen Yee Liau
e5db6a8ccd build: BUILD files formatted to have load statements at the top 2020-04-23 10:31:56 -07:00
Renovate Bot
a1c7220de1 build: update ora to version 4.0.4 2020-04-22 10:39:40 -07:00
Alan Agius
b1a5f49540 refactor(@angular-devkit/schematics): remove deprecated FileSystemHost
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.
2020-04-22 10:38:38 -07:00
Charles Lyding
98b3eb5b9e build: update rxjs to version 6.5.5 2020-04-15 13:17:31 -07:00
Filipe Silva
60e92d54fb style: reformat bazel files 2020-04-07 09:07:19 -07:00
Filipe Silva
ee24d32f71 fix(@angular-devkit/schematics): add module_name and data files 2020-04-07 09:07:19 -07:00
Filipe Silva
1e01d98ae2 build: workaround bazel module resolution bug
See https://github.com/bazelbuild/rules_nodejs/issues/313 for details.
2020-04-07 09:07:19 -07:00
Filipe Silva
5f3f736936 build: move BUILD.bazel files for secondary entry points into own folder
Without this change, module names will be computed with incorrect paths containing duplicate path fragments (e.g. `@angular-devkit/architect/testing/testing/test-logger`).
2020-04-07 09:07:19 -07:00
Filipe Silva
f2d2cd12c4 build: also produce tar.gz for bazel npm_package rules 2020-04-07 09:07:19 -07:00
Filipe Silva
b668cacd45 refactor: use BUILD.bazel instead of BUILD
Using an extension gives editors a chance to figure out the correct language syntax to use.
2020-04-07 09:07:19 -07:00
Charles Lyding
ea3d9e0285 fix(@angular-devkit/schematics): fully resolve schematic entries within packages
Fixes: #17085
2020-03-30 10:21:28 -07:00
Charles Lyding
33656f7aa8 fix(@angular-devkit/schematics): allow custom registry for node package task 2020-02-10 16:02:05 -08:00
Alan Agius
f635479cef build: update nodejs rules to 1.0+ 2020-01-27 11:03:51 -08:00
Renovate Bot
3ba89181bc build: update rxjs to version 6.5.4 2020-01-07 10:26:56 -08:00
arturovt
7e899a111f fix(@angular-devkit/schematics): fix the isBinary function
Closes: #13829
2020-01-02 11:26:28 -08:00
Renovate Bot
29a0ae3b1d build: update ora to version 4.0.3 2019-11-14 11:12:07 -08:00
Alan Agius
2aa73efa61 fix(@angular-devkit/schematics): only commit to disk when contents of file changes
Fixes: #16191
2019-11-14 11:10:19 -08:00
Filipe Silva
325dcd005f fix(@angular-devkit/schematics): show spinner for package install 2019-10-28 17:48:30 -07:00
Filipe Silva
4d23a0f0d8 fix(@angular-devkit/schematics): hide install output by default
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.
```
2019-10-28 17:48:30 -07:00
Charles Lyding
5df776780d fix(@angular-devkit/schematics): use NodeWorkflow root to resolve collections 2019-10-28 17:48:08 -07:00
Alan Agius
341b18d8a6 refactor(@angular-devkit/schematics): remove several deprecated APIs
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.
2019-10-24 16:02:21 -07:00
Alan Agius
e31d5d89b7 build: update bazel packages 2019-10-24 12:05:25 -07:00
Alan Agius
70e460d656 refactor: use require.resolve instead of custom resolve (#15906) 2019-10-23 09:59:36 -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
Alan Agius
ab5b1909d6 build: update rxjs to 6.5.3 2019-09-24 13:18:09 -07:00
Alan Agius
26dd51221a style: collapse if statements (#15449) 2019-08-27 10:25:14 -07:00
Simon Jespersen
0824e8beee refactor(@angular-devkit/schematics): remove optimize from host-tree
Remove unused optimize method marked for removal in version 7.0
2019-08-15 09:55:11 -07:00
Filipe Silva
e8dff5718f build: update to TS 3.5 2019-07-29 10:15:23 -07:00
Alan Agius
15ef15e94a style: remove redundant max-line-length disables and fix other lint issues 2019-07-24 19:06:21 -07:00
Minko Gechev
d274add7b4
fix(@angular/cli): use correct schematic defaults considering workspace (#15041)
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.
2019-07-16 09:58:01 -07:00
c4605
3aee401397 fix(@angular-devkit/schematics): fix use install subcommand when override package manager to yarn 2019-06-26 11:21:09 -07:00
ukrukarg
ba44d944b0 feat(@angular-devkit/schematics): Add registerCollection to SchematicsTestRunner
Fixes #14833
2019-06-20 10:57:24 -07:00
Alan Agius
bebd8b6c09 refactor: use standard node resolution and use async/await instead of rxjs 2019-06-06 14:07:37 -07:00
Paul Gschwendtner
a57f053867 fix(@angular/cli): ng-update migrations not running with --migrate-only
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00909 (diff-0d0a748fb9a38a7ccde08d9b42e70bce) as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.

Fixes #14565
2019-05-30 10:19:16 -07:00
Charles Lyding
2172db1ed0 fix(@angular-devkit/schematics): deprecate synchronous testing methods
All schematics can potentially be async.  The synchronous test method variants (`runSchematic`/`runExternalSchematic`) will fail if the schematic, any of its rules, or any schematic it calls are async.
2019-05-15 14:10:27 -07:00
Charles Lyding
48e6060e02 fix(@angular-devkit/schematics): use rxjs version of isObservable 2019-05-13 15:57:54 -07:00
Keen Yee Liau
816d23ba82 build: fix external block in BUILD files 2019-05-09 13:19:53 -07:00
Charles Lyding
3fc520278c refactor(@angular-devkit/schematics): update rxjs usage in rules
rxjs has improved over time and this updates the rules to take advantage of improvements where applicable.
2019-05-09 10:11:32 -07:00
Keen Yee Liau
2af2b670f8 fix(build): fix Bazel lint errors 2019-05-07 20:02:34 -07:00
Keen Yee Liau
f606a548bf
Update BUILD 2019-05-07 19:08:09 -07:00
clydin
4177b563c5 refactor(@angular-devkit/schematics): minor rule cleanup (#14313) 2019-05-07 12:35:57 -06:00