Skip to content

JS bindings: expose real filesystem mounts with per-mount readOnly support #1066

@chaliy

Description

@chaliy

The Python bindings expose mount_real_readonly_at, mount_real_readwrite_at, and dynamic mount/unmount. The JS bindings have none — the only way to populate the VFS is via the files option.

Requested API (parity with Python):

const bash = new Bash({
mounts: [
{ path: '/supabase/docs', root: '/real/path', readOnly: true },
],
})
// or
bash.mountRealReadonlyAt('/supabase/docs', docsDir)
bash.unmount('/supabase/docs')

Without native VFS-level readOnly, the only JS workaround is bash function overrides (rm() { echo EROFS; }), bypassable via command rm and redirections. The Rust crate already has OverlayFs with readOnly, and v0.1.13 added mount/unmount (#784). Python exposes it — JS should too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions