feat(document): decouple shared Office conversion from preview

This commit is contained in:
yudshj committed 2026-09-17 11:15:21 +08:00
1 parent e7a4621aa9
commit 9d2a3bf2b7
109 files changed
+3617 -70

No files matched your search

+14 -1
View File
@@ -1,6 +1,19 @@
#!/usr/bin/env node
/** Private entry owned by the Python single-file runtime packaging. */
import { fileURLToPath } from 'node:url'
import { registerHooks } from 'node:module'
import { isSea } from 'node:sea'
import { fileURLToPath, pathToFileURL } from 'node:url'
if (isSea()) {
// Office spawns executable helpers and URL workers; its complete package tree must be real files.
const parentURL = pathToFileURL(`${process.execPath.replace(/\.exe$/i, '')}-office/package.json`).href
registerHooks({
resolve(specifier, context, nextResolve) {
const office = specifier === '@deepseek-ai/libreoffice-kit' || specifier === '@deepseek-ai/libreoffice-kit/package.json'
return nextResolve(specifier, office ? { ...context, parentURL } : context)
},
})
}
const selectorName = 'DSH_SUBPROCESS_RUNNER'
const selection = process.env[selectorName]