263 Commits

Author SHA1 Message Date
Paul Gschwendtner
9dd3f0344f
Further clean-up rules_nodejs npm workspace and remove yarn.lock (#29779)
* build: disconnect `@npm` workspace from main project

This will speed up significantly as we don't need to fetch all
dependencies again just for the `@npm` repository that is at this point
only leveraged by the `ng_package` rule for some of its dependencies.

This commit allows us to drop the `yarn.lock` and Aspect lock files, and
allows us to independently migrate `ng_package` to `rules_js`.

It also allows us to drop the `_rjs` TS interop layer in follow-up commits.

* build: drop `_rjs` suffix from `ts_project` targets

We don't need the `ts_project` interop in principle
at this point. We only have one remaining instance left for the SSR
`ng_package` integration. This commit cleans up all usages.

* build: remove yarn

* build: avoid duplicated dependencies at top-level

`rules_js` seems to be sensitive if there are similar versions of the same
package installed, but with differently matched peer dependencies. This
is fine because we can (and should long-term) move those dependencies to
their package-local `package.json` files. This commit unblocks the
migration and highlights how we can move deps to the individual packages
in the future.

* build: update checkout github action

This will allow us to use pnpm.

* build: update node to avoid strict-engines error caused by `npm`

Avoids:

```
Lockfile is up to date, resolution step is skipped
 ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)

Your Node version is incompatible with "npm@11.2.0".

Expected version: ^20.17.0 || >=22.9.0
Got: v20.11.1
```

Note that we won't update the WORKSPACE test version as that would mean
we need to update the Node engines for shipped packages; and we can't do
this right now without introducing a breaking change.

* build: fix missing dependency for spec bundling

The beasties JS sources weren't available for bundling in the
`bazel-bin`, and this surfaced in RBE. This commit fixes this.
2025-03-11 10:05:52 +01:00
Paul Gschwendtner
5fd1cb56ab build: update dev-infra and rework windows native testing
As part of go/ng:windows-dev-future, we are changing how our
infrastructure supports Windows build & testing. Clearly:

- we will still support contributors on Windows, and we believe we will
  be improving and streamlining the experience here
- we will continue testing the Angular CLI for our Windows users. We are
  aware of the many Windows users using the `ng` CLI.

What is changing? We are no longer actively working towards a Bazel infrastructure
that supports native Windows building and testing. There are currently
two ways to contribute to Angular on Windows. That is via WSL, or via
e.g. native Windows cmd.exe, with Git Bash on top. We acknowledge that
the latter worked sometimes, but we also realize it very often breaks as
nobody on our team uses, verifies it, and it introduces extra complexity
because Bazel on Windows is quite disconnected from Linux/Mac (e.g. no
sandboxing). Going forward, to improve our team's effectiveness, and
improve our stability guarantees for Windows (and Windows contributors),
we are actively discouraging the use of Git Bash for contributing to
Angular; but instead ask for WSL to be used. I can speak as one of the
few long-term team members that have worked on Windows (without WSL) most
of my time, that WSL is great and the contributing experience is much
smoother and also easier to "guide". It's a positive change because we
won't be suggesting "two ways to contribute on Windows", where in
reality one is very brittle and can break at any time!

---

For testing of the Angular CLI: We will continue to maintain the
capability to cross-compile via Bazel with Windows as the target
platform. This allows us to build the e2e tests for Windows, and run
them natively outside WSL to ensure native Windows `ng` CLI testing!
This is what this change mostly does.

Notably, two things are missing here and will be followed up:

- caching of the e2e tests on Windows is not properly functioning yet.
- caching of the WSL node modules + nvm is not working properly yet.

Other than that, we are seeing very similar timing and results of the
Windows tests, so this change unblocks our `rules_js` migration.
2025-03-03 21:44:50 +01:00
Angular Robot
4b4b25bdfc build: update dependency rxjs to v7.8.2 2025-02-23 09:40:53 -05:00
Joey Perrott
c9273f8b85 build: add @types/node to assorted locations where node types are being relied on and currently obtained transitively. 2025-02-19 12:53:55 -05:00
Joey Perrott
33ed6e875e refactor: move builtin module imports to use node: prefix imports 2025-02-14 11:09:23 -08:00
Alan Agius
04f331a534 build: update all non-major dependencies
Update packages
2025-02-14 13:11:21 +01:00
Alan Agius
e7413d3ae1 refactor: reduce dependencies on @angular-devkit/core
By converting schemas from TypeScript `interfaces` to `types`, we can minimize the reliance on `json.JsonObject`. This approach avoids the error "Type 'Schema' does not satisfy the constraint 'JsonObject'" caused by the missing index signature for type 'string' in 'Schema'.
2025-01-21 16:36:23 +01:00
Paul Gschwendtner
14584f0bfd build: migrate @angular-devkit/build-webpack tests to rules_js
Migrates the `@angular-devkit/build-webpack` jasmine tests to
`rules_js`. This requires wiring up in the pnpm workspace.

Additionally `typescript` is added as it was missing as a "peer
dependency" at runtime for `@ngtools/webpack`. This is expected, and
we're already adding other peer deps before this change.
2025-01-21 09:25:54 +01:00
Paul Gschwendtner
96b6a16a65 refactor: add explicit types for createBuilder exports
This is necessary as with the new compilation, leveraging pnpm-linked
first party dependencies, there are cases **during migration** where
multiple locations of the same package exist. e.g.

- `@angular_devkit/architect/node_modules/@angular-devkit/core` (pnpm package output)
- `@angular_devkit/core` (plain js sources)

This is fine, and there is no risk of wrong types, and this should only
occur during migration anyway, but it causes a few type issues as
TypeScript is unable to emit proper types for inference. This is okay,
as we'd likely even want to make use of `isolatedDeclarations` at some
point, but we just add explicit types right now.

(also making `Builder` type more type safe, checking assignability
properly).
2025-01-15 19:20:40 +01:00
Paul Gschwendtner
4fee94a96c build: rename //:root_modules to //:node_modules.
This is necessary as `rules_js` requires this "common name" when dealing
with Yarn workspaces, linking first party dependencies automatically.

In the future, we may be able to send a PR to `rules_js` to support a
custom name somehow.
2025-01-15 19:20:40 +01:00
Paul Gschwendtner
edca9b2e04 build: migrate @angular-devkit/build-webpack to npm_package
Updates to the `rules_js` npm archive rule, as part of the overall
migration effort.
2025-01-14 16:06:07 +01:00
Paul Gschwendtner
a8335cf950 build: never use interop targets for ts compilations
* Removes `interop_deps` from the `ts_project` interop macro.
* Keeps `_rjs` suffix for now as we still need the interop targets for
  e.g. `jasmine_node_test` and the `rules_nodejs` linker.

In follow-ups we can remove the suffix, and interop layer.
2025-01-09 09:42:06 +01:00
Charles Lyding
b4e9a2af9e build: migrate @angular-devkit/build-webpack to ts_project
The `@angular-devkit/build-webpack` package has been migrated to the `rules_js` ts_project rule.
2024-12-21 12:58:54 -05:00
Paul Gschwendtner
cdf5d86688 build: improve ts_project hybrid interop with node modules
Currently the interop resulting target of a `ts_project` ends up not
necessarily working at runtime. This may be the case because a consuming
Node program may end up with mixes of `node_modules` dependencies from
`rules_nodejs` (old) and `rules_js` (new). This sounds fine at first
glance, but in practice can break very subtly because:

* Rules NodeJS leverages the linker, creating `node_module` directories
  outside of Bazel, at runtime. These don't depend on symlink resolving.
* Rules JS puts real node module folders via Bazel actions. These rely
  on `pnpm` non-hoisting layout, and symlink resolving.

As we can see there is a hard conflict with symlinks. They need to be
enabled with the new toolchain, but the other one doesn't enable symlink
resolution, and enabling is not possible as we'd otherwise risk escaping
the sandbox and cause even more subtle errors.

A good compromise solution is to automatically drop the `rules_js` node
module files/folder in the interop-`rules_nodejs` target and instead
brining in the equivalent `@npm//` dependencies from `rules_nodejs`.
This kind of keeps the logic similar to when not using `rules_js` or the
interop, and enables the simplest & safest mental model; and it works
compared to other solutions I tried with symlinking. Notably, we can't
keep both node module variants as the linker doesn't override existing
node module files from e.g. rules_js then (and would break then).
2024-12-19 12:21:37 -05:00
Angular Robot
ffad81a4de build: update all non-major dependencies 2024-12-06 10:14:31 +01:00
Alan Agius
f2571b3251 build: update all non-major dependencies 2024-12-04 15:37:27 +01:00
Angular Robot
69768bdaa4 build: update all non-major dependencies 2024-11-01 08:25:17 -04:00
Alan Agius
3cbbf456c1 refactor: handle standalone by default change
In tests, add `standalone: false` where it's missing.

Note: In the future, we should update our integration tests to use a standalone app.
2024-10-17 14:20:52 +00:00
Alan Agius
422e847a39 build: update all non-major dependencies 2024-09-27 14:49:44 -04:00
Alan Agius
358f85e4d2 build: update dependency webpack to v5.94.0 2024-08-23 13:55:59 +02:00
Angular Robot
81a3563b6f build: update all non-major dependencies 2024-07-12 11:19:35 +02:00
Charles Lyding
39f946a848 build: enabled isolated modules TypeScript option
The TypeScript `isolatedModules` option is now enabled for all TypeScript
code within the repository. As a result, all packages will now be built
with the option enabled. This does not affect projects created with the CLI
and is only related to the building of the actual Angular CLI code.
The `isolatedModules` option ensures that code can be emitted without the
TypeScript typechecker and allows tools other than TypeScript to potentially
be used. Code was updated to correct all errors after the option was enabled.
Additionally, some early code fixes were done to add function and accessor
return types to prepare for future `isolatedDeclarations` usage. More changes
would be needed to consider turning on `isolatedDeclarations`, however.
2024-06-23 15:34:49 +02:00
Angular Robot
a442f8c3a3 build: update all non-major dependencies 2024-06-20 09:15:40 +02:00
Angular Robot
a4d81759b8 build: update all non-major dependencies 2024-06-13 08:15:35 -04:00
Alan Agius
60b7c13bdd refactor: format bazel build files
The formatter does not automatically fix these failures.
2024-06-06 11:12:06 +02: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
David LJ
d24b087eff docs: update browser support links aio->adev 2024-05-27 08:31:53 +02:00
Alan Agius
0b8f53bc5f build: update all non-major dependencies 2024-03-21 09:30:08 -04:00
Alan Agius
e729f6ea10 build: update dependency webpack-dev-server to v5 2024-03-11 19:00:54 +01:00
Charles Lyding
422a9eaa70 build: update webpack to v5.90.3 2024-02-26 13:18:37 -05:00
Alan Agius
1011f3185d build: update all non-major dependencies 2024-02-02 09:56:02 -05:00
Angular Robot
eadd898e96 build: update all non-major dependencies 2024-01-25 09:35:26 +01:00
Charles Lyding
810d22114c refactor(@angular-devkit/build-webpack): align builders source directory structure with build-angular
The source code for the builders within the `@angular-devkit/build-webpack` package have been moved
into a `builders` subdirectory to more closely align with the structure of the builders in the
`@angular-devkit/build-angular` package. An initial `package.json` exports field definition has also
been added that currently continues to allow deep imports.
2023-12-05 10:05:05 -05:00
Charles Lyding
e588e84160 test: remove node-fetch package usage
Native fetch support is now available in Node.js and the `node-fetch` package can now be removed.
2023-10-31 08:57:42 +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
Angular Robot
8a47ddbd24 build: update all non-major dependencies 2023-10-16 12:16:58 -07:00
Alan Agius
c0eb2eb5fd build: update Angular to 17.0.0-next.5 2023-09-20 21:27:35 +02:00
Angular Robot
a0bf9462f5 build: update all non-major dependencies 2023-07-18 15:30:12 -07:00
Charles Lyding
333da08ea2 build: update webpack to v5.88.1 2023-06-30 20:07:47 +02:00
Angular Robot
fdd1958941 build: update all non-major dependencies 2023-06-27 07:00:12 +02:00
Alan Agius
aa0370a1c4 build: update build-tooling package and enable Node.js 18 tests
This commit updates the build-tooling package which contains fixes for RBE on Node.js 18. It also enables the Node.js 18 test suit.
2023-06-16 12:05:22 -04:00
Angular Robot
bb4c9c82e8 build: update all non-major dependencies 2023-06-15 09:59:43 -04:00
Alan Agius
051998c908 build: update all non-major dependencies
(cherry picked from commit 310fef6e9028dbc95dc1456e37e294201fc247c3)
2023-06-08 17:27:38 +02:00
Alan Agius
bc48a0db31 build: update all non-major dependencies 2023-06-07 15:26:36 +02:00
Alan Agius
1225ce4dc4 build: update all non-major dependencies 2023-05-31 10:22:08 -04:00
Kristiyan Kostadinov
b076a6f4ef build: update to TypeScript 5.1
Bumps up the dev depdencies to TypeScript 5.1-beta and expands the allowed version ranges to prepare for the final release.
2023-05-26 10:34:32 -04:00
Alan Agius
b628cff77b build: update all non-major dependencies
(cherry picked from commit 1afbec1e36708737b6ae75277e0649d0e334d1b2)
2023-05-19 17:14:01 +02:00
Angular Robot
419cc8282e build: update all non-major dependencies 2023-05-12 15:56:22 -04:00
Angular Robot
67e940635c build: update all non-major dependencies 2023-05-04 20:26:09 +00:00
Angular Robot
ae54da2990 build: update all non-major dependencies 2023-04-27 10:07:18 +00:00