Skip to content

portable types for extend() and command() - #49

Open
jbolda wants to merge 3 commits into
mainfrom
public-command-extension-types
Open

jbolda wants to merge 3 commits into
mainfrom
public-command-extension-types

Conversation

@jbolda

@jbolda jbolda commented Nov 14, 2026

Copy link
Copy Markdown
Member

What does this PR do?

We have use cases where one would export a command() or an extend() to compose the CLI routers between or from multiple packages. When exporting though, we didn't have some required types exported and I had errors such as the following. This exports the types required.

The inferred type of 'foundationExtension' cannot be named without a reference to 'ParamModel' from '../node_modules/@bomb.sh/router/esm/lib/param.js'. This is likely not portable. A type annotation is necessary.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@pkg-pr-new

pkg-pr-new Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/router@49

commit: a19f663

@jbolda
jbolda force-pushed the public-command-extension-types branch from c7eebe7 to 7856c31 Compare November 14, 2026 07:43
@jbolda
jbolda force-pushed the public-command-extension-types branch from 8aac939 to 1a542d4 Compare November 14, 2026 23:58
@jbolda
jbolda marked this pull request as ready for review November 15, 2026 01:58
@jbolda

jbolda commented Nov 15, 2026 •

Copy link
Copy Markdown
Member Author

I decided to export the command() types as "derived" versions and namespaced so we didn't have all those internal types leak into the public interface. I think this will help with breakages if we ever need to move internals around.

@jbolda
jbolda force-pushed the public-command-extension-types branch from 30ef6e3 to 5baf680 Compare November 15, 2026 07:58
@jbolda
jbolda force-pushed the public-command-extension-types branch from 5baf680 to a19f663 Compare November 15, 2026 08:00
@jbolda jbolda changed the title portable types for extend() portable types for extend() and command() Nov 15, 2026
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.

2 participants