Compare commits
7 Commits
v0.1.0
...
e567dad413
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e567dad413 | ||
|
|
7139aa3ba2 | ||
|
|
49a5054b02 | ||
|
|
10758aa20a | ||
|
|
fb7afbb138 | ||
|
|
3a07d02c0d | ||
|
|
a3591b85a5 |
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ ! -d "/Users/eric/Projects/rules_bun" ]]; then
|
||||
echo "Cannot find source directory; Did you move it?"
|
||||
echo "(Looking for "/Users/eric/Projects/rules_bun")"
|
||||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# rebuild the cache forcefully
|
||||
_nix_direnv_force_reload=1 direnv exec "/Users/eric/Projects/rules_bun" true
|
||||
|
||||
# Update the mtime for .envrc.
|
||||
# This will cause direnv to reload again - but without re-building.
|
||||
touch "/Users/eric/Projects/rules_bun/.envrc"
|
||||
|
||||
# Also update the timestamp of whatever profile_rc we have.
|
||||
# This makes sure that we know we are up to date.
|
||||
touch -r "/Users/eric/Projects/rules_bun/.envrc" "/Users/eric/Projects/rules_bun/.direnv"/*.rc
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/7f0478ddr51i3r708dpkljnvmzwc2fhn-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/affmc6lhad8f6q3iaa3iydcdjwr8lwgp-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/arl2vkxnjyw2zri2g2v6g4k6x165iidj-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/g5v3sgqy6a0fsmas7mnapc196flrplix-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/jzfmmjnq1cip816awnliw7ir69pcyg00-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/kx00h535s3jzb9803vnylxllij3zhix5-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/ngdfag0pfs1h54pbjs9ywah4zhqsphf1-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/nk13680f34w3q01a1q69c48my6fi7cxz-source
|
||||
@@ -1 +0,0 @@
|
||||
/nix/store/khk85hba90fc8fa8h8b920qqry6nz0qw-nix-shell-env
|
||||
File diff suppressed because one or more lines are too long
7
.gitignore
vendored
7
.gitignore
vendored
@@ -11,6 +11,7 @@
|
||||
build/
|
||||
dist/
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
|
||||
# Directories for the Bazel IntelliJ plugin containing the generated
|
||||
# IntelliJ project files and plugin configuration. Seperate directories are
|
||||
@@ -19,4 +20,8 @@ node_modules/
|
||||
/.aswb/
|
||||
/.clwb/
|
||||
|
||||
.env
|
||||
.env
|
||||
!tests/.env
|
||||
!examples/.env
|
||||
|
||||
.direnv
|
||||
@@ -1 +1 @@
|
||||
/nix/store/mgb6bn9dy5bpczkl81jp4r03bplwfd8w-pre-commit-config.json
|
||||
/nix/store/vq88dl8yys4hbw4gq6kwypah5ykqr8xs-pre-commit-config.json
|
||||
28
MODULE.bazel
28
MODULE.bazel
@@ -1,13 +1,15 @@
|
||||
module(
|
||||
name = "rules_bun",
|
||||
version = "0.1.0",
|
||||
version = "0.2.2",
|
||||
)
|
||||
|
||||
# Core ruleset dependencies.
|
||||
bazel_dep(name = "platforms", version = "1.0.0")
|
||||
bazel_dep(name = "rules_shell", version = "0.6.1")
|
||||
bazel_dep(name = "bazel_skylib", version = "1.8.2")
|
||||
bazel_dep(name = "stardoc", version = "0.7.2")
|
||||
|
||||
# Repository-local setup for this ruleset's own tests and examples.
|
||||
bun_ext = use_extension("//bun:extensions.bzl", "bun")
|
||||
use_repo(
|
||||
bun_ext,
|
||||
@@ -18,6 +20,30 @@ use_repo(
|
||||
"bun_windows_x64",
|
||||
)
|
||||
|
||||
# Test fixture dependency installation used by //tests/script_test.
|
||||
bun_install_ext = use_extension("//bun:extensions.bzl", "bun_install")
|
||||
bun_install_ext.install(
|
||||
name = "script_test_vite_node_modules",
|
||||
package_json = "//tests/script_test:vite_app/package.json",
|
||||
bun_lockfile = "//tests/script_test:vite_app/bun.lock",
|
||||
)
|
||||
use_repo(bun_install_ext, "script_test_vite_node_modules")
|
||||
|
||||
bun_install_ext.install(
|
||||
name = "script_test_vite_monorepo_node_modules",
|
||||
package_json = "//tests/script_test:vite_monorepo/package.json",
|
||||
bun_lockfile = "//tests/script_test:vite_monorepo/bun.lock",
|
||||
)
|
||||
use_repo(bun_install_ext, "script_test_vite_monorepo_node_modules")
|
||||
|
||||
bun_install_ext.install(
|
||||
name = "examples_vite_monorepo_node_modules",
|
||||
package_json = "//examples/vite_monorepo:package.json",
|
||||
bun_lockfile = "//examples/vite_monorepo:bun.lock",
|
||||
)
|
||||
use_repo(bun_install_ext, "examples_vite_monorepo_node_modules")
|
||||
|
||||
# Register the published Bun toolchains for this repository.
|
||||
register_toolchains(
|
||||
"//bun:darwin_aarch64_toolchain",
|
||||
"//bun:darwin_x64_toolchain",
|
||||
|
||||
36
MODULE.bazel.lock
generated
36
MODULE.bazel.lock
generated
@@ -189,8 +189,8 @@
|
||||
"moduleExtensions": {
|
||||
"//bun:extensions.bzl%bun": {
|
||||
"general": {
|
||||
"bzlTransitiveDigest": "oLR98WtKDCc+zh7Tvu9jtakNg8q/T1IPE38QR1FEQtI=",
|
||||
"usagesDigest": "NfJgMuTjZXXRLr1/kxxFkS1IKV2UyehFyr3fMvAke/k=",
|
||||
"bzlTransitiveDigest": "dy4VVPGLJrnr4plt8TA/E8PGKCOMrDWu6M9D5NWfNJo=",
|
||||
"usagesDigest": "pUJFcZPlt7todXukySNaxd4bl0KGB8biTd2Ygx044co=",
|
||||
"recordedInputs": [
|
||||
"REPO_MAPPING:,bazel_tools bazel_tools"
|
||||
],
|
||||
@@ -248,6 +248,38 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"//bun:extensions.bzl%bun_install": {
|
||||
"general": {
|
||||
"bzlTransitiveDigest": "dy4VVPGLJrnr4plt8TA/E8PGKCOMrDWu6M9D5NWfNJo=",
|
||||
"usagesDigest": "xWWY9DPXS5FKvNZvUbM6w+PBr8q9KbWKiP8wfD4RHLU=",
|
||||
"recordedInputs": [
|
||||
"REPO_MAPPING:,bazel_tools bazel_tools"
|
||||
],
|
||||
"generatedRepoSpecs": {
|
||||
"script_test_vite_node_modules": {
|
||||
"repoRuleId": "@@//internal:bun_install.bzl%bun_install_repository",
|
||||
"attributes": {
|
||||
"package_json": "@@//tests/script_test:vite_app/package.json",
|
||||
"bun_lockfile": "@@//tests/script_test:vite_app/bun.lock"
|
||||
}
|
||||
},
|
||||
"script_test_vite_monorepo_node_modules": {
|
||||
"repoRuleId": "@@//internal:bun_install.bzl%bun_install_repository",
|
||||
"attributes": {
|
||||
"package_json": "@@//tests/script_test:vite_monorepo/package.json",
|
||||
"bun_lockfile": "@@//tests/script_test:vite_monorepo/bun.lock"
|
||||
}
|
||||
},
|
||||
"examples_vite_monorepo_node_modules": {
|
||||
"repoRuleId": "@@//internal:bun_install.bzl%bun_install_repository",
|
||||
"attributes": {
|
||||
"package_json": "@@//examples/vite_monorepo:package.json",
|
||||
"bun_lockfile": "@@//examples/vite_monorepo:bun.lock"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
|
||||
"general": {
|
||||
"bzlTransitiveDigest": "ABI1D/sbS1ovwaW/kHDoj8nnXjQ0oKU9fzmzEG4iT8o=",
|
||||
|
||||
262
README.md
262
README.md
@@ -1,191 +1,205 @@
|
||||
# rules_bun
|
||||
# Bun rules for [Bazel](https://bazel.build)
|
||||
|
||||
Bazel rules for bun.
|
||||
`rules_bun` provides Bazel rules for running, testing, bundling, and developing
|
||||
JavaScript and TypeScript code with Bun.
|
||||
|
||||
## Rule reference
|
||||
## Repository layout
|
||||
|
||||
This repository follows the standard Bazel ruleset layout:
|
||||
|
||||
```text
|
||||
/
|
||||
MODULE.bazel
|
||||
README.md
|
||||
bun/
|
||||
BUILD.bazel
|
||||
defs.bzl
|
||||
extensions.bzl
|
||||
repositories.bzl
|
||||
toolchain.bzl
|
||||
docs/
|
||||
examples/
|
||||
tests/
|
||||
```
|
||||
|
||||
The public entrypoint for rule authors and users is `@rules_bun//bun:defs.bzl`.
|
||||
|
||||
## Public API
|
||||
|
||||
`rules_bun` exports these primary rules:
|
||||
|
||||
- `bun_binary`
|
||||
- `bun_bundle`
|
||||
- `bun_dev`
|
||||
- `bun_script`
|
||||
- `bun_test`
|
||||
- `js_library`
|
||||
- `ts_library`
|
||||
|
||||
Reference documentation:
|
||||
|
||||
- Published docs site: https://eriyc.github.io/rules_bun/
|
||||
- Generated API docs: [docs/rules.md](docs/rules.md)
|
||||
- Regenerate: `bazel build //docs:rules_md && cp bazel-bin/docs/rules.md docs/rules.md`
|
||||
- Generated build rule reference: [docs/rules.md](docs/rules.md)
|
||||
- `bun_install` extension docs: [docs/bun_install.md](docs/bun_install.md)
|
||||
- Docs index: [docs/index.md](docs/index.md)
|
||||
|
||||
## Use
|
||||
To refresh generated rule docs:
|
||||
|
||||
These steps show how to consume a tagged release of `rules_bun` in a separate Bazel workspace.
|
||||
|
||||
### 1) Add the module dependency
|
||||
|
||||
In your project's `MODULE.bazel`, add:
|
||||
|
||||
```starlark
|
||||
bazel_dep(name = "rules_bun", version = "0.1.0")
|
||||
|
||||
archive_override(
|
||||
module_name = "rules_bun",
|
||||
urls = ["https://github.com/Eriyc/rules_bun/archiv0.0.5.tar.gz"],
|
||||
strip_prefix = "rules_bun-v0.1.0",
|
||||
)
|
||||
```bash
|
||||
bazel build //docs:rules_md && cp bazel-bin/docs/rules.md docs/rules.md
|
||||
```
|
||||
|
||||
For channel/pre-release tags (for example `v0.1.0-rc.1`), use the matching folder prefix:
|
||||
## Bzlmod usage
|
||||
|
||||
Release announcements should provide a copy-pasteable module snippet in the
|
||||
standard ruleset form:
|
||||
|
||||
```starlark
|
||||
bazel_dep(name = "rules_bun", version = "0.1.0-rc.1")
|
||||
|
||||
archive_override(
|
||||
module_name = "rules_bun",
|
||||
urls = ["https://github.com/Eriyc/rules_bun/archiv0.0.5-rc.1.tar.gz"],
|
||||
strip_prefix = "rules_bun-v0.1.0-rc.1",
|
||||
)
|
||||
bazel_dep(name = "rules_bun", version = "0.2.2")
|
||||
```
|
||||
|
||||
Note: keep the `v` prefix in the Git tag URL and `strip_prefix`; for `bazel_dep(..., version = ...)`, use the module version string without the leading `v`.
|
||||
|
||||
### 2) Create Bun repositories with the extension
|
||||
|
||||
Still in `MODULE.bazel`, add:
|
||||
Then add the Bun repositories and register the toolchains in `MODULE.bazel`:
|
||||
|
||||
```starlark
|
||||
bun_ext = use_extension("@rules_bun//bun:extensions.bzl", "bun")
|
||||
|
||||
use_repo(
|
||||
bun_ext,
|
||||
"bun_linux_x64",
|
||||
"bun_linux_aarch64",
|
||||
"bun_darwin_x64",
|
||||
"bun_darwin_aarch64",
|
||||
"bun_windows_x64",
|
||||
bun_ext,
|
||||
"bun_linux_x64",
|
||||
"bun_linux_aarch64",
|
||||
"bun_darwin_x64",
|
||||
"bun_darwin_aarch64",
|
||||
"bun_windows_x64",
|
||||
)
|
||||
```
|
||||
|
||||
### 3) Register toolchains
|
||||
|
||||
Also in `MODULE.bazel`, register:
|
||||
|
||||
```starlark
|
||||
register_toolchains(
|
||||
"@rules_bun//bun:darwin_aarch64_toolchain",
|
||||
"@rules_bun//bun:darwin_x64_toolchain",
|
||||
"@rules_bun//bun:linux_aarch64_toolchain",
|
||||
"@rules_bun//bun:linux_x64_toolchain",
|
||||
"@rules_bun//bun:windows_x64_toolchain",
|
||||
"@rules_bun//bun:darwin_aarch64_toolchain",
|
||||
"@rules_bun//bun:darwin_x64_toolchain",
|
||||
"@rules_bun//bun:linux_aarch64_toolchain",
|
||||
"@rules_bun//bun:linux_x64_toolchain",
|
||||
"@rules_bun//bun:windows_x64_toolchain",
|
||||
)
|
||||
```
|
||||
|
||||
### 4) Load rules in `BUILD.bazel`
|
||||
If you want Bazel-managed dependency installation, also add the module
|
||||
extension for `bun_install`:
|
||||
|
||||
```starlark
|
||||
load(
|
||||
"@rules_bun//bun:defs.bzl",
|
||||
"bun_binary",
|
||||
"bun_bundle",
|
||||
"bun_dev",
|
||||
"bun_script",
|
||||
"bun_test",
|
||||
"js_library",
|
||||
"ts_library",
|
||||
)
|
||||
```
|
||||
|
||||
### 5) (Optional) Use `bun_install` module extension
|
||||
|
||||
If you want Bazel-managed install repositories, add:
|
||||
`bun_install` runs `bun install`, not `npm install`. In the example below,
|
||||
`bun_deps` is just the Bazel repository name for the generated
|
||||
`node_modules` tree. See [docs/bun_install.md](docs/bun_install.md) for the
|
||||
full extension reference.
|
||||
|
||||
```starlark
|
||||
bun_install_ext = use_extension("@rules_bun//bun:extensions.bzl", "bun_install")
|
||||
|
||||
bun_install_ext.install(
|
||||
name = "npm",
|
||||
package_json = "//:package.json",
|
||||
bun_lockfile = "//:bun.lock",
|
||||
name = "bun_deps",
|
||||
package_json = "//:package.json",
|
||||
bun_lockfile = "//:bun.lock",
|
||||
)
|
||||
|
||||
use_repo(bun_install_ext, "npm")
|
||||
use_repo(bun_install_ext, "bun_deps")
|
||||
```
|
||||
|
||||
### 6) Verify setup
|
||||
## Legacy WORKSPACE usage
|
||||
|
||||
Run one of your bun-backed targets, for example:
|
||||
For non-Bzlmod consumers, the repository exposes a legacy setup macro in
|
||||
`@rules_bun//bun:repositories.bzl`:
|
||||
|
||||
```bash
|
||||
bazel test //path/to:your_bun_test
|
||||
```starlark
|
||||
load("@rules_bun//bun:repositories.bzl", "bun_register_toolchains")
|
||||
|
||||
bun_register_toolchains()
|
||||
```
|
||||
|
||||
All `rules_bun` rule-driven Bun invocations pass `--bun`.
|
||||
## Loading rules in BUILD files
|
||||
|
||||
## Package scripts (`bun_script`)
|
||||
```starlark
|
||||
load(
|
||||
"@rules_bun//bun:defs.bzl",
|
||||
"bun_binary",
|
||||
"bun_bundle",
|
||||
"bun_dev",
|
||||
"bun_script",
|
||||
"bun_test",
|
||||
"js_library",
|
||||
"ts_library",
|
||||
)
|
||||
```
|
||||
|
||||
Use `bun_script` to expose a `package.json` script as a Bazel executable target.
|
||||
## Common workflows
|
||||
|
||||
### `bun_script` for package scripts
|
||||
|
||||
Use `bun_script` to expose a `package.json` script as a Bazel executable.
|
||||
This is the recommended way to run Vite-style `dev`, `build`, and `preview`
|
||||
scripts.
|
||||
|
||||
```starlark
|
||||
load("@rules_bun//bun:defs.bzl", "bun_script")
|
||||
|
||||
bun_script(
|
||||
name = "web_dev",
|
||||
script = "dev",
|
||||
package_json = "package.json",
|
||||
node_modules = "@npm//:node_modules",
|
||||
data = glob([
|
||||
"src/**",
|
||||
"static/**",
|
||||
"vite.config.*",
|
||||
"svelte.config.*",
|
||||
"tsconfig*.json",
|
||||
]),
|
||||
name = "web_dev",
|
||||
script = "dev",
|
||||
package_json = "package.json",
|
||||
node_modules = "@bun_deps//:node_modules",
|
||||
data = glob([
|
||||
"src/**",
|
||||
"static/**",
|
||||
"vite.config.*",
|
||||
"svelte.config.*",
|
||||
"tsconfig*.json",
|
||||
]),
|
||||
)
|
||||
```
|
||||
|
||||
Run it with:
|
||||
When `node_modules` is provided, executables from `node_modules/.bin` are added
|
||||
to `PATH`. This label typically comes from `bun_install`, which still produces a
|
||||
standard `node_modules/` directory.
|
||||
|
||||
```bash
|
||||
bazel run //path/to:web_dev -- --host
|
||||
```
|
||||
### `bun_dev` for local development
|
||||
|
||||
`bun_script` defaults to running from the directory containing `package.json`, which matches the usual expectations for `vite`, `svelte-kit`, and similar package scripts.
|
||||
|
||||
## Development mode (`bun_dev`)
|
||||
|
||||
Use `bun_dev` for long-running local development with Bun watch mode.
|
||||
Use `bun_dev` for long-running watch or hot-reload development targets.
|
||||
|
||||
```starlark
|
||||
load("@rules_bun//bun:defs.bzl", "bun_dev")
|
||||
|
||||
bun_dev(
|
||||
name = "web_dev",
|
||||
entry_point = "src/main.ts",
|
||||
# Optional: run from the entry point directory so Bun auto-loads colocated .env files.
|
||||
# working_dir = "entry_point",
|
||||
name = "web_dev",
|
||||
entry_point = "src/main.ts",
|
||||
# Optional: run from the entry point directory so Bun auto-loads colocated .env files.
|
||||
# working_dir = "entry_point",
|
||||
)
|
||||
```
|
||||
|
||||
Run it with:
|
||||
Supported development options include:
|
||||
|
||||
```bash
|
||||
bazel run //path/to:web_dev
|
||||
```
|
||||
- `watch_mode = "watch"`
|
||||
- `watch_mode = "hot"`
|
||||
- `restart_on = [...]`
|
||||
- `working_dir = "workspace" | "entry_point"`
|
||||
|
||||
`bun_dev` supports:
|
||||
|
||||
- `watch_mode = "watch"` (default) for `bun --watch`
|
||||
- `watch_mode = "hot"` for `bun --hot`
|
||||
- `restart_on = [...]` to force full process restarts when specific files change
|
||||
- `working_dir = "workspace" | "entry_point"` (default: `workspace`)
|
||||
|
||||
## Runtime working directory (`bun_binary`, `bun_dev`)
|
||||
### Working directory behavior
|
||||
|
||||
`bun_binary` and `bun_dev` support `working_dir`:
|
||||
|
||||
- `"workspace"` (default): runs from the Bazel runfiles workspace root.
|
||||
- `"entry_point"`: runs from the nearest ancestor of the entry point that contains `.env` or `package.json` (falls back to the entry point directory).
|
||||
- `"workspace"`: run from the Bazel runfiles workspace root.
|
||||
- `"entry_point"`: run from the nearest ancestor of the entry point that
|
||||
contains `.env` or `package.json`.
|
||||
|
||||
Use `"entry_point"` when Bun should resolve local files such as colocated `.env` files relative to the program directory.
|
||||
## Tests and examples
|
||||
|
||||
### Hybrid Go + Bun + protobuf workflow
|
||||
The repository keeps conformance and integration coverage in [tests/](tests/) and
|
||||
usage samples in [examples/](examples/).
|
||||
|
||||
For monorepos that mix Go and Bun (including FFI):
|
||||
Representative example docs:
|
||||
|
||||
1. Run Bun app with native watch/HMR via `bun_dev`.
|
||||
2. Put generated artifacts or bridge files in `restart_on` (for example generated JS/TS files from proto/go steps).
|
||||
3. Rebuild Go/proto artifacts separately (for example with `ibazel build`) so their output files change.
|
||||
4. `bun_dev` detects those `restart_on` changes and restarts Bun, while ordinary JS edits continue to use Bun watch/HMR without full Bazel restarts.
|
||||
- [examples/basic/README.md](examples/basic/README.md)
|
||||
- [examples/workspace/README.md](examples/workspace/README.md)
|
||||
- [examples/vite_monorepo/README.md](examples/vite_monorepo/README.md)
|
||||
|
||||
This keeps the fast Bun JS loop while still supporting full restarts when non-JS dependencies change.
|
||||
To validate the ruleset locally:
|
||||
|
||||
```bash
|
||||
bazel test //tests/...
|
||||
```
|
||||
|
||||
19
WORKSPACE
19
WORKSPACE
@@ -1,5 +1,24 @@
|
||||
workspace(name = "rules_bun")
|
||||
|
||||
load("//internal:bun_install.bzl", "bun_install")
|
||||
load("//bun:repositories.bzl", "bun_register_toolchains")
|
||||
|
||||
bun_register_toolchains()
|
||||
|
||||
bun_install(
|
||||
name = "script_test_vite_node_modules",
|
||||
package_json = "//tests/script_test:vite_app/package.json",
|
||||
bun_lockfile = "//tests/script_test:vite_app/bun.lock",
|
||||
)
|
||||
|
||||
bun_install(
|
||||
name = "script_test_vite_monorepo_node_modules",
|
||||
package_json = "//tests/script_test:vite_monorepo/package.json",
|
||||
bun_lockfile = "//tests/script_test:vite_monorepo/bun.lock",
|
||||
)
|
||||
|
||||
bun_install(
|
||||
name = "examples_vite_monorepo_node_modules",
|
||||
package_json = "//examples/vite_monorepo:package.json",
|
||||
bun_lockfile = "//examples/vite_monorepo:bun.lock",
|
||||
)
|
||||
|
||||
@@ -5,6 +5,9 @@ load(":version.bzl", "BUN_VERSION")
|
||||
exports_files([
|
||||
"defs.bzl",
|
||||
"extensions.bzl",
|
||||
"repositories.bzl",
|
||||
"toolchain.bzl",
|
||||
"version.bzl",
|
||||
])
|
||||
|
||||
bzl_library(
|
||||
@@ -13,6 +16,19 @@ bzl_library(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
bzl_library(
|
||||
name = "extensions_bzl",
|
||||
srcs = ["extensions.bzl"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//internal:bun_install_bzl"],
|
||||
)
|
||||
|
||||
bzl_library(
|
||||
name = "repositories_bzl",
|
||||
srcs = ["repositories.bzl"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
bzl_library(
|
||||
name = "defs_bzl",
|
||||
srcs = ["defs.bzl"],
|
||||
|
||||
@@ -16,4 +16,5 @@ stardoc(
|
||||
"ts_library",
|
||||
],
|
||||
deps = ["//bun:defs_bzl"],
|
||||
target_compatible_with = ["@platforms//os:linux"],
|
||||
)
|
||||
|
||||
90
docs/bun_install.md
Normal file
90
docs/bun_install.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# `bun_install`
|
||||
|
||||
`bun_install` is a Bzlmod module extension for creating an external repository
|
||||
that contains a Bun-generated `node_modules/` tree.
|
||||
|
||||
Unlike the build rules in [rules.md](rules.md), `bun_install` is not loaded from
|
||||
`@rules_bun//bun:defs.bzl`. It is loaded from
|
||||
`@rules_bun//bun:extensions.bzl`, so it is documented separately.
|
||||
|
||||
## What it does
|
||||
|
||||
`bun_install`:
|
||||
|
||||
- runs `bun install --frozen-lockfile`
|
||||
- uses your checked-in `package.json` and `bun.lock` or `bun.lockb`
|
||||
- creates an external Bazel repository exposing `:node_modules`
|
||||
- keeps dependency installation under Bun rather than npm
|
||||
|
||||
The generated repository can then be passed to rules such as `bun_script`,
|
||||
`bun_binary`, `bun_bundle`, and `bun_test`.
|
||||
|
||||
## Usage
|
||||
|
||||
```starlark
|
||||
bun_install_ext = use_extension("@rules_bun//bun:extensions.bzl", "bun_install")
|
||||
|
||||
bun_install_ext.install(
|
||||
name = "bun_deps",
|
||||
package_json = "//:package.json",
|
||||
bun_lockfile = "//:bun.lock",
|
||||
)
|
||||
|
||||
use_repo(bun_install_ext, "bun_deps")
|
||||
```
|
||||
|
||||
Then reference the installed dependencies from build targets:
|
||||
|
||||
```starlark
|
||||
load("@rules_bun//bun:defs.bzl", "bun_script")
|
||||
|
||||
bun_script(
|
||||
name = "web_dev",
|
||||
script = "dev",
|
||||
package_json = "package.json",
|
||||
node_modules = "@bun_deps//:node_modules",
|
||||
)
|
||||
```
|
||||
|
||||
## `install(...)` attributes
|
||||
|
||||
### `name`
|
||||
|
||||
Repository name to create.
|
||||
|
||||
This becomes the external repository you reference later, for example
|
||||
`@bun_deps//:node_modules`.
|
||||
|
||||
### `package_json`
|
||||
|
||||
Label string pointing to the source `package.json` file.
|
||||
|
||||
Example:
|
||||
|
||||
```starlark
|
||||
package_json = "//:package.json"
|
||||
```
|
||||
|
||||
### `bun_lockfile`
|
||||
|
||||
Label string pointing to the Bun lockfile.
|
||||
|
||||
Supported lockfile names are:
|
||||
|
||||
- `bun.lock`
|
||||
- `bun.lockb`
|
||||
|
||||
Example:
|
||||
|
||||
```starlark
|
||||
bun_lockfile = "//:bun.lock"
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- `bun_install` runs Bun, not npm.
|
||||
- The repository name is arbitrary. `bun_deps` is only an example.
|
||||
- The generated repository exposes a standard `node_modules/` tree because that
|
||||
is the dependency layout Bun installs.
|
||||
- `--frozen-lockfile` is used, so the lockfile must already be in sync with
|
||||
`package.json`.
|
||||
@@ -1,14 +1,88 @@
|
||||
# rules_bun docs
|
||||
|
||||
Documentation site for `rules_bun`.
|
||||
Documentation for `rules_bun`, a Bazel ruleset for Bun.
|
||||
|
||||
## Ruleset layout
|
||||
|
||||
The repository exposes its public Bazel API from the [bun/](../bun/) package:
|
||||
|
||||
- `@rules_bun//bun:defs.bzl` for build rules
|
||||
- `@rules_bun//bun:extensions.bzl` for Bzlmod extensions
|
||||
- `@rules_bun//bun:repositories.bzl` for legacy WORKSPACE setup
|
||||
|
||||
Supporting material lives in:
|
||||
|
||||
- [examples/](../examples/) for usage samples
|
||||
- [tests/](../tests/) for repository conformance and integration tests
|
||||
- [docs/rules.md](rules.md) for generated build rule reference
|
||||
- [docs/bun_install.md](bun_install.md) for `bun_install` extension docs
|
||||
|
||||
## Rule reference
|
||||
|
||||
- [rules.md](rules.md)
|
||||
|
||||
## Bzlmod extensions
|
||||
|
||||
- [bun_install.md](bun_install.md)
|
||||
|
||||
## Typical Bzlmod setup
|
||||
|
||||
```starlark
|
||||
bazel_dep(name = "rules_bun", version = "0.2.1")
|
||||
|
||||
bun_ext = use_extension("@rules_bun//bun:extensions.bzl", "bun")
|
||||
|
||||
use_repo(
|
||||
bun_ext,
|
||||
"bun_linux_x64",
|
||||
"bun_linux_aarch64",
|
||||
"bun_darwin_x64",
|
||||
"bun_darwin_aarch64",
|
||||
"bun_windows_x64",
|
||||
)
|
||||
|
||||
register_toolchains(
|
||||
"@rules_bun//bun:darwin_aarch64_toolchain",
|
||||
"@rules_bun//bun:darwin_x64_toolchain",
|
||||
"@rules_bun//bun:linux_aarch64_toolchain",
|
||||
"@rules_bun//bun:linux_x64_toolchain",
|
||||
"@rules_bun//bun:windows_x64_toolchain",
|
||||
)
|
||||
```
|
||||
|
||||
## Vite package scripts
|
||||
|
||||
Use `bun_script` for package-script driven workflows such as `dev`, `build`,
|
||||
and `preview`.
|
||||
|
||||
The `node_modules` label below refers to dependencies installed by
|
||||
`bun_install`.
|
||||
|
||||
```starlark
|
||||
load("@rules_bun//bun:defs.bzl", "bun_script")
|
||||
|
||||
bun_script(
|
||||
name = "web_dev",
|
||||
script = "dev",
|
||||
package_json = "package.json",
|
||||
node_modules = "@my_workspace//:node_modules",
|
||||
data = glob([
|
||||
"src/**",
|
||||
"public/**",
|
||||
"index.html",
|
||||
"vite.config.*",
|
||||
"tsconfig*.json",
|
||||
]),
|
||||
)
|
||||
```
|
||||
|
||||
`bun_script` runs from the package directory by default and adds
|
||||
`node_modules/.bin` to `PATH`.
|
||||
|
||||
## Regeneration
|
||||
|
||||
The rule reference is generated from Starlark rule docstrings:
|
||||
The rule reference is generated from the public Starlark symbols in
|
||||
`@rules_bun//bun:defs.bzl`:
|
||||
|
||||
```bash
|
||||
bazel build //docs:rules_md
|
||||
|
||||
@@ -9,7 +9,7 @@ Runs a JS/TS entry point with Bun as an executable target (`bazel run`).
|
||||
Attributes:
|
||||
|
||||
- `entry_point` (label, required): path to the main JS/TS file to execute.
|
||||
- `node_modules` (label, optional): Bun/npm package files in runfiles.
|
||||
- `node_modules` (label, optional): package files from a `node_modules` tree, typically produced by `bun_install`, made available in runfiles.
|
||||
- `data` (label_list, optional): additional runtime files.
|
||||
- `working_dir` (string, default: `"workspace"`, values: `"workspace" | "entry_point"`): runtime working directory.
|
||||
|
||||
@@ -22,7 +22,7 @@ Attributes:
|
||||
- `entry_point` (label, required): path to the main JS/TS file.
|
||||
- `watch_mode` (string, default: `"watch"`, values: `"watch" | "hot"`): Bun live-reload mode.
|
||||
- `restart_on` (label_list, optional): files that trigger full process restart when changed.
|
||||
- `node_modules` (label, optional): Bun/npm package files in runfiles.
|
||||
- `node_modules` (label, optional): package files from a `node_modules` tree, typically produced by `bun_install`, made available in runfiles.
|
||||
- `data` (label_list, optional): additional runtime files for dev process.
|
||||
- `working_dir` (string, default: `"workspace"`, values: `"workspace" | "entry_point"`): runtime working directory.
|
||||
|
||||
@@ -30,13 +30,17 @@ Attributes:
|
||||
|
||||
Runs a named `package.json` script with Bun as an executable target (`bazel run`).
|
||||
|
||||
Recommended for package-script based tools such as Vite (`dev`, `build`, `preview`).
|
||||
When `node_modules` is provided, executables from `node_modules/.bin` are added
|
||||
to `PATH`, so scripts like `vite` work without wrapper scripts.
|
||||
|
||||
Attributes:
|
||||
|
||||
- `script` (string, required): package script name passed to `bun run <script>`.
|
||||
- `package_json` (label, required): `package.json` file containing the named script.
|
||||
- `node_modules` (label, optional): Bun/npm package files in runfiles.
|
||||
- `node_modules` (label, optional): package files from a `node_modules` tree, typically produced by `bun_install`, made available in runfiles.
|
||||
- `data` (label_list, optional): additional runtime files for the script.
|
||||
- `working_dir` (string, default: `"package"`, values: `"workspace" | "package"`): runtime working directory.
|
||||
- `working_dir` (string, default: `"package"`, values: `"workspace" | "package"`): runtime working directory. The default is a good fit for Vite and similar package-script based tools.
|
||||
|
||||
## bun_bundle
|
||||
|
||||
@@ -45,7 +49,7 @@ Bundles one or more JS/TS entry points with Bun build.
|
||||
Attributes:
|
||||
|
||||
- `entry_points` (label_list, required): entry files to bundle.
|
||||
- `node_modules` (label, optional): Bun/npm package files for resolution.
|
||||
- `node_modules` (label, optional): package files from a `node_modules` tree, typically produced by `bun_install`, used for package resolution.
|
||||
- `deps` (label_list, optional): source/library dependencies for transitive inputs.
|
||||
- `data` (label_list, optional): additional non-source files needed during bundling.
|
||||
- `target` (string, default: `"browser"`, values: `"browser" | "node" | "bun"`): Bun build target.
|
||||
@@ -61,7 +65,7 @@ Runs Bun tests as a Bazel test target (`bazel test`).
|
||||
Attributes:
|
||||
|
||||
- `srcs` (label_list, required): test source files passed to `bun test`.
|
||||
- `node_modules` (label, optional): Bun/npm package files in runfiles.
|
||||
- `node_modules` (label, optional): package files from a `node_modules` tree, typically produced by `bun_install`, made available in runfiles.
|
||||
- `deps` (label_list, optional): library dependencies required by tests.
|
||||
- `data` (label_list, optional): additional runtime files needed by tests.
|
||||
|
||||
|
||||
33
examples/vite_monorepo/BUILD.bazel
Normal file
33
examples/vite_monorepo/BUILD.bazel
Normal file
@@ -0,0 +1,33 @@
|
||||
load("//bun:defs.bzl", "bun_script")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
exports_files([
|
||||
"README.md",
|
||||
"package.json",
|
||||
"bun.lock",
|
||||
"apps/app-a/package.json",
|
||||
"apps/app-b/package.json",
|
||||
])
|
||||
|
||||
bun_script(
|
||||
name = "app_a_dev",
|
||||
script = "dev",
|
||||
package_json = "apps/app-a/package.json",
|
||||
node_modules = "@examples_vite_monorepo_node_modules//:node_modules",
|
||||
data = [
|
||||
"apps/app-a/index.html",
|
||||
"apps/app-a/main.js",
|
||||
],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "app_b_dev",
|
||||
script = "dev",
|
||||
package_json = "apps/app-b/package.json",
|
||||
node_modules = "@examples_vite_monorepo_node_modules//:node_modules",
|
||||
data = [
|
||||
"apps/app-b/index.html",
|
||||
"apps/app-b/main.js",
|
||||
],
|
||||
)
|
||||
28
examples/vite_monorepo/README.md
Normal file
28
examples/vite_monorepo/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Vite monorepo example
|
||||
|
||||
Bun workspace-style example with two Vite applications sharing one root
|
||||
`bun_install` dependency installation.
|
||||
|
||||
Apps:
|
||||
|
||||
- `apps/app-a`
|
||||
- `apps/app-b`
|
||||
|
||||
This example also exercises Bun's workspace catalog syntax:
|
||||
|
||||
- `workspaces.catalog` provides the default `vite` version referenced as `catalog:`
|
||||
- `workspaces.catalogs.testing` provides a named catalog referenced as `catalog:testing`
|
||||
|
||||
Both apps run `vite` via their own `package.json` scripts while sharing the same
|
||||
generated `node_modules/` tree.
|
||||
|
||||
Run either app with Bazel:
|
||||
|
||||
```bash
|
||||
bazel run //examples/vite_monorepo:app_a_dev -- --host 127.0.0.1 --port 5173 --strictPort
|
||||
bazel run //examples/vite_monorepo:app_b_dev -- --host 127.0.0.1 --port 5174 --strictPort
|
||||
```
|
||||
|
||||
This example relies on a `bun_install` repository named
|
||||
`examples_vite_monorepo_node_modules` defined in the repo's `MODULE.bazel` and
|
||||
`WORKSPACE` files.
|
||||
12
examples/vite_monorepo/apps/app-a/index.html
Normal file
12
examples/vite_monorepo/apps/app-a/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite monorepo app A</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
examples/vite_monorepo/apps/app-a/main.js
Normal file
7
examples/vite_monorepo/apps/app-a/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const app = document.querySelector("#app");
|
||||
|
||||
if (app) {
|
||||
app.textContent = "Hello from monorepo app A";
|
||||
}
|
||||
|
||||
console.log("Hello from monorepo app A");
|
||||
11
examples/vite_monorepo/apps/app-a/package.json
Normal file
11
examples/vite_monorepo/apps/app-a/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "vite-monorepo-app-a",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "catalog:"
|
||||
}
|
||||
}
|
||||
12
examples/vite_monorepo/apps/app-b/index.html
Normal file
12
examples/vite_monorepo/apps/app-b/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite monorepo app B</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
examples/vite_monorepo/apps/app-b/main.js
Normal file
7
examples/vite_monorepo/apps/app-b/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const app = document.querySelector("#app");
|
||||
|
||||
if (app) {
|
||||
app.textContent = "Hello from monorepo app B";
|
||||
}
|
||||
|
||||
console.log("Hello from monorepo app B");
|
||||
12
examples/vite_monorepo/apps/app-b/package.json
Normal file
12
examples/vite_monorepo/apps/app-b/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "vite-monorepo-app-b",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "catalog:",
|
||||
"vitest": "catalog:testing"
|
||||
}
|
||||
}
|
||||
229
examples/vite_monorepo/bun.lock
Normal file
229
examples/vite_monorepo/bun.lock
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "vite-monorepo-test",
|
||||
},
|
||||
"apps/app-a": {
|
||||
"name": "vite-monorepo-app-a",
|
||||
"devDependencies": {
|
||||
"vite": "catalog:",
|
||||
},
|
||||
},
|
||||
"apps/app-b": {
|
||||
"name": "vite-monorepo-app-b",
|
||||
"devDependencies": {
|
||||
"vite": "catalog:",
|
||||
"vitest": "catalog:testing",
|
||||
},
|
||||
},
|
||||
},
|
||||
"catalog": {
|
||||
"vite": "5.4.14",
|
||||
},
|
||||
"catalogs": {
|
||||
"testing": {
|
||||
"vitest": "3.2.4",
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.21.5", "", { "os": "android", "cpu": "arm64" }, "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.21.5", "", { "os": "android", "cpu": "x64" }, "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.21.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ=="],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.21.5", "", { "os": "darwin", "cpu": "x64" }, "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.21.5", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.21.5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.21.5", "", { "os": "linux", "cpu": "arm" }, "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.21.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.21.5", "", { "os": "linux", "cpu": "ia32" }, "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.21.5", "", { "os": "linux", "cpu": "ppc64" }, "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.21.5", "", { "os": "linux", "cpu": "s390x" }, "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.21.5", "", { "os": "linux", "cpu": "x64" }, "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.21.5", "", { "os": "none", "cpu": "x64" }, "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.21.5", "", { "os": "openbsd", "cpu": "x64" }, "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.21.5", "", { "os": "sunos", "cpu": "x64" }, "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.21.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.21.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.21.5", "", { "os": "win32", "cpu": "x64" }, "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw=="],
|
||||
|
||||
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
|
||||
|
||||
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.59.0", "", { "os": "android", "cpu": "arm" }, "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg=="],
|
||||
|
||||
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.59.0", "", { "os": "android", "cpu": "arm64" }, "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q=="],
|
||||
|
||||
"@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.59.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg=="],
|
||||
|
||||
"@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.59.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w=="],
|
||||
|
||||
"@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.59.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA=="],
|
||||
|
||||
"@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.59.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg=="],
|
||||
|
||||
"@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.59.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg=="],
|
||||
|
||||
"@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.59.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ=="],
|
||||
|
||||
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.59.0", "", { "os": "none", "cpu": "arm64" }, "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA=="],
|
||||
|
||||
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.59.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A=="],
|
||||
|
||||
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.59.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA=="],
|
||||
|
||||
"@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
|
||||
|
||||
"@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="],
|
||||
|
||||
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
||||
|
||||
"@vitest/expect": ["@vitest/expect@3.2.4", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" } }, "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig=="],
|
||||
|
||||
"@vitest/mocker": ["@vitest/mocker@3.2.4", "", { "dependencies": { "@vitest/spy": "3.2.4", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw", "vite"] }, "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ=="],
|
||||
|
||||
"@vitest/pretty-format": ["@vitest/pretty-format@3.2.4", "", { "dependencies": { "tinyrainbow": "^2.0.0" } }, "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA=="],
|
||||
|
||||
"@vitest/runner": ["@vitest/runner@3.2.4", "", { "dependencies": { "@vitest/utils": "3.2.4", "pathe": "^2.0.3", "strip-literal": "^3.0.0" } }, "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ=="],
|
||||
|
||||
"@vitest/snapshot": ["@vitest/snapshot@3.2.4", "", { "dependencies": { "@vitest/pretty-format": "3.2.4", "magic-string": "^0.30.17", "pathe": "^2.0.3" } }, "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ=="],
|
||||
|
||||
"@vitest/spy": ["@vitest/spy@3.2.4", "", { "dependencies": { "tinyspy": "^4.0.3" } }, "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw=="],
|
||||
|
||||
"@vitest/utils": ["@vitest/utils@3.2.4", "", { "dependencies": { "@vitest/pretty-format": "3.2.4", "loupe": "^3.1.4", "tinyrainbow": "^2.0.0" } }, "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA=="],
|
||||
|
||||
"assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],
|
||||
|
||||
"cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="],
|
||||
|
||||
"chai": ["chai@5.3.3", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw=="],
|
||||
|
||||
"check-error": ["check-error@2.1.3", "", {}, "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA=="],
|
||||
|
||||
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||
|
||||
"deep-eql": ["deep-eql@5.0.2", "", {}, "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q=="],
|
||||
|
||||
"es-module-lexer": ["es-module-lexer@1.7.0", "", {}, "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA=="],
|
||||
|
||||
"esbuild": ["esbuild@0.21.5", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.21.5", "@esbuild/android-arm": "0.21.5", "@esbuild/android-arm64": "0.21.5", "@esbuild/android-x64": "0.21.5", "@esbuild/darwin-arm64": "0.21.5", "@esbuild/darwin-x64": "0.21.5", "@esbuild/freebsd-arm64": "0.21.5", "@esbuild/freebsd-x64": "0.21.5", "@esbuild/linux-arm": "0.21.5", "@esbuild/linux-arm64": "0.21.5", "@esbuild/linux-ia32": "0.21.5", "@esbuild/linux-loong64": "0.21.5", "@esbuild/linux-mips64el": "0.21.5", "@esbuild/linux-ppc64": "0.21.5", "@esbuild/linux-riscv64": "0.21.5", "@esbuild/linux-s390x": "0.21.5", "@esbuild/linux-x64": "0.21.5", "@esbuild/netbsd-x64": "0.21.5", "@esbuild/openbsd-x64": "0.21.5", "@esbuild/sunos-x64": "0.21.5", "@esbuild/win32-arm64": "0.21.5", "@esbuild/win32-ia32": "0.21.5", "@esbuild/win32-x64": "0.21.5" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw=="],
|
||||
|
||||
"estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="],
|
||||
|
||||
"expect-type": ["expect-type@1.3.0", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="],
|
||||
|
||||
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
|
||||
|
||||
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||
|
||||
"js-tokens": ["js-tokens@9.0.1", "", {}, "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ=="],
|
||||
|
||||
"loupe": ["loupe@3.2.1", "", {}, "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ=="],
|
||||
|
||||
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
|
||||
|
||||
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||
|
||||
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
|
||||
|
||||
"pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||
|
||||
"pathval": ["pathval@2.0.1", "", {}, "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ=="],
|
||||
|
||||
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||
|
||||
"picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
|
||||
|
||||
"postcss": ["postcss@8.5.8", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="],
|
||||
|
||||
"rollup": ["rollup@4.59.0", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.59.0", "@rollup/rollup-android-arm64": "4.59.0", "@rollup/rollup-darwin-arm64": "4.59.0", "@rollup/rollup-darwin-x64": "4.59.0", "@rollup/rollup-freebsd-arm64": "4.59.0", "@rollup/rollup-freebsd-x64": "4.59.0", "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", "@rollup/rollup-linux-arm-musleabihf": "4.59.0", "@rollup/rollup-linux-arm64-gnu": "4.59.0", "@rollup/rollup-linux-arm64-musl": "4.59.0", "@rollup/rollup-linux-loong64-gnu": "4.59.0", "@rollup/rollup-linux-loong64-musl": "4.59.0", "@rollup/rollup-linux-ppc64-gnu": "4.59.0", "@rollup/rollup-linux-ppc64-musl": "4.59.0", "@rollup/rollup-linux-riscv64-gnu": "4.59.0", "@rollup/rollup-linux-riscv64-musl": "4.59.0", "@rollup/rollup-linux-s390x-gnu": "4.59.0", "@rollup/rollup-linux-x64-gnu": "4.59.0", "@rollup/rollup-linux-x64-musl": "4.59.0", "@rollup/rollup-openbsd-x64": "4.59.0", "@rollup/rollup-openharmony-arm64": "4.59.0", "@rollup/rollup-win32-arm64-msvc": "4.59.0", "@rollup/rollup-win32-ia32-msvc": "4.59.0", "@rollup/rollup-win32-x64-gnu": "4.59.0", "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg=="],
|
||||
|
||||
"siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
|
||||
|
||||
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||
|
||||
"stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
|
||||
|
||||
"std-env": ["std-env@3.10.0", "", {}, "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg=="],
|
||||
|
||||
"strip-literal": ["strip-literal@3.1.0", "", { "dependencies": { "js-tokens": "^9.0.1" } }, "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg=="],
|
||||
|
||||
"tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="],
|
||||
|
||||
"tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="],
|
||||
|
||||
"tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
|
||||
|
||||
"tinypool": ["tinypool@1.1.1", "", {}, "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg=="],
|
||||
|
||||
"tinyrainbow": ["tinyrainbow@2.0.0", "", {}, "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw=="],
|
||||
|
||||
"tinyspy": ["tinyspy@4.0.4", "", {}, "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q=="],
|
||||
|
||||
"vite": ["vite@5.4.14", "", { "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", "rollup": "^4.20.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "optionalPeers": ["@types/node", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": { "vite": "bin/vite.js" } }, "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA=="],
|
||||
|
||||
"vite-monorepo-app-a": ["vite-monorepo-app-a@workspace:apps/app-a"],
|
||||
|
||||
"vite-monorepo-app-b": ["vite-monorepo-app-b@workspace:apps/app-b"],
|
||||
|
||||
"vite-node": ["vite-node@3.2.4", "", { "dependencies": { "cac": "^6.7.14", "debug": "^4.4.1", "es-module-lexer": "^1.7.0", "pathe": "^2.0.3", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" } }, "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg=="],
|
||||
|
||||
"vitest": ["vitest@3.2.4", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.4", "@vitest/mocker": "3.2.4", "@vitest/pretty-format": "^3.2.4", "@vitest/runner": "3.2.4", "@vitest/snapshot": "3.2.4", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "^5.2.0", "debug": "^4.4.1", "expect-type": "^1.2.1", "magic-string": "^0.30.17", "pathe": "^2.0.3", "picomatch": "^4.0.2", "std-env": "^3.9.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.2", "tinyglobby": "^0.2.14", "tinypool": "^1.1.1", "tinyrainbow": "^2.0.0", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", "vite-node": "3.2.4", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "@vitest/browser": "3.2.4", "@vitest/ui": "3.2.4", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@types/debug", "@types/node", "@vitest/browser", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A=="],
|
||||
|
||||
"why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
|
||||
}
|
||||
}
|
||||
17
examples/vite_monorepo/package.json
Normal file
17
examples/vite_monorepo/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "vite-monorepo-test",
|
||||
"private": true,
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
"apps/*"
|
||||
],
|
||||
"catalog": {
|
||||
"vite": "5.4.14"
|
||||
},
|
||||
"catalogs": {
|
||||
"testing": {
|
||||
"vitest": "3.2.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
flake.lock
generated
12
flake.lock
generated
@@ -9,16 +9,16 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772613315,
|
||||
"narHash": "sha256-RlPTOsyfVwuwEzvaMpwS+giOqQa6KQXMuSHyh1bctjk=",
|
||||
"ref": "v1.0.5",
|
||||
"rev": "e445e49baf8b44b385108cd4f26a14d8ccf9fd35",
|
||||
"revCount": 35,
|
||||
"lastModified": 1772815059,
|
||||
"narHash": "sha256-9Mn8t/a7b43omtmKRsF0HmFpCkNpTsvYEq0y85KLL5s=",
|
||||
"ref": "v2.0.1",
|
||||
"rev": "80cc529de7060e079d89a69d8daaf0347b53d8f9",
|
||||
"revCount": 43,
|
||||
"type": "git",
|
||||
"url": "https://git.dgren.dev/eric/nix-flake-lib"
|
||||
},
|
||||
"original": {
|
||||
"ref": "v1.0.5",
|
||||
"ref": "v2.0.1",
|
||||
"type": "git",
|
||||
"url": "https://git.dgren.dev/eric/nix-flake-lib"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
devshell-lib.url = "git+https://git.dgren.dev/eric/nix-flake-lib?ref=v1.0.5";
|
||||
devshell-lib.url = "git+https://git.dgren.dev/eric/nix-flake-lib?ref=v2.0.1";
|
||||
devshell-lib.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
];
|
||||
|
||||
features = {
|
||||
oxfmt = true;
|
||||
oxfmt = false;
|
||||
};
|
||||
|
||||
formatters = {
|
||||
|
||||
@@ -1,280 +0,0 @@
|
||||
Here's a comprehensive plan for implementing a Bazel-native `bun_rules` package:
|
||||
|
||||
---
|
||||
|
||||
## `bun_rules`: Bazel-Native Bun Implementation Plan
|
||||
|
||||
### What Is This?
|
||||
|
||||
A Bazel ruleset that integrates the [Bun](https://bun.sh) JavaScript runtime natively — similar to `rules_nodejs` but leveraging Bun's bundler, test runner, package manager, and runtime. The goal is hermetic, reproducible builds using Bun as the toolchain.
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Repository Skeleton & Toolchain
|
||||
|
||||
**Where to start.** Every Bazel ruleset begins with the toolchain — nothing else works without it.
|
||||
|
||||
### 1.1 Repo Structure
|
||||
|
||||
```
|
||||
bun_rules/
|
||||
├── MODULE.bazel # Bzlmod module definition
|
||||
├── WORKSPACE # Legacy workspace support
|
||||
├── BUILD.bazel
|
||||
├── bun/
|
||||
│ ├── repositories.bzl # Download bun binaries per platform
|
||||
│ ├── toolchain.bzl # bun_toolchain rule
|
||||
│ └── defs.bzl # Public API re-exports
|
||||
├── internal/
|
||||
│ ├── bun_binary.bzl
|
||||
│ ├── bun_test.bzl
|
||||
│ ├── bun_install.bzl
|
||||
│ └── bun_bundle.bzl
|
||||
├── examples/
|
||||
│ └── basic/
|
||||
└── tests/
|
||||
├── toolchain_test/
|
||||
├── install_test/
|
||||
├── binary_test/
|
||||
└── bundle_test/
|
||||
```
|
||||
|
||||
### 1.2 Toolchain Rule (`toolchain.bzl`)
|
||||
|
||||
```python
|
||||
BunToolchainInfo = provider(fields = ["bun_bin", "version"])
|
||||
|
||||
bun_toolchain = rule(
|
||||
implementation = _bun_toolchain_impl,
|
||||
attrs = {
|
||||
"bun": attr.label(allow_single_file = True, executable = True, cfg = "exec"),
|
||||
"version": attr.string(),
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
### 1.3 Binary Downloads (`repositories.bzl`)
|
||||
|
||||
Use `http_file` to fetch platform-specific Bun binaries:
|
||||
|
||||
- `bun-linux-x64`, `bun-linux-aarch64`
|
||||
- `bun-darwin-x64`, `bun-darwin-aarch64`
|
||||
- `bun-windows-x64.exe`
|
||||
|
||||
Use SHA256 checksums pinned per Bun release. Register via `register_toolchains()`.
|
||||
|
||||
**Tests needed:**
|
||||
|
||||
- `toolchain_resolution_test` — assert the correct binary is selected per `--platforms`
|
||||
- `bun --version` smoke test via a `sh_test`
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: `bun_install` (Package Manager)
|
||||
|
||||
Replaces `npm install` / `yarn`. This is the highest-leverage rule because every downstream rule depends on it.
|
||||
|
||||
### Rule Design
|
||||
|
||||
```python
|
||||
bun_install(
|
||||
name = "node_modules",
|
||||
package_json = "//:package.json",
|
||||
bun_lockfile = "//:bun.lockb",
|
||||
)
|
||||
```
|
||||
|
||||
- Runs `bun install --frozen-lockfile` in a sandboxed action
|
||||
- Outputs a `node_modules/` directory as a `TreeArtifact`
|
||||
- Must be hermetic: no network in actions (vendor or use a repository rule to pre-fetch)
|
||||
|
||||
### Key Challenges
|
||||
|
||||
- `bun.lockb` is binary — you need to commit it and treat it as a source file
|
||||
- Network access during `bun install` breaks Bazel's sandbox; solve with either:
|
||||
- A **repository rule** that runs install at analysis time (like `npm_install` in rules_nodejs)
|
||||
- Or a **module extension** in Bzlmod
|
||||
|
||||
**Tests needed:**
|
||||
|
||||
- Install succeeds with a valid `package.json` + `bun.lockb`
|
||||
- Build fails (with a clear error) when `bun.lockb` is out of date
|
||||
- Determinism test: run install twice, assert identical output digest
|
||||
- Test that `node_modules` is correctly provided to downstream rules
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: `bun_binary` (Run JS/TS scripts)
|
||||
|
||||
```python
|
||||
bun_binary(
|
||||
name = "my_script",
|
||||
entry_point = "src/main.ts",
|
||||
node_modules = "//:node_modules",
|
||||
data = glob(["src/**"]),
|
||||
)
|
||||
```
|
||||
|
||||
- Wraps `bun run <entry>` as a Bazel executable
|
||||
- Provides `DefaultInfo` with a launcher script
|
||||
- Handles both `.js` and `.ts` natively (no transpile step needed)
|
||||
|
||||
**Tests needed:**
|
||||
|
||||
- `bun_binary` produces a runnable target (`bazel run`)
|
||||
- TypeScript entry points work without separate compilation
|
||||
- `data` deps are available at runtime
|
||||
- Environment variables pass through correctly
|
||||
|
||||
---
|
||||
|
||||
## Phase 4: `bun_test` (Test Runner)
|
||||
|
||||
```python
|
||||
bun_test(
|
||||
name = "my_test",
|
||||
srcs = ["src/foo.test.ts"],
|
||||
node_modules = "//:node_modules",
|
||||
)
|
||||
```
|
||||
|
||||
- Wraps `bun test` with Bazel's test runner protocol
|
||||
- Must exit with code 0/non-0 correctly
|
||||
- Outputs JUnit XML for `--test_output` compatibility (use `bun test --reporter junit`)
|
||||
|
||||
**Tests needed:**
|
||||
|
||||
- Passing test suite returns exit 0
|
||||
- Failing test suite returns exit non-0 (Bazel marks as FAILED)
|
||||
- Test filtering via `--test_filter` works
|
||||
- Coverage via `bun test --coverage` integrates with `bazel coverage`
|
||||
- Tests are re-run when source files change (input tracking)
|
||||
- Tests are **not** re-run when unrelated files change (cache correctness)
|
||||
|
||||
---
|
||||
|
||||
## Phase 5: `bun_bundle` (Bundler)
|
||||
|
||||
```python
|
||||
bun_bundle(
|
||||
name = "app_bundle",
|
||||
entry_points = ["src/index.ts"],
|
||||
node_modules = "//:node_modules",
|
||||
target = "browser", # or "node", "bun"
|
||||
format = "esm", # or "cjs", "iife"
|
||||
minify = True,
|
||||
)
|
||||
```
|
||||
|
||||
- Runs `bun build` as a Bazel action
|
||||
- Outputs are declared files (JS, sourcemaps, assets)
|
||||
- Supports splitting, external packages, define/env vars
|
||||
|
||||
**Tests needed:**
|
||||
|
||||
- Output file exists and has non-zero size
|
||||
- `minify = True` produces smaller output than `minify = False`
|
||||
- `external` packages are not bundled
|
||||
- Sourcemaps are generated when requested
|
||||
- Build is hermetic: same inputs → identical output digest (content hash)
|
||||
- Invalid entry point produces a clear build error (not a cryptic Bazel failure)
|
||||
|
||||
---
|
||||
|
||||
## Phase 6: `js_library` / `ts_library` (Source Grouping)
|
||||
|
||||
Lightweight rules for grouping sources and propagating them through the dep graph:
|
||||
|
||||
```python
|
||||
ts_library(
|
||||
name = "utils",
|
||||
srcs = glob(["src/**/*.ts"]),
|
||||
deps = [":node_modules"],
|
||||
)
|
||||
```
|
||||
|
||||
**Tests needed:**
|
||||
|
||||
- `deps` correctly propagate transitive sources to `bun_bundle` and `bun_test`
|
||||
- Circular dep detection (or at least graceful failure)
|
||||
|
||||
---
|
||||
|
||||
## Required Tests Summary
|
||||
|
||||
| Category | Test |
|
||||
| ------------- | ----------------------------------------------------------- |
|
||||
| Toolchain | Correct binary resolves per platform |
|
||||
| Toolchain | `bun --version` executes successfully |
|
||||
| `bun_install` | Clean install works |
|
||||
| `bun_install` | Stale lockfile fails with clear error |
|
||||
| `bun_install` | Output is deterministic |
|
||||
| `bun_binary` | JS entry point runs |
|
||||
| `bun_binary` | TS entry point runs without compile step |
|
||||
| `bun_binary` | Data files available at runtime |
|
||||
| `bun_test` | Passing tests → exit 0 |
|
||||
| `bun_test` | Failing tests → exit non-0 |
|
||||
| `bun_test` | Cache hit: unchanged test not re-run |
|
||||
| `bun_test` | Cache miss: changed source triggers re-run |
|
||||
| `bun_test` | JUnit XML output parseable |
|
||||
| `bun_bundle` | Output file produced |
|
||||
| `bun_bundle` | Minification reduces output size |
|
||||
| `bun_bundle` | Hermetic: identical inputs → identical digest |
|
||||
| `bun_bundle` | External packages excluded correctly |
|
||||
| Integration | `examples/basic` builds end-to-end with `bazel build //...` |
|
||||
| Integration | `bazel test //...` passes all tests |
|
||||
|
||||
### Gap-Closing Checklist (Concrete Targets)
|
||||
|
||||
Use this checklist to close the current coverage gaps with explicit test targets.
|
||||
|
||||
| Status | Gap | Proposed target | Location |
|
||||
| ------- | ---------------------------------------------------------- | ---------------------------------- | ------------------------------------ |
|
||||
| Partial | Toolchain resolves per platform is only host-select tested | `toolchain_resolution_matrix_test` | `tests/toolchain_test/BUILD.bazel` |
|
||||
| Missing | `bun_install` deterministic output digest | `bun_install_determinism_test` | `tests/install_test/BUILD.bazel` |
|
||||
| Missing | `bun_binary` runtime data files availability | `bun_binary_data_test` | `tests/binary_test/BUILD.bazel` |
|
||||
| Partial | `bun_test` failing suite exists but is manual-only | `bun_test_failing_suite_test` | `tests/bun_test_test/BUILD.bazel` |
|
||||
| Missing | `bun_test` cache hit (unchanged inputs) | `bun_test_cache_hit_test` | `tests/bun_test_test/BUILD.bazel` |
|
||||
| Missing | `bun_test` cache miss (changed source) | `bun_test_cache_miss_test` | `tests/bun_test_test/BUILD.bazel` |
|
||||
| Missing | `bun_test` JUnit XML parseability | `bun_test_junit_output_test` | `tests/bun_test_test/BUILD.bazel` |
|
||||
| Missing | `bun_bundle` hermetic digest stability | `bundle_hermetic_digest_test` | `tests/bundle_test/BUILD.bazel` |
|
||||
| Missing | `bun_bundle` external package exclusion | `bundle_external_exclusion_test` | `tests/bundle_test/BUILD.bazel` |
|
||||
| Missing | `examples/basic` end-to-end build via Bazel | `examples_basic_e2e_build_test` | `tests/integration_test/BUILD.bazel` |
|
||||
| Partial | CI currently runs `bazel test //tests/...` only | `repo_all_targets_test` | `tests/integration_test/BUILD.bazel` |
|
||||
|
||||
Recommended implementation order:
|
||||
|
||||
1. `bun_test_failing_suite_test` (remove/manual split) and `bun_binary_data_test`
|
||||
2. `bun_install_determinism_test`, `bundle_hermetic_digest_test`
|
||||
3. `bun_test_cache_hit_test`, `bun_test_cache_miss_test`, `bun_test_junit_output_test`
|
||||
4. `bundle_external_exclusion_test`, `examples_basic_e2e_build_test`, `repo_all_targets_test`
|
||||
|
||||
---
|
||||
|
||||
## Development Sequence
|
||||
|
||||
```
|
||||
1. Toolchain downloads + resolution ← start here
|
||||
2. bun_install (repository rule approach)
|
||||
3. bun_binary (simplest runtime rule)
|
||||
4. bun_test
|
||||
5. bun_bundle
|
||||
6. js_library / ts_library
|
||||
7. Bzlmod module extension for installs
|
||||
8. CI matrix (linux-x64, darwin-arm64, windows)
|
||||
9. Docs + examples
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Where to Start Right Now
|
||||
|
||||
**Day 1:** Copy the pattern from [`rules_go`](https://github.com/bazelbuild/rules_go) or [`aspect-build/rules_js`](https://github.com/aspect-build/rules_js) for toolchain registration. Write `repositories.bzl` that fetches the Bun binary for your current platform only. Write a `sh_test` that calls `bun --version` and asserts it exits 0. Get that green.
|
||||
|
||||
**Reference implementations to study:**
|
||||
|
||||
- `aspect-build/rules_js` — best modern reference for JS in Bazel
|
||||
- `bazelbuild/rules_nodejs` — older but battle-tested patterns
|
||||
- `bazelbuild/rules_python` — excellent toolchain download pattern to copy
|
||||
|
||||
The toolchain is the entire foundation. Nothing else is possible without it being solid.
|
||||
@@ -28,6 +28,11 @@ bzl_library(
|
||||
srcs = ["bun_dev.bzl"],
|
||||
)
|
||||
|
||||
bzl_library(
|
||||
name = "bun_install_bzl",
|
||||
srcs = ["bun_install.bzl"],
|
||||
)
|
||||
|
||||
bzl_library(
|
||||
name = "bun_script_bzl",
|
||||
srcs = ["bun_script.bzl"],
|
||||
|
||||
@@ -79,7 +79,7 @@ Use this rule for non-test scripts and CLIs that should run via `bazel run`.
|
||||
doc = "Path to the main JS/TS file to execute.",
|
||||
),
|
||||
"node_modules": attr.label(
|
||||
doc = "Optional label providing Bun/npm package files in runfiles.",
|
||||
doc = "Optional label providing package files from a `node_modules` tree, typically produced by `bun_install`, in runfiles.",
|
||||
),
|
||||
"data": attr.label_list(
|
||||
allow_files = True,
|
||||
|
||||
@@ -72,7 +72,7 @@ Each entry point produces one output JavaScript artifact.
|
||||
doc = "Entry files to bundle.",
|
||||
),
|
||||
"node_modules": attr.label(
|
||||
doc = "Optional label providing Bun/npm package files for resolution.",
|
||||
doc = "Optional label providing package files from a `node_modules` tree, typically produced by `bun_install`, for package resolution.",
|
||||
),
|
||||
"deps": attr.label_list(
|
||||
doc = "Source/library dependencies that provide transitive inputs.",
|
||||
|
||||
@@ -169,7 +169,7 @@ watch/HMR plus optional full restarts on selected file changes.
|
||||
doc = "Files that trigger a full Bun process restart when they change.",
|
||||
),
|
||||
"node_modules": attr.label(
|
||||
doc = "Optional label providing Bun/npm package files in runfiles.",
|
||||
doc = "Optional label providing package files from a `node_modules` tree, typically produced by `bun_install`, in runfiles.",
|
||||
),
|
||||
"data": attr.label_list(
|
||||
allow_files = True,
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
"""Repository-rule based bun_install implementation."""
|
||||
|
||||
def _segment_matches(name, pattern):
|
||||
if pattern == "*":
|
||||
return True
|
||||
|
||||
if "*" not in pattern:
|
||||
return name == pattern
|
||||
|
||||
parts = pattern.split("*")
|
||||
if len(parts) == 1:
|
||||
return name == pattern
|
||||
|
||||
pos = 0
|
||||
anchored_start = not pattern.startswith("*")
|
||||
anchored_end = not pattern.endswith("*")
|
||||
|
||||
for i, part in enumerate(parts):
|
||||
if not part:
|
||||
continue
|
||||
|
||||
match_index = name.find(part, pos)
|
||||
if match_index < 0:
|
||||
return False
|
||||
|
||||
if i == 0 and anchored_start and match_index != 0:
|
||||
return False
|
||||
|
||||
pos = match_index + len(part)
|
||||
|
||||
if anchored_end and parts[-1] and not name.endswith(parts[-1]):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def _walk_workspace_dirs(root, segments):
|
||||
matches = [root]
|
||||
|
||||
for segment in segments:
|
||||
if segment == "**":
|
||||
fail("bun_install: `**` is not supported in workspace patterns; use explicit segments or `*`")
|
||||
|
||||
next_matches = []
|
||||
for parent in matches:
|
||||
for child in parent.readdir():
|
||||
if child.is_dir and _segment_matches(child.basename, segment):
|
||||
next_matches.append(child)
|
||||
|
||||
matches = next_matches
|
||||
|
||||
return matches
|
||||
|
||||
def _workspace_patterns(repository_ctx, package_json):
|
||||
manifest = json.decode(repository_ctx.read(package_json))
|
||||
workspaces = manifest.get("workspaces", [])
|
||||
|
||||
if type(workspaces) == type({}):
|
||||
workspaces = workspaces.get("packages", [])
|
||||
|
||||
if type(workspaces) != type([]):
|
||||
fail("bun_install: `workspaces` must be a list or an object with a `packages` list")
|
||||
|
||||
patterns = []
|
||||
for pattern in workspaces:
|
||||
if type(pattern) != type(""):
|
||||
fail("bun_install: workspace pattern must be a string, got {}".format(type(pattern)))
|
||||
|
||||
normalized = "/".join([segment for segment in pattern.split("/") if segment and segment != "."])
|
||||
if normalized:
|
||||
patterns.append(normalized)
|
||||
|
||||
return patterns
|
||||
|
||||
def _materialize_workspace_packages(repository_ctx, package_json):
|
||||
package_root = package_json.dirname
|
||||
package_root_str = str(package_root)
|
||||
written = {}
|
||||
|
||||
for pattern in _workspace_patterns(repository_ctx, package_json):
|
||||
segments = pattern.split("/")
|
||||
for workspace_dir in _walk_workspace_dirs(package_root, segments):
|
||||
workspace_package_json = repository_ctx.path(str(workspace_dir) + "/package.json")
|
||||
if not workspace_package_json.exists:
|
||||
continue
|
||||
|
||||
workspace_dir_str = str(workspace_dir)
|
||||
if workspace_dir_str == package_root_str:
|
||||
continue
|
||||
|
||||
relative_dir = workspace_dir_str[len(package_root_str) + 1:]
|
||||
if relative_dir in written:
|
||||
continue
|
||||
|
||||
repository_ctx.file(
|
||||
relative_dir + "/package.json",
|
||||
repository_ctx.read(workspace_package_json),
|
||||
)
|
||||
written[relative_dir] = True
|
||||
|
||||
def _select_bun_binary(repository_ctx):
|
||||
os_name = repository_ctx.os.name.lower()
|
||||
arch = repository_ctx.os.arch.lower()
|
||||
@@ -30,9 +127,14 @@ def _bun_install_repository_impl(repository_ctx):
|
||||
fail("bun_install: bun_lockfile not found: {}".format(repository_ctx.attr.bun_lockfile))
|
||||
|
||||
bun_bin = _select_bun_binary(repository_ctx)
|
||||
lockfile_name = bun_lockfile.basename
|
||||
|
||||
repository_ctx.symlink(package_json, "package.json")
|
||||
repository_ctx.symlink(bun_lockfile, "bun.lockb")
|
||||
if lockfile_name not in ["bun.lock", "bun.lockb"]:
|
||||
lockfile_name = "bun.lock"
|
||||
|
||||
repository_ctx.file("package.json", repository_ctx.read(package_json))
|
||||
repository_ctx.symlink(bun_lockfile, lockfile_name)
|
||||
_materialize_workspace_packages(repository_ctx, package_json)
|
||||
|
||||
result = repository_ctx.execute(
|
||||
[str(bun_bin), "--bun", "install", "--frozen-lockfile", "--no-progress"],
|
||||
@@ -64,11 +166,11 @@ bun_install_repository = repository_rule(
|
||||
attrs = {
|
||||
"package_json": attr.label(mandatory = True, allow_single_file = True),
|
||||
"bun_lockfile": attr.label(mandatory = True, allow_single_file = True),
|
||||
"bun_linux_x64": attr.label(default = "@bun_linux_x64//:bun", allow_single_file = True),
|
||||
"bun_linux_aarch64": attr.label(default = "@bun_linux_aarch64//:bun", allow_single_file = True),
|
||||
"bun_darwin_x64": attr.label(default = "@bun_darwin_x64//:bun", allow_single_file = True),
|
||||
"bun_darwin_aarch64": attr.label(default = "@bun_darwin_aarch64//:bun", allow_single_file = True),
|
||||
"bun_windows_x64": attr.label(default = "@bun_windows_x64//:bun", allow_single_file = True),
|
||||
"bun_linux_x64": attr.label(default = "@bun_linux_x64//:bun-linux-x64/bun", allow_single_file = True),
|
||||
"bun_linux_aarch64": attr.label(default = "@bun_linux_aarch64//:bun-linux-aarch64/bun", allow_single_file = True),
|
||||
"bun_darwin_x64": attr.label(default = "@bun_darwin_x64//:bun-darwin-x64/bun", allow_single_file = True),
|
||||
"bun_darwin_aarch64": attr.label(default = "@bun_darwin_aarch64//:bun-darwin-aarch64/bun", allow_single_file = True),
|
||||
"bun_windows_x64": attr.label(default = "@bun_windows_x64//:bun-windows-x64/bun.exe", allow_single_file = True),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -23,6 +23,15 @@ bun_bin="${{runfiles_dir}}/_main/{bun_short_path}"
|
||||
package_json="${{runfiles_dir}}/_main/{package_json_short_path}"
|
||||
package_dir="$(dirname "${{package_json}}")"
|
||||
|
||||
node_modules_bin_dirs=()
|
||||
while IFS= read -r node_modules_bin; do
|
||||
node_modules_bin_dirs+=("${{node_modules_bin}}")
|
||||
done < <(find "${{runfiles_dir}}" -type d -path '*/node_modules/.bin' 2>/dev/null | sort)
|
||||
|
||||
if [[ ${{#node_modules_bin_dirs[@]}} -gt 0 ]]; then
|
||||
export PATH="$(IFS=:; echo "${{node_modules_bin_dirs[*]}}"):${{PATH}}"
|
||||
fi
|
||||
|
||||
working_dir="{working_dir}"
|
||||
if [[ "${{working_dir}}" == "package" ]]; then
|
||||
cd "${{package_dir}}"
|
||||
@@ -61,7 +70,10 @@ bun_script = rule(
|
||||
doc = """Runs a named `package.json` script with Bun as an executable target.
|
||||
|
||||
Use this rule to expose existing package scripts such as `dev`, `build`, or
|
||||
`check` via `bazel run` without adding wrapper shell scripts.
|
||||
`check` via `bazel run` without adding wrapper shell scripts. This is a good fit
|
||||
for Vite-style workflows, where scripts like `vite dev` or `vite build` are
|
||||
declared in `package.json` and expect to run from the package directory with
|
||||
`node_modules/.bin` available on `PATH`.
|
||||
""",
|
||||
attrs = {
|
||||
"script": attr.string(
|
||||
@@ -74,7 +86,7 @@ Use this rule to expose existing package scripts such as `dev`, `build`, or
|
||||
doc = "Label of the `package.json` file containing the named script.",
|
||||
),
|
||||
"node_modules": attr.label(
|
||||
doc = "Optional label providing Bun/npm package files in runfiles.",
|
||||
doc = "Optional label providing package files from a `node_modules` tree, typically produced by `bun_install`, in runfiles. Executables from `node_modules/.bin` are added to `PATH`, which is useful for scripts such as `vite`.",
|
||||
),
|
||||
"data": attr.label_list(
|
||||
allow_files = True,
|
||||
@@ -83,7 +95,7 @@ Use this rule to expose existing package scripts such as `dev`, `build`, or
|
||||
"working_dir": attr.string(
|
||||
default = "package",
|
||||
values = ["workspace", "package"],
|
||||
doc = "Working directory at runtime: Bazel runfiles `workspace` root or the directory containing `package.json`.",
|
||||
doc = "Working directory at runtime: Bazel runfiles `workspace` root or the directory containing `package.json`. The default `package` mode matches tools such as Vite that resolve config and assets relative to the package directory.",
|
||||
),
|
||||
},
|
||||
executable = True,
|
||||
|
||||
@@ -74,7 +74,7 @@ Supports Bazel test filtering (`--test_filter`) and coverage integration.
|
||||
doc = "Test source files passed to `bun test`.",
|
||||
),
|
||||
"node_modules": attr.label(
|
||||
doc = "Optional label providing Bun/npm package files in runfiles.",
|
||||
doc = "Optional label providing package files from a `node_modules` tree, typically produced by `bun_install`, in runfiles.",
|
||||
),
|
||||
"deps": attr.label_list(
|
||||
doc = "Library dependencies required by test sources.",
|
||||
|
||||
@@ -5,4 +5,4 @@ rule_file="$1"
|
||||
|
||||
grep -Fq 'set -euo pipefail' "${rule_file}"
|
||||
grep -Fq 'src_args = " ".join([_shell_quote(src.short_path) for src in ctx.files.srcs])' "${rule_file}"
|
||||
grep -Fq 'exec "${{bun_bin}}" test {src_args} "$@"' "${rule_file}"
|
||||
grep -Fq 'exec "${{bun_bin}}" --bun test {src_args} "$@"' "${rule_file}"
|
||||
|
||||
@@ -3,5 +3,5 @@ set -euo pipefail
|
||||
|
||||
rule_file="$1"
|
||||
|
||||
grep -Fq 'exec "${{bun_bin}}" test {src_args} --test-name-pattern "${{TESTBRIDGE_TEST_ONLY}}" "$@"' "${rule_file}"
|
||||
grep -Fq 'exec "${{bun_bin}}" --bun test {src_args} --test-name-pattern "${{TESTBRIDGE_TEST_ONLY}}" "$@"' "${rule_file}"
|
||||
grep -Fq 'if [[ -n "${{TESTBRIDGE_TEST_ONLY:-}}" ]]' "${rule_file}"
|
||||
|
||||
@@ -77,6 +77,13 @@ sh_test(
|
||||
data = ["//internal:bun_install.bzl"],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_install_environment_shape_test",
|
||||
srcs = ["environment_shape.sh"],
|
||||
args = ["$(location //internal:bun_install.bzl)"],
|
||||
data = ["//internal:bun_install.bzl"],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_install_workspaces_test",
|
||||
srcs = ["workspaces.sh"],
|
||||
|
||||
@@ -4,6 +4,8 @@ set -euo pipefail
|
||||
rule_file="$1"
|
||||
|
||||
grep -Eq 'install", "--frozen-lockfile", "--no-progress"' "${rule_file}"
|
||||
grep -Eq 'repository_ctx\.symlink\(package_json, "package\.json"\)' "${rule_file}"
|
||||
grep -Eq 'repository_ctx\.symlink\(bun_lockfile, "bun\.lockb"\)' "${rule_file}"
|
||||
grep -Eq 'repository_ctx\.file\("package\.json", repository_ctx\.read\(package_json\)\)' "${rule_file}"
|
||||
grep -Eq 'lockfile_name = bun_lockfile\.basename' "${rule_file}"
|
||||
grep -Eq 'if lockfile_name not in \["bun\.lock", "bun\.lockb"\]:' "${rule_file}"
|
||||
grep -Eq 'repository_ctx\.symlink\(bun_lockfile, lockfile_name\)' "${rule_file}"
|
||||
grep -Eq 'glob\(\["node_modules/\*\*"\]' "${rule_file}"
|
||||
|
||||
7
tests/install_test/environment_shape.sh
Executable file
7
tests/install_test/environment_shape.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
rule_file="$1"
|
||||
|
||||
grep -Eq '\[str\(bun_bin\), "--bun", "install", "--frozen-lockfile", "--no-progress"\]' "${rule_file}"
|
||||
grep -Eq 'environment[[:space:]]*=[[:space:]]*\{"HOME":[[:space:]]*str\(repository_ctx\.path\("\."\)\)\}' "${rule_file}"
|
||||
@@ -1,5 +1,16 @@
|
||||
load("@rules_shell//shell:sh_test.bzl", "sh_test")
|
||||
|
||||
test_suite(
|
||||
name = "examples_test",
|
||||
tests = [
|
||||
":examples_basic_run_e2e_test",
|
||||
":examples_workspace_bundle_e2e_test",
|
||||
":examples_workspace_catalog_shape_test",
|
||||
":examples_vite_monorepo_catalog_shape_test",
|
||||
":examples_vite_monorepo_e2e_test",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "examples_basic_e2e_build_test",
|
||||
srcs = ["examples_basic_e2e_build_test.sh"],
|
||||
@@ -13,6 +24,13 @@ sh_test(
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "examples_basic_run_e2e_test",
|
||||
srcs = ["examples_basic_run_e2e_test.sh"],
|
||||
args = ["$(location //examples/basic:web_dev)"],
|
||||
data = ["//examples/basic:web_dev"],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "examples_workspace_bundle_e2e_test",
|
||||
srcs = ["examples_workspace_bundle_e2e_test.sh"],
|
||||
@@ -35,6 +53,34 @@ sh_test(
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "examples_vite_monorepo_catalog_shape_test",
|
||||
srcs = ["examples_vite_monorepo_catalog_shape_test.sh"],
|
||||
args = [
|
||||
"$(location //examples/vite_monorepo:package.json)",
|
||||
"$(location //examples/vite_monorepo:apps/app-a/package.json)",
|
||||
"$(location //examples/vite_monorepo:apps/app-b/package.json)",
|
||||
],
|
||||
data = [
|
||||
"//examples/vite_monorepo:package.json",
|
||||
"//examples/vite_monorepo:apps/app-a/package.json",
|
||||
"//examples/vite_monorepo:apps/app-b/package.json",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "examples_vite_monorepo_e2e_test",
|
||||
srcs = ["examples_vite_monorepo_e2e_test.sh"],
|
||||
args = [
|
||||
"$(location //examples/vite_monorepo:app_a_dev)",
|
||||
"$(location //examples/vite_monorepo:app_b_dev)",
|
||||
],
|
||||
data = [
|
||||
"//examples/vite_monorepo:app_a_dev",
|
||||
"//examples/vite_monorepo:app_b_dev",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "repo_all_targets_test",
|
||||
srcs = ["repo_all_targets_test.sh"],
|
||||
|
||||
36
tests/integration_test/examples_basic_run_e2e_test.sh
Executable file
36
tests/integration_test/examples_basic_run_e2e_test.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
binary="$1"
|
||||
workdir="$(mktemp -d)"
|
||||
log_file="${workdir}/basic.log"
|
||||
|
||||
cleanup() {
|
||||
if [[ -n ${server_pid:-} ]] && kill -0 "${server_pid}" 2>/dev/null; then
|
||||
kill "${server_pid}" 2>/dev/null || true
|
||||
wait "${server_pid}" 2>/dev/null || true
|
||||
fi
|
||||
rm -rf "${workdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
"${binary}" >"${log_file}" 2>&1 &
|
||||
server_pid=$!
|
||||
|
||||
for _ in {1..20}; do
|
||||
if grep -Fq "rules_bun bun_dev example" "${log_file}"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! kill -0 "${server_pid}" 2>/dev/null; then
|
||||
cat "${log_file}" >&2
|
||||
echo "basic example process exited unexpectedly" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
cat "${log_file}" >&2
|
||||
echo "Timed out waiting for bun_dev example output" >&2
|
||||
exit 1
|
||||
18
tests/integration_test/examples_vite_monorepo_catalog_shape_test.sh
Executable file
18
tests/integration_test/examples_vite_monorepo_catalog_shape_test.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root_package_json="$1"
|
||||
app_a_package_json="$2"
|
||||
app_b_package_json="$3"
|
||||
|
||||
grep -Eq '"workspaces"[[:space:]]*:[[:space:]]*\{' "${root_package_json}"
|
||||
grep -Eq '"packages"[[:space:]]*:[[:space:]]*\[' "${root_package_json}"
|
||||
grep -Eq '"apps/\*"' "${root_package_json}"
|
||||
grep -Eq '"catalog"[[:space:]]*:[[:space:]]*\{' "${root_package_json}"
|
||||
grep -Eq '"vite"[[:space:]]*:[[:space:]]*"5\.4\.14"' "${root_package_json}"
|
||||
grep -Eq '"catalogs"[[:space:]]*:[[:space:]]*\{' "${root_package_json}"
|
||||
grep -Eq '"testing"[[:space:]]*:[[:space:]]*\{' "${root_package_json}"
|
||||
grep -Eq '"vitest"[[:space:]]*:[[:space:]]*"3\.2\.4"' "${root_package_json}"
|
||||
grep -Eq '"vite"[[:space:]]*:[[:space:]]*"catalog:"' "${app_a_package_json}"
|
||||
grep -Eq '"vite"[[:space:]]*:[[:space:]]*"catalog:"' "${app_b_package_json}"
|
||||
grep -Eq '"vitest"[[:space:]]*:[[:space:]]*"catalog:testing"' "${app_b_package_json}"
|
||||
75
tests/integration_test/examples_vite_monorepo_e2e_test.sh
Executable file
75
tests/integration_test/examples_vite_monorepo_e2e_test.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
app_a_binary="$1"
|
||||
app_b_binary="$2"
|
||||
workdir="$(mktemp -d)"
|
||||
|
||||
server_pid=""
|
||||
log_file=""
|
||||
|
||||
cleanup() {
|
||||
if [[ -n ${server_pid} ]] && kill -0 "${server_pid}" 2>/dev/null; then
|
||||
kill "${server_pid}" 2>/dev/null || true
|
||||
wait "${server_pid}" 2>/dev/null || true
|
||||
fi
|
||||
rm -rf "${workdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
pick_port() {
|
||||
python3 - <<'PY'
|
||||
import socket
|
||||
sock = socket.socket()
|
||||
sock.bind(("127.0.0.1", 0))
|
||||
print(sock.getsockname()[1])
|
||||
sock.close()
|
||||
PY
|
||||
}
|
||||
|
||||
verify_vite_app() {
|
||||
local binary="$1"
|
||||
local expected_title="$2"
|
||||
local expected_js="$3"
|
||||
local log_name="$4"
|
||||
local port
|
||||
|
||||
port="$(pick_port)"
|
||||
log_file="${workdir}/${log_name}.log"
|
||||
|
||||
"${binary}" --host 127.0.0.1 --port "${port}" --strictPort >"${log_file}" 2>&1 &
|
||||
server_pid=$!
|
||||
|
||||
for _ in {1..60}; do
|
||||
if ! kill -0 "${server_pid}" 2>/dev/null; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Vite server exited unexpectedly for ${log_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if curl --fail --silent "http://127.0.0.1:${port}/" | grep -Fq "${expected_title}"; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
if ! curl --fail --silent "http://127.0.0.1:${port}/" | grep -Fq "${expected_title}"; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Timed out waiting for Vite index page for ${log_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! curl --fail --silent "http://127.0.0.1:${port}/main.js" | grep -Fq "${expected_js}"; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Expected Vite module output was not served for ${log_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kill "${server_pid}" 2>/dev/null || true
|
||||
wait "${server_pid}" 2>/dev/null || true
|
||||
server_pid=""
|
||||
}
|
||||
|
||||
verify_vite_app "${app_a_binary}" "Vite monorepo app A" "Hello from monorepo app A" "app-a"
|
||||
verify_vite_app "${app_b_binary}" "Vite monorepo app B" "Hello from monorepo app B" "app-b"
|
||||
@@ -30,4 +30,57 @@ sh_test(
|
||||
srcs = ["run_env_script.sh"],
|
||||
args = ["$(location :env_script)"],
|
||||
data = [":env_script"],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "vite_dev_server",
|
||||
script = "dev",
|
||||
package_json = "vite_app/package.json",
|
||||
node_modules = "@script_test_vite_node_modules//:node_modules",
|
||||
data = [
|
||||
"vite_app/index.html",
|
||||
"vite_app/main.js",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_script_vite_app_test",
|
||||
srcs = ["run_vite_app.sh"],
|
||||
args = ["$(location :vite_dev_server)"],
|
||||
data = [":vite_dev_server"],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "vite_monorepo_app_a_dev_server",
|
||||
script = "dev",
|
||||
package_json = "vite_monorepo/apps/app-a/package.json",
|
||||
node_modules = "@script_test_vite_monorepo_node_modules//:node_modules",
|
||||
data = [
|
||||
"vite_monorepo/apps/app-a/index.html",
|
||||
"vite_monorepo/apps/app-a/main.js",
|
||||
],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "vite_monorepo_app_b_dev_server",
|
||||
script = "dev",
|
||||
package_json = "vite_monorepo/apps/app-b/package.json",
|
||||
node_modules = "@script_test_vite_monorepo_node_modules//:node_modules",
|
||||
data = [
|
||||
"vite_monorepo/apps/app-b/index.html",
|
||||
"vite_monorepo/apps/app-b/main.js",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_script_vite_monorepo_apps_test",
|
||||
srcs = ["run_vite_monorepo_apps.sh"],
|
||||
args = [
|
||||
"$(location :vite_monorepo_app_a_dev_server)",
|
||||
"$(location :vite_monorepo_app_b_dev_server)",
|
||||
],
|
||||
data = [
|
||||
":vite_monorepo_app_a_dev_server",
|
||||
":vite_monorepo_app_b_dev_server",
|
||||
],
|
||||
)
|
||||
@@ -1,2 +1,2 @@
|
||||
const value = process.env.BUN_SCRIPT_ENV_TEST ?? "missing";
|
||||
const value = import.meta.env.BUN_SCRIPT_ENV_TEST ?? "missing";
|
||||
console.log(value);
|
||||
|
||||
@@ -5,5 +5,8 @@
|
||||
"scripts": {
|
||||
"hello": "bun ./hello.ts",
|
||||
"print-env": "bun ./env.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.3.10"
|
||||
}
|
||||
}
|
||||
|
||||
54
tests/script_test/run_vite_app.sh
Executable file
54
tests/script_test/run_vite_app.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
binary="$1"
|
||||
workdir="$(mktemp -d)"
|
||||
log_file="${workdir}/vite.log"
|
||||
|
||||
cleanup() {
|
||||
if [[ -n ${server_pid:-} ]] && kill -0 "${server_pid}" 2>/dev/null; then
|
||||
kill "${server_pid}" 2>/dev/null || true
|
||||
wait "${server_pid}" 2>/dev/null || true
|
||||
fi
|
||||
rm -rf "${workdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
port="$(
|
||||
python3 - <<'PY'
|
||||
import socket
|
||||
sock = socket.socket()
|
||||
sock.bind(("127.0.0.1", 0))
|
||||
print(sock.getsockname()[1])
|
||||
sock.close()
|
||||
PY
|
||||
)"
|
||||
|
||||
"${binary}" --host 127.0.0.1 --port "${port}" --strictPort >"${log_file}" 2>&1 &
|
||||
server_pid=$!
|
||||
|
||||
for _ in {1..60}; do
|
||||
if ! kill -0 "${server_pid}" 2>/dev/null; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Vite server exited unexpectedly" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if curl --fail --silent "http://127.0.0.1:${port}/" | grep -Fq "Vite via bun_script"; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
if ! curl --fail --silent "http://127.0.0.1:${port}/" | grep -Fq "Vite via bun_script"; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Timed out waiting for Vite index page" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! curl --fail --silent "http://127.0.0.1:${port}/main.js" | grep -Fq "Hello from Vite"; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Expected Vite module output was not served" >&2
|
||||
exit 1
|
||||
fi
|
||||
75
tests/script_test/run_vite_monorepo_apps.sh
Executable file
75
tests/script_test/run_vite_monorepo_apps.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
app_a_binary="$1"
|
||||
app_b_binary="$2"
|
||||
workdir="$(mktemp -d)"
|
||||
|
||||
server_pid=""
|
||||
log_file=""
|
||||
|
||||
cleanup() {
|
||||
if [[ -n ${server_pid} ]] && kill -0 "${server_pid}" 2>/dev/null; then
|
||||
kill "${server_pid}" 2>/dev/null || true
|
||||
wait "${server_pid}" 2>/dev/null || true
|
||||
fi
|
||||
rm -rf "${workdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
pick_port() {
|
||||
python3 - <<'PY'
|
||||
import socket
|
||||
sock = socket.socket()
|
||||
sock.bind(("127.0.0.1", 0))
|
||||
print(sock.getsockname()[1])
|
||||
sock.close()
|
||||
PY
|
||||
}
|
||||
|
||||
verify_vite_app() {
|
||||
local binary="$1"
|
||||
local expected_title="$2"
|
||||
local expected_js="$3"
|
||||
local log_name="$4"
|
||||
local port
|
||||
|
||||
port="$(pick_port)"
|
||||
log_file="${workdir}/${log_name}.log"
|
||||
|
||||
"${binary}" --host 127.0.0.1 --port "${port}" --strictPort >"${log_file}" 2>&1 &
|
||||
server_pid=$!
|
||||
|
||||
for _ in {1..60}; do
|
||||
if ! kill -0 "${server_pid}" 2>/dev/null; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Vite server exited unexpectedly for ${log_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if curl --fail --silent "http://127.0.0.1:${port}/" | grep -Fq "${expected_title}"; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
if ! curl --fail --silent "http://127.0.0.1:${port}/" | grep -Fq "${expected_title}"; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Timed out waiting for Vite index page for ${log_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! curl --fail --silent "http://127.0.0.1:${port}/main.js" | grep -Fq "${expected_js}"; then
|
||||
cat "${log_file}" >&2
|
||||
echo "Expected Vite module output was not served for ${log_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kill "${server_pid}" 2>/dev/null || true
|
||||
wait "${server_pid}" 2>/dev/null || true
|
||||
server_pid=""
|
||||
}
|
||||
|
||||
verify_vite_app "${app_a_binary}" "Vite monorepo app A" "Hello from monorepo app A" "app-a"
|
||||
verify_vite_app "${app_b_binary}" "Vite monorepo app B" "Hello from monorepo app B" "app-b"
|
||||
127
tests/script_test/vite_app/bun.lock
Normal file
127
tests/script_test/vite_app/bun.lock
Normal file
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "vite-app-test",
|
||||
"devDependencies": {
|
||||
"vite": "5.4.14",
|
||||
},
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.21.5", "", { "os": "android", "cpu": "arm64" }, "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.21.5", "", { "os": "android", "cpu": "x64" }, "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.21.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ=="],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.21.5", "", { "os": "darwin", "cpu": "x64" }, "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.21.5", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.21.5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.21.5", "", { "os": "linux", "cpu": "arm" }, "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.21.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.21.5", "", { "os": "linux", "cpu": "ia32" }, "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.21.5", "", { "os": "linux", "cpu": "ppc64" }, "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.21.5", "", { "os": "linux", "cpu": "s390x" }, "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.21.5", "", { "os": "linux", "cpu": "x64" }, "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.21.5", "", { "os": "none", "cpu": "x64" }, "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.21.5", "", { "os": "openbsd", "cpu": "x64" }, "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.21.5", "", { "os": "sunos", "cpu": "x64" }, "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.21.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.21.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.21.5", "", { "os": "win32", "cpu": "x64" }, "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw=="],
|
||||
|
||||
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.59.0", "", { "os": "android", "cpu": "arm" }, "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg=="],
|
||||
|
||||
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.59.0", "", { "os": "android", "cpu": "arm64" }, "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q=="],
|
||||
|
||||
"@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.59.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg=="],
|
||||
|
||||
"@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.59.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w=="],
|
||||
|
||||
"@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.59.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA=="],
|
||||
|
||||
"@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.59.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg=="],
|
||||
|
||||
"@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.59.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg=="],
|
||||
|
||||
"@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.59.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ=="],
|
||||
|
||||
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.59.0", "", { "os": "none", "cpu": "arm64" }, "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA=="],
|
||||
|
||||
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.59.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A=="],
|
||||
|
||||
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.59.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA=="],
|
||||
|
||||
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
||||
|
||||
"esbuild": ["esbuild@0.21.5", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.21.5", "@esbuild/android-arm": "0.21.5", "@esbuild/android-arm64": "0.21.5", "@esbuild/android-x64": "0.21.5", "@esbuild/darwin-arm64": "0.21.5", "@esbuild/darwin-x64": "0.21.5", "@esbuild/freebsd-arm64": "0.21.5", "@esbuild/freebsd-x64": "0.21.5", "@esbuild/linux-arm": "0.21.5", "@esbuild/linux-arm64": "0.21.5", "@esbuild/linux-ia32": "0.21.5", "@esbuild/linux-loong64": "0.21.5", "@esbuild/linux-mips64el": "0.21.5", "@esbuild/linux-ppc64": "0.21.5", "@esbuild/linux-riscv64": "0.21.5", "@esbuild/linux-s390x": "0.21.5", "@esbuild/linux-x64": "0.21.5", "@esbuild/netbsd-x64": "0.21.5", "@esbuild/openbsd-x64": "0.21.5", "@esbuild/sunos-x64": "0.21.5", "@esbuild/win32-arm64": "0.21.5", "@esbuild/win32-ia32": "0.21.5", "@esbuild/win32-x64": "0.21.5" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw=="],
|
||||
|
||||
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||
|
||||
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
|
||||
|
||||
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||
|
||||
"postcss": ["postcss@8.5.8", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="],
|
||||
|
||||
"rollup": ["rollup@4.59.0", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.59.0", "@rollup/rollup-android-arm64": "4.59.0", "@rollup/rollup-darwin-arm64": "4.59.0", "@rollup/rollup-darwin-x64": "4.59.0", "@rollup/rollup-freebsd-arm64": "4.59.0", "@rollup/rollup-freebsd-x64": "4.59.0", "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", "@rollup/rollup-linux-arm-musleabihf": "4.59.0", "@rollup/rollup-linux-arm64-gnu": "4.59.0", "@rollup/rollup-linux-arm64-musl": "4.59.0", "@rollup/rollup-linux-loong64-gnu": "4.59.0", "@rollup/rollup-linux-loong64-musl": "4.59.0", "@rollup/rollup-linux-ppc64-gnu": "4.59.0", "@rollup/rollup-linux-ppc64-musl": "4.59.0", "@rollup/rollup-linux-riscv64-gnu": "4.59.0", "@rollup/rollup-linux-riscv64-musl": "4.59.0", "@rollup/rollup-linux-s390x-gnu": "4.59.0", "@rollup/rollup-linux-x64-gnu": "4.59.0", "@rollup/rollup-linux-x64-musl": "4.59.0", "@rollup/rollup-openbsd-x64": "4.59.0", "@rollup/rollup-openharmony-arm64": "4.59.0", "@rollup/rollup-win32-arm64-msvc": "4.59.0", "@rollup/rollup-win32-ia32-msvc": "4.59.0", "@rollup/rollup-win32-x64-gnu": "4.59.0", "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg=="],
|
||||
|
||||
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||
|
||||
"vite": ["vite@5.4.14", "", { "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", "rollup": "^4.20.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "optionalPeers": ["@types/node", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": { "vite": "bin/vite.js" } }, "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA=="],
|
||||
}
|
||||
}
|
||||
12
tests/script_test/vite_app/index.html
Normal file
12
tests/script_test/vite_app/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite via bun_script</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
tests/script_test/vite_app/main.js
Normal file
7
tests/script_test/vite_app/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const app = document.querySelector("#app");
|
||||
|
||||
if (app) {
|
||||
app.textContent = "Hello from Vite";
|
||||
}
|
||||
|
||||
console.log("Hello from Vite");
|
||||
11
tests/script_test/vite_app/package.json
Normal file
11
tests/script_test/vite_app/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "vite-app-test",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "5.4.14"
|
||||
}
|
||||
}
|
||||
12
tests/script_test/vite_monorepo/apps/app-a/index.html
Normal file
12
tests/script_test/vite_monorepo/apps/app-a/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite monorepo app A</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
tests/script_test/vite_monorepo/apps/app-a/main.js
Normal file
7
tests/script_test/vite_monorepo/apps/app-a/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const app = document.querySelector("#app");
|
||||
|
||||
if (app) {
|
||||
app.textContent = "Hello from monorepo app A";
|
||||
}
|
||||
|
||||
console.log("Hello from monorepo app A");
|
||||
8
tests/script_test/vite_monorepo/apps/app-a/package.json
Normal file
8
tests/script_test/vite_monorepo/apps/app-a/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "vite-monorepo-app-a",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite"
|
||||
}
|
||||
}
|
||||
12
tests/script_test/vite_monorepo/apps/app-b/index.html
Normal file
12
tests/script_test/vite_monorepo/apps/app-b/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite monorepo app B</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
tests/script_test/vite_monorepo/apps/app-b/main.js
Normal file
7
tests/script_test/vite_monorepo/apps/app-b/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const app = document.querySelector("#app");
|
||||
|
||||
if (app) {
|
||||
app.textContent = "Hello from monorepo app B";
|
||||
}
|
||||
|
||||
console.log("Hello from monorepo app B");
|
||||
8
tests/script_test/vite_monorepo/apps/app-b/package.json
Normal file
8
tests/script_test/vite_monorepo/apps/app-b/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "vite-monorepo-app-b",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite"
|
||||
}
|
||||
}
|
||||
137
tests/script_test/vite_monorepo/bun.lock
Normal file
137
tests/script_test/vite_monorepo/bun.lock
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "vite-monorepo-test",
|
||||
"devDependencies": {
|
||||
"vite": "5.4.14",
|
||||
},
|
||||
},
|
||||
"apps/app-a": {
|
||||
"name": "vite-monorepo-app-a",
|
||||
},
|
||||
"apps/app-b": {
|
||||
"name": "vite-monorepo-app-b",
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.21.5", "", { "os": "android", "cpu": "arm64" }, "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.21.5", "", { "os": "android", "cpu": "x64" }, "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.21.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ=="],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.21.5", "", { "os": "darwin", "cpu": "x64" }, "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.21.5", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.21.5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.21.5", "", { "os": "linux", "cpu": "arm" }, "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.21.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.21.5", "", { "os": "linux", "cpu": "ia32" }, "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.21.5", "", { "os": "linux", "cpu": "ppc64" }, "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.21.5", "", { "os": "linux", "cpu": "none" }, "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.21.5", "", { "os": "linux", "cpu": "s390x" }, "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.21.5", "", { "os": "linux", "cpu": "x64" }, "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.21.5", "", { "os": "none", "cpu": "x64" }, "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.21.5", "", { "os": "openbsd", "cpu": "x64" }, "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.21.5", "", { "os": "sunos", "cpu": "x64" }, "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.21.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.21.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.21.5", "", { "os": "win32", "cpu": "x64" }, "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw=="],
|
||||
|
||||
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.59.0", "", { "os": "android", "cpu": "arm" }, "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg=="],
|
||||
|
||||
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.59.0", "", { "os": "android", "cpu": "arm64" }, "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q=="],
|
||||
|
||||
"@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.59.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg=="],
|
||||
|
||||
"@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.59.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w=="],
|
||||
|
||||
"@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.59.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA=="],
|
||||
|
||||
"@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.59.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg=="],
|
||||
|
||||
"@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.59.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg=="],
|
||||
|
||||
"@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.59.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ=="],
|
||||
|
||||
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.59.0", "", { "os": "none", "cpu": "arm64" }, "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA=="],
|
||||
|
||||
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.59.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A=="],
|
||||
|
||||
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.59.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA=="],
|
||||
|
||||
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
||||
|
||||
"esbuild": ["esbuild@0.21.5", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.21.5", "@esbuild/android-arm": "0.21.5", "@esbuild/android-arm64": "0.21.5", "@esbuild/android-x64": "0.21.5", "@esbuild/darwin-arm64": "0.21.5", "@esbuild/darwin-x64": "0.21.5", "@esbuild/freebsd-arm64": "0.21.5", "@esbuild/freebsd-x64": "0.21.5", "@esbuild/linux-arm": "0.21.5", "@esbuild/linux-arm64": "0.21.5", "@esbuild/linux-ia32": "0.21.5", "@esbuild/linux-loong64": "0.21.5", "@esbuild/linux-mips64el": "0.21.5", "@esbuild/linux-ppc64": "0.21.5", "@esbuild/linux-riscv64": "0.21.5", "@esbuild/linux-s390x": "0.21.5", "@esbuild/linux-x64": "0.21.5", "@esbuild/netbsd-x64": "0.21.5", "@esbuild/openbsd-x64": "0.21.5", "@esbuild/sunos-x64": "0.21.5", "@esbuild/win32-arm64": "0.21.5", "@esbuild/win32-ia32": "0.21.5", "@esbuild/win32-x64": "0.21.5" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw=="],
|
||||
|
||||
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||
|
||||
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
|
||||
|
||||
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||
|
||||
"postcss": ["postcss@8.5.8", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="],
|
||||
|
||||
"rollup": ["rollup@4.59.0", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.59.0", "@rollup/rollup-android-arm64": "4.59.0", "@rollup/rollup-darwin-arm64": "4.59.0", "@rollup/rollup-darwin-x64": "4.59.0", "@rollup/rollup-freebsd-arm64": "4.59.0", "@rollup/rollup-freebsd-x64": "4.59.0", "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", "@rollup/rollup-linux-arm-musleabihf": "4.59.0", "@rollup/rollup-linux-arm64-gnu": "4.59.0", "@rollup/rollup-linux-arm64-musl": "4.59.0", "@rollup/rollup-linux-loong64-gnu": "4.59.0", "@rollup/rollup-linux-loong64-musl": "4.59.0", "@rollup/rollup-linux-ppc64-gnu": "4.59.0", "@rollup/rollup-linux-ppc64-musl": "4.59.0", "@rollup/rollup-linux-riscv64-gnu": "4.59.0", "@rollup/rollup-linux-riscv64-musl": "4.59.0", "@rollup/rollup-linux-s390x-gnu": "4.59.0", "@rollup/rollup-linux-x64-gnu": "4.59.0", "@rollup/rollup-linux-x64-musl": "4.59.0", "@rollup/rollup-openbsd-x64": "4.59.0", "@rollup/rollup-openharmony-arm64": "4.59.0", "@rollup/rollup-win32-arm64-msvc": "4.59.0", "@rollup/rollup-win32-ia32-msvc": "4.59.0", "@rollup/rollup-win32-x64-gnu": "4.59.0", "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg=="],
|
||||
|
||||
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||
|
||||
"vite": ["vite@5.4.14", "", { "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", "rollup": "^4.20.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "optionalPeers": ["@types/node", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": { "vite": "bin/vite.js" } }, "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA=="],
|
||||
|
||||
"vite-monorepo-app-a": ["vite-monorepo-app-a@workspace:apps/app-a"],
|
||||
|
||||
"vite-monorepo-app-b": ["vite-monorepo-app-b@workspace:apps/app-b"],
|
||||
}
|
||||
}
|
||||
10
tests/script_test/vite_monorepo/package.json
Normal file
10
tests/script_test/vite_monorepo/package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "vite-monorepo-test",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"apps/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"vite": "5.4.14"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user