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:
1 parent
cdda072973
commit
7dbd9b75e2
2 files changed
+14
-57
No files matched your search
@@ -62,31 +62,9 @@
|
|||||||
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="支持的 DSH 版本: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>
|
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="支持的 DSH 版本: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
|
```sh
|
||||||
# pnpm 11 默认拦截构建脚本(node-pty / protobufjs),会让首次 add 失败;
|
dsh plugin --profile web add dsh-better-sidebar@latest # 首次会因 pnpm 11 拦截 node-pty 构建脚本而失败(依赖已写入)
|
||||||
# 先把构建许可预写进 profile 的 pnpm-workspace.yaml(幂等,可反复执行)
|
cd ~/.dsh/profiles/web && pnpm approve-builds --all # 放行构建脚本(自动重跑安装)
|
||||||
node -e '
|
dsh plugin --profile web add dsh-better-sidebar@latest # 重跑即成功
|
||||||
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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可看到侧边栏(DSH 对 client 改动热加载,无需重启;仅 host 半更新时需要重启)。
|
装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可看到侧边栏(DSH 对 client 改动热加载,无需重启;仅 host 半更新时需要重启)。
|
||||||
@@ -95,9 +73,10 @@ dsh plugin --profile web add dsh-better-sidebar@latest
|
|||||||
|
|
||||||
```text
|
```text
|
||||||
帮我安装 dsh-better-sidebar 插件(DSH 侧边栏工作台),步骤:
|
帮我安装 dsh-better-sidebar 插件(DSH 侧边栏工作台),步骤:
|
||||||
1. 先用 node 把 node-pty / protobufjs 的构建许可预写进 ~/.dsh/profiles/web/pnpm-workspace.yaml(allowBuilds),保证首次安装不被 pnpm 11 拦截(可参考仓库 scripts/install.sh 的 ensure_workspace_settings)
|
1. 执行 dsh plugin --profile web add dsh-better-sidebar@latest(首次会被 pnpm 11 拦截 node-pty 构建脚本而失败,属正常)
|
||||||
2. 再执行 dsh plugin --profile web add dsh-better-sidebar@latest
|
2. 在 ~/.dsh/profiles/web 下执行 pnpm approve-builds --all(放行构建脚本,会自动重跑安装)
|
||||||
3. 完成后提醒我硬刷新浏览器(Cmd/Ctrl+Shift+R)
|
3. 再次执行 dsh plugin --profile web add dsh-better-sidebar@latest
|
||||||
|
4. 完成后提醒我硬刷新浏览器(Cmd/Ctrl+Shift+R)
|
||||||
遇到报错先查 https://github.com/omdsh-dev/DSH-better-sidebar README 的常见问题表。
|
遇到报错先查 https://github.com/omdsh-dev/DSH-better-sidebar README 的常见问题表。
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+7
-29
@@ -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>
|
<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
|
```sh
|
||||||
# pnpm 11 blocks build scripts (node-pty / protobufjs) by default, which makes
|
dsh plugin --profile web add dsh-better-sidebar@latest # first run fails: pnpm 11 blocks node-pty build scripts (the dependency is still written)
|
||||||
# the first `dsh plugin add` fail; pre-write the build approvals into the
|
cd ~/.dsh/profiles/web && pnpm approve-builds --all # allow the build scripts (re-runs the install automatically)
|
||||||
# profile's pnpm-workspace.yaml (idempotent, safe to re-run)
|
dsh plugin --profile web add dsh-better-sidebar@latest # re-run succeeds
|
||||||
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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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).
|
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
|
```text
|
||||||
Install the dsh-better-sidebar plugin (a sidebar workbench for DSH):
|
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)
|
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. Then run: dsh plugin --profile web add dsh-better-sidebar@latest
|
2. In ~/.dsh/profiles/web run: pnpm approve-builds --all (allows the build scripts and re-runs the install)
|
||||||
3. When done, remind me to hard-refresh the browser (Cmd/Ctrl+Shift+R)
|
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
|
If anything fails, check the troubleshooting table in the README at https://github.com/omdsh-dev/DSH-better-sidebar
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user