Skip to content

Patch: Build before publish and restrict package files - #15

Open
Andrew-Paystack wants to merge 3 commits into
PaystackOSS:mainfrom
Andrew-Paystack:fix/publish-build
Open

Andrew-Paystack wants to merge 3 commits into
PaystackOSS:mainfrom
Andrew-Paystack:fix/publish-build

Conversation

@Andrew-Paystack

@Andrew-Paystack Andrew-Paystack commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Type of change

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

What issue does this change solve?

Version 1.2.1 installs without errors, but importing it fails with Cannot find module '.../dist/index.js'. The published package is missing the compiled dist/ folder.

This PR makes sure the SDK is always built before it's published:

  • Adds a prepare script that builds dist/ before every publish, and when the SDK is installed directly from GitHub
  • Adds a files list so the package only includes the build output, README and licence, and removes .npmignore, which this replaces
  • Bumps the version to 1.2.2

Additional context

We installed the packed SDK into a clean project. require, ESM imports and TypeScript types all work the same way they do in 1.2.1-beta.2.

@jules-paystack jules-paystack 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.

Looks good. I built the branch and ran npm pack --dry-run; the tarball now includes dist/index.js, index.mjs, index.d.ts and index.d.mts, which covers main/module/types, so this fixes the missing-dist issue from 1.2.1. Dropping npm run clean from build is fine since tsup's "clean": true still clears dist, and syncing package-lock to 1.2.2 fixes the beta.1/beta.2 mismatch.

One small thing and fine as a follow-up: the version is also hard-coded in the user-agent header at src/runtime.ts:58, which still says @paystack/paystack-sdk - 1.2.1-beta.2. Could you bump that to 1.2.2 as well so requests from this release report the right SDK version?

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