fix(dsh-runtime): add prepare script so git installs build dist - #7475
fix(dsh-runtime): add prepare script so git installs build dist#7475VedantMadane wants to merge 1 commit into
Conversation
Git consumers (e.g. pnpm add github:nexu-io/open-design#path:packages/dsh-runtime) never ran build, so main/exports pointed at missing dist files and DSH Desktop failed the whole plugin tree at startup. Fixes nexu-io#7471 Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
|
Thanks @VedantMadane — the #7471 packaging failure is easy to map from your write-up. I've routed this for review and linked it back to the issue so it doesn't get lost. |
PerishCode
left a comment
There was a problem hiding this comment.
The git-install path still needs a packaging change that avoids preparing the whole monorepo. I reproduced the exact dependency install at this commit and the new hook expands into repository-wide installation work before this package can build.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.| } | ||
| }, | ||
| "scripts": { | ||
| "prepare": "pnpm run build", |
There was a problem hiding this comment.
Avoid using prepare on this package while it is consumed from a subdirectory of the monorepo. With pnpm 10.33.2, an exact install of github:nexu-io/open-design#84c90101165ab75081d36b67dde4d8e00d865d8d&path:packages/dsh-runtime first fails unless the consumer allowlists this script; after allowlisting it, pnpm runs pnpm install against the fetched repository workspace. The reproduction selected all 29 workspace projects and installed 1,292 packages, then ran unrelated native postinstalls including onnxruntime-node; the runtime build had still not started after several minutes. This turns a small plugin dependency into a full repository/native-toolchain installation, so it can fail on the same constrained consumer environments this PR is intended to fix and executes much more third-party install code than the package requires. Please ship a self-contained prebuilt package instead (for example, publish/consume the existing packed artifact with dist, or provide an equivalent repository artifact that does not need a git prepare), and add an install-level regression that imports both the root and ./startup exports from that artifact.
Fixes #7471
Why
Installing
@open-design/dsh-runtimeas a git dependency (github:nexu-io/open-design#path:packages/dsh-runtime) leavesmain/exportspointing atdist/*.jsthat were never built. pnpm runs a git dependency'spreparehook at install time, but this package only declaredbuild— so install completed with nodist/, and DSH Desktop then hard-failed the whole plugin tree (atomic loader) withERR_MODULE_NOT_FOUNDfordist/startup.jsanddist/index.js.Hit this while wiring the package into a DeepSeek Harness profile via git; there is still no npm publish fallback.
What users will see
@open-design/dsh-runtimeproduce a package whose declared entry points exist (dist/built during install viaprepare).open-design-runtime/open-design-startupwithoutERR_MODULE_NOT_FOUNDfrom a missing build.Surface area
apps/weborapps/desktop(including Electron menu bar)odsubcommand or flag, newtools-dev/tools-packflag, or newOD_*env var/api/*endpoint, new SSE event, or changed shape inpackages/contractsskills/,design-systems/,design-templates/, orcraft/, or change to the skills protocolTRANSLATIONS.mdfor the locale workflow)package.jsonpackages/dsh-runtime/package.jsonscripts)Screenshots
N/A
Bug fix verification
buildbut no lifecycle hook pnpm runs for git deps; after install,dist/index.js/dist/startup.jsare absent whilepackage.jsonmain/exportsstill point at them (as reported in @open-design/dsh-runtime: git installs are broken — no prepare script, dist never built, sources stripped by files field #7471).mainand green on this branch? no — a red automated spec for install lifecycle was not cheap here (needs a full pnpm git-dep install of this package with its peer/dev toolchain).mainthatpackages/dsh-runtime/package.jsonscripts were onlybuild/test/typecheck; this PR adds"prepare": "pnpm run build"so install-time lifecycle buildsdist/before the package is linked (same fix suggested in @open-design/dsh-runtime: git installs are broken — no prepare script, dist never built, sources stripped by files field #7471). Workspace / localpnpm run buildbehavior is unchanged.Validation
packages/dsh-runtime/package.jsonbefore/after; single-line scripts change only.pnpm install/pnpm guardin this environment (sparse checkout ofpackages/dsh-runtimeonly; disk-constrained). Change is additive lifecycle wiring over the existingbuildscript.