Skip to content
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

bump-version script: further tweaks #1379

Merged
merged 2 commits into from
Aug 23, 2023
Merged

bump-version script: further tweaks #1379

merged 2 commits into from
Aug 23, 2023

Conversation

vmarta
Copy link
Contributor

@vmarta vmarta commented Jul 25, 2023

This PR add the following tweaks to the bump-version script:

  • When running npm run bump-version, it no longer increments the pre-release versions of the independent packages
    • Because it seemed like side-effect or accidental changes. For simplicity, let's remove this confusing behaviour.
  • Do list all the versions in more places
    • We were listing them while calling npm run bump-version. But now for more consistent DX, we're now doing it for the other variations too (e.g. npm run bump-version:retail-react-app)

How to test the changes

cd <monorepo-root>
npm run bump-version -- 3.1.0
# only the SDK versions are updated (and not commerce-sdk-react, retail-react-app)

npm run bump-version:retail-react-app -- 1.1.0
# you'll see in the output the list of versions for all packages in the monorepo

- No longer incrementing the pre-release versions of the independent packages
- Do list all the versions in more places
@vmarta vmarta marked this pull request as ready for review July 25, 2023 17:22
@vmarta vmarta requested a review from a team as a code owner July 25, 2023 17:22
Copy link
Contributor

@wjhsf wjhsf left a comment

Choose a reason for hiding this comment

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

Would be nice if we could update all the packages (even those with different versions) with a single command, so we only have to wait for lerna to run once.

@@ -116,6 +113,11 @@ const updateDeps = (pkgJson) => {
})
}

const listAllVersions = () => {
sh.echo('\nVersions of packages in the monorepo:\n')
sh.exec('lerna list --all --long')
Copy link
Contributor

Choose a reason for hiding this comment

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

fyi, using lerna directly rather than npx lerna or whatever means you can't node scripts/bump-version, you have to use npm run bump-version (or install lerna globally, but that's gross).

@vcua-mobify
Copy link
Contributor

@vmarta Just making sure I understand.

By default, npm run bump-version will bump only the SDK versions and npm run bump-version:retail-react-app bumps just the retail-react-app but will afterwards print the versions of everything (SDK, commerce-sdk-react, retail-react-app) on the console?

@vmarta
Copy link
Contributor Author

vmarta commented Aug 18, 2023

@vmarta Just making sure I understand.

By default, npm run bump-version will bump only the SDK versions and npm run bump-version:retail-react-app bumps just the retail-react-app but will afterwards print the versions of everything (SDK, commerce-sdk-react, retail-react-app) on the console?

@vcua-mobify that's correct. The output log is like that because I want us to easily see the big picture. Yes, you're only incrementing the version of retail-react-app, but usually we'll need to think of it in the context of the entire monorepo.

@salesforce-cla
Copy link

Thanks for the contribution! It looks like @vmarta is an internal user so signing the CLA is not required. However, we need to confirm this.

@vmarta vmarta merged commit d3171c9 into develop Aug 23, 2023
18 of 20 checks passed
@vmarta vmarta deleted the bump-version-tweaks branch August 23, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants