docs: 更新文档

This commit is contained in:
电摇小子
2026-08-08 14:54:54 +08:00
parent cd2c3cfaee
commit f2c58f39b0
23 changed files with 713 additions and 182 deletions
+18
View File
@@ -11,11 +11,13 @@ const asar = nodeRequire('@electron/asar') as {
const {
validateAsarRuntimeDependencies,
validateFfmpegRuntime,
validateReaderSkillRuntime,
validateSherpaRuntime,
validateSilkWasmRuntime
} = nodeRequire('../../scripts/after-pack.cjs') as {
validateAsarRuntimeDependencies: (runtimeResources: string) => void
validateFfmpegRuntime: (runtimeResources: string, platform?: NodeJS.Platform) => void
validateReaderSkillRuntime: (runtimeResources: string) => string
validateSherpaRuntime: (runtimeResources: string, platform: NodeJS.Platform, arch: string) => void
validateSilkWasmRuntime: (runtimeResources: string) => void
}
@@ -35,6 +37,22 @@ describe('production runtime packaging', () => {
expect(() => validateSilkWasmRuntime(join(root, 'resources'))).not.toThrow()
})
it('requires the bundled Reader Skill declared by extraResources', () => {
const resources = join(root, 'reader-skill-resources')
const skillPath = join(resources, 'skill', 'wechatexplorer-reader', 'SKILL.md')
const config = readFileSync(resolve(__dirname, '../../electron-builder.yml'), 'utf8')
expect(config).toContain('docs/skill/wechatexplorer-reader')
expect(config).toContain('to: skill/wechatexplorer-reader')
expect(() => validateReaderSkillRuntime(resources)).toThrow(
/Missing bundled WechatExplorer Reader Skill/
)
mkdirSync(dirname(skillPath), { recursive: true })
writeFileSync(skillPath, '# WechatExplorer Reader\n')
expect(validateReaderSkillRuntime(resources)).toBe(skillPath)
})
it('keeps silk-wasm in electron-builder asarUnpack', () => {
const config = readFileSync(resolve(__dirname, '../../electron-builder.yml'), 'utf8')
expect(config).toContain('node_modules/silk-wasm/**')