Skip to content

Build js-legacy client before publishing - #426

Merged
lorisleiva merged 1 commit into
mainfrom
fix/js-legacy-prepublish-build
Sep 30, 2026
Merged

lorisleiva merged 1 commit into
mainfrom
fix/js-legacy-prepublish-build

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

This PR adds a prepublishOnly: pnpm build hook to clients/js-legacy so the package is always compiled before it is published.

The publish job in the shared Publish JS workflow runs on a fresh runner and calls pnpm publish without building first. clients/js already covers this with a prepublishOnly hook, but clients/js-legacy didn't have one. As a result, @solana/spl-memo@0.3.0 was published with only LICENSE, README.md, package.json and src/index.ts, and without the lib/ directory that all its entry points reference, so consumers can't import it (e.g. solana-program/token-2022#1489). Version 0.2.5 was unaffected because it was published by hand from a local build.

I verified locally that, starting without lib/, publishing now triggers the build, the packed tarball contains lib/cjs, lib/esm and lib/types, and both import and require resolve the package's exports.

Once merged, a patch release of clients/js-legacy via Publish JS should ship a working 0.3.1, after which 0.3.0 can be deprecated on npm.

The `publish` job in the shared Publish JS workflow runs on a fresh runner and calls `pnpm publish` without building first. `clients/js` covers this with a `prepublishOnly` hook, but `clients/js-legacy` didn't have one, so `@solana/spl-memo@0.3.0` was published without `lib/` and can't be imported. This commit adds the same `prepublishOnly: pnpm build` hook to `clients/js-legacy`.

@joncinque joncinque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lorisleiva
lorisleiva merged commit c8780dd into main Sep 30, 2026
29 checks passed
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