@dsh-workbench/shared 1.0.0 → 1.1.0
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/dist/contract/protocol/bundle-install.d.ts +9 -0
- package/dist/contract/protocol/market-index.d.ts +1 -0
- package/dist/contract/protocol/market-index.js +1 -0
- package/dist/contract/unit-declaration.d.ts +11 -5
- package/dist/contract/unit-declaration.js +42 -12
- package/dist/contract/unit.d.ts +15 -1
- package/dist/contract/unit.js +8 -0
- package/dist/contract/workbench-contract.d.ts +1 -1
- package/dist/host/provision.d.ts +1 -1
- package/dist/host/provision.js +8 -2
- package/dist/host/supply-index.d.ts +4 -1
- package/dist/host/supply-index.js +18 -12
- package/dist/i18n/en.js +53 -31
- package/dist/i18n/index.d.ts +55 -33
- package/dist/i18n/zh.d.ts +54 -32
- package/dist/i18n/zh.js +54 -32
- package/dist/lib/dsh-client.d.ts +3 -1
- package/package.json +1 -1
- package/src/contract/__tests__/unit-declaration.test.ts +33 -1
- package/src/contract/protocol/bundle-install.ts +11 -0
- package/src/contract/protocol/market-index.ts +1 -0
- package/src/contract/unit-declaration.ts +52 -16
- package/src/contract/unit.ts +19 -1
- package/src/contract/workbench-contract.ts +3 -1
- package/src/host/__tests__/provision.test.ts +2 -0
- package/src/host/__tests__/supply-index.test.ts +42 -6
- package/src/host/provision.ts +6 -2
- package/src/host/supply-index.ts +40 -11
- package/src/i18n/en.ts +53 -31
- package/src/i18n/zh.ts +54 -32
- package/src/lib/dsh-client.ts +3 -1
- package/src/testing/__tests__/declaration.test.ts +6 -3
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { afterEach, describe, expect, it } from 'vitest';
|
|
5
|
+
import { unitTitleKey } from '../../contract/unit.js';
|
|
5
6
|
import { declarationOfPackage } from '../declaration.js';
|
|
6
7
|
|
|
7
8
|
const roots: string[] = [];
|
|
@@ -19,9 +20,10 @@ afterEach(() => {
|
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
const DECLARED = {
|
|
22
|
-
apiVersion:
|
|
23
|
+
apiVersion: 3,
|
|
23
24
|
unit: 'demo',
|
|
24
|
-
|
|
25
|
+
title: { zh: '演示', en: 'Demo' },
|
|
26
|
+
card: { order: 7 },
|
|
25
27
|
tools: [{ name: 'workbench_demo_list', writes: false }],
|
|
26
28
|
host: { inject: [] },
|
|
27
29
|
};
|
|
@@ -31,7 +33,8 @@ describe('模块作者写用例时读自己那份声明', () => {
|
|
|
31
33
|
const manifest = declarationOfPackage('@t/demo', packageAt(DECLARED));
|
|
32
34
|
|
|
33
35
|
expect(manifest.id).toBe('demo');
|
|
34
|
-
expect(manifest.
|
|
36
|
+
expect(manifest.title).toEqual({ zh: '演示', en: 'Demo' });
|
|
37
|
+
expect(manifest.card).toEqual({ titleKey: unitTitleKey('demo'), order: 7 });
|
|
35
38
|
expect(manifest.tools).toEqual([{ name: 'workbench_demo_list', writes: false }]);
|
|
36
39
|
});
|
|
37
40
|
|