-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Problem
Extension models that shell out to helper scripts (via Deno.Command) can't be published to the registry if the helper script imports npm packages with native/unbundleable dependencies.
The bundler tries to bundle every .ts file in extensions/models/ and in the additionalFiles extraction path. If a helper script imports a package like hap-controller (which has native deps for Bluetooth that are never used at runtime), the bundle fails and the extension can't be pushed.
Context
The @bixu/homekit extension discovers HomeKit accessories via mDNS using hap-controller. The main model (homekit.ts) bundles fine — it only imports zod and shells out to a helper script. The helper script (homekit_discover.ts) imports hap-controller and runs as a standalone deno run subprocess. This works locally in extensions/scripts/ but can't be published because:
additionalFilesare extracted toextensions/models/, where swamp tries to bundle them as models- There's no way to include a file that skips bundling
Proposed Solution
Support an extensions/scripts/ directory (or similar) that:
- Is included in the extension archive during
push - Is extracted to a known, predictable path on
pull - Is not bundled or loaded as a model by swamp
- Can be referenced by models at runtime via
context.repoDir
Alternatively, a scripts key in the manifest (alongside models and workflows) that marks files as "include but don't bundle":
manifestVersion: 1
name: "@bixu/homekit"
version: "2026.03.14.1"
models:
- homekit.ts
scripts:
- homekit_discover.tsCurrent workaround
Keep the helper script in extensions/scripts/ as a local-only file. The extension works in the repo but can't be published.