If you just want to update docs and NOT publish any new versions of BuyButton.js (to the CDN or npm), you must include [DOCS] in your PR title.
If you do want to publish a new version of the app to the CDN and npm:
git pull origin main
pnpm install
pnpm exec changeset add
Do NOT bump the version manually in package.json.
git push
This will automatically:
- Bump the version in
package.json - Create the tag in GitHub for the new version
- Publish the new version to npm
7. Deploy via Shipit
Merging the PR will automatically publish the new version to npm, but the Shipit deploy is necessary to publish the new version to Shopify's CDN.
Press "Deploy" next to your changes once CI has passed, read and tick off the checkbox once you have read and verified the instructions, and create the deploy. Monitor it and verify it succeeds.
Follow these instructions if you ONLY want to update the latest CDN version (and prevent a new version of this package from being published to npm).
If you instead want to revert a change while also publishing a new version to npm, follow the "## Deploying and publishing a new version of BuyButton.js" instructions above.
git checkout maingit checkout -b <branch-name>- Revert the faulty code changes (eg: downgrade the version of a dependency in the package.json file if bumping its version caused issues)
- In
package.json, change the package version (on line 3) by appending a string like-ROLLBACKto the existing version number- Eg:
3.0.1(original) -->3.0.1-ROLLBACK
- Eg:
- Run
pnpm install - Stage and commit your changes
- Run
git tag <new app version>which will create a new tag and tag the commit you just created- Eg: if after step 4 the app's version is now
3.0.1-ROLLBACK, you would rungit tag 3.0.1-ROLLBACK
- Eg: if after step 4 the app's version is now
- Run
git pushfollowed bygit push --tags - Visit https://github.com/Shopify/buy-button-js/tags and verify that you see the tag you just created and pushed
- Create a new PR with your branch's changes.
Caution
**IMPORTANT: **Your PR title must contain [ROLLBACK] if you ONLY want to update the latest CDN version (and prevent a new version of this package from being published to npm)
- Merge your PR into main once it is approved
- Visit https://shipit.shopify.io/shopify/buy-button-js/production and deploy your change to the CDN. Refer to step 6 in the deploy instructions (not step 6 in the rollback instructions) for more information.
- Visit Infra Central and purge the
latestCDN cache- Press "New Purge"
- Choose the "Url" option
- Paste in
https://sdks.shopifycdn.com/buy-button/latest/buybutton.js - Press "Create purge"