1185 Commits

Author SHA1 Message Date
Alan Agius
6530aa11be feat(@schematics/angular): replace assets with public directory
The `assets` directory is confusing for the users and commonly users place "assets" which are not meant to be copied but instead processed by the build system. This causes some files both bundled and copied.

With this change we rename the `assets` directory to `public` and also move the `favicon.ico` inside this newly created directory.
2024-03-25 17:10:29 +01:00
Charles Lyding
c452531828 refactor(@angular/cli): remove unneeded devkit core tag helper usage
Direct string usage can be leveraged to remove the need for the helpers
and reduce imports of `@angular-devkit/core`.
2024-03-15 14:10:32 -04:00
Alan Agius
a1833c66c2 build: update Angular versions to 18.0.0-next.0 2024-03-15 10:16:11 +01:00
Alan Agius
ac30195709 feat(@angular/cli): add ng dev alias to ng serve
This commit adds an alias to `ng serve`
2024-03-14 16:11:57 +01:00
Alan Agius
a88bc7c91f build: remove the need to bootstrap-local
This commit removes the need for the bootstrap-local logic and moves the scripts to` mts`
2024-03-14 15:46:54 +01:00
Angular Robot
8374dc6df1 build: update all non-major dependencies 2024-03-14 10:53:31 +01:00
Alan Agius
c7b208555e refactor(@angular/cli): remove support for Node.js versions <18.19.1 and <20.11.1
BREAKING CHANGE: Node.js support for versions <18.19.1 and <20.11.1 has been removed.
2024-03-12 16:51:03 +01:00
Miles Malerba
034639b9d3 build: update dependencies for version 18.0.0 2024-03-08 18:40:58 +01:00
Angular Robot
dddcb2e8f4 build: update all non-major dependencies 2024-03-08 11:55:34 +01:00
Alan Agius
73e7c2b2c5 build: update dependencies for version 17.3.0
The prerelease checks are failing due to incorrect dependencies

```
Discovered errors when validating dependency ranges.
  - @angular/pwa: Unexpected peer dependency range for "@angular/cli". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular/ssr: Unexpected peer dependency range for "@angular/common". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular/ssr: Unexpected peer dependency range for "@angular/core". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/compiler-cli". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/localize". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/platform-server". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/service-worker". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "ng-packagr". Expected: ^17.0.0 || ^17.3.0-next.0
  - @ngtools/webpack: Unexpected peer dependency range for "@angular/compiler-cli". Expected: ^17.0.0 || ^17.3.0-next.0
  - latest-versions: Invalid dependency range for "ng-packagr". Expected: ^17.3.0-next.0
  - latest-versions: Invalid dependency range for "Angular". Expected: ^17.3.0-next.0
```
2024-03-06 13:04:30 +01:00
Angular Robot
ab4f98596c build: update all non-major dependencies 2024-03-06 11:37:15 +01:00
Angular Robot
30f182c7ad build: update all non-major dependencies 2024-02-26 14:29:44 -05:00
Alan Agius
782c7185c5 fix(@angular/cli): prevent BOM errors in package.json during ng update
To prevent `JSON.parse` errors triggered by Byte Order Marks (BOMs) in package.json files, the `readJson` tree method is now utilized for more reliable BOM handling.

Closes #27052
2024-02-09 15:36:15 +01:00
Angular Robot
ccdaed4e49 build: update all non-major dependencies 2024-02-06 08:42:54 -05:00
Angular Robot
8515c6bb54 build: update all non-major dependencies 2024-01-29 15:27:28 -08:00
Alan Agius
600498f2cd feat(@angular/create): add support to bun package manager
This commit adds support to use `bun` as a package manager.

Closes #26837
2024-01-25 18:02:35 +01:00
Alan Agius
b3e206741c feat(@angular/cli): add support to bun package manager
This commit adds support to use `bun` as a package manager.

Closes #26837
2024-01-25 18:02:35 +01:00
Alan Agius
7717dba907 docs: remove ngx-deploy-npm from missing deploy targets
This package will no longer support Angular CLI workspaces in the next major version. Instead they will soley support NX.

See: https://dev.to/dianjuar/whats-coming-to-ngx-deploy-npm-v8-23gn and https://github.com/angular/angular/pull/53999
2024-01-25 13:51:54 +01:00
Alan Agius
6c65730b60 build: update angular to 17.2.0-next 2024-01-25 09:11:51 +01:00
Alan Agius
eef1aa8d79 fix(@angular/ssr): handle handle load event for multiple stylesheets and CSP nonces
The `load` event for each stylesheet may not always be triggered by Google Chrome's handling. Refer to: https://crbug.com/1521256

This results in the media attribute persistently being set to print, leading to distorted styles in the UI. To address this issue, we substitute the onload logic by replacing `link.addEventListener('load', ...` with `document.documentElement.addEventListener('load', ...` and filtering for link tags.

Closes #26932
2024-01-24 14:58:54 +01:00
Angular Robot
248b4c9a75 build: update all non-major dependencies 2024-01-23 10:52:36 +01:00
harshlakhara
efa1a19a78 fix(@angular/cli): update regex to validate the project-name 2024-01-23 10:52:24 +01:00
Angular Robot
8eab5aa912 build: update all non-major dependencies 2024-01-18 09:58:07 -05:00
Alan Agius
640a76aa74 fix(@angular/cli): retain existing EOL when updating JSON files
This commit updates the JSON utility to retain the existing EOF when updating files.
2024-01-05 16:30:06 +01:00
Alan Agius
68dae539ad feat(@angular-devkit/build-angular): initial experimental implementation of @web/test-runner builder
This is a new `@angular-devkit/build-angular:web-test-runner` builder which invokes Web Test Runner to execute unit tests in a real browser.

The implementation calls `application` builder under the hood with some option overrides build the application to a temporary directory and then runs Web Test Runner on the output. This set up is still minimal, but sufficient to run and pass tests in the generated `ng new` application.

The `schema.json` file is directly copied from the `karma` builder, since this is intended to serve as a migration target for users coming from Karma. Most of the options don't actually work yet, which is logged when they are used.

The most interesting part of this change is configuring Jasmine to execute in Web Test Runner. This is done through the `testRunnerHtml` option which allows us to control the HTML page tests are executed on. We use `test_page.html` which very carefully controls the loading process. I opted to make a single `<script type="module">` which dynamic imports all the relevant pieces so the ordering can be directly controlled more easily. This is better than trying to manage multiple `<script>` tags and pass data between them. Ideally everything would be bundled into a single entry point, however this is not feasible due to the way that ordering requirements do not align with typical `import` structure. Jasmine must come before polyfills which must come before the runner which invokes user code. In an ideal world, this ordering relationship would be represented in `import` statements, but this is not practically feasible because Angular CLI doesn't own all the files (`./polyfills.js` is user-defined) and Jasmine's loading must be split into two places so Zone.js can properly patch it.

`jasmine_runner.js` serves the purpose of executing Jasmine tests and reporting their results to Web Test Runner. I tried to write `jasmine_runner.js` in TypeScript and compile it with a `ts_library`. Unfortunately I don't think this is feasible because it needs to import `@web/test-runner-core` at runtime. This dependency has some code generated at runtime in Web Test Runner, meaning we cannot bundle this dependency and must mark it as external and dynamic `import()` the package at runtime. This works fine in native ESM, but compiling with TypeScript outputs CommonJS code by default (and I don't believe our `@build_bazel_rules_nodejs` setup can easily change that), so any `import('@web/test-runner-core')` becomes `require('@web/test-runner-core')` which fails because that package is ESM-only. The `loadEsmModule` trick does work here either because Web Test Runner is applying Node module resolution at serve time, meaning it looks for `import('@web/test-runner-core')` and rewrites it to something like `import('/node_modules/@web/test-runner-core')`. In short, there is no easy syntax which circumvents the TypeScript compiler while also being statically analyzable to Web Test Runner.
2024-01-03 18:52:58 +01:00
Alan Agius
602d0166c4 fix(@angular/cli): add prerender and ssr-dev-server schemas in angular.json schema
Add missing schemas to improve IDE DX
2024-01-03 16:18:08 +01:00
Alan Agius
fc7aa22462 refactor(@angular/cli): use process.versions.pnp to determine if PNP is used in warnOnMissingNodeModules
Instead of checking for existence of PNP config files we now use `process.versions.pnp`. See https://yarnpkg.com/advanced/pnpapi#processversionspnp
2023-12-21 16:37:55 +01:00
Alan Agius
a391b5f0c2 fix(@angular/cli): ng e2e and ng lint prompt requires to hit Enter twice to proceed on Windows
This fixes an issue where prompts in nested child processes on Windows require multiple keystrokes to proceed.

Closes #26724
2023-12-21 16:37:25 +01:00
Charles Lyding
72cf799388 refactor(@angular/pwa): use stream pipeline operator with HTML rewriter
The index HTML augmentation within the PWA schematic now uses the Node.js
promise-based pipeline helper to reduce the complexity of the code when
using the parse5 streaming rewriter. This removes a noticeable amount of
code as well as removing the need to manually wrap the result in a Promise.
2023-12-18 07:35:14 -05:00
Alan Agius
f7d538903a fix(@angular/cli): re-add -d alias for --dry-run
This got accidentally deleted during the transition to yargs.

Closes #26496
2023-12-15 16:34:08 +01:00
Alan Agius
30efb76c46 refactor(@angular/cli): remove no longer relevant regexps from ng version checks
Bazel and NgUniversal packages information is not needed in version 17.
2023-12-15 16:30:07 +01:00
Angular Robot
60b40cb3e3 build: update all non-major dependencies 2023-12-04 09:35:46 +01:00
Doug Parker
5ad8d15177 refactor: bump @angular/pwa peer dep for 17.0.0-next 2023-11-29 13:52:02 -08:00
Charles Lyding
9e356754ce build: update Angular version to v17.1 prerelease
Angular package dependency versions and the version used to generate a new project have been updated to use 17.1.0-next.0.
2023-11-17 12:34:39 -05:00
Alan Agius
bec9458b6e fix(@angular/cli): handle packages with no version
In some cases pacote will return undefined as `version` which resulted in `Cannot convert undefined or null to object`.

Closes #26337
2023-11-15 16:47:42 +01:00
Angular Robot
cb0c22ee9b build: update all non-major dependencies 2023-11-08 15:04:56 +01:00
Alan Agius
0ccb4c7d0b build: update Angular packages to version 17 stable
Update all versions to stable
2023-11-08 13:56:40 +01:00
Alan Agius
f9a798be05 fix(@angular/pwa): replace Angular logos
This commit replaces the Angular old logo with the new one.
2023-11-07 19:14:34 +01:00
水上 皓登
fac706047a docs: the node.js's link fix. 2023-11-04 11:35:21 +01:00
Alan Agius
0f5fb09852 refactor(@angular/ssr): guard against potential path traversals
This change updates to code to guard against a potential path traversal.

More context about the reasoning behind this change can be found in https://buganizer.corp.google.com/issues/299878755#comment26
2023-11-03 14:50:43 +01:00
Charles Lyding
6d8d948ad0 refactor(@angular-devkit/build-angular): cache compiled load ESM file helper
The dynamically compiled ESM import helper is now cached to prevent the need
to recompile the helper function everytime a load ESM helper call is made.
This helper is currently used to workaround dynamic import limitations with
the TypeScript compilation output. Once the build process is updated, it will
no longer be required.
2023-11-03 10:36:27 +01:00
cexbrayat
de1ec9da3b fix(@angular/ssr): enable performance profiler option name 2023-11-03 10:35:19 +01:00
Alan Agius
11420667f9 build: use single Node.js toolchain to run unit tests
E2E tests are used to run tests on multiple platforms and node.js versions.
2023-10-30 17:50:47 +01:00
Alan Agius
91dcae16d1 fix(@angular/cli): add Node.js 20 as supported version
Prior to this Node.js 20 was incorrectly being listed as unsupported.

Closes #26114
2023-10-30 12:28:00 +01:00
Charles Lyding
6161e3e031 fix(@angular/cli): ignore peer mismatch when updating @nguniversal/builders
When updating to v17, the `@nguniversal/builders` is now ignored when checking peer
dependency ranges. The `@nguniversal/builders` is no longer used and will be removed
in a migration during the update process.
2023-10-30 09:00:31 +01:00
Alan Agius
a0f8fac4b3 refactor: update inquirer to version 9.0.6
Update the mentioned package.
2023-10-26 16:11:36 +02:00
Alan Agius
842c2045d1 fix(@angular/cli): remove Node.js 16 from supported checks
Node.js support was removed, but it appears that this got through the cracks.
2023-10-24 16:12:09 +02:00
Alan Agius
f6a088bc18 fix(@angular/ssr): correctly set config URL
When calling `renderApplication` or `renderModule` the URL would be overridden to undefined as the `url` option was not provided as an option.
2023-10-24 16:11:45 +02:00
Alan Agius
2c1c676245 fix(@angular/cli): remove the need to specify --migrate-only when --name is used during ng update
This commit updates the behaviour of `ng update --migrate-only` to remove the need for `--migrate-only` option to be specified. `--migrate-only` will be set internally.

Before
```
ng update @angular/cli --migrate-only --name=migration-name
```

Now
```
ng update @angular/cli --name=migration-name
```
2023-10-20 23:11:50 +02:00
Alan Agius
70099af5be docs(@angular/cli): update build description
Replace webpack with esbuild.
2023-10-19 18:15:23 +02:00