Commit graph

300 commits

Author SHA1 Message Date
Paul Gschwendtner
d7fa04fd98 build: update dev-infra build tooling to leverage recent ESM changes (#48521)
Update dev-infra's build-tooling since multiple ESM changes have
landed there. e.g. not relying on `require.main === module` for API
bundling. This will allow us to also execute all dev-infra rules
in ESM because we plan on applying our ESM patching to `ts_library`
(which would also affect build-tooling then).

PR Close #48521
2022-12-19 19:50:42 +00:00
Paul Gschwendtner
c8e021ef4a build: support esbuild configurations using ESM dependencies (#48521)
We use `bazel/esbuild` in various places (e.g. for app bundling tests).
These tests rely on the Angular Compiler-CLI itself for e.g. linking
or the Terser configuration. Since everything in this repo is now
strict ESM, the ESBuild configs (which are already ESM-supported)
need to import from `//packages/compiler-cli`. We also need to be
able to leverage our existing ESM Bazel loader for this though as
otherwise resolution would fail.

Long-term we can remove this if everything in the compiler-cli
would use `.mjs` extensions and the import paths would also specify
an explicit extension. See: https://nodejs.org/api/esm.html#mandatory-file-extensions

PR Close #48521
2022-12-19 19:50:42 +00:00
Paul Gschwendtner
369091839f build: fix loader and support rxjs to be used in NodeJS ESM (#48521)
RxJS currently ships ESM output that cannot be executed directly
in NodeJS. This is because RxJS ships ESM as `.js` files but does
not have a `package.json` which instructs Node to execute these as ESM.

RxJS would either need to use the explicit `.mjs` extension, or add
a `type: module` `package.json` next to the `.js` sources.

We manually patch RxJS to do this, while we wait on the upstream fix
to land. See: #7130.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
83dbed0a52 build: patch ts_library to not emit a tsickle extern file (#48521)
The prodmode compilation pipeline -that we intend to use more heavily
now given it emitting files with the `.mjs` extension- exposes an
additional tsickle closure externs file. This file is empty most
of the time anyway since tsickle is not wired up.

We remove this generation as otherwise convenient `$(location` of
such ts library targets break because there always is more than 1 file.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
0d83e89217 build: support enabling esm interop loader even outside of defaults.bzl (#48521)
We introduced a loader that supports ESM with Bazel. This loader can
only be enabled as part of our `nodejs_binary` defaults.bzl test. This
works fine, but there might be other binaries/tests e.g. from
`@angular/build-tooling` that should be able to use ESM & might need to
for importing the `compiler-cli`.

We move the logic for installing the patch into a `rules_nodejs` patch.
There is an existing one that is just updated to "enable ESM support".

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
553d42c86f build: patch rules_nodejs to prioritize ESM files for nodejs_binary/test (#48521)
The Bazel NodeJS rules will always use the `.js` files as entry-points.
Since we only rely on the `.mjs` output going-forward, we need to teach
`nodejs_binary` and `nodejs_test` to use the `.mjs` extensions if
intended.

Our `defaults.bzl` macros will set `use_esm = True`, but other targets
from e.g. external repositories should keep the original behavior.

PR Close #48521
2022-12-19 19:50:41 +00:00
Alan Agius
4ab3ed3109 docs: update CLI sources ref (#48486)
This is needed to update AIO documentation as currently the CLI docs are out of date.

PR Close #48486
2022-12-14 08:44:12 -08:00
Angular Robot
126573d76b build: update all non-major dependencies (#48372)
See associated pull request for more information.

PR Close #48372
2022-12-06 11:06:39 -08:00
Paul Gschwendtner
50a3046e4b build: patch rules_nodejs to ensure nodejs_binary targets can be used as tools in RBE (#48316)
See full explanation in: https://github.com/bazelbuild/rules_nodejs/pull/3605

PR Close #48316
2022-12-02 08:57:43 -08:00
Angular Robot
b935255ef9 build: update all non-major dependencies (#48271)
See associated pull request for more information.

PR Close #48271
2022-11-30 09:29:26 -08:00
Angular Robot
131bfc5bad build: update io_bazel_rules_sass digest to a2fce75 (#47970)
See associated pull request for more information.

PR Close #47970
2022-11-23 10:52:30 -08:00
Derek Cormier
12557ec0c2 build(bazel): update workspace cli sources ref
Updates to the latest version still used in angular/main.
2022-11-22 13:51:16 -07:00
Derek Cormier
808ca8937d build(bazel): update rnj and remove launcher patch
rules_nodejs released  a fix for the RUNFILES issue.
2022-11-22 13:51:16 -07:00
Derek Cormier
24a513bdbb build(bazel): update CLI sources ref for aio build
It was out of date with the current legacy build
2022-11-22 13:51:16 -07:00
Derek Cormier
e4b82cea26 build(bazel): clean up pathing in aio build tooling
Make use of process.env.RUNFILES.
2022-11-22 13:51:16 -07:00
Derek Cormier
c64b63a18b build(bazel): remove old patch rules_nodejs patch
Patch contents included in rules_nodejs 5.6.0.
2022-11-22 13:51:16 -07:00
Derek Cormier
bbcf535ce0 build(bazel): fix a bug where $(GIT_BIN_PATH) wasn't providing a correct path on
Windows

Fixed in rules_nodejs 5.6.0
2022-11-22 13:51:16 -07:00
Derek Cormier
0d8f87407f build(bazel): use git toolchain for dgeni build
Now using a toolchain from dev-infra that provides the
path to git in a template var.
2022-11-22 13:51:16 -07:00
Derek Cormier
076c932497 build(bazel): patch architect to not clear output
Otherwise a failed build requires looking in the command log for the
error.
2022-11-22 13:51:16 -07:00
Derek Cormier
67a3dcc115 build(bazel): post-rebase fixes for aio bazel build
Updated cli source snapshot and had to fix up lockfile.
2022-11-22 13:51:16 -07:00
Derek Cormier
4cc881e7eb build(bazel): clean up manual build contents for aio example deps
This avoids the need to depend on "node_modules" and "node_modules/.bin"
separately.
2022-11-22 13:51:16 -07:00
Derek Cormier
bc1e93d639 build(bazel): refactor aio example e2es to fix windows performance
Use the same config flag to enable local vs npm deps as aio.
2022-11-22 13:51:16 -07:00
Derek Cormier
7a134cf41a build(bazel): incrementally run aio example e2e tests
Replaces the workflow where all example e2es are run at once
2022-11-22 13:51:16 -07:00
Derek Cormier
8015d467fd build(bazel): remove rules_nodejs patch
This patch was added to remove an unnecessary wrapper script around
nodejs binaries which prevented running esm scripts when the linker
was disabled.
2022-11-22 13:51:16 -07:00
Derek Cormier
07126ae40f build(bazel): fix race conditions in windows aio build
Disables the rules_nodejs linker and adds a custom esm module resolver
2022-11-22 13:51:16 -07:00
Derek Cormier
9a27c4cb50 build(bazel): incrementally build aio example zips and live examples
The existing scripts were amended to work on one example at a time
2022-11-22 13:51:16 -07:00
Derek Cormier
b5ebe9ae6e build(bazel): run aio application e2e tests under bazel
Includes a postinstall fix for puppeteer so that chromium
can be run with protractor on osx under bazel
2022-11-22 13:51:16 -07:00
Derek Cormier
20ff128103 build(bazel): create targets for aio example tooling tests
This replaces the boilerplate:test npm script
2022-11-22 13:51:16 -07:00
Derek Cormier
431c562815 build(bazel): add bazel targets for aio doc generation
This is an incremental step to produce dgeni output with bazel. The
generated outputs are not yet used by other targets.
2022-11-22 13:51:16 -07:00
Angular Robot
4de35735d3 build: update io_bazel_rules_sass digest to f6ceac7 (#47376)
See associated pull request for more information.

PR Close #47376
2022-10-11 23:16:21 +00:00
Alan Agius
1b9fd46d14 feat(core): add support for Node.js version 18 (#47730)
This change aligns with the supported Node.js versions of the Angular CLI.
See: https://github.com/angular/angular-cli/pull/24026

BREAKING CHANGE: Angular no longer supports Node.js versions `14.[15-19].x` and `16.[10-12].x`. Current supported versions of Node.js are `14.20.x`, `16.13.x` and `18.10.x`.

PR Close #47730
2022-10-11 17:21:19 +00:00
Angular Robot
b9f80d277d build: update io_bazel_rules_sass digest to f3874ae (#47292)
See associated pull request for more information.

PR Close #47292
2022-09-06 09:59:21 -07:00
Angular Robot
8340da92bb build: update io_bazel_rules_sass digest to 6802532 (#47104)
See associated pull request for more information.

PR Close #47104
2022-08-23 09:24:56 -07:00
Angular Robot
f6c57e856b build: update io_bazel_rules_sass digest to 697e5a0 (#47046)
See associated pull request for more information.

PR Close #47046
2022-08-05 09:57:45 -07:00
Angular Robot
de1e28006b build: update io_bazel_rules_sass digest to 70ffe01 (#47023)
See associated pull request for more information.

PR Close #47023
2022-08-04 13:08:42 -07:00
Paul Gschwendtner
b757b1387c build: update dev-infra packages and account for build-tooling split from ng-dev (#46976)
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.

PR Close #46976
2022-08-02 09:37:37 -07:00
Angular Robot
d6899d516d build: update io_bazel_rules_sass digest to 030f696 (#46947)
See associated pull request for more information.

PR Close #46947
2022-08-01 09:40:03 -07:00
Paul Gschwendtner
7b9269c5e4 build: account for integration test rule change (#46778)
The integration test rule now always executes tests in a directory
outside of the execroot. This ensures a more hermetic test environment
on platforms without a sandbox, or when tests are run with `tags:
local`.

As part of this change, an issue with Yarn 1.x. and `nodejs_binary`
unveiled. Yarn 1.x. is resolved properly using the tool mapping but
when Yarn inside Yarn is invoked (e.g. using `package.json` scripts),
then the second nested Yarn invocation fails due to an unknown path.

This happens because Yarn in the original invocation creates another
directory in the `/tmp` directory and modifies the `PATH` so that
the same `yarn` can be invoked again. This makes sense conceptually
but breaks in our case because the Yarn Bash script put into the `/tmp`
directory tries to resolve our vendored Yarn script relatively (which
is the wrong spot here). It worked previously in the execroot because
`nodejs_binary` invoked Yarn through `<external>/../node.sh
<absolute-path-to-yarn-cjs-script>`, but outside the execroot it invoked
Yarn using a relative path (which then ended up being preserved in the
Yarn temporary directory).

We can fix this by updating the Bazel NodeJS repository which seems to
have coincidentally have a fix for the path resolution. See:

https://github.com/bazelbuild/rules_nodejs/pull/3493#event-6870301735.

PR Close #46778
2022-07-11 20:55:30 +00:00
Derek Cormier
2c8fd2b57b build(bazel): enable runfiles (#46313)
Patches are required for tsec and rules_webtesting. The fix for
rules_webtesting was merged to that repo
(581b1557e3)
but it's unclear when a release will be cut.

PR Close #46313
2022-06-14 16:58:19 +00:00
Renovate Bot
0410c0901e build: update all non-major dependencies (#46150)
PR Close #46150
2022-06-10 14:26:34 +00:00
Renovate Bot
d869ede818 build: update all non-major dependencies (#45967)
PR Close #45967
2022-05-20 14:18:09 -07:00
Paul Gschwendtner
be7955d84e build: use vendored yarn script for installing Sass repositories (#45892)
Fixes the Bazel analysis warning and the fact that Yarn is unnecessarily
downloaded by `rules_nodejs`.

```
DEBUG: /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/external/build_bazel_rules_nodejs/index.bzl:73:14: yarn_install#yarn attribute not set and no repository named 'yarn' exists; installing default yarn
```

PR Close #45892
2022-05-05 13:56:38 -07:00
George Kalpakas
e1454aeb7b build(common): update CLDR to version 41 (#45714)
Update CLDR, which is used to generate the locales files, to version 41.
Also, make necessary code changes to account for changes in the CLDR
data.

Fixes #43301

PR Close #45714
2022-04-29 12:20:08 -04:00
George Kalpakas
57a9c17e7c build(common): specify CLDR version to use by cldr (#45714)
While generating locales, two sets of data (both derived from the
[CLDR project][1]) are used:
- JSON data with the [`cldrjs` package][2], which is used for most
  operations.
- XML data with the [`cldr` package][3], which is used for generating
  plural-related data.

The JSON data is brought in from the [unicode-org/cldr-json][4]
repository. Since we control the version of the repository that we use,
we can control the CLDR version that these correspond to.

Previously, however, we used the XML data that were bundled with the
[`cldr` package[3]. As a result, the two sets of data could correspond
to different CLDR versions, resulting in incorrect/inconsistent locales
files.

This commit addresses the problem by utilizing the `load()` method of
the [`cldr` package][3], which allows passing in a custom path to the
CLDR XML data (instead of using the bundled data. This way, we can
ensure that the data used for all operations correspond to the same CLDR
version.

Related discussion: #43301

[1]: https://github.com/unicode-org/cldr
[2]: https://www.npmjs.com/package/cldrjs
[3]: https://www.npmjs.com/package/cldr
[4]: https://github.com/unicode-org/cldr-json

PR Close #45714
2022-04-29 12:20:08 -04:00
Renovate Bot
48b8a1fcf0 build: update all non-major dependencies (#45470)
Updates all non-major dependencies, including Bazel

PR Close #45470
2022-04-11 21:01:09 +00:00
Paul Gschwendtner
a24293ae80 build: migrate more usages from @bazel/typescript to @bazel/concatjs (#45431)
As mentioned in previous commits (check them for more details), `@bazel/typescript`
no longer contains `ts_library`-specific code, so we no longer need that dependency.

PR Close #45431
2022-03-25 12:18:34 -07:00
Renovate Bot
010a39f856 build: update bazel (#45431)
Update `@bazel` packages to the latest 5.x version.

Some of the changes here are modeled after
angular/dev-infra@40c0ac8559.

Co-Authored-By: George Kalpakas <kalpakas.g@gmail.com>

PR Close #45431
2022-03-25 12:18:33 -07:00
Derek Cormier
22d1dc0acb build(bazel): add bazel build and test targets for aio build (#45022)
First step towards a migration of aio to bazel. Not yet built by ci.

PR Close #45022
2022-03-14 09:25:34 -07:00
Renovate Bot
561bd750b5 build: update dependency io_bazel_rules_sass to v1.49.8 (#45128)
PR Close #45128
2022-02-18 13:34:14 -08:00
Renovate Bot
6769f94b14 build: update all non-major dependencies (#45037)
PR Close #45037
2022-02-16 13:50:43 -08:00