408 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
Charles Lyding
319fbb6f06 refactor(@angular-devkit/core): add missing function return types
Adding explicit type information for function return types is needed
to allow the `@angular-devkit/core` package to eventually be built with
the `isolatedDeclarations` option.
2025-01-29 18:54:27 +01:00
Paul Gschwendtner
e8a97aa465 build: migrate @angular-devkit/core/node tests to rules_js
Migrates the sub-entry point tests for core/node to `rules_js`.
2025-01-21 18:19:11 +01:00
Paul Gschwendtner
3cc84e4434 build: migrate @angular-devkit/core tests to rules_js
Migrates `@angular-devkit/core` jasmine rules to the native `rules_js`
variant.
2025-01-17 16:29:45 +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
1486c63f90 build: migrate @angular-devkit/core 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
Alan Agius
adf9359ad1 fix(@angular-devkit/core): handle Windows drive letter case insensitivity in path functions
This update ensures that path-related functions in account for the case-insensitivity of drive letters on Windows systems. By addressing this inconsistency, the functionality becomes more robust and aligned with Windows filesystem behavior.

Closes #27029
2025-01-09 16:07:34 +01:00
Paul Gschwendtner
dfe9c6a3cc build: migrate angular_devkit/core to ts_project
Migrates `@angular-devkit/core` to `ts_project`.
2024-12-23 09:16:28 -05:00
Kristiyan Kostadinov
4d466bfa6a build: update to TypeScript 5.7
Updates the repo to use TypeScript 5.7.
2024-12-02 14:15:18 +01:00
Doug Parker
03d4bd2b09 test: rename @angular-devkit/build-angular:protractor usages to :private-protractor 2024-10-21 14:50:18 -07:00
Kristiyan Kostadinov
a3bbe0e585 refactor(@angular-devkit/core): fix up internal typings
Resolves some type errors that showed up internally.
2024-09-18 11:16:11 -07:00
Angular Robot
ac71ce121e build: update dependency chokidar to v4 2024-09-13 07:48:51 +02:00
Kristiyan Kostadinov
7f570c5685 build: update to TypeScript 5.6 RC
Updates the repo to the TypeScript 5.6 RC and narrows down the version to drop support for 5.4, in line with the compiler.
2024-08-29 10:40:28 +02:00
Alan Agius
0d8a1006d4 refactor(@angular-devkit/core): remove deprecated fileBuffer function in favor of stringToFileBuffer
BREAKING CHANGE: The deprecated `fileBuffer` function is no longer available. Update your code to use `stringToFileBuffer` instead to maintain compatibility.

