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

feat: migrated to changesets from lerna #4533

Open
wants to merge 79 commits into
base: main
Choose a base branch
from
Open

Conversation

blunteshwar
Copy link
Collaborator

@blunteshwar blunteshwar commented Jun 4, 2024

Description

This removes Lerna and replaces it with Changesets for handling package versioning and publishing (releases).

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

  1. Please read the Intro to Using Changesets documentation.
  2. Please read the description of the Changesets GitHub bot.
  3. Please read the documentation on adding a changeset.
  4. Finally, this blog post is handy and gives more information about using Changesets.
  5. I added two commits (a change to Well, and a changeset) to demonstrate what this would look like when the GitHub bot detected a changeset. I'll drop those two commits before merging.

It's important to know that moving to Changesets shifts the onus of version determination toward a more intentional choice for contributors. Some could argue that the onus was already on the contributor as we used Conventional Commit messages to provide Lerna a way to infer the severity of a version increase. Now, instead of relying on Conventional Commit messages, the contributor will be asked to provide changesets as part of their PR process.

The workflow for this will look something like:

  1. The contributor makes their changes and commits them.
  2. Locally, the contributor runs yarn changeset and is asked in the CLI to choose which package(s) should be part of the changeset.
  3. After the package(s) have been selected, the CLI will ask if the version increment should be a major, minor, or patch. Hitting enter in the CLI without making a choice will skip options with patch being the final option.
  4. Next, the CLI will ask for a summary of the changes. This summary will be used in the changelog.md for the respective package(s). We're also using the @changesets/changelog-github package to provide additional GitHub-related context (pull request number + link, contributor information), and this info will show in the changelog.md for the package(s), as well.
  5. Stage the change, commit the change, and push to the remote branch.

Alternatively, After committing all the changes, the contributor can also leverage changeset bot to add the chanesets.
This bot will comment on PRs saying that either a user might need to add a changeset(note that PRs changing things like documentation generally don't need a changeset)or say that the PR is good and already has a changeset.
For more details: https://github.com/changesets/bot

Motivation and context

How has this been tested?

  • Test case 1
    1. Go here
    2. Do this
  • Test case 2
    1. Go here
    2. Do this

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@blunteshwar blunteshwar requested review from pfulton, castastrophe and a team June 4, 2024 14:14
Copy link

github-actions bot commented Jun 4, 2024

Branch preview

Copy link

github-actions bot commented Jun 4, 2024

Tachometer results

Currently, no packages are changed by this PR...

Copy link

github-actions bot commented Jun 4, 2024

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.99 0.99 0.99
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this?

Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.

Transfer Size

Category Latest Main Branch
Total 250.178 kB 236.503 kB 🏆 236.715 kB
Scripts 60.238 kB 54.072 kB 🏆 54.213 kB
Stylesheet 53.788 kB 47.95 kB 🏆 48.041 kB
Document 6.225 kB 5.458 kB 🏆 5.462 kB
Font 127.092 kB 126.674 kB 126.65 kB 🏆

Request Count

Category Latest Main Branch
Total 52 52 52
Scripts 41 41 41
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2

Copy link
Collaborator

@pfulton pfulton left a comment

Choose a reason for hiding this comment

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

I left one question here, @blunteshwar. An additional thought I had was if you need to account for the fixed version numbers that you publish at. Spectrum CSS doesn't use fixed versioning, so I didn't look into this, but you may need to!

Otherwise, the rest of the changes here look good. Are you going to be using the bot and the GitHub Action?

package.json Outdated Show resolved Hide resolved
@blunteshwar blunteshwar requested a review from pfulton June 5, 2024 01:39
@blunteshwar
Copy link
Collaborator Author

blunteshwar commented Jun 5, 2024

I left one question here, @blunteshwar. An additional thought I had was if you need to account for the fixed version numbers that you publish at. Spectrum CSS doesn't use fixed versioning, so I didn't look into this, but you may need to!

Otherwise, the rest of the changes here look good. Are you going to be using the bot and the GitHub Action?

Yes, we are probably gonna use bot and the GitHub Action
As far as fixed versioning is considered, I am taking care of that in congig.json by leveraging"fixed": [["@spectrum-web-components/*"]],

pfulton
pfulton previously approved these changes Jun 5, 2024
Copy link
Collaborator

@pfulton pfulton left a comment

Choose a reason for hiding this comment

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

I think this looks good!

.changeset/README.md Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@Rajdeepc
Copy link
Contributor

Rajdeepc commented Jun 6, 2024

@blunteshwar Once you resolve the changes requested by @castastrophe ,lets run a shallow release from this branch to make sure the build scripts are working with changesets!
@castastrophe Do you feel is there another parallel way to mock test this change?

@castastrophe
Copy link
Contributor

@blunteshwar Once you resolve the changes requested by @castastrophe ,lets run a shallow release from this branch to make sure the build scripts are working with changesets! @castastrophe Do you feel is there another parallel way to mock test this change?

No I think that approach makes the most sense.

@blunteshwar blunteshwar requested a review from castastrophe June 11, 2024 03:13
Copy link
Contributor

@nikkimk nikkimk left a comment

Choose a reason for hiding this comment

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

Great work! And once again, kudos for the level of detail you put into the PR description. I have a few suggestions and questions here and then I'm happy to re-review.

README.md Outdated Show resolved Hide resolved
scripts/generate-icon-react-wrapper.js Outdated Show resolved Hide resolved
tasks/custom-element-json.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants