353 Commits

Author SHA1 Message Date
Angular Robot
d55eada6c2 build: update all non-major dependencies 2022-07-25 16:33:08 +02:00
Alan Agius
e995bdad32 fix(@schematics/angular): prevent numbers from class names
With this change we prevent creating classes with invalid characters.

Closes #12868
2022-07-21 19:18:48 -04:00
Charles Lyding
c9b2aa41da fix(@schematics/angular): Allow skipping existing dependencies in E2E schematic
The E2E schematic will now (as it did previously) skip adding dependencies
if they already exist within the `package.json` regardless of the specifier.
This is accomplished with the `existing` option for the `addDependency` rule
which allows defining the behavior for when a dependency already exists.
Currently the two option behaviors are skip and replace with replace being
the default to retain behavior for existing rule usages.
2022-07-19 13:29:37 -04:00
Angular Robot
0a990c525a build: update all non-major dependencies 2022-07-14 15:21:03 -07:00
Charles Lyding
b8bf3b480b fix(@schematics/angular): only issue a warning for addDependency existing specifier
When using the `addDependency` helper rule, a package specifier mismatch will
now result in a warning instead of an error. This prevents the potential
for breaking changes in schematics that previously allowed the behavior.
The warning will also display the existing and new specifiers to better inform
the schematic user of the outcome of the schematic.
2022-07-13 11:58:37 -07:00
Alan Agius
624e0b0ec6 fix(@angular-devkit/core): provide actionable warning when a workspace project has missing root property
The `root` property is required in a workspace project. Now we issue an actionable warning message when this is missing.

Note: this will become an error in the next major version.

