Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Copy the prepared DS node_modules contents directly so electron-builder retains the CLI entry and nested Web assets. Fail portable output validation when the DS entry is absent, preventing browser launch from failing with ENOENT. Add regression coverage using the actual builder matcher and include the pending Continue/OpenCode article screenshots. Validation: 3 focused packaging tests passed; staged whitespace checks passed. No new full-suite or remote Host validation was performed for this commit. Release note: 修复 Windows portable 包遗漏 DS Web 依赖导致无法在浏览器中打开的问题;构建时会检查启动入口是否完整。
36 lines
1.6 KiB
TypeScript
36 lines
1.6 KiB
TypeScript
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
import { createRequire } from 'node:module'
|
|
import { tmpdir } from 'node:os'
|
|
import { dirname, join, resolve } from 'node:path'
|
|
import { expect, it } from 'vitest'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const { getFileMatchers, copyFiles } = require('app-builder-lib/out/fileMatcher')
|
|
|
|
it('copies DS dependencies and nested assets through the actual builder matcher', async () => {
|
|
const root = mkdtempSync(join(tmpdir(), 'goodbuddy-dsh-packaging-'))
|
|
const config = JSON.parse(readFileSync(resolve('package.json'), 'utf8'))
|
|
const resource = config.build.extraResources.find((entry: { to: string }) => entry.to.startsWith('runtimes/dsh'))
|
|
const files = ['@deepseek-ai/dsh/lib/bin.js', '@deepseek-ai/dsh/node_modules/example/index.js', '@deepseek-ai/dsh-web/dist/index.html']
|
|
try {
|
|
for (const file of files) {
|
|
const source = join(root, '.runtime-resources/dsh-x64/node_modules', file)
|
|
mkdirSync(dirname(source), { recursive: true })
|
|
writeFileSync(source, file)
|
|
}
|
|
const destination = join(root, 'output/resources')
|
|
const matchers = getFileMatchers({ extraResources: [resource] }, 'extraResources', destination, {
|
|
defaultSrc: root,
|
|
globalOutDir: join(root, 'output'),
|
|
customBuildOptions: {},
|
|
macroExpander: (value: string) => value.replaceAll('${arch}', 'x64')
|
|
})
|
|
await copyFiles(matchers)
|
|
for (const file of files) {
|
|
expect(readFileSync(join(destination, 'runtimes/dsh/node_modules', file), 'utf8')).toBe(file)
|
|
}
|
|
} finally {
|
|
rmSync(root, { recursive: true, force: true })
|
|
}
|
|
})
|