webloom-framework 0.4.0 → 0.4.2
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.
- package/README.md +1 -1
- package/dist/advanced.d.ts +20 -8
- package/dist/advanced.js +4 -4
- package/dist/advanced.js.map +1 -1
- package/dist/{chunk-JHJZIO2H.js → chunk-CKML74MG.js} +25 -4
- package/dist/chunk-CKML74MG.js.map +1 -0
- package/dist/{chunk-YOIH6H36.js → chunk-RRNUE457.js} +112 -32
- package/dist/chunk-RRNUE457.js.map +1 -0
- package/dist/{chunk-RAQOFUZY.js → chunk-XVD7ALPV.js} +461 -46
- package/dist/chunk-XVD7ALPV.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/{messageBus-CtrwkjrO.d.ts → messageBus-BDtkjs6y.d.ts} +1 -1
- package/dist/messagePortServiceTransport-DyNmdgoa.d.ts +150 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{runtimeTypes-DquUCHz-.d.ts → runtimeTypes-CleHMFaq.d.ts} +269 -3
- package/dist/{sharedWorkerHost-Cb2a1_KD.d.ts → sharedWorkerHost-BNMUW-8v.d.ts} +37 -2
- package/dist/testing.d.ts +6 -6
- package/dist/testing.js +4 -4
- package/dist/{windowRuntime-B6Ue8jso.d.ts → windowRuntime-BGl_jfbK.d.ts} +2 -2
- package/docs/api.md +1 -1
- package/docs/proposals/webloom-v4/verification.md +100 -54
- package/package.json +5 -3
- package/dist/chunk-JHJZIO2H.js.map +0 -1
- package/dist/chunk-RAQOFUZY.js.map +0 -1
- package/dist/chunk-YOIH6H36.js.map +0 -1
- package/dist/messagePortServiceTransport-B0FyJr43.d.ts +0 -264
package/dist/testing.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { C as CreateCapabilityBridgeOptions, b as CreatePluginIntentControllerOptions, M as MessagePortLike,
|
|
5
|
-
export { C as CreateResourceScopeOptions,
|
|
6
|
-
export { c as createMessageBus } from './messageBus-
|
|
1
|
+
import { ab as RuntimeWireMessage, v as CreatePluginHostOptions, A as PluginHost } from './runtimeTypes-CleHMFaq.js';
|
|
2
|
+
export { p as CapabilityRegistration, q as CapabilityRegistry, r as ContextExtensionInput, s as ContributionAdapter, t as ContributionAdapterInput, u as ContributionHandle, H as HostCapabilityRegistration, w as HostInspection, x as PermissionPolicyInput, y as PermissionPolicyResult, z as PluginConfigStore, a7 as RuntimeUnitAttributesInput, a8 as RuntimeUnitAvailabilityInput, a9 as RuntimeUnitParentScopeInput, aa as RuntimeUnitSnapshot, ac as StartupCapabilityError, ad as StartupPluginError, ae as createCapabilityRegistry, af as createInMemoryPluginConfigStore, ag as createPluginHost, ck as createResourceStore, ai as invokeCapabilityHandler } from './runtimeTypes-CleHMFaq.js';
|
|
3
|
+
import { R as RuntimeTransport } from './messagePortServiceTransport-DyNmdgoa.js';
|
|
4
|
+
export { C as CreateCapabilityBridgeOptions, b as CreatePluginIntentControllerOptions, M as MessagePortLike, d as RuntimeReceiveMetadata, e as RuntimeUnitImplementation, f as createCapabilityBridge, g as createMessagePortRuntimeTransport, h as createPluginIntentController, i as createResourceRegistry, l as createRuntimeUnitImplementationRegistry, v as validateTransferables } from './messagePortServiceTransport-DyNmdgoa.js';
|
|
5
|
+
export { C as CreateResourceScopeOptions, f as ResourceScopeOptions, o as SharedWorkerFactory, p as SharedWorkerScopeLike, g as StartSharedWorkerAppForTestingOptions, q as connectSharedWorkerForTesting, j as createLifecycleScope, k as createResourceScope, r as startSharedWorkerAppForTesting } from './sharedWorkerHost-BNMUW-8v.js';
|
|
6
|
+
export { c as createMessageBus } from './messageBus-BDtkjs6y.js';
|
|
7
7
|
|
|
8
8
|
/** 可观察的 transport 发送记录。 */
|
|
9
9
|
interface FakeTransportMessage {
|
package/dist/testing.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { startSharedWorkerAppForTesting } from './chunk-
|
|
1
|
+
export { startSharedWorkerAppForTesting } from './chunk-RRNUE457.js';
|
|
2
2
|
export { createPluginIntentController } from './chunk-4DSINPZD.js';
|
|
3
|
-
export { connectSharedWorkerForTesting, createCapabilityBridge, createMessagePortRuntimeTransport, validateTransferables } from './chunk-
|
|
4
|
-
import { createPluginHost } from './chunk-
|
|
5
|
-
export { StartupCapabilityError, StartupPluginError, createCapabilityRegistry, createInMemoryPluginConfigStore, createLifecycleScope, createMessageBus, createPluginHost, createResourceRegistry, createResourceScope, createResourceStore, createRuntimeUnitImplementationRegistry, invokeCapabilityHandler } from './chunk-
|
|
3
|
+
export { connectSharedWorkerForTesting, createCapabilityBridge, createMessagePortRuntimeTransport, validateTransferables } from './chunk-XVD7ALPV.js';
|
|
4
|
+
import { createPluginHost } from './chunk-CKML74MG.js';
|
|
5
|
+
export { StartupCapabilityError, StartupPluginError, createCapabilityRegistry, createInMemoryPluginConfigStore, createLifecycleScope, createMessageBus, createPluginHost, createResourceRegistry, createResourceScope, createResourceStore, createRuntimeUnitImplementationRegistry, invokeCapabilityHandler } from './chunk-CKML74MG.js';
|
|
6
6
|
|
|
7
7
|
// src/testing/fakes.ts
|
|
8
8
|
function createFakeRuntimeTransport() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as RuntimePluginDefinition } from './sharedWorkerHost-
|
|
1
|
+
import { v as CreatePluginHostOptions, A as PluginHost, W as WindowApp } from './runtimeTypes-CleHMFaq.js';
|
|
2
|
+
import { c as RuntimePluginDefinition } from './sharedWorkerHost-BNMUW-8v.js';
|
|
3
3
|
|
|
4
4
|
interface CreateWindowAppOptions extends Omit<CreatePluginHostOptions, "runtime" | "runtimeUnitImplementationRegistry" | "runtimeInstanceId" | "runtimeId" | "capabilityBridge"> {
|
|
5
5
|
/** Window Runtime 逻辑标识。 */
|
package/docs/api.md
CHANGED
|
@@ -1,84 +1,130 @@
|
|
|
1
1
|
# WebLoom v4 验证记录
|
|
2
2
|
|
|
3
3
|
更新时间:2026-09-11(工作树验证)。本记录只写已经执行的命令和观察到的结果;
|
|
4
|
-
|
|
4
|
+
未执行的跨浏览器、产品部署和 registry-only 验收不会由本地测试推断为通过。
|
|
5
|
+
|
|
6
|
+
`webloom-framework@0.4.1` 已发布到 npm。本轮发布的是同一 v4 wire 的 patch 版本;registry
|
|
7
|
+
返回的 `dist.integrity` 为
|
|
8
|
+
`sha512-/sXro/by2FDq6ZehsOUnuYT8JwaaK3o6bn0uN/ZhtQBWd/7dlTbVcxZF+BlGJ/4dAhqhNOlUWXyGJ5Vk77IOLw==`。
|
|
5
9
|
|
|
6
10
|
## 1. WebLoom 本仓库
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
以下本地门禁均通过:
|
|
9
13
|
|
|
10
|
-
- `pnpm test:types`:TypeScript
|
|
11
|
-
capability identity。
|
|
12
|
-
|
|
14
|
+
- `pnpm test:types`:TypeScript 检查、`.typecheck.ts` 负向类型 fixture、契约 inventory
|
|
15
|
+
gate 和临时 Git 基线回归自测均通过;正式源码 inventory 为 1 个 capability identity。
|
|
16
|
+
负向 fixture 覆盖错误 request/response/item、local capability 跨 Runtime、错误 parser
|
|
17
|
+
和旧字符串获取。基线自测验证“源码与 inventory 同时进入新 HEAD、但
|
|
18
|
+
`contractTestVersion` 未变”会在显式旧 commit 基线下失败。
|
|
19
|
+
- `pnpm test -- --reporter=dot`:17 个测试文件、106 个测试通过。
|
|
20
|
+
- `pnpm vitest run src/runtime/v4Acceptance.test.ts --reporter=verbose`:9 个 v4 acceptance
|
|
21
|
+
测试通过,包括 AT-16。
|
|
13
22
|
- `pnpm build`:四入口 `index`、`advanced`、`react`、`testing` 的 ESM 与 declaration
|
|
14
23
|
构建通过。
|
|
15
24
|
- `pnpm lint:boundaries`、`pnpm lint:v4`:通过。
|
|
16
|
-
- `
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Worker
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
- `pnpm run test:ablation`:AT-22 baseline 通过;删除 cancel、deadline、实例过滤、目录
|
|
26
|
+
校验、revoke 五种机制后对应探针均按预期失败;恢复源码后再次通过。
|
|
27
|
+
- `pnpm run pack:consumer`:tarball gate、声明/source-map 检查,以及 core-only、advanced、
|
|
28
|
+
React、Worker 四类独立 consumer 均通过。
|
|
29
|
+
|
|
30
|
+
### 真实 Chromium
|
|
31
|
+
|
|
32
|
+
`node scripts/real-browser-runtime-smoke.mjs` 使用 Vite production fixture 和真实
|
|
33
|
+
`SharedWorker` 通过。验证结果包括:
|
|
34
|
+
|
|
35
|
+
- 两个真实 Window 页面共享同一 `SharedWorkerGlobalScope`、同一 worker unit/setup,且每个
|
|
36
|
+
peer 的 service exposure 独立;覆盖 reverse RPC、typed stream `[1,2,3]`、基础 buffer
|
|
37
|
+
detach、重连后旧 proxy 撤销、terminal `stopping → disposed`、迟到连接和
|
|
38
|
+
`protocol_mismatch`。
|
|
39
|
+
- `transfer-matrix` 通过 10 个场景:RPC request/result 的正常与重复 transfer、不可达
|
|
40
|
+
request/result、stream request 与 item 的正常/重复/不可达 transfer、ready 前取消、发送
|
|
41
|
+
后取消和发送前取消。
|
|
42
|
+
- 矩阵实际交付并回环验证 request/result/item 的业务 `MessagePort`,验证两个
|
|
43
|
+
`Uint8Array` view 仍共享 backing buffer;不可达资源返回 `transfer_invalid`,发送前取消
|
|
44
|
+
保留 buffer/port,发送后取消保持已转移状态。
|
|
24
45
|
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
真实浏览器版本:Chrome for Testing `153.0.8010.12`,Linux x64,headless。Firefox、真实
|
|
47
|
+
Safari 和 Playwright WebKit 本轮未执行,不能宣称兼容性已验收。
|
|
27
48
|
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
AT-16 的 `1/10/100 services × 1/2/10 peers` 测量在 `v4Acceptance.test.ts` 中执行:每次
|
|
50
|
+
广播只构建一个公共 base snapshot,wire 侧按 peer 投影 grant,且不重复公开 runtime 字段。
|
|
51
|
+
|
|
52
|
+
### Contract inventory 基线策略
|
|
53
|
+
|
|
54
|
+
本地 `node scripts/check-contract-inventory.mjs` 保持以当前 `HEAD` 作为默认基线,便于
|
|
55
|
+
检查未提交工作树。提交级 CI 应执行 `pnpm run test:contract-inventory:ci`:它优先使用
|
|
56
|
+
`CONTRACT_INVENTORY_BASELINE_REF` 或 GitHub Actions 的 `GITHUB_BASE_SHA`,否则使用
|
|
57
|
+
`git merge-base HEAD origin/main`,最终显式传入 `--baseline-ref <sha>`。该门禁不会把
|
|
58
|
+
包含新源码和新 inventory 的当前提交当作自己的历史基线。
|
|
30
59
|
|
|
31
60
|
## 2. DemoWebLoom
|
|
32
61
|
|
|
33
62
|
以下门禁均通过:
|
|
34
63
|
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
- `node scripts/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
identity 与逐 peer service identity。
|
|
64
|
+
- `pnpm build`:v4 boundary、`tsc --noEmit` 和 Vite production build 通过,九章入口及
|
|
65
|
+
real SharedWorker chunk 均生成。
|
|
66
|
+
- `node scripts/real-browser-smoke.mjs`:index、01–09 九章、01 插件 disable/enable、
|
|
67
|
+
07 两页真实 SharedWorker call 均通过;验证共享 worker/runtime/unit identity 与逐 peer
|
|
68
|
+
service identity。
|
|
41
69
|
|
|
42
|
-
Demo
|
|
43
|
-
|
|
70
|
+
Demo 的验证使用当前本地 WebLoom 工作树链接;这证明源码类型和真实浏览器交互,不替代
|
|
71
|
+
registry-only frozen install。Demo 已切换到 `0.4.1` 并在 frozen install 后完成类型、生产
|
|
72
|
+
构建和真实 Chromium smoke;Keymaster 的 registry-only 四入口 consumer 也已从 npm
|
|
73
|
+
`0.4.1` 验证通过。
|
|
44
74
|
|
|
45
75
|
## 3. Keymaster
|
|
46
76
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
77
|
+
以下本地代码门禁均通过:
|
|
78
|
+
|
|
79
|
+
- `pnpm test:types`:`tsc -b`、Keymaster contract inventory gate 和临时 Git 基线回归自测
|
|
80
|
+
通过,inventory 为 75 个 identity;Coordinator response/result 负向类型 fixture 通过
|
|
81
|
+
编译保护。
|
|
82
|
+
- `pnpm test`:216 个测试文件全部通过(18 个常规批次加 2 个重型隔离批次);其中
|
|
83
|
+
Coordinator worker 113 tests、Vault service 79 tests 均通过。
|
|
84
|
+
- `pnpm build`:Vite production build 通过,3982 个 module transformed;生产产物扫描
|
|
85
|
+
通过(13 个 HTML/JS/CSS 文件)。
|
|
86
|
+
- `pnpm lint:boundaries`:storage hard-switch、plugin boundary 和 Coordinator final-I/O
|
|
87
|
+
审计均通过。
|
|
52
88
|
- `git diff --check`:通过。
|
|
53
|
-
- `node scripts/check-boundaries.mjs`、`node scripts/check-react-resource-boundaries.mjs`、
|
|
54
|
-
`node scripts/check-coordinator-final-io-audit.mjs`:均通过。
|
|
55
89
|
|
|
56
|
-
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
|
|
90
|
+
另外,在提交 `1edc117` 的 detached 临时 checkout 中执行
|
|
91
|
+
`pnpm install --frozen-lockfile --ignore-scripts && pnpm test:types && pnpm test`:安装
|
|
92
|
+
成功,`test:types` 通过,随后 216 个测试文件(18 个常规批次加 2 个重型隔离批次)全部
|
|
93
|
+
通过。该 fresh-install 结果也覆盖了 `@keymaster/plugin-token-bsv21` 对
|
|
94
|
+
`@noble/secp256k1` 的直接声明,以及根测试 setup 对 `@noble/secp256k1` 和
|
|
95
|
+
`@noble/hashes` 的直接声明。
|
|
96
|
+
|
|
97
|
+
Local/S3 真实浏览器、CORS/CAS、重启、多 tab、恢复、app-view 外部环境和公开部署仍需
|
|
98
|
+
产品环境证据;单元测试和 fresh-install 通过不等价于这些验收已经关闭。
|
|
99
|
+
|
|
100
|
+
## 4. 发布与 registry 边界
|
|
60
101
|
|
|
61
|
-
|
|
62
|
-
lockfile
|
|
63
|
-
|
|
102
|
+
上一轮已实际完成 `webloom-framework@0.4.0` 的 registry integrity、Keymaster/Demo
|
|
103
|
+
lockfile 一致性、release-boundary 和 registry-only consumer 验证;该版本是本轮的已发布
|
|
104
|
+
基线。本轮已发布 `webloom-framework@0.4.1`,并从 registry 读取上述真实 `dist.integrity`。
|
|
105
|
+
Keymaster 与 Demo 的 package 声明和 lockfile 均已切换到该版本;Keymaster
|
|
106
|
+
`pnpm lint:webloom-release`、`pnpm verify:webloom-registry` 以及两仓 frozen-install 验证
|
|
107
|
+
均通过,不能用本地 tarball 代替这些证据。
|
|
64
108
|
|
|
65
|
-
##
|
|
109
|
+
## 5. Contract inventory CI
|
|
66
110
|
|
|
67
|
-
|
|
111
|
+
WebLoom 和 Keymaster 均新增 `.github/workflows/contract-inventory.yml`。workflow 使用
|
|
112
|
+
`actions/checkout` 的 `fetch-depth: 0`;PR 显式映射
|
|
113
|
+
`github.event.pull_request.base.sha`,main push 映射 `github.event.before`,然后执行
|
|
114
|
+
`pnpm test:types` 和 `pnpm run test:contract-inventory:ci`。job 名称固定为
|
|
115
|
+
`contract-inventory`,可作为仓库 required status check。
|
|
68
116
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
`webloom-framework@0.4.0` 不存在于 `https://registry.npmjs.org/`。
|
|
73
|
-
- `node scripts/check-webloom-registry-consumer.mjs` fail-closed:registry-only 临时消费
|
|
74
|
-
目录返回 npm `ETARGET`,不能安装 `webloom-framework@0.4.0`。
|
|
117
|
+
workflow 文件已落地并已在本地用显式历史 baseline 验证脚本通过;GitHub branch protection
|
|
118
|
+
中将 `contract-inventory` 设为 required 的远端仓库设置,本轮无法从当前失效的 GitHub
|
|
119
|
+
认证态读取或修改,因此该设置仍需在仓库管理面确认。
|
|
75
120
|
|
|
76
|
-
|
|
77
|
-
integrity 核对和 frozen downstream install 尚未完成”。不执行自动 npm publish,也不把
|
|
78
|
-
本地 tarball 或 workspace symlink 当作公开发布证据。
|
|
121
|
+
## 6. 尚未关闭的跨环境验收
|
|
79
122
|
|
|
80
|
-
|
|
123
|
+
- Firefox、真实 Safari、Playwright WebKit 的 module SharedWorker、双向 transfer 和 stream
|
|
124
|
+
组合尚未执行。
|
|
125
|
+
- Keymaster 的 app-view、Local/S3/CORS/CAS、重启/多 tab、恢复 ledger、不可逆 I/O 和部署
|
|
126
|
+
生产门禁没有本轮完整外部证据。
|
|
81
127
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
128
|
+
因此当前结论是:核心代码修复、`0.4.1` 下游版本一致性、registry consumer 和 inventory
|
|
129
|
+
workflow 已完成;GitHub required-check 远端设置仍待确认。跨浏览器与 Keymaster 产品/部署
|
|
130
|
+
验收仍保持明确的未验收状态。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webloom-framework",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "通用前端插件生命周期框架",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -47,10 +47,12 @@
|
|
|
47
47
|
"build": "tsup",
|
|
48
48
|
"lint:boundaries": "node scripts/check-boundaries.mjs",
|
|
49
49
|
"lint:v4": "node scripts/check-v4-boundary.mjs",
|
|
50
|
-
"test:types": "tsc -p tsconfig.json --noEmit &&
|
|
51
|
-
"test:contract-inventory": "node scripts/check-contract-inventory.mjs",
|
|
50
|
+
"test:types": "tsc -p tsconfig.json --noEmit && pnpm test:contract-inventory",
|
|
51
|
+
"test:contract-inventory": "node scripts/check-contract-inventory.mjs && node scripts/check-contract-inventory-self-test.mjs",
|
|
52
|
+
"test:contract-inventory:ci": "node scripts/check-contract-inventory-ci.mjs",
|
|
52
53
|
"test:browser:install": "playwright install chromium",
|
|
53
54
|
"test:browser": "pnpm run test:browser:install && node scripts/real-browser-runtime-smoke.mjs",
|
|
55
|
+
"test:ablation": "node scripts/check-v4-ablation.mjs",
|
|
54
56
|
"prepack": "pnpm test:types && pnpm test && pnpm build && pnpm lint:boundaries && pnpm lint:v4",
|
|
55
57
|
"pack": "npm pack",
|
|
56
58
|
"pack:consumer": "pnpm run prepack && node scripts/pack-consumer-smoke.mjs"
|