fix(ts): ship generated/ types in the npm package (#19)#20
Merged
Conversation
There was a problem hiding this comment.
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.yamlfor gateway v0.5.0 (new/updated schemas and endpoints). - Bumped
SPEC_VERSIONand updated the README’s spec-version reference to v0.5.0. - Fixed TypeScript npm type export packaging by adding
generated/to the npmfileswhitelist.
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.
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.
5becc54 to
91cee50
Compare
4 tasks
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The published TypeScript client omits its generated types.
dist/*.d.tsimport from../generated/schema, but the npmfilesarray listed onlydist, sogenerated/wasexcluded from the tarball and consumer types resolved to
any.Add
generatedtofilesso the published package shipsgenerated/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-runnow includesgenerated/schema.d.tsin the tarball.npm ci && npm run build && npm run typecheck && npm test && npm run lint- all green.