Skip to content

Commit 31d2f41

Browse files
authored
feat: bundle and vendor cli (#235)
1 parent 2c0cf74 commit 31d2f41

File tree

10 files changed

+332
-200
lines changed

10 files changed

+332
-200
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pnpm-lock.yaml linguist-generated
2+
dist/cli/index.js linguist-generated

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
bazel_dep(name = "aspect_bazel_lib", version = "2.11.0")
2+
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
23
bazel_dep(name = "aspect_rules_jest", version = "0.22.0")
34
bazel_dep(name = "aspect_rules_js", version = "2.1.2")
45
bazel_dep(name = "aspect_rules_lint", version = "1.0.8")

dist/cli/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")
2+
3+
write_source_file(
4+
name = "cli",
5+
in_file = "//src/application/cli:bundle",
6+
out_file = "index.js",
7+
)

dist/cli/index.js

Lines changed: 264 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/cli/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ bats_test(
1010
"//e2e/fixtures",
1111
"//e2e/fixtures:versioned",
1212
"//e2e/fixtures:zip",
13-
"//src/application/cli",
14-
"//src/application/cli:bin",
13+
"//src/application/cli:bundle",
1514
"@nodejs_toolchains//:resolved_toolchain",
1615
],
1716
env = {
18-
"CLI_BIN": "$(rootpath //src/application/cli:bin)",
17+
"CLI_BIN": "$(rootpath //src/application/cli:bundle)",
1918
"NODE_BIN": "$(rootpath @nodejs_toolchains//:resolved_toolchain)",
2019
},
2120
)

e2e/cli/e2e.bats

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ bats_load_library "bats-assert"
22
bats_load_library "bats-file"
33
bats_load_library "bats-support"
44

5-
setup_file() {
6-
export CLI_BIN="$(dirname "${CLI_BIN}")/../main.js"
7-
}
8-
95
setup() {
106
export REGISTRY_PATH="${TEST_TMPDIR}/bazel-central-registry"
117
mkdir -p "${REGISTRY_PATH}/modules"

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@
8686
"dependencies": {
8787
"long": "5.2.3"
8888
}
89+
},
90+
"debug": {
91+
"dependencies": {
92+
"supports-color": "*"
93+
}
94+
},
95+
"follow-redirects": {
96+
"dependencies": {
97+
"debug": "*"
98+
}
8999
}
90100
}
91101
}

0 commit comments

Comments
 (0)