feat: new bun_build and bun_compile, extend bun_install
This commit is contained in:
@@ -143,3 +143,25 @@ sh_test(
|
||||
":paraglide_monorepo_app_b_build",
|
||||
],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "workspace_filtered_script",
|
||||
script = "say",
|
||||
package_json = "workspace_run/package.json",
|
||||
data = [
|
||||
"workspace_run/packages/pkg-a/package.json",
|
||||
"workspace_run/packages/pkg-a/say.ts",
|
||||
"workspace_run/packages/pkg-b/package.json",
|
||||
"workspace_run/packages/pkg-b/say.ts",
|
||||
],
|
||||
filters = ["./packages/pkg-a"],
|
||||
execution_mode = "sequential",
|
||||
silent = True,
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_script_workspace_filter_test",
|
||||
srcs = ["run_workspace_script.sh"],
|
||||
args = ["$(location :workspace_filtered_script)"],
|
||||
data = [":workspace_filtered_script"],
|
||||
)
|
||||
|
||||
15
tests/script_test/run_workspace_script.sh
Executable file
15
tests/script_test/run_workspace_script.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
script_bin="$1"
|
||||
output="$(${script_bin})"
|
||||
|
||||
if [[ ${output} != *"pkg-a"* ]]; then
|
||||
echo "Expected workspace run output to include pkg-a: ${output}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${output} == *"pkg-b"* ]]; then
|
||||
echo "Workspace filter unexpectedly included pkg-b: ${output}" >&2
|
||||
exit 1
|
||||
fi
|
||||
7
tests/script_test/workspace_run/package.json
Normal file
7
tests/script_test/workspace_run/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "workspace-run-root",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "pkg-a",
|
||||
"scripts": {
|
||||
"say": "bun ./say.ts"
|
||||
}
|
||||
}
|
||||
1
tests/script_test/workspace_run/packages/pkg-a/say.ts
Normal file
1
tests/script_test/workspace_run/packages/pkg-a/say.ts
Normal file
@@ -0,0 +1 @@
|
||||
console.log("pkg-a");
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "pkg-b",
|
||||
"scripts": {
|
||||
"say": "bun ./say.ts"
|
||||
}
|
||||
}
|
||||
1
tests/script_test/workspace_run/packages/pkg-b/say.ts
Normal file
1
tests/script_test/workspace_run/packages/pkg-b/say.ts
Normal file
@@ -0,0 +1 @@
|
||||
console.log("pkg-b");
|
||||
Reference in New Issue
Block a user