@adep/web-container 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,5 +44,6 @@ export interface BrowserSimRuntime {
44
44
  /** 释放资源(当前无长持句柄;与 CLI createSimRuntime.dispose 对称保留)。 */
45
45
  dispose(): Promise<void>;
46
46
  }
47
+ /** 顺序合并多份 bundle:capabilities 去重(同名后者覆盖),rpcHandlers 浅合并。 */
47
48
  /** 装配浏览器模拟运行时(async:db 引擎要先把 IndexedDB 里的快照灌回来)。 */
48
49
  export declare function createBrowserSimRuntime(options: BrowserSimRuntimeOptions): Promise<BrowserSimRuntime>;
@@ -11,6 +11,8 @@
11
11
  * (真 live binding、真模块隔离),不是 CJS 打平;
12
12
  * - **转换**:`.ts` 复用 stripTypes 擦类型;`.css` 变成「注入 `<style>` 的副作用模块」;
13
13
  * `.json` 变成默认导出对象;`.vue` 经注入的 SFC 编译器(IDE 侧装 `vue/compiler-sfc`);
14
+ * JS 系产物统一过 define 替换(`process.env.NODE_ENV` / `__VUE_*__`),让 esm-bundler
15
+ * 构建(vue 等)在无打包器的浏览器里也能跑;
14
16
  * - **依赖**:裸说明符经 node-resolve 命中 VFS `node_modules/`(终端 `npm install` 的产物),
15
17
  * 与 CLI / 线上同一套解析规则;相对说明符支持 Vite 风格省略扩展名(.ts/.js/.vue/…);
16
18
  * - **HMR**:订阅 VFS 变更(`vfs.onMutate`,IDE 保存 / shell 写入 / npm 解包皆触发)→
@@ -46,6 +48,12 @@ export interface ViteServerOptions {
46
48
  /** blob URL 工厂(Node 单测注入假实现)。 */
47
49
  createObjectURL?: (blob: Blob) => string;
48
50
  revokeObjectURL?: (url: string) => void;
51
+ /**
52
+ * 文档重建且**内容有变化**时回调(PV-006):blob HMR 之外的第二条出口——
53
+ * IDE 侧据此把新产物导出并发布到预览子域(真实 HTTP 源)。
54
+ * 首建不回调(宿主由 `serverready` 事件拿首屏 URL,两处都回调会长重复发布)。
55
+ */
56
+ onDocumentChange?: (url: string) => void;
49
57
  }
50
58
  /** dev server 句柄:url / root 对外只读,`touch` 驱动 HMR,`stop` 释放资源。 */
51
59
  export interface ViteServer {