Build js-legacy client before publishing - #426
Merged
Merged
Conversation
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`.
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.
This PR adds a
prepublishOnly: pnpm buildhook toclients/js-legacyso the package is always compiled before it is published.The
publishjob in the shared Publish JS workflow runs on a fresh runner and callspnpm publishwithout building first.clients/jsalready covers this with aprepublishOnlyhook, butclients/js-legacydidn't have one. As a result,@solana/spl-memo@0.3.0was published with onlyLICENSE,README.md,package.jsonandsrc/index.ts, and without thelib/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 containslib/cjs,lib/esmandlib/types, and bothimportandrequireresolve the package's exports.Once merged, a
patchrelease ofclients/js-legacyvia Publish JS should ship a working 0.3.1, after which 0.3.0 can be deprecated on npm.