vite-plugin-enter-dev
v0.0.18
Published
A Vite plugin for development enhancements
Maintainers
Readme
vite-plugin-enter-dev
Preview media capture is installed before application scripts using the shared
@enter/preview-media-control implementation, inlined into this package's built
HTML bootstrap. It registers detached Audio and AudioContext objects while
preserving normal playback until a compatible Home Sandbox supplies a policy.
Older hosts and standalone pages therefore remain audible. Existing projects
must upgrade this plugin and restart Vite to gain document-start capture;
enterProdPlugin still does not install the preview bootstrap into immutable
Snapshots. Late Home injection cannot enumerate pre-existing detached media or
Web Audio contexts. This change requires publishing a new plugin version before
project upgrades; no package publication or deployment is performed here.
Version 0.0.15 recognizes TypeScript as, satisfies, angle-bracket assertions,
and non-null assertions around plugin expressions and options without removing
them from the configuration. Compiler ownership and conditional branches remain
unchanged. The conditional PWA incident configuration is retained as a regression
fixture, alongside real Vite development/production checks.
Version 0.0.12 preserves the host React compiler and its Babel options. Use
enterDevPlugin({ react: false }) alongside @vitejs/plugin-react; Enter adds
source locations through api.reactBabel. Templates without a host compiler
can keep enterDevPlugin(). Duplicate React compilers fail at configuration
resolution with an actionable error instead of serving broken entry modules.
vite-plugin-enter-dev/configure exports configureVite(source) and
configureViteFile(path, check?). The Gateway uses these to repair existing
and imported Vite configurations. Migration preserves host options, handles
static configurations and aliased imports, and is idempotent. Unsupported
dynamic configurations fail without changing the file; check mode never writes.
File migration requires the caller to exclude concurrent file writers for the
whole operation; the Gateway holds and drains its workspace lock before calling.
Version 0.0.11's reload-generation recovery remains enabled: served documents compare the server instance and reload revision on initial HMR connection and reconnection, reloading once when stale.
Preview instrumentation is installed before application scripts and resources.
Early script, stylesheet, image and link failures are buffered for the Sandbox
collector. During development, a Vite-processed module listens to the official
HMR lifecycle and publishes enter:preview-update with build-start,
build-end or build-error; the latest signal is retained for late Sandbox
initialization. Production HTML does not contain this HMR module. These changes
require upgrading this package and restarting Vite in existing sandboxes.
Worker failures use the same runtime diagnostics. The early probe buffers them until the Sandbox collector takes over; workers created before that handoff remain observable. Collection preserves application error handlers and does not infer an HTTP status from an opaque worker error. Older plugins gain capture for new workers when the updated Sandbox collector initializes; document-start capture requires publishing and upgrading the plugin.
Run pnpm test, pnpm lint, and pnpm typecheck in this package. Tests compile
a real TSX entry through Vite and verify source annotations, migration, and
host Babel options.
Publish 0.0.17 before deploying a Gateway requiring it. Existing sandboxes must upgrade the package, migrate the configuration, and restart Vite; the Gateway checks this even when the old server's readiness endpoint still responds.
Version 0.0.16 supports conditional spreads and nested plugin arrays while preserving development/build branches. Equivalent pure conditions are matched only when their referenced bindings are stable and shared; ambiguous compiler ownership still fails explicitly.
Version 0.0.17 accepts plugin lists that also hold inline plugin objects or constants bound to one, or to the result of a factory imported from another package. Spreads, destructuring, aliased React or Enter factories, and values that refer to either package still fail as a dynamic plugin list.
Version 0.0.18 migrates configurations wrapped in defineConfig from @lovable.dev/vite-tanstack-config. Enter is added to the preset's vite option (created when the preset options have none), or to the argument itself when the preset reads it as the Vite configuration, and always with enterDevPlugin({ react: false }) because the preset registers @vitejs/plugin-react. Spread or computed preset options, the removed cloudflare option, a non-static vite option and a top-level plugins list beside preset options still fail, as does any other wrapper. In the sandbox, the dev server binds 127.0.0.1 when neither the project config nor the CLI sets server.host, because the sandbox ingress dials IPv4 loopback; an explicit host is kept. When Vite loads a configuration as ESM (.mjs/.mts, or "type": "module"), a configuration without any default export (and no export {x as default}, export = or CommonJS export) now fails with Invalid Vite config: missing default export instead of the generic unsupported-shape error, matching Vite's rejection so the Gateway can attribute it to the project.
