{"id":21597336,"url":"https://github.com/lvjiaxuan/release","last_synced_at":"2025-04-11T00:52:20.601Z","repository":{"id":65342309,"uuid":"537342884","full_name":"lvjiaxuan/release","owner":"lvjiaxuan","description":"My own release helper tool.","archived":false,"fork":false,"pushed_at":"2024-08-14T03:03:15.000Z","size":678,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T00:52:09.468Z","etag":null,"topics":["bump","changelog"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lvjiaxuan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-16T07:00:00.000Z","updated_at":"2024-08-14T03:03:19.000Z","dependencies_parsed_at":"2023-12-28T11:36:38.429Z","dependency_job_id":"e2425f13-5597-41ed-8342-1be921160d6a","html_url":"https://github.com/lvjiaxuan/release","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"deacff1bee87ee26019992bbe6f23af90dfc9e99"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvjiaxuan%2Frelease","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvjiaxuan%2Frelease/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvjiaxuan%2Frelease/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvjiaxuan%2Frelease/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvjiaxuan","download_url":"https://codeload.github.com/lvjiaxuan/release/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322609,"owners_count":21084336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bump","changelog"],"created_at":"2024-11-24T18:08:46.438Z","updated_at":"2025-04-11T00:52:20.582Z","avatar_url":"https://github.com/lvjiaxuan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lvr\n\n![actions](https://github.com/lvjiaxuan/release/actions/workflows/ci.yml/badge.svg) [![npm](https://img.shields.io/npm/v/lvr)](https://www.npmjs.com/package/lvr)\n\nPerform jobs related to the release flows, such as:\n1. Bump version.\n2. Generate `CHANGELOG.md`.\n3. Commit / Tag / Push.\n4. Create a release and publish node packages.\n\n## Features\n\n1. One brief script is good to go, may be a little opinionated by default options.\n2. Generate a tag-ranged `CHANGELOG.md`.\n3. Publish job supports sync to cnpm.\n\n## Usage\n\nPerform Bump :point_right: CHANGELOG :point_right: Commit :point_right: Tag :point_right: Push in one script:\n```sh\nnpx lvr\n```\n\nUse the dry run option to confirm what will be executed:\n```sh\n# npx lvr --dry-run\nnpx lvr -d\n```\n\nInstall globally:\n```sh\nnpm i lvr -g\n```\n\nMore options detail:\n```sh\nlvr -h\n```\n\n### Commands used separately.\n\n#### Bump\n\nPowered by [conventional-recommended-bump](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump) and [semver](https://github.com/npm/node-semver). Using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) preset by default.\n\nBump `package.json` in the root:\n```sh\n# lvr bump\nlvr b\n```\n\n\u003e In a detected monorepo, it would bump those changed packages by default.\n\n##### options\n\nIn a detected monorepo, it would bump all packages whether they are changed.\nIf the root package.json has the `version` field, packages would be bumped to the same version based on it.\n```sh\nlvr b --all\n```\n\nIn a detected monorepo, `--pkg` helps to prompt which packages should be bumped:\n```sh\nlvr b --pkg\n```\n\nBump to the specified semver increment level rather than depending on `conventional-recommended-bump`.\n```sh\nlvr b --major\nlvr b --major --all\nlvr b --major --pkg\n```\nSemver increment level support:\n- `--major`: bump as a semver-major version.\n- `--minor`: bump as a semver-minor version.\n- `--patch`: bump as a semver-patch version.\n- `--premajor`: bump as a semver-premajor version, can set id with string.\n- `--preminor`: bump as a semver-preminor version, can set id with string.\n- `--prepatch`: bump as a semver-prepatch version, can set id with string.\n- `--prerelease`: bump as a semver-prerelease version, can set id with string.\n\nIn a detected monorepo, when releasing only one package, it specifies the tag name as `vx.x.x` instead of `abc@x.x.x`:\n```sh\nlvr b --main-pkg\n```\n\n#### Changelog\n\nPowered by [antfu/changelogithub](https://github.com/antfu/changelogithub) and [unjs/changelogen](https://github.com/unjs/changelogen).\n\nGenerate `CHANGELOG.md` with all existing tags:\n```sh\n# lvr changelog\nlvr c\n```\n\n##### options\n\n```sh\n# within a tag range.\nlvr changelog --tag=v1.0.1...v2.1.3\n\n# to last 2 tag.\nlvr changelog --tag==2\n\n# to a specified tag.\nlvr changelog --tag=v0.0.2\n```\n\nIt means that the `CHANGELOG.md` would contain more commits that were not be parsed by `conventional commits`. Disable by default.\n```sh\nlvr changelog --verbose\n```\n\n\u003e [!NOTE]\n\u003e **About author**\n\u003e\n\u003e To be able to generate the format of `@authorName` for the interaction in the GitHub's release note, I need to fetch the GitHub Rest API. However, it occurred to me that the API has a [rate limit](https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting) for an IP.\n\u003e\n\u003e So we have to pass a [GitHub PAT](https://github.com/settings/tokens?type=beta) by `--token` when encountering this situation 😔.\n\u003e\n\u003e Alternatively, we can also create a `.env.local` file which should be included in the `.gitignore` .\n\u003e ```env\n\u003e # .env.local\n\u003e GITHUB_TOKEN = your-github-pat\n\u003e ```\n\n#### Commit / Tag / Push\n\nEnable `--commit` `--tag` `--push` when execute the `lvr` script without other command. (opt-out like `--no-push`, etc.)\n\n\u003e `--no-changelog` is considered to enable these git jobs in the same way, while `--no-bump` makes no sense to the further step.\n\nUse `Release {r}` as the default commit message. The placeholder `{r}` will be replaced by the tag name from the bumped result. If multiple packages are released in the same commit, the `human-id` library is utilized to create words for the commit message and tag name:\n```sh\nlvr --commit=\"R: {r}\"\n```\n\n```sh\n# Use the tag name from bumped result from package.json by default:\nlvr --tag=BatMan\n\n# Push current branch and new tag by default.\nlvr --push\n\n# Push current branch only.\nlvr --push=branch\n\n# Push new tag only\nlvr --push=tag\n```\n\n\u003e [!NOTE]\n\u003e It is not recommended to release more than one package at the same time in order to ensure a concise commit message and tag name.\n\n### Send a GitHub Release on CI\n\nSee [yml.ts](./src/command/yml.ts) and modify on your own.\n\n```sh\n# Add a workflow file to `.github/workflows/lvr.yml`.\nlvr yml\n```\n\n### Publish on CI\n\nSee [publish.ts](./src/command/publish.ts).\n\n## Configuration\n\nSee [src/config.ts](./src/config.ts).\n\nConfiguration is loaded by [antfu/unconfig](https://github.com/antfu/unconfig) from cwd which has highest priority. You can use either `lvr.json`, `lvr.{ts,js,mjs,cjs}`, `.lvrrc` or use the `lvr` field in package.json.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvjiaxuan%2Frelease","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvjiaxuan%2Frelease","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvjiaxuan%2Frelease/lists"}