@tbox.cn/app-toolkit 0.7.2 → 0.7.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.
- package/package.json +2 -2
- package/tests/views.test.ts +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-toolkit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "tbox 应用工具面(运行面/工具面对仗:app-sdk 给运行的应用用,app-toolkit 给操作应用的工具用)——模块解析、集成配置求值/校验/写入内核,contracts 经应用侧动态解析(沙箱与目标应用版本解耦)。",
|
|
6
6
|
"exports": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"zod": "3.25.76"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tbox.cn/app-contracts": "0.12.
|
|
21
|
+
"@tbox.cn/app-contracts": "0.12.3",
|
|
22
22
|
"typescript": "5.9.3",
|
|
23
23
|
"tsup": "8.5.1",
|
|
24
24
|
"vitest": "4.1.10",
|
package/tests/views.test.ts
CHANGED
|
@@ -953,7 +953,7 @@ describe('v6 所有权族(D34 多域钉死退役 → ownedServices/binding 单
|
|
|
953
953
|
const store = joinStore(app.appDir, 'contracts');
|
|
954
954
|
writeFakeContractsPackage(store, {
|
|
955
955
|
version: '0.9.0',
|
|
956
|
-
slots: ['auth.alipay-login', 'mall.info', 'mall.
|
|
956
|
+
slots: ['auth.alipay-login', 'mall.info', 'mall.parking'],
|
|
957
957
|
});
|
|
958
958
|
linkContracts(app.appDir, store, { subdir: 'apps/server' });
|
|
959
959
|
// owns 3 / consumes 0(mall-core 形态——owns ⊄ consumes 的修复靶形态)
|
|
@@ -966,7 +966,7 @@ describe('v6 所有权族(D34 多域钉死退役 → ownedServices/binding 单
|
|
|
966
966
|
version: '0.1.0',
|
|
967
967
|
kind: 'business',
|
|
968
968
|
declare: {
|
|
969
|
-
owns: [{ service: 'auth.alipay-login' }, { service: 'mall.info' }, { service: 'mall.
|
|
969
|
+
owns: [{ service: 'auth.alipay-login' }, { service: 'mall.info' }, { service: 'mall.parking' }],
|
|
970
970
|
consumes: [],
|
|
971
971
|
},
|
|
972
972
|
dependencies: { modules: [] },
|
|
@@ -987,7 +987,7 @@ describe('v6 所有权族(D34 多域钉死退役 → ownedServices/binding 单
|
|
|
987
987
|
expect(batch.resolutions['mall.info']).toMatchObject({ module: 'module-mall' });
|
|
988
988
|
expect(batch.resolutions['mall.info']?.required).toBeUndefined();
|
|
989
989
|
expect(batch.resolutions['auth.alipay-login']).toMatchObject({ module: 'module-mall' });
|
|
990
|
-
expect(batch.resolutions['mall.
|
|
990
|
+
expect(batch.resolutions['mall.parking']).toMatchObject({ module: 'module-mall' });
|
|
991
991
|
// (d) 谓词 #3 豁免:owned+已配置不再误报「无消费方声明」;真孤儿仍报(语义收窄锁)
|
|
992
992
|
const slotNotDeclared = batch.issues.filter((i) => i.code === 'SLOT_NOT_DECLARED');
|
|
993
993
|
expect(slotNotDeclared.map((i) => i.service)).toEqual(['orphan.svc']);
|
|
@@ -996,14 +996,14 @@ describe('v6 所有权族(D34 多域钉死退役 → ownedServices/binding 单
|
|
|
996
996
|
expect(Object.keys(mod.serviceResolutions!.resolutions).sort()).toEqual([
|
|
997
997
|
'auth.alipay-login',
|
|
998
998
|
'mall.info',
|
|
999
|
-
'mall.
|
|
999
|
+
'mall.parking',
|
|
1000
1000
|
]);
|
|
1001
1001
|
// 服务面投影(owned ∪ demand 去重):consumes 空 → services = ownedServices 投影
|
|
1002
1002
|
// (fixture 词汇无 meta——id 兜底、description 键缺席;required 恒 false)
|
|
1003
1003
|
expect(mod.services).toEqual([
|
|
1004
1004
|
{ service: 'auth.alipay-login', name: 'auth.alipay-login', required: false },
|
|
1005
1005
|
{ service: 'mall.info', name: 'mall.info', required: false },
|
|
1006
|
-
{ service: 'mall.
|
|
1006
|
+
{ service: 'mall.parking', name: 'mall.parking', required: false },
|
|
1007
1007
|
]);
|
|
1008
1008
|
// owned 服务不落平台条目(moduleOccupiedServices 含 owns——AppView.services 排除不变)
|
|
1009
1009
|
const appView = await tk.loadApp();
|