Skip to content

fix(masonkit): ship subdirectory index.d.ts barrels for published web exports - #254

Open
herefishyfish wants to merge 2 commits into
triniwiz:mainfrom
herefishyfish:pr/web-export-typings
Open

herefishyfish wants to merge 2 commits into
triniwiz:mainfrom
herefishyfish:pr/web-export-typings

Conversation

@herefishyfish

@herefishyfish herefishyfish commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

Consumers importing Div and Span from the published @triniwiz/nativescript-masonkit package hit TypeScript errors (Property 'addChild' does not exist on type 'Div' and Property 'textContent' does not exist on type 'Span').

web.d.ts imports Scroll from ./scroll and Text from ./text, but packages/nativescript-masonkit/project.json omitted subdirectory index.d.ts barrel files from build.options.assets. Built output only contained platform-suffixed files (index.android.d.ts, index.ios.d.ts, etc.), leaving ./scroll and ./text unresolved in dist/.

What changed

  • packages/nativescript-masonkit/project.json adds { "glob": "*/index.d.ts", "input": "packages/nativescript-masonkit", "output": "." } to targets.build.options.assets so all 13 barrel declaration files ship in the published package.
  • Extended tools/testing/consumer-types/smoke.ts with Div.addChild and Span.textContent checks and added packages/nativescript-masonkit/published-types.spec.ts to enforce that every subdirectory index.d.ts is included in build assets.

Blast Radius

Build-packaging change only. No runtime code changes.

Verification

  • Before the fix, building with npx nx build nativescript-masonkit and type-checking smoke.ts against dist/packages/nativescript-masonkit failed with TS2339: Property 'textContent' does not exist on type 'Span' and TS2339: Property 'addChild' does not exist on type 'Div'; published-types.spec.ts failed listing all 13 missing barrels.
  • After the fix, rebuilding and type-checking against dist/packages/nativescript-masonkit passed with zero errors, published-types.spec.ts passed (1/1), npx tsc -p tools/testing/consumer-types/tsconfig.json passed, and npx vitest run --config tools/testing/vitest.config.ts --project masonkit --project android passed (1314/1314).

Before / After

Runtime confirmation: programmatic Div.addChild and Span.textContent

This branch has not been deployed

No deployments
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