1170 Commits

Author SHA1 Message Date
Jan Krems
201b60e1dd feat(@angular/cli): handle string key/value pairs, e.g. --define 2024-09-09 19:35:32 +02:00
Angular Robot
63d4f9298e build: update dependency ini to v5 2024-09-06 10:30:04 -04:00
Charles Lyding
ecc107d83b perf(@angular/cli): enable Node.js compile code cache when available
The Angular CLI will now enable the Node.js compile cache when available
for use. Node.js v22.8 and higher currently provide support for this feature.
The compile cache stores the v8 intermediate forms of JavaScript code for the Angular
CLI itself. This provides a speed up to initialization on subsequent uses the Angular CLI.
The Node.js cache is stored in a temporary directory in a globally accessible
location so that all Node.js instances of a compatible version can share the
cache. The code cache can be disabled if preferred via `NODE_DISABLE_COMPILE_CACHE=1`.

Based on initial profiling, this change provides an ~6% production build time
improvement for a newly generated project once the cache is available.

```
Benchmark 1: NODE_DISABLE_COMPILE_CACHE=1 node ./node_modules/.bin/ng build
  Time (mean ± σ):      2.617 s ±  0.016 s    [User: 3.795 s, System: 1.284 s]
  Range (min … max):    2.597 s …  2.640 s    10 runs

Benchmark 2: node ./node_modules/.bin/ng build
  Time (mean ± σ):      2.475 s ±  0.017 s    [User: 3.555 s, System: 1.354 s]
  Range (min … max):    2.454 s …  2.510 s    10 runs

Summary
  node ./node_modules/.bin/ng build ran
    1.06 ± 0.01 times faster than NODE_DISABLE_COMPILE_CACHE=1 node ./node_modules/.bin/ng build
```
2024-09-05 12:29:20 -04:00
Angular Robot
83918eee6c build: update all non-major dependencies 2024-09-03 07:44:10 -04:00
Alan Agius
474571f087 build: remove Bazel typings workaround
The workaround is no longer necessary since the bug has been resolved upstream.
2024-08-14 19:12:27 +02:00
Alan Agius
c5ed0b1248 fix(@angular/cli): prevent bypassing select/checkbox prompts on validation failure
Previously, when a select or checkbox prompt failed validation, it was bypassed, preventing users from correcting their input. This commit ensures that when validation fails, the prompts are re-displayed, allowing users to make the necessary corrections. This improves the user experience and helps avoid unintended selections.

Closes #28189
2024-08-12 15:42:17 +02:00
Angular Robot
3e1f952536 build: update all non-major dependencies 2024-08-07 11:00:03 -04:00
Angular Robot
349e052f41 build: update all non-major dependencies 2024-08-05 15:43:13 -04:00
Angular Robot
2bf8e7f296 build: update all non-major dependencies 2024-07-30 12:40:39 +02:00
Angular Robot
22938486c5 build: update all non-major dependencies 2024-07-29 14:39:15 +02:00
Angular Robot
048df34ccb build: update dependency @inquirer/prompts to v5.3.2 2024-07-23 18:14:59 -07:00
Angular Robot
94b331e667 build: update all non-major dependencies 2024-07-22 12:53:59 -07:00
Angular Robot
64b50815e1 build: update all non-major dependencies 2024-07-18 10:04:45 -07:00
Angular Robot
e21e9867f0 build: update all non-major dependencies 2024-07-17 09:34:41 -07:00
Charles Lyding
5895e9fb01 test: enable no-case-declarations lint rule
The `no-case-declarations` rule is now enabled and all failures
in have been addressed within the published code. Unit tests
have been excluded.
2024-07-11 08:19:56 +02:00
Angular Robot
22d9369aef build: update all non-major dependencies 2024-07-10 09:07:48 +02:00
Charles Lyding
10f882c562 refactor(@angular/cli): use Node.js CommonJS wrapping for schematic encapsulation
The schematics encapsulation process now uses a similar wrapping setup to
Node.js itself. This removes some custom code and also provides a more
comprehensive global object which should provide improved compatibility
for third-party packages used within schematics.
2024-07-10 08:40:11 +02:00
Charles Lyding
afbe3119bf refactor(@angular/cli): provide a default extract-i18n target for applications
The `extract-i18n` command will now use a default project target and builder
name if the target entry is not explicitly defined. This allows the removal
of additional configuration from an `angular.json` file. If the target is
already present than it will take priority over any default builder behavior.
Infrastructure is also now present to allow other architect commands to
have similar functionality in the future.
2024-07-08 12:08:44 +02:00
Angular Robot
89aa22a7ba build: update all non-major dependencies 2024-07-08 12:06:20 +02:00
Alan Agius
f16fbd82ad build: update all non-major dependencies 2024-07-01 13:44:11 +02:00
Angular Robot
7c4e0918d9 build: update all non-major dependencies 2024-06-27 10:09:22 -07:00
ddereszkiewicz
4947f29cfa fix(@angular/cli): make ng update to keep newline at the end of package.json
As stated in https://github.com/angular/angular-cli/issues/11744,
`ng update` command removed the newline at the end of the package.json file.
This commit makes `ng update` to preserve newline, if it was present before running the command.

