63 Commits

Author SHA1 Message Date
Alan Agius
93adeeb798 refactor: move experimental jobs API from @angular-devkit/core to @angular-devkit/architect
With this change we move `jobs` APIs to `@angular-devkit/architect` as this are intended to used with `@angular-devkit/architect`.
2022-10-07 11:09:53 -04:00
Jason Bedard
4de9045de8 test: unit test multiple node versions in separate jobs 2022-09-14 10:43:17 -07:00
Charles Lyding
b2add316e7 build: remove unneeded BUILD file licenses rule comments 2022-09-13 10:33:49 -07:00
Charles Lyding
e402c2358c build: adjust BUILD file external comment markers
Improvements to the syncing process allow for reduced usage of the comment markers.
2022-08-31 08:37:19 -04:00
Alan Agius
4368c85983 refactor: remove unused local variables 2022-08-12 08:19:26 -04:00
Jason Bedard
db5c1fc13c test: run tests on multiple node versions 2022-08-03 10:33:46 -07:00
Charles Lyding
2edb2a0508 refactor(@angular-devkit/core): assert catch clause variable type before usage
Prepares the `@angular-devkit/core` package for the eventual change of enabling the
TypeScript `useUnknownInCatchVariables` option. This option provides additional
code safety by ensuring that the catch clause variable is the proper type before
attempting to access its properties. Similar changes will be needed in the other
packages in the repository prior to enabling `useUnknownInCatchVariables`.
2022-06-14 11:28:21 +02:00
Alan Agius
4b4cecf88f test: update tests to work with Jasmine version 4
These changes include fixes to tests, timeout and stop of architect to make tests work with Jasmine 4.

One noticeable change that when we didn't stop architect through `run.stop()` this causes Bazel to timeout now.

Example
```
-- Test timed out at 2022-03-24 12:07:07 UTC --
/private/var/tmp/_bazel_alanagius/5168427e57f204ca069c602aa7ed1931/sandbox/darwin-sandbox/398/execroot/angular_cli/bazel-out/darwin-fastbuild/bin/packages/angular_devkit/build_angular/build_angular_browser_test.sh.runfiles/angular_cli/packages/angular_devkit/build_angular/build_angular_browser_test.sh: line 424: 41835 Terminated: 15          "${node}" ${LAUNCHER_NODE_OPTIONS[@]+"${LAUNCHER_NODE_OPTIONS[@]}"} ${USER_NODE_OPTIONS[@]+"${USER_NODE_OPTIONS[@]}"} "${MAIN}" ${ARGS[@]+"${ARGS[@]}"} 0<&0
```
2022-03-24 14:41:26 +01:00
Alan Agius
4ebfe03415 feat(@angular/cli): drop support for Node.js 12
Node.js v12 will become EOL on 2022-04-30. As a result, Angular CLI v14 will no longer support Node.js v12.

BREAKING CHANGE:

Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.
2022-03-04 22:38:45 +01:00
Alan Agius
a0c02af7e3 refactor(@angular-devkit/core): remove deprecated fs, object and array APIs
BREAKING CHANGE:

The below APIs have been removed without replacement. Users should leverage other Node.js or other APIs.
- `fs` namespace
- `clean`
- `mapObject`
2022-01-31 11:35:18 -08:00
Alan Agius
a169f26513 refactor(@angular-devkit/core): use chokidar types instead of custom interface
Replace `ChokidarWatcher` with types from `chokidar`
2021-10-09 07:04:18 +02:00
Charles Lyding
a54e5e0655 fix(@angular-devkit/core): support Node.js v16 with NodeJsSyncHost/NodeJsAsyncHost delete operation
The `NodeJsSyncHost`/`NodeJsAsyncHost` classes' `delete` method uses `fs.rmdirSync`/`fs.rmdir` to delete directories. However, Node.js v16's `fs.rmdirSync`/`fs.rmdir` will now throw an `ENOENT` error if the path does not exist. `fs.rmSync`/`fs.rm` is now the preferred option when using Node.js v16 but since this function is not available on Node.js v12 both are tried with `fs.rmSync`/`fs.rm` given preference.
Once Node.js 12 support is dropped, the `delete` method could potentially be refactored to avoid the `isDirectory` check and only use `fs.rmSync`/`fs.rm` which supports both files and directories.
2021-10-06 06:11:09 -05:00
Charles Lyding
1cb07caddc build: transition from ts-api-guardian to dev-infra api-golden utility
The dev-infra tooling now directly provides public API change testing capabilities that leverage the `api-extractor` utility. These new testing capabilities are shared with framework and components.
`ts-api-guardian` has been removed as a dependency as a result.
2021-07-21 14:55:18 -07:00
Charles Lyding
222e711136 build: add secondary entrypoint package.json files to packages
The new public API tooling searches for nested package.json files to determine the location of secondary entrypoints. All secondary entrypoints for the CLI related packages now contain a secondary entrypoint package.json file.
The internal monorepo package discovery script was also updated to support the presence of the nested package.json files.
2021-07-21 14:55:18 -07:00
Charles Lyding
9afe185fc6 build: enable noImplicitOverride TypeScript option
The `noImplicitOverride` TypeScript option improves code quality by ensuring that properties from base classes are not accidentally overriden.
Reference: https://www.typescriptlang.org/tsconfig#noImplicitOverride
2021-07-02 06:40:36 -04:00
Alan Agius
1dd3bda57f test: fix failing tests which were not shown
Previously when an unhandled error occured Bazel would mark the suit as passed instead of failed.

