191 Commits

Author SHA1 Message Date
Alan Agius
44c1e6d0d2 refactor(@angular-devkit/schematics): remove deprecated analytics property
BREAKING CHANGE:

Deprecated `analytics` property has been removed from `TypedSchematicContext` interface
2022-01-28 11:01:52 -08:00
grant-wilson
68490f1553
docs: fix character code in expression example (#22564)
* docs: fix character code in expression example

Add '\' prefix so character code is rendered literally,
not as the character it represents.

* docs: format readme.md

Run `ng-dev format files` on readme.md.
2022-01-25 19:42:25 +01:00
Derek Cormier
c2737dd51a build: use placeholder version for stamping 2022-01-12 10:02:23 -08:00
Derek Cormier
4b5c52b0d8 build: perform package.json substitutions in bazel build 2022-01-10 10:25:49 -08:00
Derek Cormier
31801c1a1a build: reproduce original package structure using bazel 2021-12-10 11:06:41 +01:00
Doug Parker
eeccbcd82b build: update some types to be compatible with Node v14
See http://cl/406111801 with the google3 version of this change.
2021-10-29 13:00:03 +02:00
Kristiyan Kostadinov
b776d8d0d7 fix(@angular-devkit/schematics): handle zero or negative length removals in update buffer
This came up while fixing an issue in a Framework migration (https://github.com/angular/angular/pull/43776/files#diff-365738677fa9dfb9fb2c4fac7c75addb58e5a35182603e722e736cc3f24bbf5bR55). The `UpdateBuffer` stops recording changes if a removal with a zero length occurs. This doesn't appear to be an issue with `UpdateBuffer2`, but considering that the former is still being used and that the fix is trivial, I decided to proceed with it.

I've also aligned the behavior between `UpdateBuffer` and `UpdateBuffer2` when dealing with negative removals.
2021-10-11 10:24:01 +02:00
Charles Lyding
a7de97e485 build: add Bazel ts_library rule package_name properties to all packages
rules_nodejs 4 requires that a package_name property be specified within a ts_library rule for the output to be linked into the package repository. Failing to add the property can cause test failures due to unresolved packages.
2021-08-26 07:30:44 +02:00
Lukas Spirig
0565ed62eb feat(@angular-devkit/schematics): add UpdateBuffer2 based on magic-string
This PR adds UpdateBuffer2 which should eventually
replace UpdateBuffer. UpdateBuffer2 internally uses
the magic-string library.
UpdateBuffer and related symbols have been marked
as deprecated.

Closes #21110
2021-08-20 10:04:33 +01:00
Alan Agius
69b972fe6d refactor(@angular-devkit/schematics): replace usage of deprecated JSON parser with jsonc-parser 2021-08-16 10:01:04 -04:00
Alan Agius
8954d1152b feat(@angular-devkit/schematics): remove deprecated isAction
BREAKING CHANGE:

`isAction` has been removed without replacement as it was unused.
2021-08-10 15:57:08 +02:00
Alan Agius
93b541bb0c docs(@angular-devkit/schematics): replace template with templating section
Closes #11733
2021-08-05 18:41:13 +02:00
Alan Agius
214523d66c docs(@angular-devkit/schematics): remove no longer relevant schematics future work 2021-08-05 18:41:13 +02:00
Alan Agius
e78f6ab5d8 feat(@angular-devkit/build-angular): remove deprecated tslint builder
BREAKING CHANGE:

Deprecated `@angular-devkit/build-angular:tslint` builder has been removed. Use https://github.com/angular-eslint/angular-eslint instead.
2021-08-02 16:57:56 +01:00
Alan Agius
053b7d66c2 feat(@angular-devkit/schematics): remove deprecated tslint APIs
BREAKING CHANGE:

With this change we remove the following deprecated APIs
- `TslintFixTask`
- `TslintFixTaskOptions`

**Note:** this only effects schematics developers.
2021-08-02 16:57:56 +01: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
Charles Lyding
b3d7080147 build: enable esModuleInterop TypeScript option
The `esModuleInterop` option is recommended to be enable by TypeScript and corrects several assumptions TypeScript would otherwise make when importing CommonJS files.
This option change helps ensure compatibility as packages move towards ESM.
Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
2021-06-13 11:45:55 -04:00
Alan Agius
a30525b68b fix(@angular-devkit/schematics): handle updating renamed files
With this change we fix an issue which caused a file not found error when trying to modify the file after it was renamed.

Closes #14255 and closes #21083
2021-06-09 19:59:45 +02:00
Renovate Bot
137bbb7b49 build: update all non-major dependencies 2021-06-08 12:30:32 +02:00
Luca Vazzano
dcbfe5cd8f docs(@angular-devkit/schematics): properly escape code in Templating quick reference 2021-05-19 12:04:14 +02:00
Charles Lyding
f7dc97f40e refactor(@angular-devkit/schematics): allow use of a package manager's force option
This change allows consumers of the `NodeWorkflow` to configure the package installation task to use a package manager's `--force` option. This will be used by the `@angular/cli` update command when the update command's force option is used. This change is not intended to enable a schematic to adjust the force option.
2021-05-10 16:21:25 +01: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
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04: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
Renovate Bot
8862a9f07c build: update ora to version 5.4.0 2021-03-18 12:15:24 +01:00
Renovate Bot
02db14ae95 build: update rxjs to version 6.6.6 2021-02-25 13:59:51 -05:00
Alan Agius
aedfcc1862 build: update to @types/node version 12 2021-02-08 14:07:24 -05:00
Alan Agius
7169c74422 ci: update to build_bazel_rules_nodejs version 3
More info: https://github.com/bazelbuild/rules_nodejs/wiki#migrating-to-30
2021-02-02 07:45:29 +01:00
Charles Lyding
495459a8a3 fix(@angular-devkit/schematics): merge external schematics after execution
When an `externalSchematic` rule was used, the input tree was branched but never merged back into the input tree.  This resulted in a different tree instance being returned from the rule.  The `externalSchematic` rule now behaves like the `schematic` rule which merges the trees.
2021-02-01 10:30:15 +01:00
Charles Lyding
8688de462e fix(@angular-devkit/schematics): check merge ancestry of delegate & scoped trees
This change ensures correct merge behavior when a `HostTree` is wrapped in a `ScopedTree` or `DelegateTree`.  Previously the ancestry of the HostTree was not available to the merge.
2021-02-01 10:30:15 +01:00
Charles Lyding
76915409df refactor(@angular-devkit/schematics): allow customization of node workflow engine host
This adds an option to the NodeWorkflow to allow a custom NodeModulesEngineHost to be used with the workflow.
2021-01-28 12:44:34 +01:00
Mike Brocchi
a179828be3 fix(@angular-devkit/schematics): Fix merge that causes an overwrite
This fixes #11337 to allow for merging of a tree with another when the the file already exists in the tree being merged into.
2021-01-28 09:34:43 +01:00
Renovate Bot
62865f7710 build: update ora to version 5.3.0 2021-01-20 10:00:36 -05:00
Renovate Bot
36e08ffcd6 build: update ora to version 5.2.0 2020-12-29 12:13:39 +01:00
Alan Agius
1cd8aa61f4 refactor(@angular-devkit/schematics): replace NodePackageInstallTaskOptions class with interface
In this context this is not a breaking change for two reasons.

- `NodePackageInstallTaskOptions` is not exported.
- `NodePackageInstallTask` is using `NodePackageInstallTaskOptions` with `Partial` type which would cause the Class to become an object literal. This can be seen here: efb97c87f0/packages/schematics/angular/ng-new/index.ts (L81-L84)
2020-12-16 13:53:29 +00:00
Charles Lyding
9280d87650 refactor(@angular-devkit/schematics): allow direct workflow option transforms
This change allows option transforms to be directly provided to the NodeWorkflow instead of needing to access the engine host inside the workflow after creation.  This also allows option transforms to affect the options prior to schema validation (if enabled).
2020-11-16 13:14:24 -05:00
Charles Lyding
0b0961c9c2 refactor(@angular-devkit/schematics): minor cleanup to reduce utility imports 2020-10-21 09:05:45 +02:00
Charles Lyding
445fe1d4e6 fix(@angular-devkit/schematics): show active package manager with install task
The manager that is being used to perform the package installation will now be shown during the installation.  This provides more insight to the user as well as providing additional troubleshooting information in the event of a failure.
2020-10-19 20:12:08 +02:00
Alan Agius
ffed990258 refactor(@angular-devkit/build-angular): deprecate unused analytics property
TypedSchematicContext `analytics` property has been deprecated without replacement.
2020-10-13 12:47:06 -04:00
Alan Agius
fed47b00cb refactor(@angular-devkit/schematics): deprecate TslintFixTask and it's options option
As part of tslint deprecation we are also deprecated the TslintFixTask. Users should use `ng lint --fix` directly instead
2020-10-07 11:12:58 -04:00
Charles Lyding
34f769fcde refactor(@angular-devkit/schematics): use interface for NodeWorkflow options
This change removes the previously repeated type definitions for the options of the NodeWorkflow class.
2020-10-02 06:30:18 -04:00
Charles Lyding
5bc3616f30 feat(@angular-devkit/schematics): support schema validation in NodeWorkflow
This change provides an additional NodeWorkflow option `schemaValidation`.  When enabled, this new option will setup schema-based validation of a schematics options prior to schematic execution.  The schema registry provided with the NodeWorkflow is used to perform the validation.  This new option removes the need to manually configure validation of schematic options when initializing a schematic runtime.
2020-10-02 06:30:18 -04:00
Charles Lyding
017581cacb feat(@angular-devkit/schematics): allow using a root path with NodeWorkflow
This change allows the creation of a NodeWorkflow class with a path string instead of requiring a fully configured filesystem host object.  This reduces the amount of code necessary to setup a schematics runtime for common cases.
2020-10-02 06:30:18 -04:00
Charles Lyding
5ce621e371 fix(@angular-devkit/schematics): resolve external schematics from requesting collection
This change first attempts to resolve a schematic referenced via the external schematic rule from the requesting schematic collection.  This allows schematic packages that are direct dependencies of another schematic package to be used with the external schematic rule without manual package resolution code within the schematic.

Closes #18098
Closes #11026
2020-09-18 14:53:44 -05:00