fix: publish declarations from @aligent/cdk-secure-rest-api#1689
Merged
Conversation
The package shipped without `.d.ts` files because it had no `.npmignore`, so `npm pack` fell back to the workspace `.gitignore` (which excludes build outputs). Consumers with `isolatedModules: true` resolved `index.ts` directly and hit TS1205 on the type re-exports. Add a package `.npmignore` matching sibling packages and split `index.ts` into a value re-export and an `export type` re-export.
TheOrangePuff
approved these changes
May 18, 2026
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
@aligent/cdk-secure-rest-api@1.1.0shipped without.d.tsfiles because the package had no.npmignore, sonpm packfell back to the workspace.gitignore(which excludes build outputs).isolatedModules: trueresolvedindex.tsdirectly and hitTS1205on the type re-exports.tsxadditionally preferred the shipped.tssource overindex.js, causingSecureRestApi is not a constructorat runtime in ESM consumers.Changes
packages/constructs/secure-rest-api/.npmignorematching sibling packages — excludes*.tssource / tests / configs while preserving*.d.tsdeclarations.index.tsinto a value re-export (SecureRestApi) andexport typere-export (SecureRestApiProps,SecureRestApiRoute) — defends against any future scenario where consumers resolve the source again.patchchangeset.Verified locally with
npm pack --dry-run: tarball is now 7 files (down from 13), no.tssource, includes bothindex.d.tsandlib/secure-rest-api.d.ts.Test plan
yarn nx lint secure-rest-apipassesyarn nx build secure-rest-apiproducesindex.d.ts+lib/secure-rest-api.d.tsyarn nx test secure-rest-apipasses (12/12)npm pack --dry-runlists*.d.tsand excludes*.tssource, test, and config files1.1.1, consumer-side.yarn/patchfor this package can be removedFollow-ups (not in this PR)
prerender-fargateis missing.npmignorefor the same reason — likely has the same bug in its published tarball.export type) is missing across most packages — currently masked by.d.tsshipping correctly, but worth a sweep.npm pack --dry-run | grep -q '\.d\.ts') to catch this class of regression before publish.