Skip to content

Third iteration of rules_js migration #30697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2025
Merged
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
@@ -1,8 +1,9 @@
# @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=-2023857461
package.json=-2113674231
pnpm-lock.yaml=409413002
pnpm-workspace.yaml=1711114604
yarn.lock=1593491870
.npmrc=-1406867100
package.json=-370577278
pnpm-lock.yaml=1107477480
pnpm-workspace.yaml=14857322
src/cdk/package.json=-908433069
yarn.lock=-987404687
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ integration/yarn-pnp-compat/.yarn/cache
integration/yarn-pnp-compat/.yarn/unplugged
integration/yarn-pnp-compat/.yarn/install-state.gz
integration/yarn-pnp-compat/node_modules

src/cdk/node_modules
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ common --@aspect_rules_ts//ts:default_to_tsc_transpiler
# https://github.com/bazelbuild/rules_typescript/issues/12 which affects the common case of
# having `tsconfig.json` in the WORKSPACE directory. Instead, you should run
# `bazel info output_base` to find out where the outputs went.
build --symlink_prefix=/
build --symlink_prefix=dist/

# Performance: avoid stat'ing input files
build --watchfs
Expand Down
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ engine-strict = false
# 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

# Avoid pnpm auto-installing peer dependencies. We want to be explicit about our versions used
# for peer dependencies, avoiding potential mismatches. In addition, it ensures we can continue
# to rely on peer dependency placeholders substituted via Bazel.
auto-install-peers=false
13 changes: 13 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ yarn_install(
"//:tools/postinstall/patches/@angular+build-tooling+0.0.0-1ebf18a3a60b182a3dbad12e9a149fd93af5c29b.patch",
"//:tools/postinstall/patches/@bazel+concatjs+5.8.1.patch",
"//:tools/postinstall/patches/tsec+0.2.2.patch",
"//src/cdk:package.json",
],
# Currently disabled due to:
# 1. Missing Windows support currently.
Expand Down Expand Up @@ -175,6 +176,7 @@ npm_translate_lock(
data = [
"//:package.json",
"//:pnpm-workspace.yaml",
"//src/cdk:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
Expand Down Expand Up @@ -209,6 +211,17 @@ http_archive(
url = "https://github.com/aspect-build/rules_rollup/releases/download/v2.0.0/rules_rollup-v2.0.0.tar.gz",
)

http_archive(
name = "aspect_rules_jasmine",
sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529",
strip_prefix = "rules_jasmine-2.0.0",
url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz",
)

load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies")

rules_jasmine_dependencies()

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

git_repository(
Expand Down
16 changes: 7 additions & 9 deletions integration/size-test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@npm//@bazel/esbuild:index.bzl", "esbuild_config")
load("//tools:defaults.bzl", "ts_library")
load("//tools:defaults2.bzl", "ts_project")

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

Expand All @@ -19,16 +19,14 @@ esbuild_config(
],
)

ts_library(
ts_project(
name = "check-size",
srcs = ["check-size.ts"],
# TODO(ESM): remove this once the Bazel NodeJS rules can handle ESM with `nodejs_binary`.
devmode_module = "commonjs",
deps = [
"@npm//@bazel/runfiles",
"@npm//@types/node",
"@npm//@types/yaml",
"@npm//chalk",
"@npm//yaml",
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//:node_modules/@types/yaml",
"//:node_modules/chalk",
"//:node_modules/yaml",
],
)
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"tslint": "tslint -c tslint.json --project ./tsconfig.json",
"stylelint": "stylelint \"src/**/*.+(css|scss)\" --config .stylelintrc.json",
"resync-caretaker-app": "ts-node --project scripts/tsconfig.json scripts/caretaking/resync-caretaker-app-prs.ts",
"ts-circular-deps:check": "yarn -s ng-dev ts-circular-deps check --config ./src/circular-deps-test.conf.js",
"ts-circular-deps:approve": "yarn -s ng-dev ts-circular-deps approve --config ./src/circular-deps-test.conf.js",
"ts-circular-deps:check": "yarn -s ng-dev ts-circular-deps check --config ./src/circular-deps-test.conf.cjs",
"ts-circular-deps:approve": "yarn -s ng-dev ts-circular-deps approve --config ./src/circular-deps-test.conf.cjs",
"merge": "yarn -s ng-dev pr merge",
"approve-api": "node ./scripts/approve-api-golden.js",
"approve-size-tests": "node ./scripts/approve-size-golden.js",
Expand Down Expand Up @@ -134,6 +134,7 @@
"inquirer": "^8.2.0",
"jasmine": "^4.1.0",
"jasmine-core": "^4.1.0",
"jasmine-reporters": "^2.5.2",
"jsonc-parser": "^3.0.0",
"kagekiri": "^1.4.1",
"karma": "^6.3.12",
Expand Down Expand Up @@ -164,6 +165,7 @@
"semver": "^7.3.5",
"send": "^0.17.2",
"shelljs": "^0.8.5",
"source-map-support": "^0.5.21",
"stylelint": "^14.14.0",
"terser": "^5.10.0",
"ts-node": "^10.9.1",
Expand Down
10 changes: 0 additions & 10 deletions packages.bzl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Each individual package uses a placeholder for the version of Angular to ensure they're
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
# version for the placeholders.
TSLIB_PACKAGE_VERSION = "^2.3.0"
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.4.0"

# Packages which are versioned together on npm
ANGULAR_COMPONENTS_SCOPED_PACKAGES = ["@angular/%s" % p for p in [
"material",
Expand All @@ -27,12 +21,8 @@ PKG_GROUP_REPLACEMENTS = {
NPM_PACKAGE_SUBSTITUTIONS = dict(PKG_GROUP_REPLACEMENTS, **{
# Peer dependency version on the Angular framework.
"0.0.0-NG": "{STABLE_FRAMEWORK_PEER_DEP_RANGE}",
# Version of `tslib`
"0.0.0-TSLIB": TSLIB_PACKAGE_VERSION,
# Version of the local package being built, generated via the `--workspace_status_command` flag.
"0.0.0-PLACEHOLDER": "{STABLE_PROJECT_VERSION}",
# Version of `rxjs`
"0.0.0-RXJS": RXJS_PACKAGE_VERSION,
})

NO_STAMP_NPM_PACKAGE_SUBSTITUTIONS = dict(NPM_PACKAGE_SUBSTITUTIONS, **{
Expand Down
Loading
Loading