Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci: use changesets for versioning and publishing#2182

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
andrii-bodnar wants to merge1 commit intolingui:main
base:main
Choose a base branch
Loading
fromandrii-bodnar:ci/add-changeset

Conversation

@andrii-bodnar
Copy link
Contributor

Description

This PR replaces Lerna with Changesets for package versioning and changelog.

Types of changes

  • Bugfix (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 not work as expected)
  • Documentation update
  • Examples update
  • CI/CD

Fixes#2127

Checklist

  • I have read theCONTRIBUTING andCODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@vercel
Copy link

vercelbot commentedFeb 13, 2025
edited
Loading

The latest updates on your projects. Learn more aboutVercel for Git ↗︎

NameStatusPreviewUpdated (UTC)
js-lingui✅ Ready (Inspect)Visit PreviewFeb 13, 2025 9:43am

@github-actions
Copy link

github-actionsbot commentedFeb 13, 2025
edited
Loading

size-limit report 📦

PathSize
packages/core/dist/index.mjs2.91 KB (0%)
packages/detect-locale/dist/index.mjs618 B (0%)
packages/react/dist/index.mjs1.35 KB (0%)

@codecov
Copy link

codecovbot commentedFeb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.38%. Comparing base(6bb8983) to head(6b07e1b).
Report is 174 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #2182      +/-   ##==========================================- Coverage   77.05%   76.38%   -0.67%==========================================  Files          84       87       +3       Lines        2157     2439     +282       Branches      555      637      +82     ==========================================+ Hits         1662     1863     +201- Misses        382      460      +78- Partials      113      116       +3

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

Copy link
Collaborator

@timofei-iatsenkotimofei-iatsenko left a comment

Choose a reason for hiding this comment

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

Interesting how flow with changesets should look like where nextmerged intomain.

Also thinking about implementing a "true", CD approach, when everything what merged tomain automatically published on a "canary" channel. Like nextjs and similar projects doing.

I believe thatnext branch in general is not needed. We should usemain as a trunk, and create branches for version to have an ability for hotfixes.

Comment on lines +1 to +18
{
"$schema":"https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": ["@changesets/changelog-github", {"repo":"lingui/js-lingui" }],
"commit":false,
"fixed": [["@lingui/*"]],
"linked": [],
"ignore": [
"*",
"@lingui/remote-loader"
],
"access":"public",
"baseBranch":"main",
"updateInternalDependencies":"patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange":true,
"updateInternalDependents":"always"
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

There should be "private: false" to not public private packages (jest-mocks for example)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

There is no such option in the configuration (schema.json), changesets should ignore private packages by default

Copy link
Collaborator

Choose a reason for hiding this comment

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

"private":true,
"name":"@lingui/jest-mocks",
"version":"3.0.3",
"version":"5.1.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think this package version here could be reset to "0.0.0" to avoid confusion with public packages

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This one is updated by changesets (as well as its CHANGELOG) because it's listed in thedevDependencies of some packages and cannot be ignored even if it is private. Yes, it's strange and unexpected.

It's a known issue mentioned here -changesets/changesets#1158

Copy link
Collaborator

Choose a reason for hiding this comment

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

It could be ignored, i'm using changeset on my full-time job and we have plenty of the private packages and they don't get bumped

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably need some explanation here, you can tell changeset to ignore private packages in two ways:

  • Remove the version field from package json. - This is a recomended way by theirs maintainers and it was there since the begining. Changeset will not bump packages which doesn't have a version field. However, this doesn't play well with a "workspace:" protocol in yarn / pnpm. They will fail publishing a package if encounter a link to a package without version field.
  • privatePackages: false this will disable changeset bump for packages with"private": true

@andrii-bodnar
Copy link
ContributorAuthor

As for canary releases, I think it's overcomplicated for the Lingui case. The flow withmain as stable andnext as unstable future major release works pretty well and there is no need to publish every merge to themain branch. Most of the time, we simply don't have anext branch at all.

Interesting how flow with changesets should look like where next merged into main.

Good question. Probably this could cause problems and the first stable release of the new major version should be done manually to make sure everything is ready for release. I am also still thinking about a separate workflow for publishing that should be triggered manually. This gives more control over the process.

@timofei-iatsenko
Copy link
Collaborator

As for canary releases, I think it's overcomplicated for the Lingui case. The flow with main as stable and next as unstable future major release works pretty well and there is no need to publish every merge to the main branch. Most of the time, we simply don't have a next branch at all.

This is debatable, but I don’t think it’s complicated. In fact, it’s even simpler because it removes the need for branching entirely—it’s a shift in how we think about releases.

Thenext branch actually introduces a problem: once it’s created, you now havetwo branches to maintain and keep in sync whenever something lands inmain. The real issue here is the branching topology.

Instead, a more streamlined approach could be:

  • main → Always has the latest changes, including breaking ones.
  • v5 → A snapshot of the repo when we decided to start the next major version.
  • v4,v3, etc. → Older stable versions.

With this model, if a hotfix is needed for the latest stable version, you apply it there and cherry-pick it tomain if necessary—without having to constantly syncnext withmain.

This also benefits contributors, as they always work with the latest changes by default, without needing to be explicitly directed to anext branch.

And as for canary releases, it's really just about automation—fresh changes are published automatically so contributors and early adopters can start using them right away.

@andrii-bodnarandrii-bodnar marked this pull request as draftMarch 21, 2025 09:36
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@timofei-iatsenkotimofei-iatsenkotimofei-iatsenko requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Use Changesets instead of Lerna

2 participants

@andrii-bodnar@timofei-iatsenko

[8]ページ先頭

©2009-2025 Movatter.jp