fix(release): keep desktop version aligned with dsh

This commit is contained in:
07akioni
2026-09-02 18:40:21 +08:00
parent e187001b04
commit 44d7ebf12f
6 changed files with 13 additions and 11 deletions
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write apps/desktop/README.md
README.md: 8377a26dc1348e943954f898acc7a13001d9802a
README.zh.md: f6e14bd213f386f1f4047ef9cdf61e1f73a6b64b
README.md: 2b57257375e231de4dc8c5ba8da3e4c9b2e083d4
README.zh.md: fd5dd957ec4dd4677bd4fa0f3e74a7665ec10b3e
+1 -1
View File
@@ -158,7 +158,7 @@ pnpm run prepare:desktop
This diagnostic command is an alternative stopping point, not the first half of a two-command build. A later `package:desktop*` command repeats the official build and preparation so it cannot consume stale dsh packages, runtime files, or seed content.
Every package command performs the official repository build, packs the dsh and vendored package families, and packs the Landlock entry before preparing release resources. `prepare:packages` selects the first-party production closure rooted at `@deepseek-ai/dsh`, verifies that its tarball contains both `lib/desktop-host.js` and `config/desktop.cordis.patch.yml`, copies the selected tarballs into the seed input, and records their sizes and SHA-512 integrity. The overlay is the only CLI configuration file published specifically for Desktop; example configurations remain outside the tarball. These are the official `pnpm pack` outputs, so each package's `files` manifest controls its published contents: Desktop adds no second filter, retains published declarations such as `lib/types`, and neither strips nor adds source maps independently. Registry packages likewise retain their published package bytes in pnpm's content-addressed store. The root dsh package and Electron package must have the same version, but dsh does not need to be published to npm before the Desktop application is built. `prepare:runtime` downloads Node.js 24.17.0 from the official Node.js release service, verifies its SHA-256 entry before extraction, and executes the prepared target binary on a compatible build host to verify its reported version. It copies the pnpm version declared by the desktop package and records both runtime versions in the release seed. `prepare:seed` runs that target Node.js and bundled pnpm, so platform- and CPU-filtered optional dependencies make the pnpm store and seed target-specific. It generates local core-package mappings, disables the global virtual store, materializes external production dependencies from npm without lifecycle scripts, deletes `node_modules` and all temporary pnpm cache, config, and state, proves the complete graph installs offline with both Desktop Host files, performs the macOS rewrite when applicable, proves the rewritten store with another offline installation, removes temporary pnpm project registrations, and replaces the loose store with 16 deterministic uncompressed tar shards. It extracts those final shards and verifies every embedded macOS signature before inventory generation. Later GUI plugin operations retain the local core mappings while resolving plugin packages and their external dependencies from the fixed Desktop npm registry. `electron-builder` emits each target's platform artifacts under `apps/desktop/.desktop-build/targets/<target>/artifacts`; a later version keeps differently named immutable installers and blockmaps while replacing that target's unpacked application, diagnostics, completion record, and channel metadata.
Every package command performs the official repository build, packs the dsh and vendored package families, and packs the Landlock entry before preparing release resources. `prepare:packages` selects the first-party production closure rooted at `@deepseek-ai/dsh`, verifies that its tarball contains both `lib/desktop-host.js` and `config/desktop.cordis.patch.yml`, copies the selected tarballs into the seed input, and records their sizes and SHA-512 integrity. The overlay is the only CLI configuration file published specifically for Desktop; example configurations remain outside the tarball. These are the official `pnpm pack` outputs, so each package's `files` manifest controls its published contents: Desktop adds no second filter, retains published declarations such as `lib/types`, and neither strips nor adds source maps independently. Registry packages likewise retain their published package bytes in pnpm's content-addressed store. The dsh release bump updates the private Desktop manifest together with the root and publishable workspaces; packaging also requires the root dsh package and Electron package to have the same version. dsh does not need to be published to npm before the Desktop application is built. `prepare:runtime` downloads Node.js 24.17.0 from the official Node.js release service, verifies its SHA-256 entry before extraction, and executes the prepared target binary on a compatible build host to verify its reported version. It copies the pnpm version declared by the desktop package and records both runtime versions in the release seed. `prepare:seed` runs that target Node.js and bundled pnpm, so platform- and CPU-filtered optional dependencies make the pnpm store and seed target-specific. It generates local core-package mappings, disables the global virtual store, materializes external production dependencies from npm without lifecycle scripts, deletes `node_modules` and all temporary pnpm cache, config, and state, proves the complete graph installs offline with both Desktop Host files, performs the macOS rewrite when applicable, proves the rewritten store with another offline installation, removes temporary pnpm project registrations, and replaces the loose store with 16 deterministic uncompressed tar shards. It extracts those final shards and verifies every embedded macOS signature before inventory generation. Later GUI plugin operations retain the local core mappings while resolving plugin packages and their external dependencies from the fixed Desktop npm registry. `electron-builder` emits each target's platform artifacts under `apps/desktop/.desktop-build/targets/<target>/artifacts`; a later version keeps differently named immutable installers and blockmaps while replacing that target's unpacked application, diagnostics, completion record, and channel metadata.
An unpacked artifact contains four independent size contributors: Electron, the offline seed store shards and local dsh tarballs, the upstream Node.js and pnpm runtime, and the small shell application. The shards are uncompressed so the outer DMG, ZIP, or NSIS compressor and differential updater can operate on stable ranges. Filesystem size is not installer download size, so measure both separately. First packaged startup also extracts the seed store into `$DSH_HOME/desktop/pnpm/store` before installing the writable profile, so release qualification must measure both application and Harness-home disk use.
+1 -1
View File
@@ -158,7 +158,7 @@ pnpm run prepare:desktop
这条诊断命令是另一种停止位置,并非两条命令构建流程的前半段。之后执行 `package:desktop*` 时仍会重新完成正式构建与准备,避免使用陈旧的 dsh 包、运行时文件或 seed 内容。
每条打包命令都会先执行仓库的正式构建,打包 dsh 与 vendored 包族,并打包 Landlock 入口,然后再准备发布资源。`prepare:packages` 选择以 `@deepseek-ai/dsh` 为根的第一方生产依赖闭包,验证 dsh tarball 同时包含 `lib/desktop-host.js``config/desktop.cordis.patch.yml`,把选中的 tarball 复制到种子输入,并记录其大小与 SHA-512 完整性。该 overlay 是唯一为了 Desktop 而发布的 CLI 配置文件;示例配置仍留在 tarball 之外。这些 tarball 是正式的 `pnpm pack` 输出,因此各包的 `files` manifest 决定发布内容:Desktop 不增加第二套过滤规则,会保留 `lib/types` 等已发布声明,也不会独立删除或增加 source map。Registry 包同样在 pnpm 内容寻址 store 中保留其发布的包字节。根 dsh 包与 Electron 包必须使用同一版本,但构建 Desktop 应用前不要求 dsh 已发布到 npm。`prepare:runtime` 从 Node.js 官方发行服务下载 Node.js 24.17.0,在解压前验证其 SHA-256 条目,并在兼容的构建宿主上执行准备完成的目标二进制文件以验证其报告版本。它复制桌面包声明的 pnpm 版本,并把两个运行时版本记录进发布种子。`prepare:seed` 运行该目标 Node.js 与内置 pnpm,因此按平台和 CPU 过滤的可选依赖会使 pnpm store 与 seed 成为目标专用内容。它生成本地核心包映射、禁用全局 virtual store、从 npm 物化外部生产依赖并禁用生命周期脚本、删除 `node_modules` 以及所有临时 pnpm cache、config 和 state,证明完整依赖图可以离线安装并包含两个 Desktop Host 文件,在适用时执行 macOS 重写,再通过一次离线安装证明重写后的 store,删除临时 pnpm 项目注册,然后把松散 store 替换为 16 个确定性的未压缩 tar 分片。它会解包这些最终分片,并在生成清单前验证每个内嵌 macOS 签名。后续 GUI 插件操作保留本地核心包映射,同时从固定的 Desktop npm registry 解析插件包及其外部依赖。`electron-builder` 把各目标的平台产物写到 `apps/desktop/.desktop-build/targets/<target>/artifacts`;后续版本会保留不同名称的不可变安装包与 blockmap,但会替换该目标的未打包应用、诊断文件、完成记录与频道元数据。
每条打包命令都会先执行仓库的正式构建,打包 dsh 与 vendored 包族,并打包 Landlock 入口,然后再准备发布资源。`prepare:packages` 选择以 `@deepseek-ai/dsh` 为根的第一方生产依赖闭包,验证 dsh tarball 同时包含 `lib/desktop-host.js``config/desktop.cordis.patch.yml`,把选中的 tarball 复制到种子输入,并记录其大小与 SHA-512 完整性。该 overlay 是唯一为了 Desktop 而发布的 CLI 配置文件;示例配置仍留在 tarball 之外。这些 tarball 是正式的 `pnpm pack` 输出,因此各包的 `files` manifest 决定发布内容:Desktop 不增加第二套过滤规则,会保留 `lib/types` 等已发布声明,也不会独立删除或增加 source map。Registry 包同样在 pnpm 内容寻址 store 中保留其发布的包字节。dsh 发布版本更新会同步更新私有 Desktop manifest、仓库根与可发布 workspace;打包还会要求根 dsh 包与 Electron 包使用同一版本构建 Desktop 应用前不要求 dsh 已发布到 npm。`prepare:runtime` 从 Node.js 官方发行服务下载 Node.js 24.17.0,在解压前验证其 SHA-256 条目,并在兼容的构建宿主上执行准备完成的目标二进制文件以验证其报告版本。它复制桌面包声明的 pnpm 版本,并把两个运行时版本记录进发布种子。`prepare:seed` 运行该目标 Node.js 与内置 pnpm,因此按平台和 CPU 过滤的可选依赖会使 pnpm store 与 seed 成为目标专用内容。它生成本地核心包映射、禁用全局 virtual store、从 npm 物化外部生产依赖并禁用生命周期脚本、删除 `node_modules` 以及所有临时 pnpm cache、config 和 state,证明完整依赖图可以离线安装并包含两个 Desktop Host 文件,在适用时执行 macOS 重写,再通过一次离线安装证明重写后的 store,删除临时 pnpm 项目注册,然后把松散 store 替换为 16 个确定性的未压缩 tar 分片。它会解包这些最终分片,并在生成清单前验证每个内嵌 macOS 签名。后续 GUI 插件操作保留本地核心包映射,同时从固定的 Desktop npm registry 解析插件包及其外部依赖。`electron-builder` 把各目标的平台产物写到 `apps/desktop/.desktop-build/targets/<target>/artifacts`;后续版本会保留不同名称的不可变安装包与 blockmap,但会替换该目标的未打包应用、诊断文件、完成记录与频道元数据。
未压缩产物包含四块相互独立的体积:Electron、离线 seed store 分片与本地 dsh tarball、上游 Node.js 与 pnpm 运行时,以及很小的桌面壳应用。分片不压缩,使外层 DMG、ZIP 或 NSIS 压缩器与差分更新器可以处理稳定的数据区间。文件系统占用不等于安装包下载大小,因此必须分别测量。打包应用首次启动时还会先把 seed store 解包到 `$DSH_HOME/desktop/pnpm/store`,再安装可写 profile,因此发布验证必须同时测量应用与 Harness home 的磁盘占用。
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@deepseek-ai/dsh-desktop",
"description": "Electron desktop shell for an isolated pnpm-installed dsh runtime",
"version": "0.1.2-alpha.4",
"version": "0.1.2-alpha.5",
"private": true,
"license": "MIT",
"type": "module",
+5 -5
View File
@@ -48,7 +48,7 @@ interface PlannedVersion {
readonly tag: string | undefined
}
/** One private dsh package whose version follows the publishable family. */
/** One private dsh workspace whose version follows the publishable family. */
interface PrivateDshVersion {
/** Repository-relative manifest path. */
readonly manifestPath: string
@@ -243,13 +243,13 @@ function rootVersion(root: string): string {
}
/**
* Discover private package manifests that share the dsh version without joining
* its publish set.
* Discover private package and application manifests that share the dsh version
* without joining its publish set.
* @param root - repository root.
* @returns Private package manifests sorted by path.
* @returns Private workspace manifests sorted by path.
*/
function privateDshVersions(root: string): PrivateDshVersion[] {
return globSync('packages/*/*/package.json', { cwd: root })
return globSync(['apps/*/package.json', 'packages/*/*/package.json'], { cwd: root })
.map(path => path.replaceAll('\\', '/'))
.sort()
.flatMap((manifestPath) => {
+3 -1
View File
@@ -58,10 +58,11 @@ describe('release families', () => {
expect(releaseFamily('dsh').members(root).map(entry => entry.name)).toEqual(['@deepseek-ai/dsh-public'])
})
it('bumps private dsh packages without adding release tags', () => {
it('bumps private dsh workspaces without adding release tags', () => {
const root = mkdtempSync(join(tmpdir(), 'dsh-release-version-'))
roots.push(root)
write(join(root, 'package.json'), '{"version":"0.0.1"}\n')
write(join(root, 'apps/desktop/package.json'), '{"version":"0.0.1","private":true}\n')
write(join(root, 'packages/experimental/prototype/package.json'), '{"version":"0.0.1","private":true}\n')
write(join(root, 'packages/core/unselected/package.json'), '{"version":"0.0.1"}\n')
@@ -72,6 +73,7 @@ describe('release families', () => {
expect(planned.map(entry => ({ path: entry.manifestPath, tag: entry.tag }))).toEqual([
{ path: 'package.json', tag: undefined },
{ path: 'packages/core/published/package.json', tag: 'dsh-v0.0.2' },
{ path: 'apps/desktop/package.json', tag: undefined },
{ path: 'packages/experimental/prototype/package.json', tag: undefined },
])
})