From 2a7e030b3bd91c941da4872d0d197a5fc72b6ab0 Mon Sep 17 00:00:00 2001 From: figmar Date: Sun, 6 Sep 2026 18:09:09 +0800 Subject: [PATCH] chore: fork dsh-better-sidebar v0.18.0 as dsh-apes-sidebar v1.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename dsh-better-sidebar → dsh-apes-sidebar across 74 files (262 occurrences) - Bump version 0.18.0 → 1.0.0 (package.json + dsh.plugin.json + SIDEBAR_SERVICE_VERSION) - Add forkedFrom metadata to package.json (upstream pin: commit 9e1a034) - Add fork notice banner to README.md (MIT attribution preserved) - Keep original MIT copyright (c) 2026 dsh-external - Full gate green: typecheck + build (6 bundles) + test (1241 passed / 9 skipped) --- .github/ISSUE_TEMPLATE/issue_report.yml | 6 +-- .github/workflows/ci.yml | 6 +-- .github/workflows/release.yml | 6 +-- README.md | 4 +- cordis.patch.yml | 14 +++---- dsh.plugin.json | 4 +- package.json | 12 ++++-- scripts/check-consumer-types.sh | 24 +++++------ scripts/e2e-aggregate-mount.sh | 6 +-- scripts/e2e-common.sh | 6 +-- scripts/e2e-mount.sh | 14 +++---- scripts/install.sh | 20 +++++----- scripts/package-registry.mjs | 4 +- src/client/RenderBoundary.tsx | 4 +- src/client/Sidebar.tsx | 6 +-- src/client/SubagentView.tsx | 4 +- src/client/TerminalView.tsx | 4 +- src/client/chunk-loader.ts | 8 ++-- src/client/chunks/editor.tsx | 2 +- src/client/chunks/terminal.tsx | 2 +- src/client/conversation-draft.ts | 8 ++-- src/client/index.tsx | 28 ++++++------- src/client/intercept.tsx | 4 +- src/client/lang.ts | 2 +- src/client/lazy-chunk.tsx | 2 +- src/client/locales-ar.ts | 4 +- src/client/locales-de.ts | 4 +- src/client/locales-fr.ts | 4 +- src/client/locales-hi.ts | 4 +- src/client/locales-id.ts | 4 +- src/client/locales-it.ts | 6 +-- src/client/locales-ja.ts | 4 +- src/client/locales-ko.ts | 4 +- src/client/locales-nl.ts | 4 +- src/client/locales-pl.ts | 4 +- src/client/locales-pt.ts | 4 +- src/client/locales-ru.ts | 4 +- src/client/locales-sv.ts | 4 +- src/client/locales-th.ts | 4 +- src/client/locales-tr.ts | 4 +- src/client/locales-vi.ts | 4 +- src/client/locales-zh-HK.ts | 4 +- src/client/locales-zh-MO.ts | 4 +- src/client/locales-zh-TW.ts | 4 +- src/client/locales.ts | 8 ++-- src/client/plugins-shared.ts | 4 +- src/client/plugins-tabs.ts | 40 +++++++++---------- src/client/service.ts | 12 +++--- src/client/settings-nav-icon.ts | 2 +- src/config.ts | 2 +- src/context-types.ts | 4 +- src/index.ts | 28 ++++++------- src/invariant.ts | 8 ++-- src/jobs-routes.ts | 2 +- src/prefs-shared.ts | 2 +- src/pty-deps.ts | 2 +- src/sidechat-core.ts | 2 +- tests/consumer-types.ts | 2 +- tests/e2e/desktop-layout.e2e.ts | 2 +- tests/e2e/drag-layout.e2e.ts | 34 ++++++++-------- tests/e2e/float-window.e2e.ts | 14 +++---- tests/e2e/mount.e2e.ts | 22 +++++----- tests/e2e/perf.e2e.ts | 12 +++--- tests/e2e/toggle-layout.e2e.ts | 2 +- .../aggregate-better-sidebar/cordis.patch.yml | 4 +- tests/git-worktree.spec.ts | 4 +- tests/git.spec.ts | 2 +- tests/install-powershell.spec.ts | 4 +- tests/plugin-shape.spec.ts | 6 +-- tests/pty-deps.spec.ts | 12 +++--- tests/sidechat-routes.spec.ts | 2 +- tests/smoke.spec.ts | 4 +- tests/terminal-deps-banner.spec.tsx | 2 +- tests/turn-tail-intercept.spec.ts | 2 +- tsdown.config.ts | 18 ++++----- 75 files changed, 275 insertions(+), 267 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/issue_report.yml b/.github/ISSUE_TEMPLATE/issue_report.yml index 8eb22e2..f4486b3 100644 --- a/.github/ISSUE_TEMPLATE/issue_report.yml +++ b/.github/ISSUE_TEMPLATE/issue_report.yml @@ -16,7 +16,7 @@ body: options: - label: 我已搜索现有 issue,确认没有**完全相同**的条目(只有完全一致才算重复)| I searched existing issues and confirmed there is no **exact duplicate** (only exactly identical issues count as duplicates) required: true - - label: 我已确认使用最新版本 dsh-better-sidebar / I confirmed I am on the latest dsh-better-sidebar version + - label: 我已确认使用最新版本 dsh-apes-sidebar / I confirmed I am on the latest dsh-apes-sidebar version required: false - type: dropdown @@ -58,8 +58,8 @@ body: id: plugin-version attributes: label: 插件版本 / Plugin version - description: dsh-better-sidebar 的版本号 | The dsh-better-sidebar version - placeholder: "如 0.13.1(`dsh plugin --profile web add dsh-better-sidebar@latest` 安装的版本)" + description: dsh-apes-sidebar 的版本号 | The dsh-apes-sidebar version + placeholder: "如 0.13.1(`dsh plugin --profile web add dsh-apes-sidebar@latest` 安装的版本)" validations: required: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da30813..a60e2b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: # config; the runner has none by default. - name: Configure git identity for tests run: | - git config --global user.name "dsh-better-sidebar-ci" + git config --global user.name "dsh-apes-sidebar-ci" git config --global user.email "ci@dsh.invalid" - name: Install dependencies run: pnpm install --frozen-lockfile @@ -82,7 +82,7 @@ jobs: # identity and rely on ambient config, which the runner lacks. - name: Configure git identity for tests run: | - git config --global user.name "dsh-better-sidebar-ci" + git config --global user.name "dsh-apes-sidebar-ci" git config --global user.email "ci@dsh.invalid" - name: Install dependencies run: pnpm install --frozen-lockfile @@ -143,7 +143,7 @@ jobs: run: pnpm test:mount # Aggregate double-mount regression: a fixture aggregate bundle mounts - # dsh-better-sidebar under its own entry id BEFORE the plugin's bundle + # dsh-apes-sidebar under its own entry id BEFORE the plugin's bundle # row; the plugin must back off (no duplicate /sidebar/api, boot OK). # Uses the pinned DSH CLI installed above. - name: Aggregate double-mount regression diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 670dfa7..f811c66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: Release -# Publishes `dsh-better-sidebar` to npm via npm Trusted Publishing (OIDC) — +# Publishes `dsh-apes-sidebar` to npm via npm Trusted Publishing (OIDC) — # no NPM_TOKEN secret required, provenance is attached to the tarball. # # Trigger: a GitHub Release is published (tag vX.Y.Z). The tag MUST match @@ -12,7 +12,7 @@ name: Release # supports the stable DSH line); stable versions publish as `latest`. # # One-time npm-side setup (manual, on npmjs.com): -# 1. package `dsh-better-sidebar` -> Settings -> Publishing access +# 1. package `dsh-apes-sidebar` -> Settings -> Publishing access # -> Trusted Publishers -> "Add Trusted Publisher". # 2. Provider: GitHub Actions # Organization or user: omdsh-dev @@ -66,7 +66,7 @@ jobs: # (see tests/smoke.spec.ts); the runner has none by default. - name: Configure git identity for tests run: | - git config --global user.name "dsh-better-sidebar-ci" + git config --global user.name "dsh-apes-sidebar-ci" git config --global user.email "ci@dsh.invalid" - name: Install dependencies diff --git a/README.md b/README.md index 4fcc7b9..454e759 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# dsh-better-sidebar +# dsh-apes-sidebar + +> **Fork notice** — This project is a fork of [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) v0.18.0 (commit `9e1a034`), distributed under the MIT License. Original copyright (c) 2026 dsh-external. This fork adds the `apes:*` information-layer tabs (tasks / agents / apps / messages / profile) on top of the upstream sidebar. See `package.json → forkedFrom` for the exact upstream pin.
diff --git a/cordis.patch.yml b/cordis.patch.yml index 420076f..aad107d 100644 --- a/cordis.patch.yml +++ b/cordis.patch.yml @@ -1,12 +1,12 @@ -# dsh-better-sidebar bundle patch +# dsh-apes-sidebar bundle patch # # This file is the `dsh.bundle.patch` layer of the published npm package: when # the plugin is installed through the official CLI — # -# dsh plugin --profile add dsh-better-sidebar@ +# dsh plugin --profile add dsh-apes-sidebar@ # # — the command reconciles `dsh.profile.bundles` against installed packages -# and, seeing this declaration, appends `dsh-better-sidebar` to the bundle +# and, seeing this declaration, appends `dsh-apes-sidebar` to the bundle # stack. The profile boot then merges THIS patch (a single `insert` of the # plugin row) exactly like the manual cordis.patch.yml mount line used # before. No profile file edits needed — one command installs and mounts. @@ -23,7 +23,7 @@ # # - insert: # - id: better-sidebar -# name: 'dsh-better-sidebar' +# name: 'dsh-apes-sidebar' # config: # shell: /bin/zsh # shellArgs: @@ -35,7 +35,7 @@ # `web-ui-better-sidebar`). Two mounts register /sidebar/api twice and fail the # whole plugin tree at boot ("duplicate prefix route"). The `!!js` disabled # expression backs THIS row off when another *enabled* entry already mounts -# `dsh-better-sidebar`; the aggregate instance then owns the sidebar. The +# `dsh-apes-sidebar`; the aggregate instance then owns the sidebar. The # loader evaluates it when this row is processed (entry-list order, only rows # before this one are visible), so the aggregate bundle must precede this one # in `dsh.profile.bundles` — the standard install order, since `dsh plugin add` @@ -45,5 +45,5 @@ # fail loudly at the loader as before. - insert: - id: better-sidebar - name: 'dsh-better-sidebar' - disabled: !!js "[...ctx.loader.entries()].some((e) => e.options.name === 'dsh-better-sidebar' && e.options.id !== 'better-sidebar' && !e.disabled)" + name: 'dsh-apes-sidebar' + disabled: !!js "[...ctx.loader.entries()].some((e) => e.options.name === 'dsh-apes-sidebar' && e.options.id !== 'better-sidebar' && !e.disabled)" diff --git a/dsh.plugin.json b/dsh.plugin.json index c35dda3..d140fce 100644 --- a/dsh.plugin.json +++ b/dsh.plugin.json @@ -1,6 +1,6 @@ { - "id": "dsh-external/dsh-better-sidebar", - "version": "0.18.0", + "id": "dsh-external/dsh-apes-sidebar", + "version": "1.0.0", "main": "./lib/index.js", "description": "VSCode 风格右侧侧边栏:文件资源管理器 / 编辑器 / 终端 / Git / 浏览器,按会话隔离。暴露服务供其他插件注册侧边栏页面和文件预览器", "engines": { diff --git a/package.json b/package.json index 4d9de77..d0164b2 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,18 @@ { - "name": "dsh-better-sidebar", - "version": "0.18.0", - "description": "DSH web plugin: a VSCode-like right sidebar (explorer / editor / terminal / git / browser), isolated per conversation session. Exposes a service for other plugins to register sidebar tabs and file viewers.", + "name": "dsh-apes-sidebar", + "version": "1.0.0", + "description": "APE fork of dsh-better-sidebar v0.18.0: VSCode-like right sidebar (explorer / editor / terminal / git / browser) + apes:* information-layer tabs (tasks / agents / apps / messages / profile). Forked from omdsh-dev/DSH-better-sidebar under MIT.", "type": "module", "repository": { "type": "git", "url": "https://github.com/omdsh-dev/DSH-better-sidebar" }, + "forkedFrom": { + "name": "dsh-better-sidebar", + "version": "0.18.0", + "commit": "9e1a034", + "url": "https://github.com/omdsh-dev/DSH-better-sidebar" + }, "publishConfig": { "access": "public" }, diff --git a/scripts/check-consumer-types.sh b/scripts/check-consumer-types.sh index 51b9ccd..f66f81e 100755 --- a/scripts/check-consumer-types.sh +++ b/scripts/check-consumer-types.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Consumer-facing type surface check: build a tiny standalone consumer that -# imports `dsh-better-sidebar/client/service` WITHOUT @types/node and with +# imports `dsh-apes-sidebar/client/service` WITHOUT @types/node and with # skipLibCheck: false, then type-check it with the repo's tsc. # # This is the exact scenario the v0.12.0 API work cares about: the shipped @@ -35,14 +35,14 @@ mkdir -p "$WORK/node_modules" # (GetFinalPathNameByHandle on Windows) expands junctions, which bash-level # resolution may leave untouched; node is guaranteed here (tsc runs below). resolve_dir() { node -e 'process.stdout.write(require("node:fs").realpathSync.native(process.argv[1]))' "$1"; } -ln -s "$(resolve_dir "$(pwd)")" "$WORK/node_modules/dsh-better-sidebar" +ln -s "$(resolve_dir "$(pwd)")" "$WORK/node_modules/dsh-apes-sidebar" # The vendored cordis base (and, through its realpath, cosmokit / standard-schema) # must resolve so the consumer can type `Context` against the DSH runtime scope. mkdir -p "$WORK/node_modules/@deepseek-ai" ln -s "$(resolve_dir "$(pwd)/node_modules/@deepseek-ai/cordis")" "$WORK/node_modules/@deepseek-ai/cordis" # Loud guard: both links must resolve to a package root, or tsc below would # report misleading module-resolution errors. -for pkg_json in "$WORK/node_modules/dsh-better-sidebar/package.json" "$WORK/node_modules/@deepseek-ai/cordis/package.json"; do +for pkg_json in "$WORK/node_modules/dsh-apes-sidebar/package.json" "$WORK/node_modules/@deepseek-ai/cordis/package.json"; do if [ ! -f "$pkg_json" ]; then echo "[check-consumer-types] FAIL: $pkg_json does not resolve (broken link). Link layer:" >&2 ls -la "$WORK/node_modules" "$WORK/node_modules/@deepseek-ai" >&2 || true @@ -51,14 +51,14 @@ for pkg_json in "$WORK/node_modules/dsh-better-sidebar/package.json" "$WORK/node done cat > "$WORK/check.ts" <<'EOF' -import { SIDEBAR_FEATURES, SIDEBAR_SERVICE_VERSION } from 'dsh-better-sidebar/client/service' -import type {} from 'dsh-better-sidebar/client/service' +import { SIDEBAR_FEATURES, SIDEBAR_SERVICE_VERSION } from 'dsh-apes-sidebar/client/service' +import type {} from 'dsh-apes-sidebar/client/service' import type { BetterSidebarService, FileViewerDescriptor, OpenTabSeed, SidebarSettingsRenderProps, TabComponentProps, TabDescriptor, -} from 'dsh-better-sidebar/client/service' -import type { SessionScope, SidebarSnapshot, SidebarState, SidebarStore, SidebarTab } from 'dsh-better-sidebar/client/service' -import type { SidebarPrefs } from 'dsh-better-sidebar/client/service' +} from 'dsh-apes-sidebar/client/service' +import type { SessionScope, SidebarSnapshot, SidebarState, SidebarStore, SidebarTab } from 'dsh-apes-sidebar/client/service' +import type { SidebarPrefs } from 'dsh-apes-sidebar/client/service' // The vendored-cordis path: `Context` from '@deepseek-ai/cordis' plus the // side-effect type import above must expose `ctx.betterSidebar` — the consumer // never needs to import this package's own Context type. @@ -126,14 +126,14 @@ set -e # Fail only on errors that mention OUR package / declarations / the fixture. # Upstream noise (vendored cordis / cosmokit declaration warnings under the # repo's pinned TS lib) lives anywhere under node_modules and is filtered. -if grep -E "dsh-better-sidebar|lib/types|check\.ts" "$WORK/strict.log" | grep -vE "node_modules/[^ ]*(cordis|cosmokit)"; then - echo "[check-consumer-types] FAIL: errors in the dsh-better-sidebar declaration surface:" >&2 - grep -E "dsh-better-sidebar|lib/types|check\.ts" "$WORK/strict.log" >&2 +if grep -E "dsh-apes-sidebar|lib/types|check\.ts" "$WORK/strict.log" | grep -vE "node_modules/[^ ]*(cordis|cosmokit)"; then + echo "[check-consumer-types] FAIL: errors in the dsh-apes-sidebar declaration surface:" >&2 + grep -E "dsh-apes-sidebar|lib/types|check\.ts" "$WORK/strict.log" >&2 exit 1 fi if [ "$STATUS" -ne 0 ]; then echo "[check-consumer-types] pass 2 note: strict mode only reports upstream declaration noise:" - grep -v "dsh-better-sidebar\|lib/types\|check\.ts" "$WORK/strict.log" | head -5 || true + grep -v "dsh-apes-sidebar\|lib/types\|check\.ts" "$WORK/strict.log" | head -5 || true fi echo "[check-consumer-types] OK: the client/service declaration surface is node-free and self-contained." diff --git a/scripts/e2e-aggregate-mount.sh b/scripts/e2e-aggregate-mount.sh index 322e847..53eab1b 100755 --- a/scripts/e2e-aggregate-mount.sh +++ b/scripts/e2e-aggregate-mount.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash # ============================================================================= -# dsh-better-sidebar 聚合双挂载冒烟(CI + 本地): +# dsh-apes-sidebar 聚合双挂载冒烟(CI + 本地): # # 场景:一个聚合 bundle(tests/fixtures/aggregate-better-sidebar)先以独立 -# 条目 id 挂载 dsh-better-sidebar,插件自身的 bundle patch 后到 —— 旧行为 +# 条目 id 挂载 dsh-apes-sidebar,插件自身的 bundle patch 后到 —— 旧行为 # 两个实例都注册 /sidebar/api,整个插件树启动失败(duplicate prefix # route);新行为插件行检测到已有启用中的同包名挂载后自动 disabled,由 # 聚合行接管 sidebar。 @@ -22,7 +22,7 @@ # 环境变量(均可省略): # DSH_CMD dsh 命令;缺省 PATH 上的 `dsh`,回退 npx 拉官方包 # (同 e2e-mount.sh) -# TARBALL 插件 tarball;缺省仓库根 dsh-better-sidebar-*.tgz(须已 pack) +# TARBALL 插件 tarball;缺省仓库根 dsh-apes-sidebar-*.tgz(须已 pack) # PORT 固定端口(默认 0 = OS 分配,从日志解析 URL) # DSH_HOME_BASE scratch 根目录(默认系统临时目录)。脚本始终在其下新建 # 本调用拥有的独立子目录,只写入/删除该子目录;调用方提供 diff --git a/scripts/e2e-common.sh b/scripts/e2e-common.sh index 4d7989b..739f61f 100644 --- a/scripts/e2e-common.sh +++ b/scripts/e2e-common.sh @@ -57,9 +57,9 @@ e2e_resolve_dsh_cmd() { # 过期产物上。未找到候选时返回非零,由调用方按各自文案 die。 e2e_resolve_tarball() { if [ -z "${TARBALL:-}" ]; then - TARBALL="$(ls -t "$ROOT"/dsh-better-sidebar-*.tgz 2>/dev/null | head -1 || true)" + TARBALL="$(ls -t "$ROOT"/dsh-apes-sidebar-*.tgz 2>/dev/null | head -1 || true)" local count - count="$(ls "$ROOT"/dsh-better-sidebar-*.tgz 2>/dev/null | wc -l | tr -d ' ' || true)" + count="$(ls "$ROOT"/dsh-apes-sidebar-*.tgz 2>/dev/null | wc -l | tr -d ' ' || true)" [ "$count" -le 1 ] || warn "发现 $count 个 tarball,按 mtime 选用最新:$(basename "$TARBALL")(建议清理其余)" fi [ -n "$TARBALL" ] && [ -f "$TARBALL" ] @@ -134,7 +134,7 @@ allowBuilds: protobufjs: true minimumReleaseAgeExclude: - - dsh-better-sidebar + - dsh-apes-sidebar - '@deepseek-ai/*' EOF } diff --git a/scripts/e2e-mount.sh b/scripts/e2e-mount.sh index feeef7e..005b4e4 100755 --- a/scripts/e2e-mount.sh +++ b/scripts/e2e-mount.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # ============================================================================= -# dsh-better-sidebar 挂载冒烟编排(CI + 本地): +# dsh-apes-sidebar 挂载冒烟编排(CI + 本地): # # 1. 用官方 CLI 把 npm 打包产物(tarball)真实挂载进一个全新 scratch # profile(`dsh plugin --profile web add file:`,触发 @@ -14,7 +14,7 @@ # # 环境变量(均可省略): # DSH_CMD dsh 命令;缺省 PATH 上的 `dsh`,回退 npx 拉官方包 -# TARBALL 插件 tarball;缺省仓库根 dsh-better-sidebar-*.tgz(须已 pack) +# TARBALL 插件 tarball;缺省仓库根 dsh-apes-sidebar-*.tgz(须已 pack) # PORT 固定端口(默认 0 = OS 分配,从日志解析 URL) # DSH_HOME_BASE 覆盖 scratch 根目录(默认系统临时目录)。脚本始终在其下 # 新建本调用拥有的独立子目录,只写入/删除该子目录;调用方 @@ -44,7 +44,7 @@ e2e_require_cmd pnpm "dsh plugin 转发给 pnpm" e2e_resolve_dsh_cmd -e2e_resolve_tarball || die "找不到 tarball(TARBALL 或 \$ROOT/dsh-better-sidebar-*.tgz)——先运行 pnpm build && pnpm pack" +e2e_resolve_tarball || die "找不到 tarball(TARBALL 或 \$ROOT/dsh-apes-sidebar-*.tgz)——先运行 pnpm build && pnpm pack" TARBALL="$(cd "$(dirname "$TARBALL")" && pwd)/$(basename "$TARBALL")" say "tarball: $TARBALL" @@ -72,18 +72,18 @@ e2e_write_profile "$PROFILE_DIR" say "执行 dsh plugin --profile web add file:$TARBALL ..." $DSH_CMD plugin --profile web add "file:$TARBALL" -# 步骤 3:校验挂载生效(dsh.profile.bundles 含 dsh-better-sidebar) +# 步骤 3:校验挂载生效(dsh.profile.bundles 含 dsh-apes-sidebar) if ! node -e ' const fs = require("fs"); const p = JSON.parse(fs.readFileSync(process.argv[1], "utf8")); const bundles = p.dsh?.profile?.bundles ?? []; - process.exit(bundles.includes("dsh-better-sidebar") ? 0 : 1); + process.exit(bundles.includes("dsh-apes-sidebar") ? 0 : 1); ' "$PROFILE_DIR/package.json"; then - warn "dsh-better-sidebar 未出现在 dsh.profile.bundles 中——挂载未注册" + warn "dsh-apes-sidebar 未出现在 dsh.profile.bundles 中——挂载未注册" cat "$PROFILE_DIR/package.json" exit 1 fi -say "挂载已注册:dsh.profile.bundles 包含 dsh-better-sidebar" +say "挂载已注册:dsh.profile.bundles 包含 dsh-apes-sidebar" # 步骤 4:启动 dsh web(--port 0 = OS 分配,避免端口冲突;keyless 可起) say "启动 dsh web(port=${PORT})..." diff --git a/scripts/install.sh b/scripts/install.sh index f43672d..853d1cf 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash # ============================================================================= -# dsh-better-sidebar 一键安装脚本(官方 CLI 方式,macOS / Linux / Windows Git Bash) +# dsh-apes-sidebar 一键安装脚本(官方 CLI 方式,macOS / Linux / Windows Git Bash) # # 通过 DSH 官方插件命令安装 npm 包并自动挂载: -# dsh plugin --profile web add dsh-better-sidebar@ +# dsh plugin --profile web add dsh-apes-sidebar@ # # 包内声明了 dsh.bundle.patch(cordis.patch.yml):CLI 的 bundle 协调会把它 # 自动加进 profile 的 dsh.profile.bundles,下次启动即挂载——无需手动写 @@ -38,8 +38,8 @@ # minimumReleaseAgeExclude(幂等),放行本插件,避免"重跑一次才成功"。 # - 老版本(<0.10.2)用手动挂载行,bundle 通道激活后需移除,否则双挂载 # (Node 半挂两次、页面两个侧边栏)。脚本会幂等移除 better-sidebar 挂载行。 -# - 回滚:dsh plugin --profile web remove dsh-better-sidebar,或把 profile 依赖 -# 改回 "dsh-better-sidebar": "link:<路径>" 再 pnpm install。 +# - 回滚:dsh plugin --profile web remove dsh-apes-sidebar,或把 profile 依赖 +# 改回 "dsh-apes-sidebar": "link:<路径>" 再 pnpm install。 # ============================================================================= set -euo pipefail @@ -47,7 +47,7 @@ set -euo pipefail for arg in "$@"; do if [ "$arg" = "-h" ] || [ "$arg" = "--help" ]; then cat <<'EOF' -dsh-better-sidebar 一键安装 / 依赖修复脚本 +dsh-apes-sidebar 一键安装 / 依赖修复脚本 用法: bash scripts/install.sh [版本] [--restart] [--dry-run] [--profile <名>] @@ -67,7 +67,7 @@ done DSH_HOME="${DSH_HOME:-${HOME:-${USERPROFILE:-}}/.dsh}" REGISTRY="${REGISTRY:-https://registry.npmjs.org}" -PKG="dsh-better-sidebar" +PKG="dsh-apes-sidebar" DSH_CMD="${DSH_CMD:-dsh}" RESTART=false @@ -118,11 +118,11 @@ if (!/^\s*allowBuilds:\s*$/m.test(t)) { } } // minimumReleaseAgeExclude:放行本插件(版本无关),避免 <24h 新版本被拒 -if (!/^\s*-\s+dsh-better-sidebar\s*$/m.test(t)) { +if (!/^\s*-\s+dsh-apes-sidebar\s*$/m.test(t)) { if (/^\s*minimumReleaseAgeExclude:\s*$/m.test(t)) { - t = t.replace(/^(\s*minimumReleaseAgeExclude:\s*)$/m, "$1\n - dsh-better-sidebar"); + t = t.replace(/^(\s*minimumReleaseAgeExclude:\s*)$/m, "$1\n - dsh-apes-sidebar"); } else { - t += "\nminimumReleaseAgeExclude:\n - dsh-better-sidebar\n"; + t += "\nminimumReleaseAgeExclude:\n - dsh-apes-sidebar\n"; } } if (t !== before) fs.writeFileSync(p, t); @@ -224,7 +224,7 @@ if ! node -e ' const bundles = p.dsh?.profile?.bundles ?? []; process.exit(bundles.includes(process.argv[2]) ? 0 : 1); ' "$PROFILE_DIR/package.json" "$PKG"; then - warn "dsh-better-sidebar 未出现在 dsh.profile.bundles 中——挂载未注册。" + warn "dsh-apes-sidebar 未出现在 dsh.profile.bundles 中——挂载未注册。" warn "若上面的 pnpm 输出提示 ignored build scripts,请确认 $WS_YML 的 allowBuilds 后重跑本脚本。" exit 1 fi diff --git a/scripts/package-registry.mjs b/scripts/package-registry.mjs index 92f45b8..5d7e52a 100644 --- a/scripts/package-registry.mjs +++ b/scripts/package-registry.mjs @@ -6,7 +6,7 @@ * pnpm build * node scripts/package-registry.mjs * dsh registry install ./registry - * dsh registry enable dsh-external/dsh-better-sidebar + * dsh registry enable dsh-external/dsh-apes-sidebar * * The registry install copies the whole source directory (`cp -r`), so * installing the repo root would drag in `node_modules/` (machine-local @@ -54,4 +54,4 @@ for (const file of files) { cpSync(source, target) } console.log(`registry/ assembled (${files.length} files)`) -console.log('next: dsh registry install ./registry && dsh registry enable dsh-external/dsh-better-sidebar') +console.log('next: dsh registry install ./registry && dsh registry enable dsh-external/dsh-apes-sidebar') diff --git a/src/client/RenderBoundary.tsx b/src/client/RenderBoundary.tsx index f856adf..2359f2f 100644 --- a/src/client/RenderBoundary.tsx +++ b/src/client/RenderBoundary.tsx @@ -26,14 +26,14 @@ export class RenderBoundary extends Component<{ children?: ReactNode; className? } componentDidCatch(error: Error, info: ErrorInfo): void { - console.error('[dsh-better-sidebar] render error:', error, info.componentStack) + console.error('[dsh-apes-sidebar] render error:', error, info.componentStack) } render(): ReactNode { if (this.state.error !== null) { return (
- dsh-better-sidebar: {this.state.error} + dsh-apes-sidebar: {this.state.error}