Fixes #11744
2024-06-27 10:08:29 -07:00
Charles Lyding
741cf7fe1e test: enable @typescript-eslint/await-thenable lint rule
The `@typescript-eslint/await-thenable` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04:00
Alan Agius
aebfde28c7 build: update all non-major dependencies
Closes #27881
2024-06-25 20:53:49 +02:00
Charles Lyding
137949e8ff refactor(@angular/cli): use non-experimental decorators for internal memoize
With standard decorator support now available for use, the memoize decorator
has been updated to be a standard decorator instead of a TypeScript experimental
decorator. This change also removes the only usage of decorators within the
Angular CLI code itself. This change does not affect application code.
2024-06-25 09:31:57 -07:00
Charles Lyding
579f81798f build: remove tsetse rule exclusions
To remove the tsetse rule exclusions, several usages of `JSON.parse` that
did not have type casting where adjusted to add types. This removed the
need for the manual configuration within the tsconfig.
2024-06-24 12:50:55 -04:00
Charles Lyding
8b6ae4cf24 refactor(@angular/cli): allow tty and color helpers to use a stream
The `isTTY` and `supportColor` helpers can now accept a stream to check
instead of assuming stdout. This is useful if stderr needs to be checked,
for instance. Also, color checking now uses Node.js `hasColors` where
possible which has been available since Node.js v10.
2024-06-21 16:26:45 +02:00
Angular Robot
a442f8c3a3 build: update all non-major dependencies 2024-06-20 09:15:40 +02:00
Charles Lyding
18226c6f57 refactor(@angular/cli): remove ora spinner dependency from package
The ora package has been removed now that the progress indicator for the
update command is now based on the `listr2` package that is also used
by the `ng add` command.
2024-06-19 09:52:24 +02:00
Charles Lyding
4c96537378 refactor(@angular/cli): remove ora-based spinner from update command
The `listr2` dependency that was recently introduced to improve the console
UI for the `ng add` command is now used for the package installation step
of the `ng update` command process.
2024-06-19 09:52:24 +02:00
Angular Robot
a1f60f93c4 build: update all non-major dependencies 2024-06-18 09:41:37 +02:00
Charles Lyding
303807aa68 refactor(@angular/cli): remove direct use of ansi-colors package
The newly introduced `listr2` dependency used for the updated `ng add`
console UI provides color support. This removes the need to retain a
direct dependency on a color package within the `@angular/cli`.
2024-06-18 09:38:57 +02:00
Charles Lyding
af1016630f refactor(@angular/cli): improve console status logging for add command
The step-based console UI of the add command has been refactored to use the `listr2` library.
Previously, an `ora` spinner was manually used and needed to handle a
variety of error conditions and could not handle the potential for concurrent
tasks as well as streaming subcommands cleanly while the spinner was in use.
Behavior of the add command has not been changed during this refactor. Further
improvements are possible including the integration of the schematic execution
within the step-based UI.
2024-06-17 09:07:34 -04:00
Alan Agius
6d266c146c fix(@angular/cli): add fallbacks for migration package resolution
Before this commit, running `ng update @angular/cli` would fail when using the PNPM package manager. This update resolves the issue by implementing fallbacks in the migration package resolution logic, similar to the approach used in `NodeWorkflow`.
2024-06-12 18:32:54 +02:00
Charles Lyding
9e35d174cb refactor(@angular/cli): use Node.js builtin ANSI escape removal helper
Node.js contains a helper function within the `util` builtin that will
remove any ANSI escape codes from a string. This removes the need for
a custom utility function.
2024-06-11 08:20:20 -04:00
Charles Lyding
b411b9854e refactor(@angular/cli): use latest inquirer prompt package
The `inquirer` package has been rewritten with a new set of packages.
The rewrite had a focus on reduced package size and improved performance.
The main prompt package is now `@inquirer/prompts`. The API is very similar
but did require some refactoring to adapt to Angular's usage.
2024-06-07 08:58:25 -04:00
Ash Ramirez
434a3740f0 refactor(@angular/cli): update aio links -> adev links
Updates for all angular.io links to the new angular.dev domain. Additionally, adjustment to new resources where the equivalent does not exist on the new site (e.g. Tour of Heroes tutorial)
2024-06-06 11:12:06 +02:00
Krzysztof Platis
ce8b5a3a74 fix(@angular/cli): add schema.json options to parsed command, also when a version is passed to ng add <package>@<version>
This commit fixes the method `AddCommandModule.getCollectionName()`, so it now returns only the package name, but remove the specified version (if present).

