Skip to content

fix(cli): vendor scaffold-response types, unblock 0.10.0 publish#93

Merged
stackbilt-admin merged 1 commit intomainfrom
fix/cli-vendor-contract-types
Apr 9, 2026
Merged

fix(cli): vendor scaffold-response types, unblock 0.10.0 publish#93
stackbilt-admin merged 1 commit intomainfrom
fix/cli-vendor-contract-types

Conversation

@stackbilt-admin
Copy link
Copy Markdown
Member

Summary

`@stackbilt/cli` had `"@stackbilt/contracts": "file:../../../contracts"` in its dependencies — pointing to an unpublished sibling repo. Publishing the tarball as-is would ship a broken package: every downstream `npm install @stackbilt/cli` would fail with ENOENT when npm tries to resolve the file: spec.

Root cause

`packages/cli/src/http-client.ts` imported three type-only symbols from `@stackbilt/contracts/dist/scaffold-response`:

  • `ScaffoldFileType`
  • `GovernanceDocsType`
  • `PromptContextType`

These were erased at compile time (zero runtime cost), but the declared `dependencies` entry is still resolved at install time on the consumer side. Caught during 0.10.0 publish pre-flight via `npm pack` tarball inspection.

Fix

Vendored the three interfaces inline at `packages/cli/src/types/scaffold-contract-types.ts` with structural copies of the upstream `@stackbilt/contracts@0.1.0` definitions. Re-pointed the type-only import in `http-client.ts`. Removed `@stackbilt/contracts` from `cli/package.json` dependencies.

Validation

  • ✅ `pnpm run typecheck`: clean
  • ✅ `pnpm run build`: clean
  • ✅ `pnpm run test`: 345/345 passing (no regressions)
  • ✅ `npm pack` tarball: `dependencies` block contains only workspace:^ refs (file: spec is gone)

Follow-up

When `@stackbilt/contracts` is properly published to npm, the vendored file can be deleted and `http-client.ts` can re-import from the real package.

Unblocks

  • `@stackbilt/cli@0.10.0` npm publish
  • `@stackbilt/blast@0.10.0` + `@stackbilt/surface@0.10.0` first publishes
  • cc-taskrunner 1.5.0 blast gate (needs `@stackbilt/cli >= 0.10.0` on PATH)

🤖 Generated with Claude Code

…t/contracts

@stackbilt/cli had a file:../../../contracts dep pointing to a sibling
repo that is not published to npm. Packing the tarball preserved the
file: specifier in the resulting package.json, which would cause every
downstream `npm install @stackbilt/cli` to fail with ENOENT.

Root cause: http-client.ts imported three type-only symbols (ScaffoldFileType,
GovernanceDocsType, PromptContextType) from @stackbilt/contracts/dist/scaffold-response.
The import was erased at compile time, but the declared dep was still
resolved at install time on the consumer side.

Fix: vendor the three interfaces inline at
packages/cli/src/types/scaffold-contract-types.ts and re-point the
type-only import. The contracts dep is then removed from package.json
entirely. Verified via `npm pack` tarball inspection — no more file:
specifier in the published package.json.

When @stackbilt/contracts is properly published to npm, the vendored
file can be deleted and http-client.ts re-imports from the real package.

Validation:
- pnpm run typecheck: clean
- pnpm run build: clean
- pnpm run test: 345/345 passing (no change)
- npm pack tarball: dependencies block has only workspace:^ refs (no file:)

This unblocks publishing @stackbilt/cli@0.10.0 and the full 0.10.0 release.
@stackbilt-admin stackbilt-admin merged commit 3ca7baf into main Apr 9, 2026
3 checks passed
@stackbilt-admin stackbilt-admin deleted the fix/cli-vendor-contract-types branch April 9, 2026 17:23
stackbilt-admin pushed a commit that referenced this pull request Apr 9, 2026
Two small drift-cleanup changes after the 0.10.0 publish:

- .ai/state.adf — CURRENT was still v0.8.0 from the #50-53 era, had
  no mention of blast + surface or the npm publish milestone. Refreshed
  to reflect the current reality: 0.10.0 live on npm, #94/#90/#69 as
  the next queue, vendor-fix (#93) recorded in COMPLETED so the
  scaffold-response type-vendor context isn't lost.
- packages/cli/src/http-client.ts — the ScaffoldFile doc comment said
  "sourced from @stackbilt/contracts" which is no longer accurate after
  #93. Updated to "vendored from @stackbilt/contracts" and pointed at
  the local types file for discoverability.

No runtime behavior change. Sweep also confirmed the rest of the docs
(README, CHANGELOG, PUBLISHING.md, per-package READMEs, docs/) are
already 0.10.0-accurate from yesterday's pre-release docs audit.
stackbilt-admin added a commit that referenced this pull request Apr 9, 2026
Two small drift-cleanup changes after the 0.10.0 publish:

- .ai/state.adf — CURRENT was still v0.8.0 from the #50-53 era, had
  no mention of blast + surface or the npm publish milestone. Refreshed
  to reflect the current reality: 0.10.0 live on npm, #94/#90/#69 as
  the next queue, vendor-fix (#93) recorded in COMPLETED so the
  scaffold-response type-vendor context isn't lost.
- packages/cli/src/http-client.ts — the ScaffoldFile doc comment said
  "sourced from @stackbilt/contracts" which is no longer accurate after
  #93. Updated to "vendored from @stackbilt/contracts" and pointed at
  the local types file for discoverability.

No runtime behavior change. Sweep also confirmed the rest of the docs
(README, CHANGELOG, PUBLISHING.md, per-package READMEs, docs/) are
already 0.10.0-accurate from yesterday's pre-release docs audit.

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant