Skip to content

fix(ci): build lib/ before publishing to npm#118

Merged
alexchavez1 merged 1 commit into
mainfrom
alexchavez/fix-rn-publish-missing-lib
May 14, 2026
Merged

fix(ci): build lib/ before publishing to npm#118
alexchavez1 merged 1 commit into
mainfrom
alexchavez/fix-rn-publish-missing-lib

Conversation

@alexchavez1
Copy link
Copy Markdown
Contributor

@alexchavez1 alexchavez1 commented May 14, 2026

Description of this change

Fix CI release job that has been publishing tarballs missing the lib/ directory since v0.10.3, causing MODULE_NOT_FOUND errors for all npm consumers.

  • Add npm run prepare step to the release job so lib/ is built before npm publish runs
  • Add Verify tarball contains lib/ step to the build job that asserts lib/commonjs/index.js, lib/module/index.js, and lib/typescript/src/index.d.ts are present in the would-be tarball on every PR

Why is this change being made?

  • Chore (non-functional changes)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How was this tested? How can the reviewer verify your testing?

Tested Locally:

  • Confirmed @ketch-com/ketch-react-native@0.19.0 (latest published) is missing lib/node -e "require('@ketch-com/ketch-react-native')" throws MODULE_NOT_FOUND on a clean install
  • Simulated the release runner locally: npm ci --ignore-scripts && npm run prepare && npm pack --dry-run — confirmed lib/commonjs/index.js and lib/module/index.js appear in the tarball listing
  • Verified npm run prepare builds all 3 targets (lib/commonjs, lib/module, lib/typescript) successfully

Related issues

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Add screen recording (learn how to)
  • I have evaluated the security impact of this change, and OWASP Secure Coding Practices have been observed.
  • I have informed stakeholders of my changes.

Note

Low Risk
Low risk: workflow-only changes that ensure build artifacts are produced and included in the package tarball; main failure mode is a CI/release pipeline break rather than runtime behavior changes.

Overview
Ensures published npm tarballs include the built lib/ outputs by running npm run prepare in the release job before npm publish.

Adds a CI guard in the build job that runs npm pack --dry-run and fails if expected lib/commonjs, lib/module, and TypeScript .d.ts entries are missing from the would-be tarball.

Reviewed by Cursor Bugbot for commit 998bce2. Configure here.

@alexchavez1 alexchavez1 requested review from a team as code owners May 14, 2026 20:01
@alexchavez1 alexchavez1 self-assigned this May 14, 2026
@alexchavez1 alexchavez1 merged commit 4800671 into main May 14, 2026
11 checks passed
@alexchavez1 alexchavez1 deleted the alexchavez/fix-rn-publish-missing-lib branch May 14, 2026 21:06
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