Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# @generated
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-203833057
package.json=1896764724
pnpm-lock.yaml=-141829712
pnpm-workspace.yaml=1711114604
yarn.lock=-1888396006
8 changes: 5 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test
# On CI we might set this to `3` to run with deflaking.
test --flaky_test_attempts=1

# Required by `rules_ts`.
common --@aspect_rules_ts//ts:skipLibCheck=always
common --@aspect_rules_ts//ts:default_to_tsc_transpiler

###############################
# Filesystem interactions #
###############################
Expand Down Expand Up @@ -102,8 +106,6 @@ build:remote --cpu=k8
build:remote --host_cpu=k8

# Toolchain and platform related flags
build:remote --crosstool_top=@npm//@angular/build-tooling/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=@npm//@angular/build-tooling/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform
build:remote --host_platform=@npm//@angular/build-tooling/bazel/remote-execution:platform
build:remote --platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform
Expand All @@ -115,7 +117,7 @@ build:remote --remote_cache=remotebuildexecution.googleapis.com
build:remote --remote_executor=remotebuildexecution.googleapis.com
build:remote --remote_upload_local_results=false

build:remote --experimental_remote_grpc_log=/tmp/rbe-grpc.log
build:remote --remote_grpc_log=/tmp/rbe-grpc.log

# See: https://docs.google.com/document/d/1NgDPsCIwprDdqC1zj0qQrh5KGK2hQTSTux1DAvi4rSc/edit?tab=t.0.
build:remote --experimental_remote_execution_keepalive
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
6.5.0
1 change: 1 addition & 0 deletions .ng-dev/release.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {ReleaseConfig} from '@angular/ng-dev';

