Merge master and preserve files context menus across session restores
This commit is contained in:
commit
3c2ebf698d
34 files changed
+633
-168
No files matched your search
@@ -0,0 +1,161 @@
|
||||
name: Package Desktop · macOS · Intel
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
source_ref:
|
||||
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
|
||||
type: string
|
||||
default: master
|
||||
required: true
|
||||
preset:
|
||||
description: '打包环境:选择机器上的 test 或 production 配置;同时决定后续发布环境'
|
||||
type: choice
|
||||
options: [test, production]
|
||||
default: test
|
||||
required: true
|
||||
update_channel:
|
||||
description: '升级通道:nightly 或 latest(须为稳定版本);自动更新不会切换通道'
|
||||
type: choice
|
||||
options: [nightly, latest]
|
||||
default: nightly
|
||||
required: true
|
||||
version_mode:
|
||||
description: '版本模式:default 为 test 自动编号、production 跟随产品;product 保留原版本,auto 自动编号,manual 手填'
|
||||
type: choice
|
||||
options: [default, product, auto, manual]
|
||||
default: default
|
||||
required: true
|
||||
build_version:
|
||||
description: '手动版本号:仅 manual 时填写完整版本;须为产品原版本或受支持的预发布后缀'
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
test_release_id:
|
||||
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
compression_level:
|
||||
description: 'ZIP 压缩等级:只影响 ZIP 和自动升级下载,不影响 DMG;3 打包较快,7 压缩更强'
|
||||
type: choice
|
||||
options: ['3', '7']
|
||||
default: '3'
|
||||
required: true
|
||||
skip_notarization:
|
||||
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选'
|
||||
type: boolean
|
||||
default: false
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: macos-desktop-package
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
package:
|
||||
runs-on: [self-hosted, macOS, ARM64, dsh-mac-package-trial]
|
||||
timeout-minutes: 180
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
env:
|
||||
DSH_DESKTOP_TARGET_PLATFORM: darwin
|
||||
DSH_DESKTOP_TARGET_ARCH: x64
|
||||
PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL: ${{ inputs.compression_level }}
|
||||
PACKAGE_SKIP_NOTARIZATION: ${{ inputs.skip_notarization }}
|
||||
PACKAGE_SOURCE_REF: ${{ inputs.source_ref }}
|
||||
PACKAGE_VERSION_MODE: ${{ inputs.version_mode }}
|
||||
DSH_DESKTOP_UPDATE_CHANNEL: ${{ inputs.update_channel }}
|
||||
DSH_TELEMETRY_DISABLED: '1'
|
||||
DSH_PACKAGING_PRESET: ${{ inputs.preset }}
|
||||
PACKAGE_TEST_RELEASE_ID: ${{ inputs.test_release_id }}
|
||||
steps:
|
||||
- uses: actions/[email protected]
|
||||
id: checkout
|
||||
with:
|
||||
persist-credentials: false
|
||||
clean: true
|
||||
ref: ${{ inputs.source_ref }}
|
||||
- name: Validate selected source and adapter support
|
||||
run: >-
|
||||
node -e "const fs=require('node:fs'); const ref=process.env.PACKAGE_SOURCE_REF;
|
||||
const cp=require('node:child_process'); const preset=process.env.DSH_PACKAGING_PRESET;
|
||||
if(!['test','production'].includes(preset)) throw Error('Unknown packaging preset');
|
||||
const tag=/^dsh-v[0-9][0-9A-Za-z.-]*$/.test(ref);
|
||||
if(preset==='production' && ref!=='master' && !tag) throw Error('Production source must be master or dsh-v*');
|
||||
if(tag) {
|
||||
const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;
|
||||
if(ref!=='dsh-v'+v) throw Error('Source tag must match product version');
|
||||
const tagged=cp.execFileSync('git',['rev-parse','--verify','refs/tags/'+ref+'^{commit}'],{encoding:'utf8'}).trim();
|
||||
const head=cp.execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8'}).trim();
|
||||
if(tagged!==head) throw Error('Checkout does not match source tag');
|
||||
} else {
|
||||
const branch=cp.execFileSync('git',['rev-parse','--abbrev-ref','HEAD'],{encoding:'utf8'}).trim();
|
||||
if(branch==='HEAD' || branch!==ref || ref.startsWith('refs/')) throw Error('Select a branch in this repository, not a SHA or PR ref');
|
||||
}
|
||||
if(!fs.readFileSync('apps/desktop/scripts/prepare-macos-ci.mjs','utf8').includes('resolveDesktopBuildTarget')) throw Error('Source lacks Intel macOS CI support; select a newer source');
|
||||
if(!fs.readFileSync('apps/desktop/scripts/desktop-ci-version.mjs','utf8').includes('PACKAGE_VERSION_MODE')) throw Error('Source lacks Desktop channel/version CI support; select a newer release');"
|
||||
- uses: pnpm/[email protected]
|
||||
with:
|
||||
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
- uses: actions/[email protected]
|
||||
with:
|
||||
node-version: '24'
|
||||
- name: Configure persistent package caches
|
||||
env:
|
||||
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
|
||||
run: |
|
||||
echo "DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store" >> "$GITHUB_ENV"
|
||||
- name: Check Rosetta execution
|
||||
run: arch -x86_64 /usr/bin/true
|
||||
- name: Install locked dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Validate preset and resolve build version
|
||||
id: settings
|
||||
env:
|
||||
PACKAGE_BUILD_VERSION: ${{ inputs.build_version }}
|
||||
run: node apps/desktop/scripts/prepare-macos-ci.mjs
|
||||
- name: Check packaging configuration and toolchain
|
||||
env:
|
||||
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
|
||||
run: |
|
||||
args=()
|
||||
if [[ "$PACKAGE_SKIP_NOTARIZATION" = true ]]; then args+=(--skip-notarization); fi
|
||||
pnpm run package:desktop:mac:x64 --check --build-version "$PACKAGE_VERSION" "${args[@]}"
|
||||
- name: Build signed installers
|
||||
env:
|
||||
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
|
||||
run: |
|
||||
args=()
|
||||
if [[ "$PACKAGE_SKIP_NOTARIZATION" = true ]]; then args+=(--skip-notarization); fi
|
||||
pnpm run package:desktop:mac:x64 --build-version "$PACKAGE_VERSION" "${args[@]}"
|
||||
- name: Retain complete package outside the checkout
|
||||
id: retained
|
||||
env:
|
||||
PACKAGE_SOURCE_SHA: ${{ steps.checkout.outputs.commit }}
|
||||
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
|
||||
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts
|
||||
- name: Retain packaging diagnostics
|
||||
if: always() && steps.checkout.outcome == 'success'
|
||||
uses: actions/[email protected]
|
||||
with:
|
||||
name: macos-x64-package-logs-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
include-hidden-files: true
|
||||
path: apps/desktop/.desktop-build/packaging-runs/
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
- name: Retain installers for the selected mode
|
||||
if: success()
|
||||
uses: actions/[email protected]
|
||||
with:
|
||||
name: macos-x64-${{ steps.settings.outputs.mode }}-${{ steps.settings.outputs.version }}-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
include-hidden-files: true
|
||||
path: ${{ steps.retained.outputs.directory }}/*
|
||||
compression-level: 0
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
@@ -1,35 +1,19 @@
|
||||
name: Package Desktop · macOS
|
||||
name: Package Desktop · macOS · Apple Silicon
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
source_ref:
|
||||
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
|
||||
type: string
|
||||
default: master
|
||||
required: true
|
||||
preset:
|
||||
description: '打包环境:选择机器上的 test 或 production 配置;同时决定后续发布环境'
|
||||
type: choice
|
||||
options: [test, production]
|
||||
default: test
|
||||
required: true
|
||||
zip_compression_level:
|
||||
description: 'ZIP 压缩等级:只影响 ZIP 和自动升级下载,不影响 DMG;3 打包较快,7 压缩更强'
|
||||
type: choice
|
||||
options: ['3', '7']
|
||||
default: '3'
|
||||
required: true
|
||||
skip_notarization:
|
||||
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选'
|
||||
type: boolean
|
||||
default: false
|
||||
required: true
|
||||
test_release_id:
|
||||
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
source_ref:
|
||||
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
|
||||
type: string
|
||||
default: master
|
||||
required: true
|
||||
update_channel:
|
||||
description: '升级通道:nightly 或 latest(须为稳定版本);自动更新不会切换通道'
|
||||
type: choice
|
||||
@@ -47,6 +31,22 @@ on:
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
test_release_id:
|
||||
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
compression_level:
|
||||
description: 'ZIP 压缩等级:只影响 ZIP 和自动升级下载,不影响 DMG;3 打包较快,7 压缩更强'
|
||||
type: choice
|
||||
options: ['3', '7']
|
||||
default: '3'
|
||||
required: true
|
||||
skip_notarization:
|
||||
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选'
|
||||
type: boolean
|
||||
default: false
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -63,7 +63,9 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
env:
|
||||
PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL: ${{ inputs.zip_compression_level }}
|
||||
DSH_DESKTOP_TARGET_PLATFORM: darwin
|
||||
DSH_DESKTOP_TARGET_ARCH: arm64
|
||||
PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL: ${{ inputs.compression_level }}
|
||||
PACKAGE_SKIP_NOTARIZATION: ${{ inputs.skip_notarization }}
|
||||
PACKAGE_SOURCE_REF: ${{ inputs.source_ref }}
|
||||
PACKAGE_VERSION_MODE: ${{ inputs.version_mode }}
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
name: Package Desktop · Windows
|
||||
name: Package Desktop · Windows · x64
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
source_ref:
|
||||
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
|
||||
type: string
|
||||
default: master
|
||||
required: true
|
||||
preset:
|
||||
description: '打包环境:选择机器上的 test 或 production 配置;同时决定后续发布环境'
|
||||
type: choice
|
||||
options: [test, production]
|
||||
default: test
|
||||
required: true
|
||||
signing:
|
||||
description: '签名方式:unsigned 仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请选择 signed(EV 硬件令牌)'
|
||||
type: choice
|
||||
options: [signed, unsigned]
|
||||
default: signed
|
||||
required: true
|
||||
test_release_id:
|
||||
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
source_ref:
|
||||
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
|
||||
type: string
|
||||
default: master
|
||||
required: true
|
||||
update_channel:
|
||||
description: '升级通道:nightly 或 latest(须为稳定版本);自动更新不会切换通道'
|
||||
type: choice
|
||||
@@ -42,6 +31,23 @@ on:
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
test_release_id:
|
||||
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
compression_level:
|
||||
description: '安装器压缩等级:3 打包较快,7 压缩更强;覆盖本轮机器配置'
|
||||
type: choice
|
||||
options: ['3', '7']
|
||||
default: '3'
|
||||
required: true
|
||||
signing:
|
||||
description: '签名方式:unsigned 仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请选择 signed(EV 硬件令牌)'
|
||||
type: choice
|
||||
options: [signed, unsigned]
|
||||
default: signed
|
||||
required: true
|
||||
cache_namespace:
|
||||
description: '缓存测量命名空间:留空使用共享缓存;新名称用于冷缓存,再次使用同名测热缓存,不清除现有缓存'
|
||||
type: string
|
||||
@@ -52,12 +58,6 @@ on:
|
||||
type: string
|
||||
default: ''
|
||||
required: false
|
||||
compression_level:
|
||||
description: '安装器压缩等级:3 打包较快,7 压缩更强;覆盖本轮机器配置'
|
||||
type: choice
|
||||
options: ['3', '7']
|
||||
default: '3'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
en: 5b4f0f80a117f202
|
||||
zh: ff05be196c181087
|
||||
/desktop-packaging/windows-actions-packaging:
|
||||
en: 364223725374d9ac
|
||||
zh: c4d4cc58d7cbafbd
|
||||
en: 9dd2227f2878519e
|
||||
zh: cd95dd6efd48298f
|
||||
/desktop-packaging/macos-self-hosted-packaging:
|
||||
en: bb1dcdfef3f3a113
|
||||
zh: 9c151800a61e2505
|
||||
en: ee628e830d849ae9
|
||||
zh: 44313f5fb842f042
|
||||
/desktop-packaging/unsigned-windows-test-installer:
|
||||
en: f429bc0c280e2dfa
|
||||
zh: 4adbcc9e906bdf80
|
||||
|
||||
@@ -109,7 +109,7 @@ Each target owns its packed package inputs, prepared runtime, package set, dsh t
|
||||
|
||||
For supervised runner startup and recovery, follow [Windows runner machine setup](../windows-signing/README.md#machine-setup).
|
||||
|
||||
The `Package Desktop · Windows` [manual workflow](../../../.github/workflows/windows-package.yml) selects the dedicated Windows x64 runner label `dsh-win-package-trial` and the machine preset `test` or `production`. Choose `signed` (default) or `unsigned`; signed mode uses the existing EV token preflight, signature cache and failure interlock. It does not publish or upload a release. `build_version` defaults to `auto`, using the CI identifier in [Release versions](#release-versions); an explicit value may be the checkout's product version or an extended build version such as `0.2.1-alpha.1.20261009.1` for product `0.2.1-alpha.1`. The version prefix must match the selected checkout; validation errors show its current example. Manifests remain unchanged.
|
||||
The `Package Desktop · Windows · x64` [manual workflow](../../../.github/workflows/windows-package.yml) selects the dedicated Windows x64 runner label `dsh-win-package-trial` and the machine preset `test` or `production`. Choose `signed` (default) or `unsigned`; signed mode uses the existing EV token preflight, signature cache and failure interlock. It does not publish or upload a release. `build_version` defaults to `auto`, using the CI identifier in [Release versions](#release-versions); an explicit value may be the checkout's product version or an extended build version such as `0.2.1-alpha.1.20261009.1` for product `0.2.1-alpha.1`. The version prefix must match the selected checkout; validation errors show its current example. Manifests remain unchanged.
|
||||
|
||||
Select the workflow in Actions, choose the source branch, preset, signing mode and version, then click Run workflow. Before merging input changes, test the pushed branch with `gh workflow run windows-package.yml --ref <branch> -f preset=test -f signing=unsigned -f build_version=auto`; verify the web form after merging. There is no push or PR trigger. Logs and successful EXEs are retained for 14 days. Inspect the retained logs and installer before relying on packaging; installation is separate. Before checkout, Node removes the runner-owned source directory without following dependency junctions; the workflow validates its location and rejects linked ancestors. Never point it at a development checkout. Runs share one concurrency group without cancelling an active build; only one run remains pending, and a newer dispatch replaces it. Diagnostics upload requires a successful clean checkout. Machine settings stay outside the checkout and are never uploaded as artifacts.
|
||||
|
||||
@@ -127,7 +127,9 @@ Installer uploads store the already-compressed release files without ZIP recompr
|
||||
|
||||
## macOS self-hosted packaging
|
||||
|
||||
The `Package Desktop · macOS` [manual workflow](../../../.github/workflows/macos-package.yml) targets an Apple Silicon runner labeled `dsh-mac-package-trial`. It selects `test` or `production`, resolves `build_version=auto` from the UTC date, run number and attempt, and uses the existing signing, notarization and packaged-runtime checks. Installer upload disables redundant ZIP compression; diagnostic logs retain normal compression. Successful DMG/ZIP files and diagnostic logs are retained for 14 days; this workflow does not publish a release. The operator must register the runner and verify a complete Actions run before relying on it. The `zip_compression_level` dropdown defaults to `3` and also offers `7`; it overrides the machine preset for this run and affects only the ZIP and automatic-update downloads, not the DMG.
|
||||
The [Apple Silicon workflow](../../../.github/workflows/macos-package.yml) and [Intel workflow](../../../.github/workflows/macos-intel-package.yml) produce separate arm64 and x64 packages on the Apple Silicon runner labeled `dsh-mac-package-trial`. Both share one concurrency group. The Intel workflow checks Rosetta execution before dependency installation; its selected source must include the target-aware macOS CI adapter. Both select `test` or `production` and use the existing signing, notarization and packaged-runtime checks. Successful DMG/ZIP files and diagnostic logs are retained for 14 days without publishing a release. Installer uploads disable redundant ZIP compression. The operator must verify a complete Actions run and installation on the target architecture before release qualification. The `compression_level` dropdown defaults to `3` and also offers `7`; it overrides the machine preset for this run and affects only ZIP and automatic-update downloads, not DMG.
|
||||
|
||||
All three platform forms put source, environment, update channel, version mode, manual version, test release ID and compression level first, with matching defaults. macOS notarization and Windows signing, cache measurement and isolated-workspace options follow these common fields.
|
||||
|
||||
Run `node apps/desktop/scripts/setup-macos-packaging.mjs "$HOME/dsh-ci"` to prepare private `runner/`, `packaging/{presets,secrets,certificates}` and `cache/macos-signatures` directories without overwriting existing files; append `--check` to inspect them. Fill the [preset](../config/macos-packaging/test.env.example) and [signing](../config/macos-packaging/macos-signing.env.example) templates outside the checkout. Set secret and certificate files to mode `0600`. `DSH_PACKAGING_CONFIG_DIR` selects the absolute `packaging` directory and `DSH_PACKAGING_PRESET` selects its preset; missing files fail without falling back to `.env.macos`. Signed and preparation-only Mac builds read `secrets/macos-signing.env`; relative credential paths resolve beside that file. Public presets reject signing credentials, and signing files cannot override public settings. Local unsigned Mac builds retain their configuration-free behavior.
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ macOS 正式发布和本地未签名 DMG 都通过 [electron-builder 配置](../
|
||||
|
||||
runner 的受监督启动和恢复见 [Windows runner 机器准备](../windows-signing/README.zh.md#machine-setup)。
|
||||
|
||||
`Package Desktop · Windows` [手动工作流](../../../.github/workflows/windows-package.yml) 选择专用 Windows x64 runner 标签 `dsh-win-package-trial`,并使用机器 preset `test` 或 `production`。选择 `signed`(默认)或 `unsigned`;签名模式复用现有 EV token 预检、签名缓存与失败 interlock,不发布或上传 release。`build_version` 默认为 `auto`,使用[发布版本](#release-versions)中的 CI 标识;显式值可以是源码产品版本,或扩展构建版本,例如产品 `0.2.1-alpha.1` 对应 `0.2.1-alpha.1.20261009.1`。版本前缀必须匹配所选源码;校验错误显示其当前示例。manifest 保持不变。
|
||||
`Package Desktop · Windows · x64` [手动工作流](../../../.github/workflows/windows-package.yml) 选择专用 Windows x64 runner 标签 `dsh-win-package-trial`,并使用机器 preset `test` 或 `production`。选择 `signed`(默认)或 `unsigned`;签名模式复用现有 EV token 预检、签名缓存与失败 interlock,不发布或上传 release。`build_version` 默认为 `auto`,使用[发布版本](#release-versions)中的 CI 标识;显式值可以是源码产品版本,或扩展构建版本,例如产品 `0.2.1-alpha.1` 对应 `0.2.1-alpha.1.20261009.1`。版本前缀必须匹配所选源码;校验错误显示其当前示例。manifest 保持不变。
|
||||
|
||||
在 Actions 选择工作流、源码分支、preset、签名模式和版本,再点击 Run workflow。输入变更合并前,用 `gh workflow run windows-package.yml --ref <branch> -f preset=test -f signing=unsigned -f build_version=auto` 测试已推送分支;合并后验证网页表单。它不监听 push 或 PR。日志和成功生成的 EXE 保留 14 天。依赖打包流程前检查日志和安装包;安装是独立操作。检出前,Node 删除 runner 专用源码目录,不跟随依赖 junction;工作流校验目标位置并拒绝链接祖先目录。不得指向日常开发目录。运行共享一个并发组,不取消正在进行的构建;最多保留一个待运行任务,新触发会替换它。仅在成功完成干净检出后上传诊断。机器配置位于 checkout 之外,不作为产物上传。
|
||||
|
||||
@@ -127,7 +127,9 @@ runner 的受监督启动和恢复见 [Windows runner 机器准备](../windows-s
|
||||
|
||||
## macOS 自托管打包
|
||||
|
||||
`Package Desktop · macOS` [手动工作流](../../../.github/workflows/macos-package.yml) 使用带有 `dsh-mac-package-trial` 标签的 Apple Silicon runner。它选择 `test` 或 `production`,以 UTC 日期、运行编号和重试次数解析 `build_version=auto`,并复用现有签名、公证和打包运行时检查。安装包上传关闭重复 ZIP 压缩;诊断日志保留普通压缩。成功的 DMG/ZIP 与诊断日志保留 14 天;工作流不发布 release。操作人员须注册 runner,并验收完整 Actions 运行后再依赖该流程。 `zip_compression_level` 下拉选项默认为 `3`,也可选择 `7`;本次运行以该选项覆盖机器预设,只影响 ZIP 和自动升级下载,不影响 DMG。
|
||||
[Apple Silicon 工作流](../../../.github/workflows/macos-package.yml)与 [Intel 工作流](../../../.github/workflows/macos-intel-package.yml)在带有 `dsh-mac-package-trial` 标签的 Apple Silicon runner 上分别生成 arm64 和 x64 安装包,两者共用一个并发组。Intel 工作流在安装依赖前检查 Rosetta 能否执行;所选源码必须包含按目标架构校验的 macOS CI 适配脚本。两者均选择 `test` 或 `production`,并复用现有签名、公证和打包运行时检查。成功的 DMG/ZIP 与诊断日志保留 14 天,不发布 release;安装包上传关闭重复 ZIP 压缩。操作人员须验收完整 Actions 运行及目标架构上的安装,才能确认可交付。`compression_level` 下拉选项默认为 `3`,也可选择 `7`;本次运行以该选项覆盖机器预设,只影响 ZIP 和自动升级下载,不影响 DMG。
|
||||
|
||||
三个平台的表单均依次展示源码、环境、升级通道、版本模式、手动版本号、测试 release ID 和压缩等级,默认值一致。macOS 公证选项和 Windows 签名、缓存测量、独立构建目录选项位于公共字段之后。
|
||||
|
||||
运行 `node apps/desktop/scripts/setup-macos-packaging.mjs "$HOME/dsh-ci"` 创建私有 `runner/`、`packaging/{presets,secrets,certificates}` 和 `cache/macos-signatures` 目录,不覆盖已有文件;追加 `--check` 仅检查。在 checkout 外填写 [preset](../config/macos-packaging/test.env.example) 和[签名](../config/macos-packaging/macos-signing.env.example)模板,将秘密和证书文件权限设为 `0600`。`DSH_PACKAGING_CONFIG_DIR` 指定 `packaging` 的绝对目录,`DSH_PACKAGING_PRESET` 选择其中的 preset;缺少文件立即失败,不回退到 `.env.macos`。Mac 签名和仅准备构建读取 `secrets/macos-signing.env`,相对凭据路径以该文件所在目录为基准。公开 preset 拒绝签名凭据,签名文件不能覆盖公开配置。本地未签名 Mac 构建保留无需配置的行为。
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: 0478d8e35f9a3d55
|
||||
zh: 0aa3fd828bc02691
|
||||
/desktop-ci-publication/machine-setup:
|
||||
en: f80388c2b1ffef4c
|
||||
zh: f242ab2316bf38a1
|
||||
en: 6e7b928af17f4377
|
||||
zh: 7c559078306df3fd
|
||||
/desktop-ci-publication/package-and-publish:
|
||||
en: f7c12d343891e547
|
||||
zh: da596ee1366c2046
|
||||
|
||||
@@ -56,7 +56,7 @@ Keep `DSH_PACKAGING_CONFIG_DIR` pointed at the existing machine packaging direct
|
||||
|
||||
Create `publishing/test.json` and, when authorized, `publishing/production.json` below the configuration directory. Each declares `bucket`, HTTPS `origin` without a path, and an absolute `credentialsFile`. The credential file contains only `secretId` and `secretKey`. macOS also requires `macOS.signingIdentity` and `macOS.teamId`; Windows requires `windows.certificateThumbprint`. Production requires the exact origin `https://download.deepseek.com` and `githubApp.clientId` plus an absolute `githubApp.privateKeyFile`. These files stay outside Git. The uploader supports permanent COS credentials, not STS session credentials. Administrators must keep test and production buckets unversioned (neither enabled nor suspended). Publication assumes this deployment prerequisite and does not call `GetBucketVersioning` or require its permission. Immutable binary PUTs retain `x-cos-forbid-overwrite`; their protection depends on administrators maintaining the bucket configuration.
|
||||
|
||||
Set the repository variable `DESKTOP_PUBLISH_RUNNERS` to a JSON mapping of registered runner names to unique labels and targets, for example `{"mini":{"label":"dsh-mini-publish","target":"mac-arm64"}}`. Assign that label to exactly that runner. Windows uses target `win-x64`. The routing job checks the original successful job, and the publisher checks its own runner name against the recorded name. Machines need no shared filesystem or LAN connection to each other.
|
||||
Set the repository variable `DESKTOP_PUBLISH_RUNNERS` to a JSON mapping of registered runner names to unique labels and targets, for example `{"mini":{"label":"dsh-mini-publish","target":["mac-arm64","mac-x64"]}}`. Assign that label to exactly that runner. A target may be a single name or a nonempty list; the Mac entry above authorizes both packaging workflows on the same machine. Windows uses target `win-x64`. The retained target must match the selected packaging workflow. The routing job checks the original successful job, and the publisher checks its own runner name against the recorded name. Machines need no shared filesystem or LAN connection to each other.
|
||||
|
||||
An administrator must create `desktop-test` and `desktop-production`, each with required reviewers and an allowed `master` deployment branch. The workflow checks reviewers for either deployment. Test can allow self-approval. The GitHub App needs installation access to this repository and Contents write permission, plus permission under the `desktop-v*` tag ruleset to create release tags. Reviewer approval does not transfer the reviewer's tag permissions to the App. Missing configuration stops publication; there is no personal-token fallback. The App action creates and later revokes a short-lived token. Protect the local private key and COS credential files with the publishing account's filesystem permissions. The token action accepts key contents, so the masked PEM also passes through the runner's temporary `GITHUB_OUTPUT` file during the job; masking hides logs, not local file access.
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ job 排队时,先对照 job 页面请求的标签与 **Settings → Actions
|
||||
|
||||
在配置目录下创建 `publishing/test.json`,获得授权后再创建 `publishing/production.json`。每份配置声明 `bucket`、不带路径的 HTTPS `origin` 和绝对路径 `credentialsFile`。凭据文件只包含 `secretId` 和 `secretKey`。macOS 还需 `macOS.signingIdentity` 和 `macOS.teamId`;Windows 需要 `windows.certificateThumbprint`。production 必须使用 origin `https://download.deepseek.com`,并提供 `githubApp.clientId` 和绝对路径 `githubApp.privateKeyFile`。这些文件不进入 Git。上传器支持长期 COS 凭据,不支持 STS 会话凭据。管理员必须维持 test 和 production bucket 未启用版本控制(不能是已启用或已暂停状态)。发布流程以此为部署前提,不调用 `GetBucketVersioning`,也不要求该权限。二进制 PUT 仍携带 `x-cos-forbid-overwrite`;防覆盖保证依赖管理员维持桶配置。
|
||||
|
||||
将仓库变量 `DESKTOP_PUBLISH_RUNNERS` 配置为已注册 runner 名称到唯一标签和目标的 JSON 映射,例如 `{"mini":{"label":"dsh-mini-publish","target":"mac-arm64"}}`。该标签只能分配给这台 runner。Windows 使用目标 `win-x64`。路由 job 检查原构建成功的 job,发布器再检查自身 runner 名称与记录一致。机器之间不需要共享文件系统或局域网连接。
|
||||
将仓库变量 `DESKTOP_PUBLISH_RUNNERS` 配置为已注册 runner 名称到唯一标签和目标的 JSON 映射,例如 `{"mini":{"label":"dsh-mini-publish","target":["mac-arm64","mac-x64"]}}`。该标签只能分配给这台 runner。目标可为单个名称或非空列表;上述 Mac 条目允许同一台机器处理两种架构的打包工作流。Windows 使用目标 `win-x64`。留存包的目标必须与所选打包工作流一致。路由 job 检查原构建成功的 job,发布器再检查自身 runner 名称与记录一致。机器之间不需要共享文件系统或局域网连接。
|
||||
|
||||
管理员必须创建 `desktop-test` 和 `desktop-production`,分别设置必需审批人并允许 `master` 部署分支。工作流会检查两种环境的审批人配置。test 可允许发起者自行审批。GitHub App 需要安装到本仓库、具有 Contents write 权限,并获准在 `desktop-v*` tag ruleset 下创建发布 tag。审批不会把审批人的 tag 权限传给 App。缺少配置会停止发布,不回退到个人 token。App action 创建短期 token,并在结束后撤销。使用发布账户的文件系统权限保护本机私钥及 COS 凭据文件。token action 需要密钥内容,因此已屏蔽日志的 PEM 在 job 期间也会经过 runner 临时 `GITHUB_OUTPUT` 文件;日志屏蔽不限制本地文件访问。
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/** Validate a completed packaging attempt and route publication back to its original runner. */
|
||||
import { z } from 'zod'
|
||||
import { desktopPublishRunnersSchema, desktopPackageWorkflows } from './desktop-publish-targets.ts'
|
||||
import { desktopPublishQualificationError } from './desktop-publish-qualification.mjs'
|
||||
|
||||
const positive = z.number().int().positive()
|
||||
@@ -12,12 +13,11 @@ const requestSchema = z.object({ source: z.object({
|
||||
repository: z.string(), runId: z.string(), attempt: z.string(), commit: z.string().regex(/^[a-f0-9]{40}$/u),
|
||||
workflowCommit: z.string(), sourceRef: z.string().min(1),
|
||||
channel: z.enum(['nightly', 'latest']),
|
||||
runnerName: z.string(), target: z.enum(['mac-arm64', 'win-x64']), preset: z.enum(['test', 'production']),
|
||||
runnerName: z.string(), target: z.enum(['mac-arm64', 'mac-x64', 'win-x64']), preset: z.enum(['test', 'production']),
|
||||
qualification: z.enum(['signed', 'notarized', 'unsigned', 'unnotarized']),
|
||||
}).refine(source => source.preset === 'test' || /^(?:master|dsh-v[0-9][0-9A-Za-z.-]*)$/u.test(source.sourceRef),
|
||||
'Production source must be master or dsh-v*') })
|
||||
const jobsSchema = z.array(z.object({ name: z.string(), runner_name: z.string().nullable(), conclusion: z.string().nullable() }))
|
||||
const routesSchema = z.record(z.string(), z.object({ label: z.string().regex(/^dsh-[a-z0-9-]+$/u), target: z.enum(['mac-arm64', 'win-x64']) }))
|
||||
|
||||
/** Validated values handed to the privileged publisher; no caller-selected shell fragments. */
|
||||
export interface DesktopPublishRoute {
|
||||
@@ -28,7 +28,7 @@ export interface DesktopPublishRoute {
|
||||
readonly channel: 'nightly' | 'latest'
|
||||
readonly runnerName: string
|
||||
readonly runnerLabel: string
|
||||
readonly target: 'mac-arm64' | 'win-x64'
|
||||
readonly target: 'mac-arm64' | 'mac-x64' | 'win-x64'
|
||||
readonly preset: 'test' | 'production'
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ export function resolveDesktopPublishRoute(
|
||||
const diagnostic = desktopPublishQualificationError(source.qualification)
|
||||
if (diagnostic) throw new Error(diagnostic)
|
||||
const jobs = jobsSchema.parse(jobsValue)
|
||||
const routes = routesSchema.parse(routesValue)
|
||||
const workflow = source.target === 'win-x64' ? '.github/workflows/windows-package.yml' : '.github/workflows/macos-package.yml'
|
||||
const routes = desktopPublishRunnersSchema.parse(routesValue)
|
||||
const workflow = desktopPackageWorkflows[source.target]
|
||||
if (run.repository.full_name !== repository || source.repository !== repository || run.path !== workflow
|
||||
|| source.runId !== String(run.id) || source.attempt !== String(run.run_attempt)
|
||||
|| source.workflowCommit !== run.head_sha
|
||||
@@ -58,7 +58,7 @@ export function resolveDesktopPublishRoute(
|
||||
throw new Error('desktop publish: request does not match the successful packaging attempt')
|
||||
}
|
||||
const route = routes[source.runnerName]
|
||||
if (!route || route.target !== source.target) throw new Error('desktop publish: original machine has no configured publishing route')
|
||||
if (!route || !route.target.includes(source.target)) throw new Error('desktop publish: original machine has no configured publishing route')
|
||||
if (new Set(Object.values(routes).map(value => value.label)).size !== Object.keys(routes).length) {
|
||||
throw new Error('desktop publish: each configured machine needs its own unique runner label')
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/** Approved packaging workflows and machine publication targets. */
|
||||
import { z } from 'zod'
|
||||
|
||||
/** Each target is produced by its own manually dispatched workflow. */
|
||||
export const desktopPackageWorkflows = {
|
||||
'mac-arm64': '.github/workflows/macos-package.yml',
|
||||
'mac-x64': '.github/workflows/macos-intel-package.yml',
|
||||
'win-x64': '.github/workflows/windows-package.yml',
|
||||
} as const
|
||||
|
||||
const targetSchema = z.enum(['mac-arm64', 'mac-x64', 'win-x64'])
|
||||
|
||||
/** Machine labels are unique; a scalar target is shorthand for a one-element target list. */
|
||||
export const desktopPublishRunnersSchema = z.record(z.string(), z.object({
|
||||
label: z.string().regex(/^dsh-[a-z0-9-]+$/u),
|
||||
target: z.union([targetSchema, z.array(targetSchema).min(1)])
|
||||
.transform(value => typeof value === 'string' ? [value] : value),
|
||||
}))
|
||||
@@ -29,7 +29,7 @@ export function preflightDesktopPublish(repository, inputs, api) {
|
||||
for (const { name } of pages.flatMap(page => page.artifacts)) {
|
||||
if (!name.endsWith(`-${inputs.package_run_id}-${attempt}`)) continue
|
||||
const qualification = name.startsWith('windows-x64-unsigned-') ? 'unsigned'
|
||||
: name.startsWith('macos-arm64-unnotarized-debug-') ? 'unnotarized' : ''
|
||||
: /^macos-(?:arm64|x64)-unnotarized-debug-/u.test(name) ? 'unnotarized' : ''
|
||||
const diagnostic = desktopPublishQualificationError(qualification)
|
||||
if (diagnostic) throw new Error(diagnostic)
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
import { appendFileSync, readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { execFileSync } from 'node:child_process'
|
||||
import { desktopTargetPlatform, resolveDesktopBuildTarget } from './desktop-build-paths.mjs'
|
||||
import { desktopCiVersion } from './desktop-ci-version.mjs'
|
||||
import { loadDesktopPackageEnvironment, validateDesktopPackageEnvironment } from './desktop-package-environment.mjs'
|
||||
|
||||
const target = desktopTargetPlatform(resolveDesktopBuildTarget(process.env))
|
||||
if (target.platform !== 'darwin') throw new Error('macOS CI requires a macOS target')
|
||||
const appRoot = resolve(import.meta.dirname, '..')
|
||||
const product = JSON.parse(readFileSync(resolve(appRoot, 'package.json'), 'utf8'))
|
||||
const version = desktopCiVersion(process.env, product.version)
|
||||
@@ -18,8 +21,8 @@ for (const [name, value] of Object.entries(environment)) {
|
||||
process.stdout.write(`::add-mask::${escaped}\n`)
|
||||
}
|
||||
}
|
||||
validateDesktopPackageEnvironment(environment, { platform: 'darwin', arch: 'arm64' }, { skipNotarization })
|
||||
validateDesktopPackageEnvironment(environment, target, { skipNotarization })
|
||||
if (!process.env.GITHUB_OUTPUT || !process.env.GITHUB_STEP_SUMMARY) throw new Error('Run this adapter from GitHub Actions')
|
||||
appendFileSync(process.env.GITHUB_OUTPUT, `version=${version}\nartifacts=${skipNotarization ? 'unnotarized-artifacts' : 'artifacts'}\nmode=${skipNotarization ? 'unnotarized-debug' : 'signed'}\n`)
|
||||
appendFileSync(process.env.GITHUB_STEP_SUMMARY, `macOS arm64 signed installer\n\nVersion: ${version}\n\nCommit: ${execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim()}\n\nChannel: ${process.env.DSH_DESKTOP_UPDATE_CHANNEL}\n\nSource: ${process.env.PACKAGE_SOURCE_REF}\n\nPreset: ${process.env.DSH_PACKAGING_PRESET}\n`)
|
||||
appendFileSync(process.env.GITHUB_STEP_SUMMARY, `macOS ${target.arch} signed installer\n\nVersion: ${version}\n\nCommit: ${execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim()}\n\nChannel: ${process.env.DSH_DESKTOP_UPDATE_CHANNEL}\n\nSource: ${process.env.PACKAGE_SOURCE_REF}\n\nPreset: ${process.env.DSH_PACKAGING_PRESET}\n`)
|
||||
if (skipNotarization) appendFileSync(process.env.GITHUB_STEP_SUMMARY, '\nWARNING: signed but NOT notarized or stapled. Internal debugging only; Gatekeeper may block downloaded copies. Not qualified for distribution or update publishing.\n')
|
||||
@@ -18,7 +18,7 @@ import { desktopPublishQualificationError } from './desktop-publish-qualificatio
|
||||
|
||||
const routeSchema = z.object({ runId: z.string(), attempt: z.string(), commit: z.string(), runnerName: z.string(),
|
||||
sourceRef: z.string(), channel: z.enum(['nightly', 'latest']),
|
||||
target: z.enum(['mac-arm64', 'win-x64']), preset: z.enum(['test', 'production']) })
|
||||
target: z.enum(['mac-arm64', 'mac-x64', 'win-x64']), preset: z.enum(['test', 'production']) })
|
||||
|
||||
/**
|
||||
* Check retained bytes, original machine, destination and signatures before reading any upload secret.
|
||||
|
||||
@@ -3,17 +3,17 @@ import { execFileSync } from 'node:child_process'
|
||||
import { appendFile, readFile } from 'node:fs/promises'
|
||||
import { resolve } from 'node:path'
|
||||
import { z } from 'zod'
|
||||
import { desktopPublishRunnersSchema, desktopPackageWorkflows } from './desktop-publish-targets.ts'
|
||||
|
||||
const positiveId = z.string().regex(/^[1-9]\d*$/u)
|
||||
const inputsSchema = z.object({ package_run_id: positiveId, package_run_attempt: z.union([positiveId, z.literal('')]).optional() })
|
||||
const runSchema = z.object({ id: z.number().int().positive(), run_attempt: z.number().int().positive(),
|
||||
head_sha: z.string().regex(/^[a-f0-9]{40}$/u), status: z.literal('completed'), conclusion: z.literal('success'),
|
||||
event: z.literal('workflow_dispatch'), path: z.enum(['.github/workflows/macos-package.yml', '.github/workflows/windows-package.yml']),
|
||||
event: z.literal('workflow_dispatch'), path: z.enum(Object.values(desktopPackageWorkflows)),
|
||||
repository: z.object({ full_name: z.string() }) })
|
||||
const jobsSchema = z.object({ jobs: z.array(z.object({
|
||||
name: z.string(), runner_name: z.string().nullable(), conclusion: z.string().nullable(),
|
||||
})) })
|
||||
const routesSchema = z.record(z.string(), z.object({ label: z.string().regex(/^dsh-[a-z0-9-]+$/u), target: z.enum(['mac-arm64', 'win-x64']) }))
|
||||
|
||||
/**
|
||||
* Read GitHub evidence for one explicit attempt, or the latest attempt without falling back after failure.
|
||||
@@ -37,10 +37,11 @@ export function selectDesktopPackage(repository: string, inputsValue: unknown, r
|
||||
const packages = jobs.filter(job => job.name === 'package' && job.conclusion === 'success' && job.runner_name)
|
||||
if (packages.length !== 1) throw new Error('desktop publish: expected one successful package job')
|
||||
const runnerName = packages[0]!.runner_name!
|
||||
const routes = routesSchema.parse(routesValue)
|
||||
const routes = desktopPublishRunnersSchema.parse(routesValue)
|
||||
const route = routes[runnerName]
|
||||
const target = run.path.endsWith('/macos-package.yml') ? 'mac-arm64' : 'win-x64'
|
||||
if (!route || route.target !== target) throw new Error('desktop publish: original machine has no configured publishing route')
|
||||
const target = (Object.keys(desktopPackageWorkflows) as Array<keyof typeof desktopPackageWorkflows>)
|
||||
.find(name => desktopPackageWorkflows[name] === run.path)!
|
||||
if (!route || !route.target.includes(target)) throw new Error('desktop publish: original machine has no configured publishing route')
|
||||
if (new Set(Object.values(routes).map(value => value.label)).size !== Object.keys(routes).length) {
|
||||
throw new Error('desktop publish: each configured machine needs its own unique runner label')
|
||||
}
|
||||
|
||||
@@ -121,3 +121,17 @@ it('resolves an old locally retained package with publishRequested=false without
|
||||
await expect(resolveRetainedDesktopPublication(env, api)).rejects.toThrow()
|
||||
} finally { await rm(root, { recursive: true, force: true }) }
|
||||
})
|
||||
|
||||
it('routes both Mac architectures to one machine without authorizing an unlisted target', () => {
|
||||
const f = fixture()
|
||||
const routes = { mini: { label: 'dsh-mini', target: ['mac-arm64', 'mac-x64'] } }
|
||||
for (const path of ['macos-package.yml', 'macos-intel-package.yml']) {
|
||||
f.run.path = `.github/workflows/${path}`
|
||||
expect(selectDesktopPackage('owner/repo', { package_run_id: '42' }, routes, f.api))
|
||||
.toMatchObject({ runnerName: 'mini', runnerLabel: 'dsh-mini' })
|
||||
}
|
||||
expect(() => selectDesktopPackage('owner/repo', { package_run_id: '42' }, f.routes, f.api)).toThrow(/no configured/u)
|
||||
for (const target of [[], ['mac-x64', 'linux-x64']]) {
|
||||
expect(() => selectDesktopPackage('owner/repo', { package_run_id: '42' }, { mini: { label: 'dsh-mini', target } }, f.api)).toThrow()
|
||||
}
|
||||
})
|
||||
@@ -2,6 +2,7 @@ import { expect, it } from 'vitest'
|
||||
import { preflightDesktopPublish } from '../scripts/preflight-desktop-publish.mjs'
|
||||
|
||||
it.each([
|
||||
['macos-x64-unnotarized-debug-1.0.0-42-2', '跳过了公证'],
|
||||
['macos-arm64-unnotarized-debug-1.0.0-42-2', '跳过了公证'],
|
||||
['windows-x64-unsigned-1.0.0-42-2', '未签名'],
|
||||
])('rejects %s from paginated artifact metadata with rebuilding instructions', (name, reason) => {
|
||||
|
||||
@@ -75,3 +75,16 @@ it('allows repository branch packages for test but rejects them for production',
|
||||
f.source.preset = 'production'
|
||||
expect(() => resolveDesktopPublishRoute('owner/repo', f.run, { source: f.source }, f.jobs, f.routes)).toThrow(/Production source/u)
|
||||
})
|
||||
|
||||
it('matches Intel artifacts to the Intel workflow on a machine serving both architectures', () => {
|
||||
const f = fixture()
|
||||
f.source.target = 'mac-x64'
|
||||
const routes = { mini: { label: 'dsh-mini', target: ['mac-arm64', 'mac-x64'] } }
|
||||
expect(() => resolveDesktopPublishRoute('owner/repo', f.run, { source: f.source }, f.jobs, routes)).toThrow(/does not match/u)
|
||||
f.run.path = '.github/workflows/macos-intel-package.yml'
|
||||
expect(resolveDesktopPublishRoute('owner/repo', f.run, { source: f.source }, f.jobs, routes))
|
||||
.toMatchObject({ target: 'mac-x64', runnerLabel: 'dsh-mini' })
|
||||
expect(() => resolveDesktopPublishRoute('owner/repo', f.run, { source: f.source }, f.jobs, f.routes)).toThrow(/no configured/u)
|
||||
f.source.target = 'mac-arm64'
|
||||
expect(() => resolveDesktopPublishRoute('owner/repo', f.run, { source: f.source }, f.jobs, routes)).toThrow(/does not match/u)
|
||||
})
|
||||
@@ -60,7 +60,7 @@ it.skipIf(process.platform !== 'darwin')('prepares private machine directories w
|
||||
}
|
||||
})
|
||||
|
||||
it('records debugging artifact paths only for an explicit CI selection without notarization credentials', async () => {
|
||||
it.each(['arm64', 'x64'])('records %s debugging artifact paths only for an explicit CI selection without notarization credentials', async (arch) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'macos-ci-settings-'))
|
||||
try {
|
||||
await mkdir(join(root, 'presets'))
|
||||
@@ -81,6 +81,7 @@ it('records debugging artifact paths only for an explicit CI selection without n
|
||||
const run = (skip: string) => spawnSync(process.execPath,
|
||||
[join(import.meta.dirname, '../scripts/prepare-macos-ci.mjs')], { encoding: 'utf8', env: {
|
||||
...process.env, DSH_PACKAGING_CONFIG_DIR: root, DSH_PACKAGING_PRESET: 'test',
|
||||
DSH_DESKTOP_TARGET_PLATFORM: 'darwin', DSH_DESKTOP_TARGET_ARCH: arch,
|
||||
PACKAGE_SKIP_NOTARIZATION: skip, PACKAGE_BUILD_VERSION: 'auto',
|
||||
GITHUB_RUN_NUMBER: '1', GITHUB_RUN_ATTEMPT: '1', GITHUB_OUTPUT: output, GITHUB_STEP_SUMMARY: summary,
|
||||
} })
|
||||
@@ -91,10 +92,13 @@ it('records debugging artifact paths only for an explicit CI selection without n
|
||||
expect(invalidSelection.status).toBe(1)
|
||||
expect(invalidSelection.stderr).toContain('Invalid skip notarization selection')
|
||||
const debugging = run('true')
|
||||
expect(debugging.error).toBeUndefined()
|
||||
expect(debugging.signal).toBeNull()
|
||||
expect(debugging.stderr).toBe('')
|
||||
expect(debugging.status).toBe(0)
|
||||
expect(await readFile(output, 'utf8')).toContain('artifacts=unnotarized-artifacts\nmode=unnotarized-debug\n')
|
||||
expect(await readFile(summary, 'utf8')).toContain('Internal debugging only')
|
||||
expect(await readFile(summary, 'utf8')).toContain(`macOS ${arch} signed installer`)
|
||||
} finally {
|
||||
await rm(root, { recursive: true, force: true })
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ const roots: string[] = []
|
||||
afterEach(async () => { await Promise.all(roots.splice(0).map(root => rm(root, { recursive: true, force: true }))) })
|
||||
|
||||
it.each([
|
||||
['mac-arm64', 'notarized'], ['win-x64', 'signed'], ['mac-arm64', 'unnotarized'], ['win-x64', 'unsigned'],
|
||||
['mac-arm64', 'notarized'], ['mac-x64', 'notarized'], ['mac-x64', 'unnotarized'], ['win-x64', 'signed'], ['mac-arm64', 'unnotarized'], ['win-x64', 'unsigned'],
|
||||
] as const)('retains the complete %s %s release without signing or upload credentials', async (target, qualification) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'retain-ci-'))
|
||||
roots.push(root)
|
||||
@@ -23,13 +23,13 @@ it.each([
|
||||
await writeFile(join(appRoot, 'package.json'), '{"version":"1.0.0"}')
|
||||
await writeFile(join(config, 'presets/test.env'), `DSH_DESKTOP_AUTO_UPDATE_ENV=test\nDOWNLOAD_TEST_RELEASE_ID=${'a'.repeat(32)}\n`)
|
||||
const names = debug ? (target === 'win-x64' ? [`deepseek-harness-1.0.0-win-x64-${qualification}.exe`]
|
||||
: [`deepseek-harness-1.0.0-mac-arm64-${qualification}.dmg`, `deepseek-harness-1.0.0-mac-arm64-${qualification}.zip`]) : target === 'win-x64'
|
||||
: [`deepseek-harness-1.0.0-${target}-${qualification}.dmg`, `deepseek-harness-1.0.0-${target}-${qualification}.zip`]) : target === 'win-x64'
|
||||
? ['deepseek-harness-1.0.0-win-x64.exe', 'deepseek-harness-1.0.0-win-x64.exe.blockmap', 'win-x64-release.json', 'nightly.yml']
|
||||
: ['deepseek-harness-1.0.0-mac-arm64.dmg', 'deepseek-harness-1.0.0-mac-arm64.zip', 'deepseek-harness-1.0.0-mac-arm64.zip.blockmap', 'mac-arm64-release.json', 'nightly-mac.yml']
|
||||
: [`deepseek-harness-1.0.0-${target}.dmg`, `deepseek-harness-1.0.0-${target}.zip`, `deepseek-harness-1.0.0-${target}.zip.blockmap`, `${target}-release.json`, 'nightly-mac.yml']
|
||||
await Promise.all(names.map(name => writeFile(join(artifacts, name), 'fixture')))
|
||||
const env = {
|
||||
DSH_PACKAGING_CONFIG_DIR: config, DSH_PACKAGING_PRESET: 'test', DSH_DESKTOP_TARGET_PLATFORM: target === 'win-x64' ? 'win32' : 'darwin',
|
||||
DSH_DESKTOP_TARGET_ARCH: target === 'win-x64' ? 'x64' : 'arm64', PACKAGE_SOURCE_REF: 'master', PACKAGE_SOURCE_SHA: 'b'.repeat(40), PACKAGE_VERSION: '1.0.0',
|
||||
DSH_DESKTOP_TARGET_ARCH: target === 'mac-arm64' ? 'arm64' : 'x64', PACKAGE_SOURCE_REF: 'master', PACKAGE_SOURCE_SHA: 'b'.repeat(40), PACKAGE_VERSION: '1.0.0',
|
||||
PACKAGE_SIGNING: qualification === 'unsigned' ? 'unsigned' : 'signed', PACKAGE_SKIP_NOTARIZATION: qualification === 'unnotarized' ? 'true' : 'false', GITHUB_RUN_ID: '123', GITHUB_RUN_ATTEMPT: '2',
|
||||
GITHUB_STEP_SUMMARY: join(root, 'summary.md'),
|
||||
GITHUB_REPOSITORY: 'owner/repository', GITHUB_SHA: 'b'.repeat(40), RUNNER_NAME: 'dedicated',
|
||||
|
||||
@@ -397,9 +397,9 @@ describe.skipIf(MODE === 'record')('web e2e: details panel follows the current S
|
||||
expect(await panel.getAttribute('data-sidebar-right-panel')).toBe('push')
|
||||
expect(await paneSnapshot(page)).toEqual(retainedB)
|
||||
await open()
|
||||
await expect.poll(() => workspaceDirectory.getAttribute('aria-expanded')).toBe('false')
|
||||
await expect.poll(() => workspaceDirectory.getAttribute('aria-expanded')).toBe('true')
|
||||
expect(await paneSnapshot(page)).toEqual(retainedB)
|
||||
await checkpoint('B restored: normal mode and collapsed Files directory')
|
||||
await checkpoint('B restored: normal mode and expanded Files directory')
|
||||
await close()
|
||||
await select(original, 'LIGHTHOUSE')
|
||||
await expect.poll(() => columns(page)).toEqual(normalColumns)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
en: ed52405be7c3fa24
|
||||
zh: d06dbd49c786c5f0
|
||||
/deepseek-ai-dsh-client-ui-sidebar-files/the-tree:
|
||||
en: 4d14a19bbccca137
|
||||
zh: 28fb52f159deb007
|
||||
en: 7227d732ae614482
|
||||
zh: e19ad4362f56edce
|
||||
/deepseek-ai-dsh-client-ui-sidebar-files/model-experience:
|
||||
en: a18a43f6842f1371
|
||||
zh: 69f2a2b35f06dfc7
|
||||
@@ -27,8 +27,8 @@
|
||||
en: 5a6febb45089991a
|
||||
zh: b17ed755fd098b83
|
||||
/deepseek-ai-dsh-client-ui-sidebar-files/known-limitations-and-deferred-work:
|
||||
en: 0221377b59299a3c
|
||||
zh: abdacebf73b75390
|
||||
en: 92d8b6977b0f4ceb
|
||||
zh: 370603496d958bfe
|
||||
/deepseek-ai-dsh-client-ui-sidebar-files/known-limitations-and-deferred-work/dev-note:
|
||||
en: d8b51fb935f38650
|
||||
zh: fee9d330ecf8ec0e
|
||||
@@ -45,7 +45,7 @@ The root is the session's working directory, read from `useSessions().byId[sessi
|
||||
|
||||
A level cut by the endpoint's entry cap ends with a marker; an empty level says so; a level that failed shows one line per code — `workspace-file/not-found`, `outside-workspace`, `not-directory` — and the transport's own message otherwise. Reload refreshes the root and expanded levels in place, retaining displayed entries during reads instead of resetting the whole tree; collapsed levels are fetched again when they next open. A session without a working directory shows a single line instead of a tree.
|
||||
|
||||
State lives in the type's own store, bucketed by tab id: `root`, `levels` (loading / ready / failed per absolute path), `expanded`, `autoRefresh`, and `scrollTop`, which the body tracks locally while scrolling and commits once when it unmounts. Because the store outlives the body, switching to another sidebar tab and back remounts the tree with its levels intact and its scroll offset restored. The owner's `signal` ends a bucket: on abort the tab is forgotten, and neither a listing that settles afterwards nor the unmount's offset commit writes anything.
|
||||
State lives in the type's own store, bucketed by tab id: `root`, `levels` (loading / ready / failed per absolute path), `expanded`, `autoRefresh`, and `scrollTop`, which the body tracks locally while scrolling and commits once when it unmounts. Because the store outlives the body, switching to another sidebar tab and back remounts the tree with its levels intact and its scroll offset restored. The store instance ends with its Session binding when the reader leaves the Session, so the body also hands the tree it last drew to the face when it unmounts, which retains it per Session and tab until the tab closes; returning to the Session seeds the new store with that tree when the workspace root is unchanged and replaces the earlier binding's directory watches. The owner's `signal` ends a bucket: on abort the tab is forgotten, and neither a listing that settles afterwards nor the unmount's offset commit writes anything.
|
||||
|
||||
Each open `DirectoryNode` owns its target watch for the Tab lifetime; collapse closes that node and its hidden descendants. Expansion changes during ancestor restoration update the store and pending nodes, so restored descendants follow the latest expansion preferences. Automatic refresh defaults to enabled; its separate toggle is hidden while state, labels, styles, and toggle logic remain. Changes received during a directory read or its completion remain pending for another refresh.
|
||||
|
||||
@@ -65,6 +65,7 @@ None; directory listings travel over the Remote and assemble no model request.
|
||||
<a id="known-limitations-and-deferred-work"></a>
|
||||
- **Listing only.** No search, artifact filter, drag-and-drop, rename, or current-file highlight.
|
||||
- **One root.** The tree is rooted at the session's working directory; there is no way to browse above it, and the Host refuses paths outside the workspace root anyway.
|
||||
- **Watches outlive a released Session.** The face cannot observe a Session binding ending, so a tab's directory watches keep running after the reader leaves the Session until the reader returns or the tab closes; the retained tree, with its loaded listings, is held for the same period.
|
||||
|
||||
<a id="dev-note"></a>
|
||||
### Dev Note
|
||||
|
||||
@@ -45,7 +45,7 @@ kind: "package-reference"
|
||||
|
||||
被端点条目上限截断的层以一条标记收尾;空层如实说明;失败的层按错误码各显示一行(`workspace-file/not-found`、`outside-workspace`、`not-directory`),其他情况显示传输层自己的消息。重新读取就地刷新根与展开中的层,读取期间保留显示条目,不重置整棵树;折叠的层在下次打开时重新拉取。没有工作目录的会话只显示一行说明,而不是树。
|
||||
|
||||
状态保存在类型自己的存储里,按 tab id 分桶:`root`、`levels`(每个绝对路径的 loading / ready / failed)、`expanded`、`autoRefresh` 与 `scrollTop`——滚动期间偏移由正文自己记录,卸载时一次性写入。存储比 body 活得久,切到其他侧栏 tab 再切回来时树带着已加载的层重新挂载,滚动位置也随之恢复。owner 的 `signal` 终结一个桶:中止时忘掉该 tab,其后才结算的列表与卸载时的偏移提交都什么也不写。
|
||||
状态保存在类型自己的存储里,按 tab id 分桶:`root`、`levels`(每个绝对路径的 loading / ready / failed)、`expanded`、`autoRefresh` 与 `scrollTop`——滚动期间偏移由正文自己记录,卸载时一次性写入。存储比 body 活得久,切到其他侧栏 tab 再切回来时树带着已加载的层重新挂载,滚动位置也随之恢复。读者离开 Session 时,存储实例随其 Session 绑定一同结束,因此 body 卸载时还会把它最后绘制的树交给 face,face 按 Session 与 tab 保留它直到 tab 关闭;回到该 Session 时,若工作区根目录未变,新存储以这棵树为初值,并替换先前绑定的目录监听。owner 的 `signal` 终结一个桶:中止时忘掉该 tab,其后才结算的列表与卸载时的偏移提交都什么也不写。
|
||||
|
||||
每个打开的 `DirectoryNode` 在 Tab 生命周期内持有自己的目标监听;折叠关闭该节点及其不可见后代。祖先恢复期间的展开状态变化会更新存储和待恢复节点,后代恢复时遵循最新展开偏好。自动刷新默认开启;独立开关暂时隐藏,状态、文案、样式与切换逻辑保留。目录读取期间或收尾时收到的变化仍会留待下一次刷新。
|
||||
|
||||
@@ -65,6 +65,7 @@ kind: "package-reference"
|
||||
<a id="known-limitations-and-deferred-work"></a>
|
||||
- **只有列目录。**没有搜索、产物过滤、拖拽、重命名或当前文件高亮。
|
||||
- **只有一个根。**树以会话工作目录为根;没有办法浏览到它之上,而 Host 本来也拒绝工作区根之外的路径。
|
||||
- **监听比已释放的 Session 存活更久。**face 无法观察到 Session 绑定的结束,因此读者离开 Session 后,tab 的目录监听会持续运行,直到读者返回或 tab 关闭;保留的树及其已加载的列表也在同一期间保留。
|
||||
|
||||
<a id="dev-note"></a>
|
||||
### 开发备注
|
||||
|
||||
@@ -162,7 +162,7 @@ function Level({ path, tree }: { path: string; tree: TreeContext }): ReactNode {
|
||||
/** The file tree's body: the workspace root and whatever the reader has opened under it. */
|
||||
export function FilesBody({
|
||||
useTabInfo, sessionId, useSessions, useStore, actions,
|
||||
start, refresh, setAutoRefresh, toggle, t, renderSlot, openContextMenu,
|
||||
start, refresh, setAutoRefresh, toggle, retain, t, renderSlot, openContextMenu,
|
||||
}: FilesBodyProps): ReactNode {
|
||||
const { tab, panel } = useTabInfo()
|
||||
useEffect(() => tab.actions.bindCommands({ refresh: () => { refresh(tab.id) } }), [tab.actions, tab.id, refresh])
|
||||
@@ -172,7 +172,8 @@ export function FilesBody({
|
||||
const bodyRef = useRef<HTMLDivElement>(null)
|
||||
const scrollTopRef = useRef(0)
|
||||
// Come back where the reader was: loaded levels outlive the body in the
|
||||
// store, so a remounted tree lays out at its full height before this runs
|
||||
// store, or in the face's retained tree once the Session's store was
|
||||
// released, so a remounted tree lays out at its full height before this runs
|
||||
// and the stored offset re-lands exactly. A fresh tree stores 0.
|
||||
const seeded = state !== undefined
|
||||
useLayoutEffect(() => {
|
||||
@@ -182,12 +183,17 @@ export function FilesBody({
|
||||
scrollTopRef.current = body.scrollTop
|
||||
}
|
||||
}, [seeded])
|
||||
// Scrolling only moves the ref; the store hears about it once, on unmount,
|
||||
// so a scroll neither re-renders the tree nor writes after the owner's
|
||||
// abort has forgotten the bucket.
|
||||
const treeRef = useRef(state)
|
||||
useEffect(() => { treeRef.current = state }, [state])
|
||||
// Scrolling only moves the ref; the store and the face hear about it once,
|
||||
// on unmount, so a scroll neither re-renders the tree nor writes after the
|
||||
// owner's abort has forgotten the bucket.
|
||||
useEffect(() => () => {
|
||||
if (seeded && !signal.aborted) actions.scrolled(tab.id, scrollTopRef.current)
|
||||
}, [seeded, signal, tab.id, actions])
|
||||
const tree = treeRef.current
|
||||
if (tree === undefined || signal.aborted) return
|
||||
actions.scrolled(tab.id, scrollTopRef.current)
|
||||
retain(tab.id, { ...tree, scrollTop: scrollTopRef.current })
|
||||
}, [signal, tab.id, actions, retain])
|
||||
useEffect(() => {
|
||||
// A bucket gone because the record aborted must not be re-seeded by a
|
||||
// component that has not unmounted yet.
|
||||
|
||||
@@ -17,12 +17,19 @@
|
||||
* `signal`: a request is not made for a record that already ended, and when the
|
||||
* record goes away the bucket and the tab's listing bookkeeping are forgotten,
|
||||
* so no later settlement writes to it.
|
||||
*
|
||||
* The store instance lives only as long as its Session binding, which ends when
|
||||
* the reader leaves the Session while its tab records stay open. Each tab's last
|
||||
* drawn tree is therefore retained beside the per-binding faces, keyed by Session
|
||||
* and tab, and seeds the tab again when the reader returns. The latest binding
|
||||
* to start a tab owns it: its start closes the earlier binding's watches, and
|
||||
* only its body's tree is retained.
|
||||
*/
|
||||
import type { ClientRemote, RemoteResult } from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import type { BoundActions } from '@deepseek-ai/dsh-client-store'
|
||||
import type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
||||
import type { DirLevel, createFilesStore } from './store.ts'
|
||||
import type { DirLevel, FilesTabState, createFilesStore } from './store.ts'
|
||||
import type { WorkspaceFileWatchFrame } from '@deepseek-ai/dsh-api-workspace-files/types'
|
||||
import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import { DirectoryNode } from './directory-node.ts'
|
||||
@@ -141,6 +148,21 @@ export interface FilesInjected {
|
||||
* @param signal - the tab record's lifetime.
|
||||
*/
|
||||
readonly toggle: (tabId: TabId, parentPath: string, path: string, expanded: readonly string[], signal: AbortSignal) => void
|
||||
/**
|
||||
* Keep the tree a body last drew, for a later binding of the same Session.
|
||||
* Does nothing once the tab record ended or a later binding started the tab.
|
||||
* @param tabId - the tab being drawn.
|
||||
* @param tree - the tab's tree, with the body's final scroll offset.
|
||||
*/
|
||||
readonly retain: (tabId: TabId, tree: FilesTabState) => void
|
||||
}
|
||||
|
||||
/** One open tab's directory watches and, once its body unmounted, its last drawn tree. */
|
||||
interface RetainedTab {
|
||||
readonly node: DirectoryNode
|
||||
/** Detaches the owning binding's tab-close cleanup when a later binding takes the tab over. */
|
||||
readonly detach: AbortController
|
||||
tree?: FilesTabState
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,6 +175,7 @@ export function filesFace(
|
||||
list: ListWorkspaceDirectory,
|
||||
watch: WatchWorkspaceDirectory,
|
||||
): (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>) => FilesInjected {
|
||||
const retained = new Map<SessionId, Map<TabId, RetainedTab>>()
|
||||
return (
|
||||
sessionId: SessionId,
|
||||
actions: BoundActions<ReturnType<typeof createFilesStore>>,
|
||||
@@ -187,20 +210,38 @@ export function filesFace(
|
||||
roots.get(tabId)?.setAutomatic(enabled)
|
||||
},
|
||||
start(tabId, root, signal) {
|
||||
actions.start(tabId, root)
|
||||
let tabs = retained.get(sessionId)
|
||||
if (tabs === undefined) retained.set(sessionId, tabs = new Map<TabId, RetainedTab>())
|
||||
const previous = tabs.get(tabId)
|
||||
// The previous binding's watches and cleanup belong to a released store.
|
||||
previous?.detach.abort()
|
||||
void previous?.node.close()
|
||||
const detach = new AbortController()
|
||||
const tree = previous?.tree?.root === root ? previous.tree : undefined
|
||||
if (tree === undefined) actions.start(tabId, root)
|
||||
else actions.restore(tabId, tree)
|
||||
signal.addEventListener('abort', () => {
|
||||
void roots.get(tabId)?.close()
|
||||
roots.delete(tabId)
|
||||
generations.delete(tabId)
|
||||
tabs.delete(tabId)
|
||||
if (tabs.size === 0) retained.delete(sessionId)
|
||||
actions.forget(tabId)
|
||||
}, { once: true })
|
||||
roots.set(tabId, new DirectoryNode(root,
|
||||
}, { once: true, signal: detach.signal })
|
||||
const node = new DirectoryNode(root,
|
||||
(path, lifetime) => load(tabId, path, lifetime),
|
||||
(path, lifetime) => watch(sessionId, path, lifetime),
|
||||
(path, error) => {
|
||||
if (!signal.aborted) actions.failed(tabId, path, new RemoteError('gateway/internal', error instanceof Error ? error.message : String(error), {}))
|
||||
}, signal,
|
||||
).open())
|
||||
}, signal, tree?.expanded,
|
||||
)
|
||||
if (tree?.autoRefresh === false) node.setAutomatic(false)
|
||||
roots.set(tabId, node.open())
|
||||
tabs.set(tabId, { node, detach })
|
||||
},
|
||||
retain: (tabId, tree) => {
|
||||
const tab = retained.get(sessionId)?.get(tabId)
|
||||
if (tab !== undefined && roots.get(tabId) === tab.node) tab.tree = tree
|
||||
},
|
||||
load: (tabId, path, signal) => { void load(tabId, path, signal) },
|
||||
toggle(tabId, parentPath, path, expanded, signal) {
|
||||
|
||||
@@ -74,6 +74,7 @@ function bucket(state: FilesState, tabId: TabId): FilesTabState {
|
||||
type FilesActions = {
|
||||
autoRefresh: (draft: FilesState, tabId: TabId, enabled: boolean) => void
|
||||
start: (draft: FilesState, tabId: TabId, root: string) => void
|
||||
restore: (draft: FilesState, tabId: TabId, tree: FilesTabState) => void
|
||||
loading: (draft: FilesState, tabId: TabId, path: string) => void
|
||||
loaded: (draft: FilesState, tabId: TabId, path: string, level: DirLevel) => void
|
||||
failed: (draft: FilesState, tabId: TabId, path: string, failure: RemoteFailure) => void
|
||||
@@ -104,6 +105,15 @@ export function createFilesStore(): EngineStoreHandle<FilesState, FilesActions>
|
||||
start: (d, tabId: TabId, root: string) => {
|
||||
d.byTab[tabId] = { root, levels: {}, expanded: [root], scrollTop: 0, autoRefresh: true }
|
||||
},
|
||||
/**
|
||||
* Seed one tab with the tree it showed before its Session's store was released.
|
||||
* @param d - draft state.
|
||||
* @param tabId - the tab being drawn.
|
||||
* @param tree - the tab's retained tree.
|
||||
*/
|
||||
restore: (d, tabId: TabId, tree: FilesTabState) => {
|
||||
d.byTab[tabId] = tree
|
||||
},
|
||||
/**
|
||||
* Mark one directory as being listed.
|
||||
* @param d - draft state.
|
||||
|
||||
@@ -281,6 +281,97 @@ describe('filesFace', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('filesFace retention across Session store instances', () => {
|
||||
it('seeds a returning tab with its retained tree and automatic setting, and starts fresh at another root', async () => {
|
||||
const script = scriptedList()
|
||||
const bind = filesFace(script.list, script.watch)
|
||||
const controller = new AbortController()
|
||||
onTestFinished(async () => {
|
||||
controller.abort()
|
||||
await script.dispose()
|
||||
})
|
||||
const first = createFilesStore().create()
|
||||
const firstFace = bind(SESSION, first.actions)
|
||||
firstFace.start(TAB, ROOT, controller.signal)
|
||||
const firstStream = await script.watches.ready(ROOT)
|
||||
await script.settle({ ok: true, value: LEVEL })
|
||||
firstFace.setAutoRefresh(TAB, false)
|
||||
firstFace.retain(TAB, { ...first.getSnapshot().byTab[TAB]!, scrollTop: 40 })
|
||||
|
||||
const second = createFilesStore().create()
|
||||
bind(SESSION, second.actions).start(TAB, ROOT, controller.signal)
|
||||
expect(firstStream.signal.aborted).toBe(true)
|
||||
// Only the current binding's cleanup forgets the tab when it closes.
|
||||
const forgetFirst = vi.spyOn(first.actions, 'forget')
|
||||
expect(second.getSnapshot().byTab[TAB]).toEqual({
|
||||
root: ROOT, expanded: [ROOT], levels: { [ROOT]: { kind: 'ready', level: LEVEL } }, scrollTop: 40, autoRefresh: false,
|
||||
})
|
||||
const secondStream = await script.watches.ready(ROOT, 1)
|
||||
await script.settle({ ok: true, value: LEVEL })
|
||||
await secondStream.deliver('change')
|
||||
expect(script.list).toHaveBeenCalledTimes(2)
|
||||
|
||||
const third = createFilesStore().create()
|
||||
const thirdFace = bind(SESSION, third.actions)
|
||||
thirdFace.retain(TAB, { ...second.getSnapshot().byTab[TAB]!, scrollTop: 40 })
|
||||
thirdFace.start(TAB, '/work/other', controller.signal)
|
||||
expect(third.getSnapshot().byTab[TAB]).toEqual({ root: '/work/other', expanded: ['/work/other'], levels: {}, scrollTop: 0, autoRefresh: true })
|
||||
controller.abort()
|
||||
expect(third.getSnapshot().byTab[TAB]).toBeUndefined()
|
||||
expect(second.getSnapshot().byTab[TAB]).toBeDefined()
|
||||
expect(forgetFirst).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('ignores a tree retained by a binding that a later binding replaced', () => {
|
||||
const script = scriptedList()
|
||||
const bind = filesFace(script.list, script.watch)
|
||||
const controller = new AbortController()
|
||||
onTestFinished(async () => {
|
||||
controller.abort()
|
||||
await script.dispose()
|
||||
})
|
||||
const first = createFilesStore().create()
|
||||
const firstFace = bind(SESSION, first.actions)
|
||||
firstFace.start(TAB, ROOT, controller.signal)
|
||||
const second = createFilesStore().create()
|
||||
const secondFace = bind(SESSION, second.actions)
|
||||
secondFace.start(TAB, ROOT, controller.signal)
|
||||
secondFace.retain(TAB, { ...second.getSnapshot().byTab[TAB]!, scrollTop: 30 })
|
||||
firstFace.retain(TAB, { ...first.getSnapshot().byTab[TAB]!, scrollTop: 90 })
|
||||
const third = createFilesStore().create()
|
||||
bind(SESSION, third.actions).start(TAB, ROOT, controller.signal)
|
||||
expect(third.getSnapshot().byTab[TAB]?.scrollTop).toBe(30)
|
||||
})
|
||||
|
||||
it('forgets a closed tab, so a later record with its id starts fresh, and keeps the other tabs', async () => {
|
||||
const script = scriptedList()
|
||||
const bind = filesFace(script.list, script.watch)
|
||||
onTestFinished(() => script.dispose())
|
||||
const closed = new AbortController()
|
||||
const kept = new AbortController()
|
||||
onTestFinished(() => { kept.abort() })
|
||||
const other = 'tab-2' as TabId
|
||||
const first = createFilesStore().create()
|
||||
const firstFace = bind(SESSION, first.actions)
|
||||
firstFace.start(TAB, ROOT, closed.signal)
|
||||
firstFace.start(other, ROOT, kept.signal)
|
||||
firstFace.retain(other, { ...first.getSnapshot().byTab[other]!, scrollTop: 25 })
|
||||
const tree = { ...first.getSnapshot().byTab[TAB]!, scrollTop: 40 }
|
||||
firstFace.retain(TAB, tree)
|
||||
closed.abort()
|
||||
// A retain after the record ended has no tab to attach to.
|
||||
firstFace.retain(TAB, tree)
|
||||
const reopened = new AbortController()
|
||||
onTestFinished(() => { reopened.abort() })
|
||||
const second = createFilesStore().create()
|
||||
const secondFace = bind(SESSION, second.actions)
|
||||
secondFace.start(TAB, ROOT, reopened.signal)
|
||||
secondFace.start(other, ROOT, kept.signal)
|
||||
expect(second.getSnapshot().byTab[TAB]?.scrollTop).toBe(0)
|
||||
expect(second.getSnapshot().byTab[other]?.scrollTop).toBe(25)
|
||||
})
|
||||
})
|
||||
|
||||
describe('createList', () => {
|
||||
it('passes the session, the absolute path, and the signal through, and keeps entries and truncation', async () => {
|
||||
const listing: WorkspaceDirectoryListing = {
|
||||
|
||||
@@ -270,6 +270,37 @@ describe('FilesBody', () => {
|
||||
expect(back.container.querySelector('[data-files-body]')!.scrollTop).toBe(120)
|
||||
})
|
||||
|
||||
it('restores the tree and scroll offset under a new Session store and replaces the earlier watches', async () => {
|
||||
const { view, script, rebind, shared, tabActions } = mountBody()
|
||||
const child = `${ROOT}/src`
|
||||
const rootStream = await act(() => script.watches.ready(ROOT))
|
||||
await act(() => script.settle({ ok: true, value: ROOT_LEVEL }))
|
||||
act(() => { fireEvent.click(view.container.querySelector(`[data-files-path="${child}"] > button`)!) })
|
||||
const childStream = await act(() => script.watches.ready(child))
|
||||
await act(() => script.settle({ ok: true, value: { entries: [{ name: 'a.ts', type: 'file' }], truncated: false } }))
|
||||
fireEvent.scroll(view.container.querySelector('[data-files-body]')!, { target: { scrollTop: 120 } })
|
||||
view.unmount()
|
||||
|
||||
const back = await act(() => rebind())
|
||||
expect(rootStream.signal.aborted).toBe(true)
|
||||
expect(childStream.signal.aborted).toBe(true)
|
||||
expect(names(back.view.container)).toContain(`${child}/a.ts`)
|
||||
expect(back.view.container.querySelector('[data-files-body]')!.scrollTop).toBe(120)
|
||||
expect(back.instance.getSnapshot().byTab[TAB]!.expanded).toEqual([ROOT, child])
|
||||
fireEvent.contextMenu(back.view.getByRole('button', { name: 'a.ts' }), { clientX: 45, clientY: 56 })
|
||||
expect(shared.openContextMenu).toHaveBeenLastCalledWith('file', `${child}/a.ts`, 'pane-1', { x: 45, y: 56 })
|
||||
expect(tabActions.openResource).not.toHaveBeenCalled()
|
||||
await act(() => script.watches.ready(ROOT, 1))
|
||||
await act(() => script.settle({ ok: true, value: ROOT_LEVEL }))
|
||||
await act(() => script.watches.ready(child, 1))
|
||||
await act(() => script.settle({ ok: true, value: { entries: [{ name: 'b.ts', type: 'file' }], truncated: false } }))
|
||||
expect(names(back.view.container)).toContain(`${child}/b.ts`)
|
||||
expect(names(back.view.container)).not.toContain(`${child}/a.ts`)
|
||||
fireEvent.contextMenu(back.view.getByRole('button', { name: 'b.ts' }), { clientX: 50, clientY: 60 })
|
||||
expect(shared.openContextMenu).toHaveBeenLastCalledWith('file', `${child}/b.ts`, 'pane-1', { x: 50, y: 60 })
|
||||
expect(tabActions.openResource).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('a scroll before the owner aborts is not written to a forgotten bucket', async () => {
|
||||
const { view, script, controller, instance } = mountBody()
|
||||
await act(() => script.watches.ready(ROOT))
|
||||
|
||||
@@ -57,13 +57,16 @@ export interface Mounted {
|
||||
readonly tabActions: MockedTabActions
|
||||
/** Render a fresh body over the same store and face, as a tab switch remounts it. */
|
||||
readonly remount: () => RenderResult
|
||||
/** Render a fresh body over a new store instance and face, as returning to a released Session binding does. */
|
||||
readonly rebind: () => { readonly view: RenderResult; readonly instance: FilesStoreInstance }
|
||||
}
|
||||
|
||||
/** One store instance, one face, one owner share. */
|
||||
function harness(cwd: string | null, refreshShortcut?: ReturnType<FilesBodyProps['useTabInfo']>['tab']['refreshShortcut']) {
|
||||
const instance = createFilesStore().create()
|
||||
const script = scriptedList()
|
||||
const face = filesFace(script.list, script.watch)(SESSION, instance.actions)
|
||||
const bindFace = filesFace(script.list, script.watch)
|
||||
const instance = createFilesStore().create()
|
||||
const face = bindFace(SESSION, instance.actions)
|
||||
const controller = new AbortController()
|
||||
onTestFinished(async () => {
|
||||
controller.abort()
|
||||
@@ -76,6 +79,11 @@ function harness(cwd: string | null, refreshShortcut?: ReturnType<FilesBodyProps
|
||||
close: vi.fn<SidebarRightTabActions['close']>(),
|
||||
}
|
||||
const sessions = { byId: cwd === null ? {} : { [SESSION]: { cwd } } } as unknown as SessionListState
|
||||
const bind = (instance: FilesStoreInstance) => ({
|
||||
useStore: hookOf(instance),
|
||||
actions: instance.actions,
|
||||
...bindFace(SESSION, instance.actions),
|
||||
})
|
||||
const shared = {
|
||||
// A page tab's address is the shell's to mint; the body never reads it.
|
||||
useTabInfo: () => ({
|
||||
@@ -97,7 +105,7 @@ function harness(cwd: string | null, refreshShortcut?: ReturnType<FilesBodyProps
|
||||
...face,
|
||||
t: makeTranslate(zh),
|
||||
}
|
||||
return { instance, script, face, controller, tabActions, shared }
|
||||
return { instance, script, face, controller, tabActions, shared, bind }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +114,19 @@ function harness(cwd: string | null, refreshShortcut?: ReturnType<FilesBodyProps
|
||||
* @param refreshShortcut - effective binding advertised by the tab owner.
|
||||
*/
|
||||
export function mountBody(cwd: string | null = ROOT, refreshShortcut?: ReturnType<FilesBodyProps['useTabInfo']>['tab']['refreshShortcut']): Mounted {
|
||||
const { shared, ...hands } = harness(cwd, refreshShortcut)
|
||||
const view = render(<FilesBody {...shared as unknown as FilesBodyProps} />)
|
||||
return { ...hands, shared, view, remount: () => render(<FilesBody {...shared as unknown as FilesBodyProps} />) }
|
||||
const { shared: base, bind, ...hands } = harness(cwd, refreshShortcut)
|
||||
const draw = (store?: ReturnType<typeof bind>) => {
|
||||
const shared = { ...base, ...store }
|
||||
return render(<FilesBody {...shared as unknown as FilesBodyProps} />)
|
||||
}
|
||||
return {
|
||||
...hands,
|
||||
shared: base,
|
||||
view: draw(),
|
||||
remount: () => draw(),
|
||||
rebind: () => {
|
||||
const instance = createFilesStore().create()
|
||||
return { instance, view: draw(bind(instance)) }
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import yaml from 'js-yaml'
|
||||
import { expect, it } from 'vitest'
|
||||
|
||||
it('presents common packaging fields in the same order with the same defaults', () => {
|
||||
const workflows = ['macos-package.yml', 'macos-intel-package.yml', 'windows-package.yml'].map(name =>
|
||||
yaml.load(readFileSync(resolve(import.meta.dirname, '../.github/workflows', name), 'utf8')) as {
|
||||
on: { workflow_dispatch: { inputs: Record<string, Record<string, unknown>> } }
|
||||
})
|
||||
const common = ['source_ref', 'preset', 'update_channel', 'version_mode', 'build_version', 'test_release_id', 'compression_level']
|
||||
const reference = workflows[0]!.on.workflow_dispatch.inputs
|
||||
for (const workflow of workflows) {
|
||||
const inputs = workflow.on.workflow_dispatch.inputs
|
||||
expect(Object.keys(inputs).slice(0, common.length)).toEqual(common)
|
||||
for (const field of common) {
|
||||
const { description: _description, ...settings } = inputs[field]!
|
||||
const { description: _referenceDescription, ...expected } = reference[field]!
|
||||
expect(settings).toEqual(expected)
|
||||
if (field !== 'compression_level') expect(inputs[field]).toEqual(reference[field])
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,70 +1,88 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import yaml from 'js-yaml'
|
||||
import { expect, it } from 'vitest'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const workflow = yaml.load(readFileSync(resolve(import.meta.dirname, '../.github/workflows/macos-package.yml'), 'utf8')) as {
|
||||
on: Record<string, unknown>
|
||||
permissions: Record<string, string>
|
||||
concurrency: { group: string; 'cancel-in-progress': boolean }
|
||||
jobs: Record<string, {
|
||||
'runs-on': string[]
|
||||
env: Record<string, string>
|
||||
steps: Array<{
|
||||
id?: string
|
||||
name?: string
|
||||
if?: string
|
||||
uses?: string
|
||||
run?: string
|
||||
env?: Record<string, string>
|
||||
with?: Record<string, unknown>
|
||||
describe.each(['arm64', 'x64'])('macOS %s packaging', (arch) => {
|
||||
const filename = arch === 'arm64' ? 'macos-package.yml' : 'macos-intel-package.yml'
|
||||
const workflow = yaml.load(readFileSync(resolve(import.meta.dirname, `../.github/workflows/${filename}`), 'utf8')) as {
|
||||
on: Record<string, unknown>
|
||||
permissions: Record<string, string>
|
||||
concurrency: { group: string; 'cancel-in-progress': boolean }
|
||||
jobs: Record<string, {
|
||||
'runs-on': string[]
|
||||
env: Record<string, string>
|
||||
steps: Array<{
|
||||
id?: string
|
||||
name?: string
|
||||
if?: string
|
||||
uses?: string
|
||||
run?: string
|
||||
env?: Record<string, string>
|
||||
with?: Record<string, unknown>
|
||||
}>
|
||||
}>
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
it('confines signed Mac packaging to manual dispatch and a dedicated Apple Silicon runner', () => {
|
||||
expect(Object.keys(workflow.on)).toEqual(['workflow_dispatch'])
|
||||
expect(workflow.jobs.package).not.toHaveProperty('name')
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { test_release_id: { type: 'string', default: '', required: false } } })
|
||||
expect(workflow.on.workflow_dispatch).not.toHaveProperty('inputs.publish')
|
||||
expect(workflow.permissions).toEqual({ contents: 'read' })
|
||||
expect(workflow.concurrency).toEqual({ group: 'macos-desktop-package', 'cancel-in-progress': false })
|
||||
expect(workflow.jobs.package!['runs-on']).toEqual(['self-hosted', 'macOS', 'ARM64', 'dsh-mac-package-trial'])
|
||||
const steps = workflow.jobs.package!.steps
|
||||
expect(steps.find(step => step.id === 'checkout')?.with).toMatchObject({ 'persist-credentials': false, clean: true })
|
||||
for (const step of steps) expect(step.run ?? '').not.toContain('${{ inputs.')
|
||||
const uploads = steps.filter(step => step.uses?.startsWith('actions/upload-artifact@'))
|
||||
expect(uploads).toHaveLength(2)
|
||||
expect(uploads[0]?.if).toBe("always() && steps.checkout.outcome == 'success'")
|
||||
expect(uploads[1]?.if).toBe('success()')
|
||||
expect(uploads[1]?.with?.path).toBe('${{ steps.retained.outputs.directory }}/*')
|
||||
expect(uploads[1]?.with?.['compression-level']).toBe(0)
|
||||
})
|
||||
it('confines signed Mac packaging to manual dispatch and a dedicated Apple Silicon runner', () => {
|
||||
expect(Object.keys(workflow.on)).toEqual(['workflow_dispatch'])
|
||||
expect(workflow.jobs.package).not.toHaveProperty('name')
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { test_release_id: { type: 'string', default: '', required: false } } })
|
||||
expect(workflow.on.workflow_dispatch).not.toHaveProperty('inputs.publish')
|
||||
expect(workflow.permissions).toEqual({ contents: 'read' })
|
||||
expect(workflow.concurrency).toEqual({ group: 'macos-desktop-package', 'cancel-in-progress': false })
|
||||
expect(workflow.jobs.package!['runs-on']).toEqual(['self-hosted', 'macOS', 'ARM64', 'dsh-mac-package-trial'])
|
||||
const steps = workflow.jobs.package!.steps
|
||||
expect(steps.find(step => step.id === 'checkout')?.with).toMatchObject({ 'persist-credentials': false, clean: true })
|
||||
for (const step of steps) expect(step.run ?? '').not.toContain('${{ inputs.')
|
||||
const uploads = steps.filter(step => step.uses?.startsWith('actions/upload-artifact@'))
|
||||
expect(uploads).toHaveLength(2)
|
||||
expect(uploads[0]?.if).toBe("always() && steps.checkout.outcome == 'success'")
|
||||
expect(uploads[1]?.if).toBe('success()')
|
||||
expect(uploads[1]?.with?.path).toBe('${{ steps.retained.outputs.directory }}/*')
|
||||
expect(uploads[1]?.with?.['compression-level']).toBe(0)
|
||||
})
|
||||
|
||||
it('defaults to notarization and labels the explicit debugging option', () => {
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { skip_notarization: {
|
||||
type: 'boolean', default: false,
|
||||
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选',
|
||||
} } })
|
||||
const steps = workflow.jobs.package!.steps
|
||||
expect(steps.filter(step => step.run?.includes('args+=(--skip-notarization)'))).toHaveLength(2)
|
||||
expect(steps.find(step => step.name === 'Retain installers for the selected mode')?.with?.name).toContain('${{ steps.settings.outputs.mode }}')
|
||||
})
|
||||
it('defaults to notarization and labels the explicit debugging option', () => {
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { skip_notarization: {
|
||||
type: 'boolean', default: false,
|
||||
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选',
|
||||
} } })
|
||||
const steps = workflow.jobs.package!.steps
|
||||
expect(steps.filter(step => step.run?.includes('args+=(--skip-notarization)'))).toHaveLength(2)
|
||||
expect(steps.find(step => step.name === 'Retain installers for the selected mode')?.with?.name).toContain('${{ steps.settings.outputs.mode }}')
|
||||
})
|
||||
|
||||
it('retains build inputs outside checkout and run-specific pnpm installations', () => {
|
||||
const env = workflow.jobs.package!.env
|
||||
expect(JSON.stringify(env)).not.toContain('runner.')
|
||||
const steps = workflow.jobs.package!.steps
|
||||
const cache = steps.find(step => step.name === 'Configure persistent package caches')!
|
||||
expect(cache.env?.DSH_DESKTOP_PACKAGE_CACHE_DIR).toBe('${{ runner.tool_cache }}/dsh-desktop-package-cache')
|
||||
expect(cache.run).toContain('PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store')
|
||||
expect(cache.run).toContain('DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR')
|
||||
expect(steps.indexOf(cache)).toBeLessThan(steps.findIndex(step => step.name === 'Install locked dependencies'))
|
||||
})
|
||||
it('retains build inputs outside checkout and run-specific pnpm installations', () => {
|
||||
const env = workflow.jobs.package!.env
|
||||
expect(JSON.stringify(env)).not.toContain('runner.')
|
||||
const steps = workflow.jobs.package!.steps
|
||||
const cache = steps.find(step => step.name === 'Configure persistent package caches')!
|
||||
expect(cache.env?.DSH_DESKTOP_PACKAGE_CACHE_DIR).toBe('${{ runner.tool_cache }}/dsh-desktop-package-cache')
|
||||
expect(cache.run).toContain('PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store')
|
||||
expect(cache.run).toContain('DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR')
|
||||
expect(steps.indexOf(cache)).toBeLessThan(steps.findIndex(step => step.name === 'Install locked dependencies'))
|
||||
})
|
||||
|
||||
it('offers ZIP compression choices with a fast default', () => {
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { zip_compression_level: {
|
||||
type: 'choice', options: ['3', '7'], default: '3', required: true,
|
||||
} } })
|
||||
expect(workflow.jobs.package!.env.PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL).toBe('${{ inputs.zip_compression_level }}')
|
||||
it('offers ZIP compression choices with a fast default', () => {
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { compression_level: {
|
||||
type: 'choice', options: ['3', '7'], default: '3', required: true,
|
||||
} } })
|
||||
expect(workflow.jobs.package!.env.PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL).toBe('${{ inputs.compression_level }}')
|
||||
})
|
||||
|
||||
it('passes the same target to preparation, packaging and retention', () => {
|
||||
const job = workflow.jobs.package!
|
||||
expect(job.env.DSH_DESKTOP_TARGET_PLATFORM).toBe('darwin')
|
||||
expect(job.env.DSH_DESKTOP_TARGET_ARCH).toBe(arch)
|
||||
const builds = job.steps.filter(step => step.run?.includes('pnpm run package:desktop:mac:'))
|
||||
expect(builds).toHaveLength(2)
|
||||
for (const step of builds) expect(step.run).toContain(`package:desktop:mac:${arch}`)
|
||||
expect(job.steps.find(step => step.name === 'Retain installers for the selected mode')?.with?.name).toContain(`macos-${arch}-`)
|
||||
if (arch === 'x64') {
|
||||
const rosetta = job.steps.findIndex(step => step.run === 'arch -x86_64 /usr/bin/true')
|
||||
expect(rosetta).toBeGreaterThan(-1)
|
||||
expect(rosetta).toBeLessThan(job.steps.findIndex(step => step.name === 'Install locked dependencies'))
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -645,7 +645,7 @@
|
||||
"1bbd18e22567ce0529d02b770533f9bda84ff379b161dda8b9548053a18a0e97": 1
|
||||
},
|
||||
"packages/client/ui-sidebar-files/tests/mount.client.tsx": {
|
||||
"2caa9ae382deea09b4ac64586c1ab49bd935b1e689218e3d485bd7b918e22066": 2,
|
||||
"2caa9ae382deea09b4ac64586c1ab49bd935b1e689218e3d485bd7b918e22066": 1,
|
||||
"684eae6dc3d4dbe526c5a5b11ebd84e35e335bebd519cf09c0f3a24ba9280fc1": 1
|
||||
},
|
||||
"packages/client/ui-sidebar-files/tests/watch.client.spec.ts": {
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
}
|
||||
```
|
||||
|
||||
## B restored: normal mode and collapsed Files directory
|
||||
## B restored: normal mode and expanded Files directory
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -249,7 +249,9 @@
|
||||
"panelOuterWidth": 756,
|
||||
"coversViewport": false,
|
||||
"resizeHandleWidth": 8,
|
||||
"expandedDirectories": [],
|
||||
"expandedDirectories": [
|
||||
"workspace"
|
||||
],
|
||||
"panes": [
|
||||
{
|
||||
"active": true,
|
||||
|
||||
Reference in new issue
Block a user