Previously, a `@<version>` specified in the const `collectionName` was causing a (silenced) error during the invocation of `workflow.engine.createCollection(collectionName)`, which lead to skipping eventually the invocation of the method `this.addSchemaOptionsToCommand()` in the try/catch block.

fixes https://github.com/angular/angular-cli/issues/27766
2024-06-04 11:20:34 -07:00
Angular Robot
2e9fe6a22a build: update all non-major dependencies 2024-06-03 10:50:03 -07:00
David LJ
767652bdcc docs: update blog, analytics, hydration links aio->adev 2024-05-27 08:31:53 +02:00
David LJ
b5782891c8 docs: update i18n, deploy links aio->dev 2024-05-27 08:31:53 +02:00
Angular Robot
c7205ea182 build: update all non-major dependencies 2024-05-22 17:56:52 -04:00
Charles Lyding
83ef6a133e fix(@angular/cli): only add --version option on default command
The newly added `--version` option was previously added to all subcommands
which can result in a warning being shown if the subcommand was a builder
or schematics that also happened to have a `version` option. To support
the default `--version` option that displays the actual CLI version, the
option is now only added when no subcommand is present. This prevents
potential version option overlap.
2024-05-22 07:08:54 -04:00
Alan Agius
386d766232 fix(@angular/cli): add --version option
This commit introduces the `--version` option, which will display the Angular CLI version when using `ng --version`.

Closes #27668
2024-05-21 13:59:31 -04:00
Alan Agius
36195059e0 fix(@angular/cli): eliminate prompts during ng version command
This update removes the analytics and completion prompts that appear when executing the `ng version` command, ensuring a smoother and uninterrupted user experience.

Closes #27668
2024-05-21 13:59:31 -04:00
Charles Lyding
ebfd7b12ee refactor(@angular/cli): show optional migration name and documentation URL if available during updates
The optional migration selection prompt shown during an interactive
`ng update` will now show the name of the migration which can be used
to manually run the update at a later time as well as a documentation link
if present for the migration.
2024-05-20 17:09:33 -04:00
Charles Lyding
3e07f5e788 fix(@angular/cli): keep cli package first in update package group metadata
The `ng update` command will use the first element in the `packageGroup`
metadata data within `package.json` for display purposes. The newly
introduced `@angular/build` package was initially added alphabetically
but this interfered with the first element position.
2024-05-20 17:09:33 -04:00
Angular Robot
776e63d3c9 build: update all non-major dependencies 2024-05-20 09:44:20 -04:00
Charles Lyding
c79a513a76 refactor(@angular/cli): use prompt helper functions in analytics and completion commands
Instead of manually invoking an underlying prompt library, the analytics
and completion commands now use the helper utility functions present to
handle console prompts.
2024-05-17 14:14:40 -04:00
Charles Lyding
cb18da3917 fix(@angular/cli): change update guide link to angular.dev
References to the Angular update guide now use the new angular.dev site.
2024-05-17 12:44:40 -04:00