53 Commits

Author SHA1 Message Date
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
Hans
a3a657f7e7 feat(@angular-devkit/core): Jobs API added
See the README for more details about usage.
2018-12-14 10:55:04 -08:00
Hans
6bf80edf54 ci: add golden-api file for core/node
This is necessary as we introduce namespaces in jobs.
2018-12-14 10:55:04 -08:00
Alan Agius
717b02f533 ci: add ts api guardian (#12010)
* refactor: fix `import` and `export` paths to work with classic resolution

`ts-api-guardian` only support classic module resolution which means that we need to specify `index` so that the resolution works.

* build: add `npm_package` to packages

* build: add ts-api-guardian to repo

* test: add api golden files

* refactor: use proper namespace instead of alias export

* refactor: use proper namspace einstead of alias export

* build: add `_golden_api` files

At the moment ts api guardian doesn't support aliased symbols as namespaces, this is a workaround to still have namespaced symbols in the final golden file.

* build: update angular archive for workspace

* test: fix reference to `TestHost` to use namespace

* refactor: create `fs` namespace instead of aliased export

* test: update api golden file for `@angular-devkit/core/node`
2018-11-30 11:53:54 -08:00
Alan Agius
bd4dc38359 refactor: use createConsoleLogger and remove duplicate code (#12787) 2018-11-08 10:30:41 -08:00
Alan Agius
6e0b60df32 fix(@angular/cli): errors and warnings are hard to read in windows cmd (#12767)
* fix(@angular-devkit/core): errors and warnings are hard to read in windows cmd

Closes #12755

* fix(@angular/cli): errors and warnings are hard to read in windows cmd

Closes #12755
2018-10-31 21:03:03 -07:00
Keen Yee Liau
a3b05a0283 build: Use fine-grained node_module deps
This commit updates the BUILD files to specify fine-grained node_module deps
by replacing "@typings" comments with actual @npm node module.

Moved tools/bazel.rc -> .bazelrc

Removed "jasmine" typings from base tsconfig.json

Added @bazel/karma to devDependencies, needed for `ts_web_test`
2018-10-31 20:56:27 -07:00
Alan Agius
04ed3010b2 feat(@angular-devkit/core): createConsoleLogger now accepts 2 parameters to add custom stdout and stderr 2018-09-18 11:33:11 -07:00
Charles Lyding
d202480a17 build: update/cleanup tslint rules & fix errors 2018-08-23 11:35:34 -07:00
Filipe Silva
9720077a4b build: make resolution logic compatible with Bazel 2018-08-22 16:36:10 -07:00
Filipe Silva
b9a8fd1392 fix(@angular-devkit/core): propagate node host delete errors 2018-07-05 11:43:11 -04:00