375 Commits

Author SHA1 Message Date
Alan Agius
f209cb5545 test(@angular-devkit/core): update host tests to not use deprecated Jasmine behaviour
```
DEPRECATION: An asynchronous before/it/after function was defined with the async keyword but also took a done callback. This is not supported and will stop working in the future. Either remove the done callback (recommended) or remove the async keyword.
```
2021-05-31 12:48:18 +01:00
Alan Agius
06af7d7e7b fix(@angular-devkit/core): handle async schema validations 2021-05-31 12:48:18 +01:00
Alan Agius
9f85bc5625 fix(@angular-devkit/core): handle complex smart defaults in schemas 2021-05-31 12:48:18 +01:00
Alan Agius
600d266ca4 fix(@angular-devkit/core): show allowed enum values when validation on enum fails 2021-05-31 12:48:18 +01:00
Alan Agius
621938dd5e test(@angular-devkit/core): fix memory host spec
This previously caused an `UnhandledPromiseRejection` which caused tests not to run. But Jasmine, still reported success.

```
yarn bazel test //packages/angular_devkit/core:core_test --test_summary=detailed --test_output=all

INFO: Analyzed target //packages/angular_devkit/core:core_test (1 packages loaded, 10 targets configured).
INFO: Found 1 test target...
Target //packages/angular_devkit/core:core_test up-to-date:
  dist/bin/packages/angular_devkit/core/core_test.sh
  dist/bin/packages/angular_devkit/core/core_test_loader.js
  dist/bin/packages/angular_devkit/core/core_test_require_patch.js
INFO: Elapsed time: 0.327s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
PASSED: //packages/angular_devkit/core:core_test (see /private/var/tmp/_bazel_alanagius/5168427e57f204ca069c602aa7ed1931/execroot/angular_cli/bazel-out/darwin-fastbuild/testlogs/packages/angular_devkit/core/core_test/test.log)
INFO: From Testing //packages/angular_devkit/core:core_test
==================== Test output for //packages/angular_devkit/core:core_test:
(node:12829) UnhandledPromiseRejectionWarning: Error: Cannot find module '/private/var/tmp/_bazel_alanagius/5168427e57f204ca069c602aa7ed1931/execroot/angular_cli/node_modules/@angular-devkit/core/src/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:303:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (packages/angular_devkit/core/src/virtual-fs/host/memory_spec.ts:10:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Loader.requireShim [as require_] (node_modules/jasmine/lib/loader.js:35:3)
    at node_modules/jasmine/lib/loader.js:28:12
    at new Promise (<anonymous>)
    at Loader.load (node_modules/jasmine/lib/loader.js:27:12)
    at Jasmine.loadSpecs (node_modules/jasmine/lib/jasmine.js:91:23)
    at Jasmine.execute (node_modules/jasmine/lib/jasmine.js:267:3)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12829) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:12829) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
================================================================================
Test cases: finished with 1 passing and 0 failing out of 1 test cases

Executed 0 out of 1 test: 1 test passes.
```
2021-05-31 12:48:18 +01:00
Alan Agius
43926a21ba fix(@angular-devkit/build-angular): compile schema in synchronously
AJV only support a single schema with the same ID, compiling schemas async can cause a race condition were multiple schemas with the same name as compiled at the same time.

Closes #20847
2021-05-19 16:34:55 +02:00
Renovate Bot
2c7e5d9fc9 build: update all non-major dependencies 2021-05-18 13:15:00 +02:00
Renovate Bot
d279b12e61 build: update all non-major dependencies 2021-05-10 16:22:25 +01:00
Renovate Bot
24ca8b22ae build: update all non-major dependencies 2021-05-05 08:58:50 -04: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
Renovate Bot
8b34305777 build: update all non-major dependencies 2021-04-28 12:18:43 +02: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
09676c90a9 fix(@angular-devkit/core): improve handling of set schema values
Closes #20594
2021-04-23 07:22:47 +02:00
Alan Agius
08753138d3 feat(@angular-devkit/core): update schema validator
With this change we update ajv to version 8

BREAKING CHANGE: support for JSON Schema draft-04 and draft-06 is removed. If you have schemas using the `id` keyword replace them with `$id`. For an interim period we will auto rename any top level `id` keyword to `$id`.

**NB**: This change only effects schematics and builders authors.
2021-04-13 10:51:12 -04:00
Renovate Bot
c2c9a4169c build: update rxjs to version 6.6.7 2021-03-29 08:20:35 -06:00
Alan Agius
79856644b4 feat(@angular/cli): support TypeScript 4.2
BREAKING CHANGE