See: https://togithub.com/bazelbuild/rules_nodejs/commit/3c4ef58
2021-06-10 16:25:19 +02:00
why520crazy
966c0aebbc fix(@angular-devkit/core): transform path using getSystemPath for NodeJsAsyncHost's exists method 2021-06-02 09:16:19 +02:00
Alan Agius
e992c9a70b build: update files to be fix eslint header/header failures 2021-05-04 09:59:40 -04:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Alan Agius
e79e7dd8d4 refactor(@angular-devkit/core): refactor NodeJsAsyncHost to use FS promises 2021-02-08 14:07:24 -05:00
Alan Agius
aedfcc1862 build: update to @types/node version 12 2021-02-08 14:07:24 -05:00
Alan Agius
caad431271 refactor(@angular-devkit/core): clean up NodeJsAsyncHost and NodeJsSyncHost
- Remove redundant try/catch block
- Use `mkdir` with `recursive: true` instead of custom implementation
2020-10-30 10:17:27 -05:00
Charles Lyding
b6a3353edb refactor(@angular-devkit/core): deprecate unused isFile/isDirectory utilities
`isFile` and `isDirectory` are tooling only APIs for Node.js that are no longer used by the Angular CLI.
2020-10-20 18:47:35 +02:00
Alan Agius
622d08447d refactor: use ansi-colors instead of removed terminal utils 2020-09-10 20:19:33 +02:00
Alan Agius
208336dee0 refactor(@angular-devkit/core): remove resolve methods and options
BREAKING CHANGE: deprecated API's `ModuleNotFoundException`, `ResolveOptions`, `resolve` have been removed. Use `MODULE_NOT_FOUND` and `require.resolve` instead.

**Note**: this change only effect users using `@angular-devkit/core` public API and not application developers.
2020-09-03 00:20:12 +03:00
Doug Parker
5dc60f13c3 refactor(@angular-devkit/core): fix strict typing errors in node/
This fixes a few error surfaced by adding `"strict": true` to `tsconfig.json`.
* `_callFs(fs.readdir, /* ... */)` needs explicit types because `fs.readdir` has a few overloads, which was confusing type inference.
* `TempScopedNodeJsSyncHost._sync` is an uninitialized property, but it was already being checked for `undefined`, so I simply made its type optional.
* `TempScopedNodeJsSyncHost.files` had an incorrect type assertion, but was otherwise correct. I just removed the assertion and let type inference do the trick.
2020-08-20 20:36:02 -04:00
Alan Agius
3e76676fe1 test: disable resolve global test which fails under bazel
This test currently fails under Bazel. `Expected function not to throw, but it threw Error: Could not find module "npm" from "/"..`

NB: The resolve method is deprecated
2020-08-19 16:00:07 +02:00
Alan Agius
d1adba1347 build: update build_bazel_rules_nodejs to 2.0.2 2020-08-19 16:00:07 +02:00
santoshyadavdev
dfef55e3f7 refactor(@angular-devkit/core): remove any types 2020-08-18 16:32:42 +02: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
Filipe Silva
60e92d54fb style: reformat bazel files 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
Sachin Grover
54b79ade65 fix(@angular-devkit/core): Rename to a non-existing dir
Added unit test and requested changes.
Fixes #16484
2020-02-07 08:29:40 -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
b0dcfd08a0 fix(@angular/cli): logic to determine if the installed CLI is out of date
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.
2019-10-22 13:13:54 -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
ef360dd7f8 refactor(@angular-devkit/architect): use standard node resolution methods where possible (#15622)
* refactor(@angular-devkit/architect): use standard node resolution methods where possible

* refactor(@angular-devkit/core): use standard node resolution methods where possible
2019-09-18 14:49:22 +01:00
Charles Lyding
225cd36f49 fix(@angular-devkit/core): NodeJSAsyncHost.isFile should check for a file 2019-05-09 10:09:51 -07:00
Alan Agius
8fcf9a4401 fix(@angular-devkit/core): host.delete() completes but never emits
RxJS `EMPTY` creates an Observable that emits no items immediately emits a complete notification.

Fixes #14235
2019-04-23 08:03:35 -07:00
Alex Eagle
eb5643e370 feat(@angular-devkit/core): Remove dep on chokidar
It is unused within our code, as webpack will do the file watching.
This removes 1.4 MB from the download size of the package.
See https://codepen.io/alexeagle/full/zbZWRM

BREAKING CHANGE:
Users who rely on angular-devkit/core to do the file watching must add chokidar to their devDependencies.
2019-03-13 13:53:53 -07:00
Alan Agius
ae13974f1d build: update to rxjs 6.4 2019-02-26 08:33:48 -08:00
Charles Lyding
d849834445 feat(@angular-devkit/core): support console logger color customization 2019-02-15 08:01:41 -08:00
Hans Larsen
c4798b69d6 refactor(@angular-devkit/core): move core/node experimental files to own directory
It's just cleaner that way.
2019-02-07 15:57:48 -08:00
Alan Agius
2ed1719eaa fix(@angular-devkit/core): remove colors for info messages
Rely on the terminal to provide the color for info messages

fixes #13497
2019-01-23 10:37:51 -08:00
Mikel Ward
7d15c5dd02 fix(@angular-devkit/core): Make default and info log messages use default colors
Previously, we set the color to white, which is (nearly) invisible on
terminals with a white background.

Fixes #13439.
2019-01-15 17:10:22 -08:00