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

Replace lerna-changelog with changesets #100

Merged
merged 7 commits into from
Oct 30, 2023
Merged

Conversation

ijlee2
Copy link
Owner

@ijlee2 ijlee2 commented Oct 30, 2023

Description

I updated @codemod-utils/cli so that, by default, codemod projects use changesets to update CHANGELOG.md and publish the package. pnpm recommends changesets and we might see more frequent releases (in comparison, lerna-changelog hasn't had a release since October 2021).

Why @changesets/get-github-info?

The built-in implementations (@changesets/changelog-git and @changesets/changelog-github) currently pose a large technical risk (the code is complex and in need of refactoring) and generate CHANGELOG's that I don't find useful.

With @changesets/changelog-git
## 0.1.2

### Patch Changes

- f8f2bef: Third attempt at publishing packages
With @changesets/changelog-github
## 0.1.2

### Patch Changes

- [#13](https://github.com/ijlee2/my-project/pull/13) [`f8f2bef`](https://github.com/ijlee2/my-project/commit/f8f2bef08dc907458b0d9e9acabe6301ae0559d0) Thanks [@ijlee2](https://github.com/ijlee2)! - Third attempt at publishing packages

With a custom formatter, we can create CHANGELOG's that help maintainers and end-developers (users) more. The output is inspired from lerna-changelog and will look like:

## 0.1.2

### Patch Changes

- [#13](https://github.com/ijlee2/my-project/pull/13) Third attempt at publishing packages ([@ijlee2](https://github.com/ijlee2))

@ijlee2 ijlee2 added the enhance: code Issue asks for new feature or refactor label Oct 30, 2023

<summary>Publish package (for admins)</summary>

1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled.
Copy link
Owner Author

Choose a reason for hiding this comment

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

For public repos, one can use the default scopes (none selected). For private repos, however, they will need repo and read:user scopes.

To simplify the instructions, we'll ask maintainers to select the repo and read:user scopes.

"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "tsc --noEmit",
"prepare": "pnpm build",
"release:changelog": "changeset version",
"release:publish": "pnpm build && changeset publish",
Copy link
Owner Author

Choose a reason for hiding this comment

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

I added pnpm build to ensure that the latest TS files are compiled, then published.

@ijlee2 ijlee2 marked this pull request as ready for review October 30, 2023 17:54
@ijlee2 ijlee2 merged commit 5bb88a0 into main Oct 30, 2023
2 checks passed
@ijlee2 ijlee2 deleted the replace-lerna-changelog branch October 30, 2023 18:02
ijlee2 added a commit that referenced this pull request Oct 31, 2023
@ijlee2 ijlee2 mentioned this pull request Oct 31, 2023
ijlee2 added a commit that referenced this pull request Oct 31, 2023
* chore: Patched #100

* chore: Updated fixtures

* bugfix: Reverted the release:publish script

* chore: Updated fixtures

* chore: Added changeset

---------

Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance: code Issue asks for new feature or refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant