From e4b14d7a96b45148d9c9150648f1c27aaa4bd6d4 Mon Sep 17 00:00:00 2001 From: landuoduo Date: Fri, 17 Jul 2026 17:06:23 +0800 Subject: [PATCH] fix(cli): publish cli/package.json so --cli metadata lookup works from the installed package The root package `files` allowlist did not include `cli/package.json`, so it was absent from the published npm tarball. `cli/build/index.js` imports `../package.json` to read the CLI name and version for the client identity; when the process working directory happens to have a sibling `package.json`, the existing cwd-relative `fs.existsSync` probe selects that module-relative `../package.json` (i.e. `cli/package.json`), which is not shipped, and every `--cli` invocation dies with `ERR_MODULE_NOT_FOUND` (broken since v0.17.0). Adding `cli/package.json` to `files` makes both resolution targets present in the tarball, so the metadata import always succeeds. Verified with `npm pack --dry-run`: the file is absent before this change and present after. Fixes #1503 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8330ebd8f..6e7a57149 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "client/dist", "server/build", "server/static", - "cli/build" + "cli/build", + "cli/package.json" ], "workspaces": [ "client",