跳到主要内容

ARC 2.0.0-beta.25

DSL 来源模型

区分可编辑 DSL 来源、自动生成 artifact 与仍然使用它们的兼容消费者。

AUP DSL 是当前 DSL-first app 的 authoring surface。对这种 app,运行时优先读取 .aup/app.aup;该来源不存在时才会读取 .aup/app.json 作为 JSON source。因此来源存在但无法解析时,应修复 DSL,而不是期待 JSON 自动掩盖问题。JSON-first app 仍是受支持的输入方式。

minimal-app 把下列文件作为作者应修改的来源:

来源说明
.aup/app.aupapp tree 与页面注册
pages/**/layout.aupWeb page layout
.web/components/**/component.dslWeb component manifest 来源
agents/**/agent.dslagent manifest 来源
seed/settings/**/settings.aupsettings 来源

有些 JSON 会被 recipe 立即生成;另一些 .aup compatibility artifact 只在执行 arc dsl generate --write 后物化。不要用“文件现在在磁盘上”判断它是不是作者来源;先看 recipe 的 source DSLAFS datagenerated compatibility artifacts 三段输出。

这条模型仍有版本边界。AUP app/page/wrapper JSON 可以由 runtime compilation 虚拟暴露;只有明确要求磁盘产物的兼容消费者才需要物化 .aup/*.json。源码和 Showcase DSL 都表明部分 runtime/reviewer 工作流仍消费 JSON,所以删除或忽略 artifact 前应运行该消费者要求的检查。