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.
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.
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.
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.
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.
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.
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
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.
Without this change, module names will be computed with incorrect paths containing duplicate path fragments (e.g. `@angular-devkit/architect/testing/testing/test-logger`).
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.
* refactor(@angular-devkit/architect): use standard node resolution methods where possible
* refactor(@angular-devkit/core): use standard node resolution methods where possible
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.
* 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`
* 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
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`