Skip to content

fix(ts): ship generated/ types in the npm package (#19)#20

Merged
bburda merged 2 commits into
mainfrom
chore/regenerate-spec-0.5.0
Jun 11, 2026
Merged

fix(ts): ship generated/ types in the npm package (#19)#20
bburda merged 2 commits into
mainfrom
chore/regenerate-spec-0.5.0

Conversation

@bburda

@bburda bburda commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

The published TypeScript client omits its generated types. dist/*.d.ts import from
../generated/schema, but the npm files array listed only dist, so generated/ was
excluded from the tarball and consumer types resolved to any.

Add generated to files so the published package ships generated/schema.d.ts.

This is the standalone bug fix for #19, split out from the 0.5.0 release so it lands as
its own reviewable change. The spec regeneration and the package version bump to 0.5.0
are handled in the release PR (#21), which is rebased on top of this fix once it merges.

Issue

closes #19

Type

Testing

  • npm pack --dry-run now includes generated/schema.d.ts in the tarball.
  • npm ci && npm run build && npm run typecheck && npm test && npm run lint - all green.

Copilot AI review requested due to automatic review settings June 1, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refreshes the repository’s source OpenAPI specification to match ros2_medkit gateway v0.5.0, updates the tracked spec version, and fixes the TypeScript npm packaging issue from #19 by ensuring generated type artifacts are included in the published tarball.

Changes:

  • Regenerated/updated spec/openapi.yaml for gateway v0.5.0 (new/updated schemas and endpoints).
  • Bumped SPEC_VERSION and updated the README’s spec-version reference to v0.5.0.
  • Fixed TypeScript npm type export packaging by adding generated/ to the npm files whitelist.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
spec/openapi.yaml Updates the canonical OpenAPI 3.1 spec used to generate clients (gateway v0.5.0).
SPEC_VERSION Bumps tracked spec version from 0.4.0 → 0.5.0.
README.md Updates documentation to reference the new spec/gateway version.
clients/typescript/package.json Ensures generated/ is included in the npm publish files list (fix for #19).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread clients/typescript/package.json
dist/*.d.ts import from ../generated/schema, but the npm "files" array
listed only "dist", so the published package omitted generated/ and
consumer types resolved to any. Add "generated" to files.
@bburda bburda force-pushed the chore/regenerate-spec-0.5.0 branch from 5becc54 to 91cee50 Compare June 11, 2026 09:07
@bburda bburda changed the title Regenerate clients from gateway 0.5.0 + fix npm type export (#19) fix(ts): ship generated/ types in the npm package (#19) Jun 11, 2026
…nerated/

prepublishOnly ran `npm run build` (tsc) but not `npm run generate`. tsc
compiles against `generated/schema.d.ts`, so a manual `npm publish` from a
clone with a stale `generated/` would build and pack outdated types without
regenerating from the current spec. Run generate before build so any publish
path produces fresh types, matching the CI publish job.
@bburda bburda self-assigned this Jun 11, 2026
@mfaferek93 mfaferek93 self-requested a review June 11, 2026 10:19

@mfaferek93 mfaferek93 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bburda bburda merged commit 15b4138 into main Jun 11, 2026
4 checks passed
@bburda bburda deleted the chore/regenerate-spec-0.5.0 branch June 11, 2026 10:27
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.

[BUG] Published npm package missing generated/ types - paths resolves to any

3 participants