Closes: #21310
2022-07-08 15:57:51 +02:00
renovate[bot]
04160c58ce build: update all non-major dependencies 2022-06-27 08:15:08 -04:00
Charles Lyding
bb43e0a7c4 test(@schematics/angular): update several tests to use async expectations
Using Jasmine's `expectAsync` allows for reduced test code when testing that
a function returning a promise rejects with a specific error.
2022-06-14 11:28:21 +02:00
Doug Parker
3bce5da1c2 docs: fix typo in latest versions package.json 2022-06-02 14:33:08 -07:00
Renovate Bot
a28f4b3423 build: update dependency karma-jasmine-html-reporter to v2 2022-05-26 18:03:31 +02:00
Charles Lyding
707911d423 feat(@schematics/angular): support controlling addDependency utility rule install behavior
When using the `addDependency` rule from `@schematics/angular/utility` a new option is now
available that supports controlling the rule's behavior when scheduling the `NodePackageInstallTask`.
Previously, the behavior was automatic and the rule would only schedule the task if it was not already
scheduled by a previous `addDependency` rule usage for the `package.json`. This behavior is still the
default behavior. However, it can now be customized per rule invocation via the `install` rule option
which can be either `InstallBehavior.None`, `InstallBehavior.Auto`, or `InstallBehavior.Always`.
2022-05-25 11:24:39 -07:00
Charles Lyding
c3821caf98 refactor(@schematics/angular): use updated utilities in E2E schematic
Updates the E2E schematic to use the workspace and dependency utility rules exported from `@schematics/angular/utility`.
This change also removes the use of the custom path manipulation functions from `@angular-devkit/core`.
The development dependency versions for `protractor` and `jasmine-spec-reporter` are also moved to the latest
versions helper `package.json` file. This move allows the versions to be automatically updated via renovate
instead of hardcoded in the schematic source code.
2022-05-25 11:24:18 -07:00
Kristiyan Kostadinov
d2e9edd463 build: update to TypeScript 4.7 final
Bumps up the TypeScript 4.7 for our own build as well as any newly-created apps.
2022-05-25 11:15:46 -07:00
Renovate Bot
790a1711bf build: update all non-major dependencies 2022-05-24 09:59:55 -07:00
Kristiyan Kostadinov
0301cf6c10 build: prepare TypeScript 4.7
Expands the version range to allow TypeScript 4.7 and makes the necessary code changes in order to support it.
2022-05-06 15:51:02 -07:00
Charles Lyding
1b2b8d96e5 refactor(@schematics/angular): track E2E ts-node version with latest-versions utility
This change allows renovate to automatically manage the dependency updates for the `ts-node` package used by the E2E schematic.
2022-05-06 11:00:55 -07:00
Charles Lyding
b07ccfbb1b feat(@schematics/angular): introduce a utility subpath export for Angular rules and utilities
The `@schematics/angular` package now contains a defined set of package `exports` including a `utility` subpath export.
A wildcard export is also temporarily defined to support transition away from existing deep-import usage.
The `@schematics/angular/utility` subpath export will contain supported utility methods used by the first-party schematics
contained within the `@schematics/angular` package and can be considered public API that will follow SemVer stability constraints.
The first group of utilities introduced in this change are used to modify the `angular.json` workspace file
within the schematics and include the `updateWorkspace` rule and `readWorkspace`/`writeWorkspace` helpers.
2022-05-03 14:04:47 -07:00
Charles Lyding
3fa38b08ba feat(@schematics/angular): introduce addDependency rule to utilities
An `addDependency` schematics rule has been added to the newly introduced `utility` subpath export for the `@schematics/angular` package.
This new rule allows for adding a package as a dependency to a `package.json`. By default the `package.json` located
at the schematic's root will be used. The `packageJsonPath` option can be used to explicitly specify
a `package.json` in a different location. The type of the dependency can also be specified instead
of the default of the `dependencies` section by using the `type` option for either development or peer dependencies.
2022-05-03 12:23:26 -07:00
Kristiyan Kostadinov
7b78b7840e feat(@schematics/angular): add --standalone to ng generate
Adds the `--standalone` flag when generating components, directives or pipes through `ng generate`.
2022-04-27 15:33:48 -04:00
Charles Lyding
a0e3de2b5f refactor(@schematics/angular): use Tree's newly introduced readText and readJSON functionality
Code related to decoding buffers into strings and parsing content into JSON can now be removed by using the
support provided directly from the Tree instance for the executing schematic.
2022-04-26 19:24:55 -04:00
Charles Lyding
ccd7e71a47 refactor(@schematics/angular): minor cleanup of unneeded @angular-devkit/core imports
Several imported types and values from `@angular-devkit/core` could be removed while still
maintaining the same functionality. This further reduces the schematics direct dependence
on the `@angular-devkit/core` package.
2022-04-22 11:31:53 -04:00
Charles Lyding
291bbffcc9 refactor(@schematics/angular): use string helper re-export from @angular-devkit/schematics
By using the `strings` re-export from `@angular-devkit/schematics` instead of from `@angular-devkit/core`,
the number of imports from `@angular-devkit/core` has been reduced and lowers the direct dependency count
for many of the individual schematics.
2022-04-22 11:31:53 -04:00
Renovate Bot
c636cc8a2a build: update dependency karma-jasmine to v5 2022-04-14 13:05:09 +02:00
Renovate Bot
95954bba04 build: update all non-major dependencies 2022-04-12 10:37:05 -07:00
Alan Agius
7db433bb06 fix(@schematics/angular): provide actionable error message when routing declaration cannot be found
Due to incorrect castings previously the code would crash when the module doesn't contain an routing module with the following error:

```
Cannot read property 'properties' of undefined
```

Closes #21397
2022-04-04 10:03:40 -04:00
Renovate Bot
53771e18b5 build: update dependency @types/jasmine to v4 2022-03-24 14:18:44 +01:00
Alan Agius
366cabc66c feat(@angular/cli): add support for multiple schematics collections
The `schematicCollections` can be placed under the `cli` option in the global `.angular.json` configuration, at the root or at project level in `angular.json` .

```jsonc
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "cli": {
    "schematicCollections": ["@schematics/angular", "@angular/material"]
  }
  // ...
}
```

**Rationale**
When this option is not configured and a user would like to run a schematic which is not part of `@schematics/angular`,
the collection name needs to be provided to `ng generate` command in the form of `[collection-name:schematic-name]`. This make the `ng generate` command too verbose for repeated usages.

This is where `schematicCollections` comes handle. When adding `@angular/material` to the list of `schematicCollections`, the generate command will try to locate the schematic in the specified collections.

```
ng generate navigation
```

is equivalent to:

```
ng generate @angular/material:navigation
```

**Conflicting schematic names**
When multiple collections have a schematic with the same name. Both `ng generate` and `ng new` will run the first schematic matched based on the ordering (as specified) of `schematicCollections`.

DEPRECATED:

The `defaultCollection` workspace option has been deprecated in favor of `schematicCollections`.

Before
```json
"defaultCollection": "@angular/material"
```

After
```json
"schematicCollections": ["@angular/material"]
```

Closes #12157
2022-03-22 09:37:57 -07:00
Alan Agius
9ddb220c3d docs: replace app with application 2022-03-14 10:03:06 -04:00
Alan Agius
7fa3e65879 feat(@angular/cli): support TypeScript 4.6.2
BREAKING CHANGE:

Support for TypeScript 4.4 and 4.5 has been removed. Please update to TypeScript 4.6.
2022-03-10 15:36:19 -05:00
Alan Agius
90a5a4c284 build: update @types/node to ^14.15.0
Version 12 is no longer supported.
2022-03-07 19:04:35 +01:00
Renovate Bot
4b529fe80c build: update all non-major dependencies 2022-02-10 14:16:24 +01:00
Alan Agius
b3082355c0 build: update @angular/ packages to version 14 prerelease 2022-01-28 10:59:53 -08:00
Alan Agius
7e7de6858d feat(@schematics/angular): update Angular dependencies to use ^ as version prefix
With this change we update Angular dependencies to use `^` instead of `~` as version prefix.

Closes #21925
2022-01-27 11:07:13 -08:00
Renovate Bot
f70f871db2 build: update all non-major dependencies 2022-01-10 11:32:40 -08:00
Renovate Bot
f20c6d03aa build: update schematics dependencies to v4 2022-01-10 10:24:59 -08:00
cexbrayat
41a828e206 fix(@schematics/angular): updated Angular new project version to v13.2.0-next.0 2021-12-10 11:04:29 +01:00
Alan Agius
f95cc8281a feat(@schematics/angular): generate new projects using TypeScript 4.5 2021-12-02 09:45:04 -08:00
Renovate Bot
d94613268e build: update dependency karma-coverage to ~2.1.0 2021-12-02 16:42:44 +00:00
Alan Agius
21809e14cd feat(@schematics/angular): loosen project name validation
With this change we update the validation of the libraries and application projects names to fully allow characters that make a valid NPM package name. http://json.schemastore.org/package has been used as reference.

We also remove validators that are no longer needed.

Closes #11051
2021-11-16 10:51:10 +00:00
Joey Perrott
cf67f2629d fix(@schematics/angular): updated Angular new project version to v13.0.0 2021-11-03 18:03:27 -07:00
Alan Agius
97624f3e84 build: update ng-packagr to stable version 2021-11-03 17:37:15 +01:00
Renovate Bot
80b026c051 build: update all non-major dependencies 2021-10-19 12:01:08 -04:00
Renovate Bot
167706a5d7 build: update all non-major dependencies 2021-10-14 12:55:20 -04:00
Charles Lyding
b3dcefa13c refactor(@schematics/angular): update new project rxjs version to ~7.4.0
`rxjs` 7 versions prior to 7.4.0 did not export the ES2015 variant in a way that could be leveraged via the new package.json `exports` feature. As a result, prior versions would cause larger ES5 variants of rxjs to be bundled within applications. Version 7.4.0 is now set as the minimum version for new projects to allow for the ES2015 rxjs code to be used when building applications.
2021-10-06 19:10:24 -04:00
Alan Agius
9c924a4c24 build: update to TypeScript 4.4 2021-09-28 09:35:19 -04:00
Charles Lyding
7bdcd7da1f feat(@schematics/angular): create new projects with rxjs 7
With the Angular framework supporting rxjs 7 for Angular 13, new projects (`ng new ...`) can now be created using rxjs 7. rxjs 6 is also still fully supported with Angular 13 allowing existing projects to continue to use rxjs 6 if preferred or required.
Support for rxjs 7 within the framework was enabled via https://github.com/angular/angular/pull/42991
2021-09-23 06:59:14 -04:00
Renovate Bot
7ab1cf3b29 build: update all non-major dependencies 2021-09-03 10:34:02 +02:00
Alan Agius
c13cc888d0 build: update ng-packagr to version 13.0.0-next.1 2021-09-02 17:54:09 +02:00
Renovate Bot
9e71069610 build: update all non-major dependencies 2021-08-23 11:07:13 +01:00
Charles Lyding
f227e145df fix(@schematics/angular): updated Angular new project version to v13.0 prerelease 2021-08-06 08:12:06 +02:00