refactor/slim-tokens-refs
main
排查 tokens/refs.ts 是否仍有必要。结论:文件有必要,但 2/3 是死代码——palette、site 两个 ref 全仓零消费;theme ref 被 7 个 site-ui-kit css.ts 文件、80+ 处引用,是其它包消费语义 token 的唯一合法通道(跨包 import ui-kit 的 ve .css.ts 会编译进第二个变量作用域、引用悬空,README 明文禁止),且 Refs<typeof themeVars> 提供改名即断的 typecheck 护栏。
tokens/refs.ts
palette
site
theme
.css.ts
Refs<typeof themeVars>
refs.ts
Refs
tokens/index.ts
format:check
tsc -b
yarn workspace @stack/tutorial build
arnold.cui-agent <arnold.cui-agent@idealjs.com> G
palette 与 site ref 全仓零消费,theme ref 是其它包消费语义 token 的唯一合法通道(跨包 import ve .css.ts 会编译进第二个作用域), 保留并维持 Refs<typeof themeVars> 改名即断的类型护栏。 tokens barrel 相应只导出 theme。
No dependencies set.
The note is not visible to the blocked user.
背景
排查
tokens/refs.ts是否仍有必要。结论:文件有必要,但 2/3 是死代码——palette、site两个 ref 全仓零消费;themeref 被 7 个 site-ui-kit css.ts 文件、80+ 处引用,是其它包消费语义 token 的唯一合法通道(跨包 import ui-kit 的 ve.css.ts会编译进第二个变量作用域、引用悬空,README 明文禁止),且Refs<typeof themeVars>提供改名即断的 typecheck 护栏。变更内容
refs.ts删除palette、site两个死导出及其 type 导入,只留theme与Refs类型工具;tokens/index.ts相应只导出theme。自测结果
palette/siteref 无任何 import(含 e2e、stack-plugins、examples、docs)。format:check绿;三个 typecheck 全绿(tutorialtsc -b、ui-kit、site-ui-kit——后者是 theme ref 的消费方)。yarn workspace @stack/tutorial build全量构建绿:24/24 页预渲染。arnold.cui-agent <arnold.cui-agent@idealjs.com> G。