Drop support for TypeScript versions prior to 4.2.3
2021-03-17 19:32:01 +01:00
Alan Agius
8e981d0880 feat(@angular-devkit/core): add handling for defaultConfiguration target definition property 2021-03-08 08:45:54 -06:00
Charles Lyding
c2b7260f79 refactor(@angular-devkit/core): deprecate unused utility functions
The `clean` and `mapObject` utility functions are unused by the Angular CLI.
2021-03-03 09:18:40 -05:00
Renovate Bot
02db14ae95 build: update rxjs to version 6.6.6 2021-02-25 13:59:51 -05: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
Charles Lyding
5ba886cbb5 refactor(@angular-devkit/core): convert json schema registry to use async/await 2021-02-04 08:43:15 +01:00
Charles Lyding
5fc18efa6f test(@angular-devkit/core): allow asynchronous jobs to start execution before expect 2021-02-04 08:43:15 +01:00
Charles Lyding
3bb3c6cd51 fix(@angular-devkit/core): ensure job input values are processed in order
If schema validation happens to be asynchronous then the switchMap could cause loss of input values.
2021-02-04 08:43:15 +01:00
Alan Agius
f766fc1617 refactor(@angular-devkit/core): deprecate flatten schema method.
The flatten schema method has been deprecated without replacement.

Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original.

See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
2021-01-25 09:17:45 -06:00
Charles Lyding
d62441f183 feat(@angular-devkit/core): provide prompt validation errors to provider
This change provides the first schema validation error to a prompt provider when using a prompt definition's `validate` function.  This allows a prompt provider to show additional context to a user when an entered value is invalid.
2021-01-14 15:37:41 -05:00
Alan Agius
1f42e071b4 fix(@angular-devkit/core): correctly handle null prototype in deepCopy
Closes #19492
2020-11-30 11:18:13 +01:00
Charles Lyding
8874ef430a refactor(@angular-devkit/core): add generic type to Promise constructors
This is in preparation to support TypeScript 4.1.  Within TypeScript 4.1 constructed Promises must specify the resolved type.
2020-11-05 08:31:35 +01:00
Alan Agius
32581ef078 refactor(@angular-devkit/core): deprecate json parser
Use 3rd party JSON parsers such as `jsonc-parser` instead.
2020-11-05 08:31:02 +01: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
ae899935f6 refactor(@angular-devkit/core): remove unneeded clean utility function use
The reduce call can be used to directly filter undefined elements.
2020-10-26 10:13:59 -04:00
Charles Lyding
83c91204ed fix(@angular-devkit/core): allow prompt providers to access property types
This allows prompt providers to adjust their logic based on the type of property requested.
2020-10-21 16:37:11 +02: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
Renovate Bot
3a9b5123f4 build: update ajv to version 6.12.6 2020-10-12 11:03:44 -04:00
Alan Agius
c5a1b21f7c refactor(@angular-devkit/core): remove unused NgBuildBuildEventLog from NgCliAnalyticsDimensions 2020-10-07 13:18:30 -04:00
Charles Lyding
660f214f9a fix(@angular-devkit/core): remove deprecated isObservable function
BREAKING CHANGE:
Deprecated `isObservable` function removed.  As an alternative, use `isObservable` from the `rxjs` package.
NOTE: This change does not affect application development.
2020-10-07 13:18:15 -04:00
Alan Agius
db5c7776ac test(@angular-devkit/core): remove unused benchmark tests 2020-10-07 10:20:54 -04:00
Alan Agius
1b8fabfcc3 feat(@angular-devkit/core): add basic support for oneOf/anyOf to addUndefinedDefaults transformer 2020-09-25 20:32:35 +02:00
Joey Perrott
25aa2d5929 refactor: remove usages of the term whitelist 2020-09-24 00:07:10 +03:00
Renovate Bot
f20a250d07 build: update ajv to version 6.12.5 2020-09-13 20:04:03 -04:00
Keen Yee Liau
297fc923ab build: remove experimental build event protocol 2020-09-11 13:24:38 -04:00
Alan Agius
622d08447d refactor: use ansi-colors instead of removed terminal utils 2020-09-10 20:19:33 +02:00
Alan Agius
6d43e320b6 refactor(@angular-devkit/core): remove deprecated terminal utils
BREAKING CHANGE:

Deprecated `@angular-devkit/core` terminal API has been removed. Use 3rd party packages like chalk, colors or ansi-colors instead.

**Note:** this changes doesn't effect application developers
2020-09-10 20:19:33 +02:00
Renovate Bot
8dac017e23 build: update rxjs to version 6.6.3 2020-09-07 14:44:16 +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
Charles Lyding
8036c1c7f0 fix(@angular-devkit/core): allow property remove with workspace API
Removal changes were previously being improperly recorded with the wrong parent.  A property can now be directly removed by setting the value to undefined or by using the delete operator.
2020-08-31 11:58:28 +01:00
Charles Lyding
df70c7a857 refactor(@angular-devkit/core): remove experimental workspace API
BREAKING CHANGE:
The experimental workspace API has been removed from `@angular-devkit/core`.  This API was no longer used by the Angular CLI and was replaced with the stable workspace API also found within `@angular-devkit/core`. This change does not affect project code and is related to tooling infrastructure only.
2020-08-28 08:53:38 +01:00
Charles Lyding
3de6f48094 refactor(@angular-devkit/core): adjust types to support strict mode 2020-08-21 16:09:10 -04:00