{"id":17398456,"url":"https://github.com/vweevers/remark-changelog","last_synced_at":"2025-04-30T05:22:20.528Z","repository":{"id":35090603,"uuid":"204035247","full_name":"vweevers/remark-changelog","owner":"vweevers","description":"Lint or fix a changelog written in markdown, following Keep A Changelog. Superseded by remark-common-changelog.","archived":false,"fork":false,"pushed_at":"2023-11-01T12:56:28.000Z","size":47,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T01:58:22.074Z","etag":null,"topics":["changelog","keep-a-changelog","markdown","nodejs","npm-package","remark"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/vweevers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-08-23T16:37:25.000Z","updated_at":"2024-04-21T11:41:43.000Z","dependencies_parsed_at":"2024-06-21T15:44:39.867Z","dependency_job_id":"387839e3-2887-4516-9e2a-bdac7371059f","html_url":"https://github.com/vweevers/remark-changelog","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fremark-changelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fremark-changelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fremark-changelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fremark-changelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/remark-changelog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251645987,"owners_count":21620847,"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":["changelog","keep-a-changelog","markdown","nodejs","npm-package","remark"],"created_at":"2024-10-16T14:56:45.056Z","updated_at":"2025-04-30T05:22:20.507Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-changelog\n\n**Lint or fix a changelog written in markdown, following [`Keep A Changelog`](https://keepachangelog.com/en/1.0.0/).** Changelogs should be written by humans, for humans. This tool focuses on helping you do that.\n\n[![npm status](http://img.shields.io/npm/v/remark-changelog.svg)](https://www.npmjs.org/package/remark-changelog)\n[![node](https://img.shields.io/node/v/remark-changelog.svg)](https://www.npmjs.org/package/remark-changelog)\n[![Test](https://github.com/vweevers/remark-changelog/actions/workflows/test.yml/badge.svg)](https://github.com/vweevers/remark-changelog/actions/workflows/test.yml)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Usage\n\n```js\nconst changelog = require('remark-changelog')\nconst vfile = require('to-vfile')\nconst remark = require('remark')\n\nremark()\n  .use(changelog)\n  .process(vfile.readSync('CHANGELOG.md'), function (err, file) {\n    if (err) throw err\n    console.log(String(file))\n  })\n```\n\nPair with [`remark-github`](https://github.com/remarkjs/remark-github) for ultimate pleasure. If you're looking for a CLI that includes both, checkout [`hallmark`](https://github.com/vweevers/hallmark), a markdown style guide with linter and automatic fixer.\n\n## Rules\n\n### `title`\n\nChangelog must start with a top-level \"Changelog\" heading. In `fix` mode, it is either added or updated.\n\n### `release-heading-depth`\n\nRelease must start with second-level heading.\n\n### `release-heading`\n\nRelease heading must be `Unreleased` or have the format `\u003cversion\u003e - \u003cdate\u003e`.\n\n### `release-version`\n\nRelease must have a semver-valid version, without `v` prefix. Releases that have no matching git tag are _not_ rejected, to support adding a git tag after updating the changelog.\n\n### `release-version-link`\n\nRelease version must have a link. The destination URL is not linted. In `fix` mode links are automatically inserted (to `https://github.com/OWNER/REPO/compare/A...B` or `https://github.com/OWNER/REPO/releases/tag/$tag` for the oldest release) requiring a nearby `package.json` with a `repository` field. The link is optional for the oldest (last listed) release.\n\n### `release-version-link-reference`\n\nUse a link reference for version link.\n\nValid:\n\n```md\n## [1.0.0] - 2019-08-23\n\n[1.0.0]: https://github.com/vweevers/remark-changelog/compare/v0.0.1...v1.0.0\n```\n\nInvalid:\n\n```md\n## [1.0.0](https://github.com/vweevers/remark-changelog/compare/v0.0.1...v1.0.0) - 2019-08-23\n```\n\n### `release-date`\n\nRelease must have a date with format `YYYY-MM-DD`.\n\n### `latest-release-first`\n\nReleases must be sorted latest-first according to semver rules. If there is an Unreleased section, it must be the very first. In `fix` mode, releases are reordered.\n\n### `latest-definition-first`\n\nDefinitions must be sorted latest-first, same as releases. Any additional definitions (that don't describe a release) must be last. In `fix` mode, definitions are reordered.\n\nValid:\n\n```md\n[2.0.0]: https://github.com/vweevers/remark-changelog/compare/v1.0.0...v2.0.0\n[1.0.0]: https://github.com/vweevers/remark-changelog/compare/v0.0.1...v1.0.0\n```\n\nInvalid:\n\n```md\n[1.0.0]: https://github.com/vweevers/remark-changelog/compare/v0.0.1...v1.0.0\n[2.0.0]: https://github.com/vweevers/remark-changelog/compare/v1.0.0...v2.0.0\n```\n\n### `unique-release`\n\nEach release must have a unique version.\n\n### `no-empty-release`\n\nA release section must have content. This also goes for the Unreleased section.\n\nIn fix mode, an empty release is filled with a commit log as a leg up. Merge commits are skipped. GitHub merge commits (\"Merge pull request #n\") are used to annotate commits with a PR number (best effort). Squashed GitHub commits that have a default commit description (a list of squashed commits) are converted to sublists.\n\nValid:\n\n```md\n## [2.0.0] - 2019-09-02\n\nfoo\n\n## [1.0.0] - 2019-09-01\n\nbar\n```\n\nInvalid:\n\n```md\n## [2.0.0] - 2019-09-02\n\n## [1.0.0] - 2019-09-01\n```\n\n### `group-heading`\n\nA \"group\" (of changes) must start with a third-level, text-only heading.\n\n### `group-heading-type`\n\nA group heading must be one of Changed, Added, Deprecated, Removed, Fixed, Security.\n\n### `no-empty-group`\n\nA group must not be empty. Invalid:\n\n```md\n### Added\n### Fixed\n```\n\n### `no-uncategorized-changes`\n\nThere should not be a group with heading Uncategorized. This group is added by `remark-changelog` if the `fix` option is true and it populates an empty release with commits. This rule then hints that changes should be categorized.\n\n### `filename`\n\nFilename must be `CHANGELOG.md`.\n\nTo support using `remark-changelog` in a pipeline that runs on other files too, `remark-changelog` ignores files other than `CHANGELOG.md` but it does reject alternative extensions and the alternative names `HISTORY` and `RELEASES`.\n\n## API\n\n### `changelog([opts])`\n\nOptions:\n\n- `fix` (boolean): attempt to fix issues\n- `cwd` (string): working directory, defaults to `cwd` of file or `process.cwd()`\n- `pkg` (object): a parsed `package.json`, defaults to reading a nearby `package.json` (starting in `cwd` and then its parent directories)\n- `repository` (string or object): defaults to `repository` field of `pkg`. Used to construct diff URLs.\n- `version` (string): defaults to `version` field of `pkg` or the last tag. Used to identify a new release (anything that's greater than `version` and would normally be rejected in fix mode because it has no git tag yet) to support the workflow of updating a changelog before tagging.\n- `submodules` (boolean): enable experimental git submodule support. Will collect commits from submodules and list them in the changelog as `\u003cname\u003e: \u003cmessage\u003e`.\n- `add` (string): add a new changelog entry (only if `fix` is true). Value must be one of:\n  - A release type: `major`, `minor`, `patch`, `premajor`, `preminor`, `prepatch`, `prerelease` (relative to last entry in changelog)\n    - The `major` type bumps the major version (for example `2.4.1 =\u003e 3.0.0`); `minor` and `patch` work the same way.\n    - The `premajor` type bumps the version up to the next major version and down to a prerelease of that major version; `preminor` and `prepatch` work the same way.\n    - The `prerelease` type works the same as `prepatch` if the previous version is a non-prerelease. If the previous is already a prerelease then it's simply incremented (for example `4.0.0-rc.2 =\u003e 4.0.0-rc.3`).\n  - A specific version like 2.4.0 (must be [semver](https://semver.org/)). This can also be used to insert a missing version (that is not necessarily the latest).\n\n## FAQ\n\n### Why not call it `remark-keep-a-changelog`?\n\nBecause we might deviate from `Keep A Changelog`, which is too loose to lint and has a broad target audience and thus technical scope. Conversely, `remark-changelog` only works on npm packages with a GitHub repository, to start.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install remark-changelog\n```\n\n## License\n\n[MIT](LICENSE.md) © 2019-present Vincent Weevers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fremark-changelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Fremark-changelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fremark-changelog/lists"}