From f965ff6f5b28746fb98d7b67210dc247641877f5 Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Mon, 12 Oct 2026 21:20:56 +0700 Subject: [PATCH] 0.1.5: install test no longer breaks under npm publish v0.1.3 and v0.1.4 release runs failed in prepublishOnly: npm leaks npm_* config into the test's child npm calls. Nothing was published for either tag. Co-Authored-By: Claude Sonnet 5.5 --- package-lock.json | 4 ++-- package.json | 2 +- test/install.test.mjs | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d6c984..6628306 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@coderbuzz/dsh", - "version": "0.1.4", + "version": "0.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@coderbuzz/dsh", - "version": "0.1.4", + "version": "0.1.5", "license": "MIT", "dependencies": { "chalk": "^5.6.2", diff --git a/package.json b/package.json index 11a9030..3f88770 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coderbuzz/dsh", - "version": "0.1.4", + "version": "0.1.5", "description": "DeepSeek harness for orchestrators: structured JSON SDK and CLI on top of the deepcode-cli engine", "license": "MIT", "repository": { diff --git a/test/install.test.mjs b/test/install.test.mjs index 4900429..76e0305 100644 --- a/test/install.test.mjs +++ b/test/install.test.mjs @@ -8,16 +8,18 @@ import os from "node:os"; import path from "node:path"; const run = promisify(execFile); +// `npm publish` runs this via prepublishOnly and leaks npm_* config (dry-run, command, ...) into child npm calls. +const cleanEnv = Object.fromEntries(Object.entries(process.env).filter(([k]) => !k.toLowerCase().startsWith("npm_"))); const script = path.resolve("install.sh"); const version = JSON.parse(fs.readFileSync("package.json", "utf8")).version; test("install.sh: install, rerun, refuse to overwrite, uninstall", async () => { const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "dsh-inst-")); - const packed = (await run("npm", ["pack", "--pack-destination", tmp, "--ignore-scripts", "--json"])).stdout; + const packed = (await run("npm", ["pack", "--pack-destination", tmp, "--ignore-scripts", "--json"], { env: cleanEnv })).stdout; const tarball = path.join(tmp, JSON.parse(packed)[0].filename); const prefix = path.join(tmp, "prefix"); const bin = path.join(tmp, "bin"); - const env = { ...process.env, DSH_PACKAGE: tarball, HOME: tmp }; + const env = { ...cleanEnv, DSH_PACKAGE: tarball, HOME: tmp }; const install = (...args) => run("sh", [script, "--prefix", prefix, "--bin-dir", bin, ...args], { env }); const first = await install();