基线:upstream omdsh-dev/DSH-better-sidebar @ 96d6ef4(main,npm 0.34.0-alpha.1,MIT) 宿主:DSH 0.2.3-alpha.2 / cordis 4.2.0-alpha.1(Desktop Beta 2.0.24-beta.2 实测) 改动(改名 + 身份对齐,不改架构): - package.json:name → dsh-apes-sidebar,version 2.0.0,peer 升 ^0.2.3-alpha.2,cordis 钉 ^4.2.0-alpha.1 - dsh.plugin.json:id → dsh-external/dsh-apes-sidebar,engines.dsh >=0.2.3-alpha.2 <0.3.0 - cordis.patch.yml:挂载行 id better-sidebar → apes-sidebar - tsdown.config.ts:客户端 factory id → dsh-apes-sidebar / dsh-external/dsh-apes-sidebar - src/index.ts:SIDEBAR_PACKAGE_NAME → dsh-apes-sidebar(loader 行自查找) - settings 命名空间保留 dsh-better-sidebar(用户既有偏好不丢) 文档:README.md(我们自己的)、NOTICE.md(上游 MIT 出处)、docs/apesi/(规则 + 第一代材料 + 重建记录) 实测:boot 18–29s,include:apes-sidebar ready,无重复 factory 注册 / 无 loader 行告警 / 无 React #130
43 lines
2.2 KiB
YAML
43 lines
2.2 KiB
YAML
# dsh-apes-sidebar bundle patch (ApeSi fork of dsh-better-sidebar)
|
|
#
|
|
# 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 <name> add dsh-apes-sidebar@<version>
|
|
#
|
|
# — the command reconciles `dsh.profile.bundles` against installed packages
|
|
# and, seeing this declaration, appends `dsh-better-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.
|
|
#
|
|
# If the profile still carries the old manual mount line in its own
|
|
# cordis.patch.yml, remove it before switching to the bundle channel to
|
|
# avoid double-mounting (two Node halves, two sidebars).
|
|
#
|
|
# The `config.shell` / `config.shellArgs` rows are gone with the plugin's own
|
|
# terminal (DSH 0.1.6 ships its own right-Sidebar terminal, and its shell is
|
|
# chosen from the shell menu there):
|
|
#
|
|
# - insert:
|
|
# - id: better-sidebar
|
|
# name: 'dsh-better-sidebar'
|
|
#
|
|
# Aggregate double-mount guard: aggregate bundles (e.g. @linxin666/dsh-web-ui-all)
|
|
# may already mount this package under their own entry id (e.g.
|
|
# `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
|
|
# 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`
|
|
# appends new bundles last. The reverse order (this bundle before the
|
|
# aggregate) is a known limitation: the guard cannot see rows that come after
|
|
# it, and no runtime singleton guard is added. Same-id manual duplicates still
|
|
# fail loudly at the loader as before.
|
|
- insert:
|
|
- id: apes-sidebar
|
|
name: 'dsh-apes-sidebar'
|
|
disabled: !!js "[...ctx.loader.entries()].some((e) => e.options.name === 'dsh-apes-sidebar' && e.options.id !== 'apes-sidebar' && !e.disabled)"
|