Skip to content

add dry-run, npm tags to publish #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ekozilforce
Copy link
Collaborator

@ekozilforce ekozilforce commented Jun 5, 2025

Description

This pr updates the publish command to support npm distribution tags based on the semver pre-release suffix defined in package.json's version field.

Additionally, we introduce dry run capabilities to publish.sh.

Testing

I tested the dry-run feature. Will test an actual release when we release.

0.3.4-ea

% yarn release:dry-run
yarn run v1.22.22
$ bin/publish.sh -d

> @heroku/salesforce-sdk-nodejs@0.3.4-ea prepack
> tsc -b --clean && tsc -b --force

npm notice
npm notice 📦  @heroku/salesforce-sdk-nodejs@0.3.4-ea
npm notice Tarball Contents
npm notice 667B CHANGELOG.md
...
npm notice 2.5kB package.json
npm notice Tarball Details
npm notice name: @heroku/salesforce-sdk-nodejs
npm notice version: 0.3.4-ea
npm notice filename: heroku-salesforce-sdk-nodejs-0.3.4-ea.tgz
npm notice package size: 19.4 kB
npm notice unpacked size: 73.6 kB
npm notice shasum: ae7b7299f69dbb819c3dd853d24385721b1c20d4
npm notice integrity: sha512-OiHcdzCg5YAAL[...]D7nlugK4LKKQg==
npm notice total files: 40
npm notice
npm warn This command requires you to be logged in to https://registry.yarnpkg.com (dry-run)
npm notice Publishing to https://registry.yarnpkg.com with tag ea and default access (dry-run)
+ @heroku/salesforce-sdk-nodejs@0.3.4-ea
DRY RUN: Skipping git tag and push operations
✨  Done in 4.50s.

0.3.4

% yarn release:dry-run
yarn run v1.22.22
$ bin/publish.sh -d

> @heroku/salesforce-sdk-nodejs@0.3.4 prepack
> tsc -b --clean && tsc -b --force

npm notice
npm notice 📦  @heroku/salesforce-sdk-nodejs@0.3.4
npm notice Tarball Contents
npm notice 667B CHANGELOG.md
...
npm notice 2.5kB package.json
npm notice Tarball Details
npm notice name: @heroku/salesforce-sdk-nodejs
npm notice version: 0.3.4
npm notice filename: heroku-salesforce-sdk-nodejs-0.3.4.tgz
npm notice package size: 19.4 kB
npm notice unpacked size: 73.6 kB
npm notice shasum: 842cb6cd784c0941a668737b78a40bfc16d33a4a
npm notice integrity: sha512-RRFHfP8sJexO0[...]EjNJNyMcksrdQ==
npm notice total files: 40
npm notice
npm warn This command requires you to be logged in to https://registry.yarnpkg.com (dry-run)
npm notice Publishing to https://registry.yarnpkg.com with tag latest and default access (dry-run)
+ @heroku/salesforce-sdk-nodejs@0.3.4
DRY RUN: Skipping git tag and push operations
✨  Done in 3.97s.

@ekozilforce ekozilforce marked this pull request as ready for review June 5, 2025 14:27
@ekozilforce ekozilforce requested a review from a team as a code owner June 5, 2025 14:27
@ekozilforce ekozilforce marked this pull request as draft June 5, 2025 15:44
Comment on lines +30 to +33
if [[ $version == *-* ]]; then
# Extract suffix after the last dash (e.g., "1.0.0-ea" -> "ea")
tag="${version##*-}"
else
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to modify this to allow prerelease versions: 1.0.0-ea.0. Currently would extract ea.0 as the tag when we want ea.

npm version prerelease --preid=ea
1.0.0 -> 1.0.0-ea.0

tag="${version##*-}"
else
# No suffix, use latest tag
tag="latest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we'll only want to use latest for the latest major version. If we have branches for prior major versions we are still supporting, we wouldn't want to publish those older versions as latest because that would result in users grabbing that older version when they use npm install @heroku/applink

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