**Note:** that this change does not affect application developers.
2024-08-21 14:26:00 +02:00
Charles Lyding
7610d80efb test: update @typescript-eslint/eslint-plugin to v8.0.1
The `@typescript-eslint/eslint-plugin` package has been updated to v8.0.1.
With new major versions of the package, additional rules are added to the
default recommended list. Several such new rules have been disabled to
minimize the code changes to update the package. Several minor type only
fixes were however included to reduce the number of disabled rules.
2024-08-07 06:25:31 +02:00
Angular Robot
346ad54a58 build: update all non-major dependencies 2024-07-15 09:29:51 -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
Charles Lyding
fa9bce0e9a test: enable @typescript-eslint/no-unnecessary-type-assertion lint rule
The `@typescript-eslint/no-unnecessary-type-assertion` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04: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
7c5b365a2f refactor(@angular-devkit/core): additional JSON parse type casting
Add type casting to several additional `JSON.parse` usages to avoid
implicit any usage in the code.
2024-06-25 09:38:14 +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
Charles Lyding
ce850da171 build: update yarn version to v4.2.2 2024-06-10 18:17:03 -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
Angular Robot
dc4231f33d build: update all non-major dependencies 2024-06-05 12:12:07 +02:00
Angular Robot
84cb277470 build: update all non-major dependencies 2024-05-27 08:09:05 +02:00
Angular Robot
4e923fa9cb build: update all non-major dependencies 2024-04-30 10:15:41 -04:00
Angular Robot
3860fb3e42 build: update all non-major dependencies
(cherry picked from commit 7da0965ce3856cfc99158db8510ae339d3dc8fad)
2024-04-02 10:07:07 -07:00
Angular Robot
f97c0f3ea3 build: update dependency ajv-formats to v3 2024-04-01 09:16:28 -07:00
Alan Agius
2f70f9554b build: lock file maintenance 2024-03-05 15:59:07 +01:00
Angular Robot
8d09b80be9 build: update dependency picomatch to v4 2024-02-08 11:31:38 +01:00
Charles Lyding
910531a3c8 refactor: remove outdated namespace syntax usage
The `namespace` TypeScript usage within the CLI has been removed. This
syntax is not recommended outside of type definition files.
2024-01-26 08:55:53 +01:00
Charles Lyding
cd08b55ac6 refactor(@angular-devkit/core): remove single usage of const enum
const enums complicate the potential use of the TypeScript isolatedModules option.
2024-01-25 18:46:41 +01:00
Angular Robot
248b4c9a75 build: update all non-major dependencies 2024-01-23 10:52:36 +01:00
Alan Agius
d77c005313 fix(@angular-devkit/core): retain existing EOL when updating workspace config
This commit updates the JSON utility to retain the existing EOF when updating the workspace config.
2024-01-05 16:30:06 +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
0155ae73b2 build: update dependency picomatch to v3 2023-10-30 08:59:54 +01:00
Charles Lyding
f9372acb1a refactor(@angular-devkit/core): use picomatch for PatternMatchingHost glob support
The glob support in the `PatternMatchingHost` class now uses the capabilities of the
`picomatch` package to convert glob strings into regular expressions. This removes
custom string replacement code that previously was used. The `picomatch` package is
already used by `@angular-devkit/build-angular` and is present in the repository but
is a new dependency for the `@angular-devkit/core` package specifically.
2023-08-30 09:08:39 +02:00
Charles Lyding
e037dc9675 refactor(@angular-devkit/core): use package exports field for secondary entries
The secondary entry point (`node`) within the `@angular-devkit/core` package is
now defined by an exports entry in the main package.json file for the package. This
removes the need for the additional nested package.json file in a subdirectory.
The exports field also contains backward compatible entries to allow for continued
deep imports into the package. These compatibility entries will, however, be removed
in a future major version. Deep imported files are not considered part of the public
API of the package.
2023-05-23 10:36:29 -04:00
Charles Lyding
11e0a51b17 build: minor cleanup of bazel build rules
BUILD files for each package have had outdated glob excludes removed.
Additionally, some src args have been reduced to a single file where possible.
The root bazel ignore file has also been expanded to include all node module
directories in each package. The ignore file does not appear to currently support
globs so each path has been individually specified.
2023-05-22 09:36:44 -04:00
Alan Agius
a70e7a42f1 refactor(@angular-devkit/core): update stringToFileBuffer and fileBufferToString to use TextDecoder and TextEncoder
`TextDecoder` and `TextEncoder` can now be used on Node.js
2023-05-10 15:33:35 +00:00
Angular Robot
367ddabed0 build: update dependency rxjs to v7.8.1 2023-04-27 10:01:39 +00:00
Kristiyan Kostadinov
f3070f2e93 build: update to TypeScript 5.0
Updates the repo to TypeScript 5.0.0-beta. The remaining usages in tests and schematics will be updated once the 5.0 final version is released.
2023-03-02 18:59:49 +00:00
Alan Agius
0ad81cdbc7 refactor(@angular-devkit/core): remove deprecated exceptions
With commits removes the several deprecated exceptions.

BREAKING CHANGE:

- `ContentHasMutatedException`, `InvalidUpdateRecordException`, `UnimplementedException` and `MergeConflictException` API from `@angular-devkit/core` have been removed in favor of the API from `@angular-devkit/schematics`.
- `UnsupportedPlatformException` - A custom error exception should be created instead.
2023-02-21 16:56:43 +00:00
Alan Agius
d58428d3db feat(@angular/cli): remove deprecated defaultProject from workspace configuration
The deprecated 'defaultProject' workspace option has been removed

BREAKING CHANGE: The deprecated `defaultProject` workspace option has been removed. The project to use will be determined from the current working directory.
2023-02-17 16:10:21 +00:00
Alan Agius
8095268fa4 build: update to rxjs 7
G3 is now using RXJS version 7 which makes it possible for the CLI to also be updated to RXJS 7.

NB: this change does not remove all usages of the deprecated APIs.

Closes #24371
2023-02-16 14:59:40 +00:00