/** Configuration for the `ng-dev release` command. */
export const release: ReleaseConfig = {
rulesJsInteropMode: true,
publishRegistry: 'https://wombat-dressing-room.appspot.com',
representativeNpmPackage: '@angular/core',
npmPackages: [
Expand Down
8 changes: 7 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
engine-strict = true
# Yarn Berry doesn't check engines at all, so pnpm shouldn't either.
engine-strict = false

# Disabling pnpm [hoisting](https://pnpm.io/npmrc#hoist) by setting `hoist=false` is recommended on
# projects using rules_js so that pnpm outside of Bazel lays out a node_modules tree similar to what
# rules_js lays out under Bazel (without a hidden node_modules/.pnpm/node_modules)
hoist=false
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.prettierrc

pnpm-lock.yaml
7 changes: 6 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("//tools:defaults.bzl", "nodejs_binary")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("//:yarn.bzl", "YARN_PATH")
load("//tools:defaults.bzl", "nodejs_binary")

package(default_visibility = ["//visibility:public"])

Expand All @@ -16,6 +17,10 @@ exports_files([
"angular.json",
])

npm_link_all_packages(
name = "node_modules",
)

filegroup(
# filegroup is needed so that this package.json file can be a dep
# in a js_library target, which doesn't allow source file deps
Expand Down
110 changes: 96 additions & 14 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
workspace(
name = "angular",
managed_directories = {
"@npm": ["node_modules"],
},
)

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//:yarn.bzl", "YARN_LABEL")

Expand Down Expand Up @@ -34,19 +32,22 @@ http_archive(
],
)

# Fetch Aspect lib for utilities like write_source_files
# NOTE: We cannot move past version 1.23.2 of aspect_bazel_lib because it requires us to move to bazel 6.0.0 which
# breaks our usage of managed_directories
http_archive(
name = "aspect_bazel_lib",
sha256 = "4b2e774387bae6242879820086b7b738d49bf3d0659522ea5d9363be01a27582",
strip_prefix = "bazel-lib-1.23.2",
url = "https://github.com/aspect-build/bazel-lib/archive/refs/tags/v1.23.2.tar.gz",
name = "aspect_rules_js",
sha256 = "75c25a0f15a9e4592bbda45b57aa089e4bf17f9176fd735351e8c6444df87b52",
strip_prefix = "rules_js-2.1.0",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.0/rules_js-v2.1.0.tar.gz",
)

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

# Setup the Node.js toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")

NODE_VERSION = "20.11.1"

NODE_20_REPO = {
"20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
Expand All @@ -60,7 +61,14 @@ NODE_20_REPO = {
nodejs_register_toolchains(
name = "nodejs",
node_repositories = NODE_20_REPO,
node_version = "20.11.1",
node_version = NODE_VERSION,
)

load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")

rules_js_register_toolchains(
node_repositories = NODE_20_REPO,
node_version = NODE_VERSION,
)

# Download npm dependencies.
Expand All @@ -74,6 +82,7 @@ yarn_install(
data = [
YARN_LABEL,
"//:.yarnrc",
"//:tools/npm-patches/@angular+ng-dev+0.0.0-a6dcd24107d12114198251ee5d20cda814a1986a.patch",
"//:tools/npm-patches/@bazel+jasmine+5.8.1.patch",
"//tools:postinstall-patches.js",
"//tools/esm-interop:patches/npm/@angular+build-tooling+0.0.0-d30a56c19bafaac67cf44e605ed8c2c0e45b0a51.patch",
Expand All @@ -88,13 +97,51 @@ yarn_install(
exports_directories_only = False,
manual_build_file_contents = npm_package_archives(),
package_json = "//:package.json",
# We prefer to symlink the `node_modules` to only maintain a single install.
# See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details.
symlink_node_modules = True,
yarn = YARN_LABEL,
yarn_lock = "//:yarn.lock",
)

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

npm_translate_lock(
name = "npm2",
data = [
"//:package.json",
"//:pnpm-workspace.yaml",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
update_pnpm_lock = True,
verify_node_modules_ignored = "//:.bazelignore",
yarn_lock = "//:yarn.lock",
)

load("@npm2//:repositories.bzl", "npm_repositories")

npm_repositories()

http_archive(
name = "aspect_rules_ts",
sha256 = "9acd128abe77397505148eaa6895faed57839560dbf2177dd6285e51235e2724",
strip_prefix = "rules_ts-3.3.1",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.3.1/rules_ts-v3.3.1.tar.gz",
)

load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")

rules_ts_dependencies(
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.8.2 | jq -r '.dist.integrity'
ts_integrity = "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
ts_version_from = "//:package.json",
)

http_archive(
name = "aspect_rules_rollup",
sha256 = "c4062681968f5dcd3ce01e09e4ba73670c064744a7046211763e17c98ab8396e",
strip_prefix = "rules_rollup-2.0.0",
url = "https://github.com/aspect-build/rules_rollup/releases/download/v2.0.0/rules_rollup-v2.0.0.tar.gz",
)

load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

aspect_bazel_lib_dependencies()
Expand Down Expand Up @@ -194,3 +241,38 @@ yarn_install(
yarn = YARN_LABEL,
yarn_lock = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:yarn.lock",
)

git_repository(
name = "devinfra",
commit = "c4f7d3cdec164044284139182b709dfd4be339ed",
remote = "https://github.com/angular/dev-infra.git",
)

load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1")

setup_dependencies_1()

load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")

setup_dependencies_2()

git_repository(
name = "rules_angular",
commit = "0a54fca16350cab2b823908f1725aec175fcfeb2",
remote = "https://github.com/devversion/rules_angular.git",
)

load("@rules_angular//setup:step_1.bzl", "rules_angular_step1")

rules_angular_step1()

load("@rules_angular//setup:step_2.bzl", "rules_angular_step2")

rules_angular_step2()

load("@rules_angular//setup:step_3.bzl", "rules_angular_step3")

rules_angular_step3(
angular_compiler_cli = "//:node_modules/@angular/compiler-cli",
typescript = "//:node_modules/typescript",
)
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@
"undici": "^6.15.0",
"vrsource-tslint-rules": "6.0.0"
},
"// 3": "Ensure that transitive dependencies on `https-proxy-agent` are at minimum v5 as older versions patch NodeJS directly, breaking tools like webdriver which is used by the karma-sauce-launcher as an example.",
"// 4": "Ensure that a single instance of the `saucelabs` package is used. Protractor and the Karma sauce launcher pull this package as dependency. A single instance allows for e.g. easier patching in the Karma config.",
"resolutions": {
"**/https-proxy-agent": "7.0.6",
"**/saucelabs": "9.0.2"
"https-proxy-agent": "7.0.6",
"saucelabs": "9.0.2"
},
"pnpm": {
"onlyBuiltDependencies": []
}
}
18 changes: 18 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
load("//:packages.bzl", "DOCS_ENTRYPOINTS")
load("//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest.bzl", "generate_api_manifest")
load("//tools:defaults.bzl", "ts_config", "ts_library")
Expand Down Expand Up @@ -33,6 +34,23 @@ ts_config(
],
)

rules_js_tsconfig(
name = "build-tsconfig",
src = "tsconfig-build.json",
deps = [
"//:node_modules/tslib",
],
)

rules_js_tsconfig(
name = "test-tsconfig",
src = "tsconfig-test.json",
deps = [
":build-tsconfig",
"//:node_modules/@types/jasmine",
],
)

exports_files([
"license-banner.txt",
"README.md",
Expand Down
Loading