@deepseek-ai/dsh-typert-generator 0.2.0-rc.2 → 0.2.1-alpha.1
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.i18n.yaml +4 -4
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/index.js +1 -1
- package/lib/types/analyzer.js +2 -2
- package/package.json +5 -5
package/README.i18n.yaml
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
en: b8720f6ac186a8e8
|
|
22
22
|
zh: 3e04a4c1bebc2cf4
|
|
23
23
|
/deepseek-ai-dsh-typert-generator/use-this-package/analyzing-a-workspace-statically:
|
|
24
|
-
en:
|
|
25
|
-
zh:
|
|
24
|
+
en: 4ea0e4977cefa39d
|
|
25
|
+
zh: 41bdb6047bc79524
|
|
26
26
|
/deepseek-ai-dsh-typert-generator/use-this-package/running-generation-inside-a-tsdown-build:
|
|
27
27
|
en: cc3f7d23739380f6
|
|
28
28
|
zh: 864d15088f581271
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
en: f3b1002133fe8736
|
|
58
58
|
zh: e8d5fecd10db5e3a
|
|
59
59
|
/deepseek-ai-dsh-typert-generator/known-limitations-and-deferred-work/dev-note:
|
|
60
|
-
en:
|
|
61
|
-
zh:
|
|
60
|
+
en: e67f633dc6fe7773
|
|
61
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -47,6 +47,8 @@ After the build, `lib/typert.host.js` and `lib/typert.host.d.ts` exist and the [
|
|
|
47
47
|
|
|
48
48
|
Static consumers call `WorkspaceAnalyzer` directly against the workspace's `tsconfig.host.json` and `tsconfig.client.json` aggregates, select a face and package subset, and read the resulting `FaceModel` and type graph without emitting or loading runtime artifacts. `analyzeInBatches()` processes a large package selection through bounded compiler programs with the same model shape, and `discoverPackages()` finds contributing packages without building a type-checker program.
|
|
49
49
|
|
|
50
|
+
JSON, YAML, SVG, PNG, JPEG, and WebP resource exports contribute no TypeScript declarations and are excluded from the API model. Missing JavaScript or TypeScript export sources remain errors.
|
|
51
|
+
|
|
50
52
|
### Running generation inside a tsdown build
|
|
51
53
|
|
|
52
54
|
The package's `./tsdown` subpath provides `typertPlugin()` for the root tsdown config: it lowers standard decorators in TypeScript dependencies before bundling and emits the model-driven face artifacts at the package output root. In `package` mode it emits only the bundled package; in `workspace` mode it emits every explicit contributor once.
|
|
@@ -141,5 +143,3 @@ These limits define what the generator cannot model or emit; they are current pa
|
|
|
141
143
|
None.
|
|
142
144
|
|
|
143
145
|
</details>
|
|
144
|
-
|
|
145
|
-
**Runtime invariant:** No companion is published. The source-project analyzer and build-time emitter run outside any Cordis runtime; model snapshots, executable artifacts, and consuming-package typechecks enforce the output contract.
|
package/README.zh.md
CHANGED
|
@@ -47,6 +47,8 @@ files:
|
|
|
47
47
|
|
|
48
48
|
静态消费方直接针对工作区的 `tsconfig.host.json` 与 `tsconfig.client.json` 聚合配置调用 `WorkspaceAnalyzer`,选择 face 与包子集,并在不生成或加载运行时产物的前提下读取生成的 `FaceModel` 与类型图。`analyzeInBatches()` 通过有界的编译器程序处理大批量包选择,模型形态保持一致;`discoverPackages()` 无需构建类型检查程序即可找出参与贡献的包。
|
|
49
49
|
|
|
50
|
+
JSON、YAML、SVG、PNG、JPEG 和 WebP 资源导出不提供 TypeScript 声明,因此不进入 API 模型。JavaScript 或 TypeScript 导出源文件缺失时仍报错。
|
|
51
|
+
|
|
50
52
|
### 在 tsdown 构建中运行生成
|
|
51
53
|
|
|
52
54
|
包的 `./tsdown` 子路径为根 tsdown 配置提供 `typertPlugin()`:它在打包前转换 TypeScript 依赖中的标准装饰器,并在包输出根目录生成模型驱动的 face 产物。`package` 模式只生成当前打包的包;`workspace` 模式对每个显式贡献方各生成一次。
|
|
@@ -141,5 +143,3 @@ Host 与 Client 是两个独立的 TypeScript 程序。直接项目引用确定
|
|
|
141
143
|
无。
|
|
142
144
|
|
|
143
145
|
</details>
|
|
144
|
-
|
|
145
|
-
**运行时不变式:** 不发布伴生入口。源码项目分析器与构建时 emitter 均不在任何 Cordis 运行时中运行;模型快照、可执行产物与消费方包的类型检查会强制执行其输出约定。
|
package/lib/index.js
CHANGED
|
@@ -455,7 +455,7 @@ var FaceAnalyzer = class {
|
|
|
455
455
|
const targets = packageExportTargets(registration.manifest).filter(([subpath]) => registration.exportSubpaths === void 0 || registration.exportSubpaths.includes(subpath));
|
|
456
456
|
const records = [];
|
|
457
457
|
for (const [subpath, target] of targets) {
|
|
458
|
-
if (target.includes("*") || subpath === "./package.json" || subpath === "./typert" || subpath === "./client/typert" || subpath === "./remote" ||
|
|
458
|
+
if (target.includes("*") || subpath === "./package.json" || subpath === "./typert" || subpath === "./client/typert" || subpath === "./remote" || /\.(?:json|ya?ml|svg|png|jpe?g|webp)$/iu.test(target)) continue;
|
|
459
459
|
const sourcePath = sourcePathForExport(registration.root, target);
|
|
460
460
|
const sourceFile = this.sourceFiles.get(realPath(sourcePath));
|
|
461
461
|
if (sourceFile === void 0) throw new TypertAnalysisError(`typert(${this.face}): ${registration.name} export ${subpath} resolves to missing source ${sourcePath}`);
|
package/lib/types/analyzer.js
CHANGED
|
@@ -556,8 +556,8 @@ class FaceAnalyzer {
|
|
|
556
556
|
for (const [subpath, target] of targets) {
|
|
557
557
|
if (target.includes('*') || subpath === './package.json'
|
|
558
558
|
|| subpath === './typert' || subpath === './client/typert' || subpath === './remote'
|
|
559
|
-
// Data exports
|
|
560
|
-
||
|
|
559
|
+
// Data exports carry no TypeScript API; their owning readers validate the resources.
|
|
560
|
+
|| /\.(?:json|ya?ml|svg|png|jpe?g|webp)$/iu.test(target))
|
|
561
561
|
continue;
|
|
562
562
|
const sourcePath = sourcePathForExport(registration.root, target);
|
|
563
563
|
const sourceFile = this.sourceFiles.get(realPath(sourcePath));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-typert-generator",
|
|
3
3
|
"description": "TypeScript project analyzer and model-driven Typert artifact generator",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"typescript": "^6.0.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
39
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"zod": "^4.4.3",
|
|
43
|
-
"@deepseek-ai/dsh-tool-cordis": "0.2.
|
|
44
|
-
"@deepseek-ai/dsh-typert-registry": "0.2.
|
|
45
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
43
|
+
"@deepseek-ai/dsh-tool-cordis": "0.2.1-alpha.1",
|
|
44
|
+
"@deepseek-ai/dsh-typert-registry": "0.2.1-alpha.1",
|
|
45
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
46
46
|
}
|
|
47
47
|
}
|