From 3c3b203f634bb56bd4993b987ca107a51e35cfb5 Mon Sep 17 00:00:00 2001 From: Eric Lee <> Date: Fri, 29 May 2026 19:02:48 +0800 Subject: [PATCH] Fix #62: declare picocolors and @clack/core as runtime dependencies The CLI bundle imports picocolors and @clack/core directly (the custom interactive file selector in file-selector-with-header.ts), but neither was declared in the published root package.json. esbuild keeps all npm packages external (packages: 'external'), so both must exist at runtime. They only resolved by accident, as hoisted transitive deps of @clack/prompts. In strict / non-hoisting installs (pnpm, or npm under a version conflict) they land nested under @clack/prompts and become unreachable from opkg's own chunk: Cannot find package 'picocolors' imported from .../packages/cli/dist/chunk-*.js Declaring both as direct dependencies puts them on opkg's resolution path regardless of hoisting. @clack/core is pinned to ^1.0.1 to dedupe with @clack/prompts (which pins it exactly), avoiding a second copy of the AutocompletePrompt base class we subclass. Verified with a non-hoisting repro (npm --install-strategy=nested): the exact #62 error before, clean after. Type-check clean, 123/123 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- package-lock.json | 2 ++ package.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/package-lock.json b/package-lock.json index 473b608..3256a51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "packages/*" ], "dependencies": { + "@clack/core": "^1.0.1", "@clack/prompts": "^1.0.1", "commander": "^14.0.0", "fast-fuzzy": "^1.12.0", @@ -25,6 +26,7 @@ "minimatch": "^10.1.1", "nanoid": "^5.0.7", "ora": "^9.3.0", + "picocolors": "^1.1.0", "prompts": "^2.4.2", "semver": "^7.7.2", "smol-toml": "^1.6.0", diff --git a/package.json b/package.json index 9117cb4..d61147d 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "test": "TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/run-tests.ts" }, "dependencies": { + "@clack/core": "^1.0.1", "@clack/prompts": "^1.0.1", "commander": "^14.0.0", "fast-fuzzy": "^1.12.0", @@ -71,6 +72,7 @@ "minimatch": "^10.1.1", "nanoid": "^5.0.7", "ora": "^9.3.0", + "picocolors": "^1.1.0", "prompts": "^2.4.2", "semver": "^7.7.2", "smol-toml": "^1.6.0",