build: Bazel rules_js — link node_modules via pnpm-lock

bazel build //walldash:node_modules. Adds pnpm-lock.yaml (from package-lock)
+ pnpm.onlyBuiltDependencies, and npm_link_all_packages in BUILD.bazel.
Native bun build/run is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cediackermann 2026-06-13 20:39:07 +02:00
parent 8c8c37fb7e
commit f69b9f401a
No known key found for this signature in database
3 changed files with 1083 additions and 15 deletions

View file

@ -1,19 +1,12 @@
# Next.js app built with bun, which rules_js cannot consume. This app keeps its
# native `bun`/Next.js build. The filegroup just makes the directory a valid
# Bazel package and exposes sources.
# TODO: for real Bazel builds, generate a package-lock.json and adopt
# aspect_rules_js (https://github.com/aspect-build/rules_js).
load("@npm//:defs.bzl", "npm_link_all_packages")
# rules_js PoC: link the full npm dependency graph (from package-lock.json) via
# Bazel. `bazel build //walldash:node_modules` resolves all packages.
# A complete `next build` under Bazel is a further step (ts_project + next rule).
npm_link_all_packages(name = "node_modules")
filegroup(
name = "srcs",
srcs = glob(["src/**"], allow_empty = True) + glob(
[
"*.ts",
"*.tsx",
"*.mjs",
"*.js",
"*.json",
],
allow_empty = True,
),
srcs = glob(["src/**"], allow_empty = True),
visibility = ["//visibility:public"],
)

View file

@ -28,5 +28,8 @@
"react": "^19.2.5",
"react-dom": "^19.2.5",
"react-router-dom": "^7.14.1"
},
"pnpm": {
"onlyBuiltDependencies": []
}
}

1072
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff