Repository navigation
refactor: 对齐 dsh 0.1.7-rc.2,配置改走 configForms 表单 - #6
Merged
Merged
Conversation
- 主机端改用 settings.configure({ auto: false }, ctx.fiber),extraTools 经 .volatile() 进入设置表单
- 浏览器端改用 ctx.configForms.get('dsh-edit-diff'),替代 ctx.settingsScope
- devDependencies 对齐 dsh 0.1.7-rc.2:cordis 4.0.4、schemastery 3.18.4、dsh-settings 0.1.7-rc.2,新增 cosmokit
- peerDependencies 的 cordis 与 schemastery 下限同步
- 版本 0.4.0 → 0.4.1,description 加中文名前缀,README 更新 installSection 的过时说法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: 对齐 dsh 0.1.7-rc.2,配置改走 configForms 表单
问题
dsh 0.1.7-rc.2 用
ctx.configForms取代了ctx.settingsScope,主机端的settings.installSection()也换成settings.configure()。插件的 peerDependencies 上一轮已声明^0.1.7-rc.2,代码却还停在旧 API,装上后extraTools配置读不到。更早的一层问题在依赖:devDependencies 仍是 0.1.5 时代,
schemastery3.18.2 没有.volatile(),cordis4.0.2 不导出Volatile,dsh-settings还是 0.1.5-rc.2。pnpm typecheck与pnpm build都直接失败,插件在 0.1.7-rc.2 上根本构建不出来。方案
ctx.inject(['settings'], ...)子级里以 effect 注册settings.configure({ auto: false }, ctx.fiber),声明本插件自带配置页面extraTools加.volatile(),使其出现在设置表单中ctx.settingsScope.bind()改为ctx.configForms.get('dsh-edit-diff'),读getSnapshot().valuecordis ^4.0.4、schemastery ^3.18.4、dsh-settings 0.1.7-rc.2,新增cosmokit ^1.8.5cordis与schemastery下限同步提到能用这些 API 的版本Schema<{ extraTools?: ExtraTool[] }, Config>。Schema<S, T>的 S 是输入、T 是输出,volatile 让两者分家,只写Schema<Config>必然不匹配,不写注解则 dts 生成报 TS2742installSection的过时说法一并更新行为变化
extraTools出现在 dsh 设置表单里,改动即时生效验证
pnpm typecheck通过pnpm build产出lib/index.js、lib/index.d.ts、lib/client.js与 sourcemaplib/index.js做契约检查:extraTools的 meta 为{"default":[],"volatile":true},configure收到{auto:false}且 owner 是插件 fiberlib/client.js内为ctx.inject(["configForms"])加scope.getSnapshot().value其他