Skip to content

Commit 5db3d0f

Browse files
committed
fix: transitive bzlmod usage of rules_ts
1 parent caf018f commit 5db3d0f

28 files changed

+360
-54
lines changed

e2e/bzlmodules/.bazelignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module_a
2+
module_b
3+
module_c

e2e/bzlmodules/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
load("@bazel_skylib//rules:build_test.bzl", "build_test")
2+
3+
build_test(
4+
name = "module-tests",
5+
targets = [
6+
"@module_a//:content",
7+
# "@module_b//:all",
8+
"@module_c//:module_a_content_tar",
9+
],
10+
)

e2e/bzlmodules/MODULE.bazel

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The root module must do the override despite not directly using the module
2+
local_path_override(
3+
module_name = "aspect_rules_ts",
4+
path = "../..",
5+
)
6+
7+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
8+
bazel_dep(name = "module_a")
9+
local_path_override(
10+
module_name = "module_a",
11+
path = "./module_a",
12+
)
13+
14+
# bazel_dep(name = "module_b")
15+
# local_path_override(
16+
# module_name = "module_b",
17+
# path = "./module_b",
18+
# )
19+
20+
bazel_dep(name = "module_c")
21+
local_path_override(
22+
module_name = "module_c",
23+
path = "./module_c",
24+
)

e2e/bzlmodules/WORKSPACE

Whitespace-only changes.

e2e/bzlmodules/module_a/.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#common --@aspect_rules_ts//ts:skipLibCheck=always
2+
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
2+
3+
ts_config(
4+
name = "tsconfig",
5+
src = "tsconfig.json",
6+
)
7+
8+
ts_project(
9+
name = "content",
10+
srcs = ["content.ts"],
11+
declaration = True,
12+
declaration_map = True,
13+
source_map = True,
14+
tsconfig = ":tsconfig",
15+
visibility = ["//visibility:public"],
16+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module(name = "module_a")
2+
3+
bazel_dep(name = "aspect_rules_ts", version = "0.0.0")
4+
local_path_override(
5+
module_name = "aspect_rules_ts",
6+
path = "../../..",
7+
)
8+
9+
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
10+
rules_ts_ext.deps(
11+
ts_version_from = "//:package.json",
12+
)
13+
use_repo(rules_ts_ext, "npm_typescript")

e2e/bzlmodules/module_a/WORKSPACE

Whitespace-only changes.

e2e/bzlmodules/module_a/content.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const CONTENT = 'content'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "module_a",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"packageManager": "[email protected]",
13+
"dependencies": {
14+
"typescript": "5.8.3"
15+
}
16+
}

0 commit comments

Comments
 (0)