docs(readme): simplify install to add -> approve-builds -> add

The node one-liner prewrite was overkill for the README. Plain double
'add' does NOT work (both runs exit 1 on ERR_PNPM_IGNORED_BUILDS,
verified in scratch); the working minimal flow is add (fails, dep
written) -> pnpm approve-builds --all (re-runs install scripts) ->
add (succeeds, bundle registered). Verified end-to-end in a scratch
profile.
This commit is contained in:
Menghuan1918 committed 2026-08-22 12:10:24 +08:00
1 parent cdda072973
commit 7dbd9b75e2
2 files changed
+14 -57

No files matched your search

+7 -29
View File
@@ -62,32 +62,9 @@
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="Supported DSH versions: 0.1.0-rc.8 · 0.1.1-rc.1 · 0.1.1-rc.2" src="https://img.shields.io/badge/DSH-0.1.0--rc.8_%C2%B7_0.1.1--rc.1_%C2%B7_0.1.1--rc.2-4d6bfe" /></a>
```sh
# pnpm 11 blocks build scripts (node-pty / protobufjs) by default, which makes
# the first `dsh plugin add` fail; pre-write the build approvals into the
# profile's pnpm-workspace.yaml (idempotent, safe to re-run)
node -e '
const f = require("fs"), p = process.argv[1];
let t = f.readFileSync(p, "utf8");
t = t.replace(/^(\s*)(node-pty|protobufjs):.*$/gm, "$1$2: true");
if (!/^\s*allowBuilds:\s*$/m.test(t)) {
t += "\nallowBuilds:\n node-pty: true\n protobufjs: true\n";
} else {
for (const k of ["node-pty", "protobufjs"]) {
if (!new RegExp("^\\s*" + k + ":\\s*true\\s*$", "m").test(t)) {
t = t.replace(/^(\s*allowBuilds:\s*)$/m, "$1\n " + k + ": true");
}
}
}
if (!/^\s*-\s+dsh-better-sidebar\s*$/m.test(t)) {
if (/^\s*minimumReleaseAgeExclude:\s*$/m.test(t)) {
t = t.replace(/^(\s*minimumReleaseAgeExclude:\s*)$/m, "$1\n - dsh-better-sidebar");
} else {
t += "\nminimumReleaseAgeExclude:\n - dsh-better-sidebar\n";
}
}
f.writeFileSync(p, t);
' ~/.dsh/profiles/web/pnpm-workspace.yaml
dsh plugin --profile web add dsh-better-sidebar@latest
dsh plugin --profile web add dsh-better-sidebar@latest # first run fails: pnpm 11 blocks node-pty build scripts (the dependency is still written)
cd ~/.dsh/profiles/web && pnpm approve-builds --all # allow the build scripts (re-runs the install automatically)
dsh plugin --profile web add dsh-better-sidebar@latest # re-run succeeds
```
Then **hard-refresh the browser** (Cmd/Ctrl+Shift+R) to see the sidebar (DSH hot-reloads client changes; only host-half updates need a restart).
@@ -96,9 +73,10 @@ Then **hard-refresh the browser** (Cmd/Ctrl+Shift+R) to see the sidebar (DSH hot
```text
Install the dsh-better-sidebar plugin (a sidebar workbench for DSH):
1. First pre-write build approvals for node-pty / protobufjs into ~/.dsh/profiles/web/pnpm-workspace.yaml (allowBuilds) so the first install is not blocked by pnpm 11 (see ensure_workspace_settings in the repo's scripts/install.sh)
2. Then run: dsh plugin --profile web add dsh-better-sidebar@latest
3. When done, remind me to hard-refresh the browser (Cmd/Ctrl+Shift+R)
1. Run: dsh plugin --profile web add dsh-better-sidebar@latest (the first run fails because pnpm 11 blocks node-pty build scripts — that's expected)
2. In ~/.dsh/profiles/web run: pnpm approve-builds --all (allows the build scripts and re-runs the install)
3. Run the add command again: dsh plugin --profile web add dsh-better-sidebar@latest
4. When done, remind me to hard-refresh the browser (Cmd/Ctrl+Shift+R)
If anything fails, check the troubleshooting table in the README at https://github.com/omdsh-dev/DSH-better-sidebar
```