Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-release

eslint14.1kMIT3.3.0

ESLint Release Tools

build, release, semver, versioning, changelog

readme

NPM version Downloads Build Status

ESLint Release Tool

This release tool has been extracted from the ESLint project so that it can be shared among projects. While it's intended for use in ESLint organization projects, it is shared freely so others might use it as well.

Please note that while this project is shared freely, it is not intended to be a general-purpose utility. The functionality is highly specific to how ESLint projects handle releases and the project will remain very focused on this use case.

Warning: There are minimal tests for this project and the API is rapidly changing. Use at your own risk.

Installation

You can install the ESLint release tool using npm:

$ npm install eslint-release --save-dev

Usage

To start, you'll need to define two environment variables:

  • NPM_TOKEN - a token to use for npm publish. The token must be from a user that has permission to publish the package.
  • ESLINT_GITHUB_TOKEN - a token for a GitHub user that has repo permission (used for posting release notes).

The ESLint release tool is designed to be used on the command line and is divided into two phases: package generation and package publishing.

To generate a regular release:

$ eslint-generate-release

To generate a prerelease, you need to include the prerelease identifier:

$ eslint-generate-prerelease alpha

Both eslint-generate-release and eslint-generate-prerelease generate a new version and update the changelog but will not push back to GitHub or publish to npm. It will generate an npm package and a .eslint-release-info.json file.

For both releases and prereleases, you can then publish the release:

$ eslint-publish-release

This command publishes the generate npm package and pushes the changes to GitHub. The .eslint-release-info.json file is required for this step to work correctly.

You can optionally include the release tool in another Node.js script:

var ReleaseOps = require("eslint-release");

What It Does

When you run the release tool for a regular release, the following steps take place:

  1. Updates your npm packages to ensure you're running everything with the version that would be installed with a fresh install (only outside of CI release)
  2. Runs npm test to validate the release
  3. Gathers the commit message for each commit since the last release
  4. Calculates the next release version based on the commit message format of the changes since the last release
  5. Updates CHANGELOG.md and commits the changes
  6. Runs npm version to update the version
  7. Pushes the current branch to origin, with tags
  8. Creates GitHub release marked as Latest
  9. Converts all line endings to Unix style
  10. Publishes the package to npm
  11. Reverts any file changes

When you do a prerelease, the same steps are taken except that package is published to npm under the next tag instead of latest, and the GitHub release is marked as Pre-release.

API Usage

This package exports two functions:

  • generateRelease(prereleaseId, packageTag) - This corresponds to the CLI command eslint-generate-release when prereleaseId is undefined, and the CLI command eslint-generate-prerelease prereleaseId when prereleaseId is a string value.
  • publishRelease() - This corresponds to the CLI command eslint-publish-release.

packageTag is used as the --tag value in the npm publish command. It's also used to determine whether a regular release will be marked as Latest on GitHub: it will be marked as Latest only if packageTag is "latest". This parameter is optional and defaults to "latest" when prereleaseId is undefined, "next" otherwise.

Examples

Publish a regular latest release:

const ReleaseOps = require("eslint-release");

ReleaseOps.generateRelease();
ReleaseOps.publishRelease();

Publish a regular release with maintenance tag:

const ReleaseOps = require("eslint-release");

ReleaseOps.generateRelease(undefined, "maintenance");
ReleaseOps.publishRelease();

Publish an alpha prerelease:

const ReleaseOps = require("eslint-release");

ReleaseOps.generateRelease("alpha");
ReleaseOps.publishRelease();

Contributing

Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the ESLint Contributor Guidelines, so please be sure to read them before contributing. If you're not sure where to dig in, check out the issues.

License

MIT License

Where to ask for help?

Join our Chatroom

changelog

v3.3.0 - September 11, 2024

  • 2e6f2e6 feat: Support updates to previous major versions (#62) (Milos Djermanovic)

v3.2.2 - February 21, 2024

  • e419afd chore: remove dependency shelljs (#61) (Francesco Trotta)

v3.2.1 - November 15, 2023

  • a453432 chore: standardize npm script names (#60) (Nitin Kumar)
  • e4cc0d1 chore: add triage action (#59) (Milos Djermanovic)
  • 198c7e7 docs: update badges (#58) (Milos Djermanovic)

v3.2.0 - November 2, 2021

  • 182e1f3 fix: add missing tags test and upgrade (#57) (Milos Djermanovic)
  • 0fdda4d Update: Support conventional commits (#55) (Nicholas C. Zakas)
  • 397557b Fix: Omit sponsors sync from changelog (#53) (Nicholas C. Zakas)
  • a968dff Chore: upgrade eslint-config-eslint@7.0.0 (#54) (Milos Djermanovic)
  • 4ea4f6b Build: Update CI to point to main branch (#52) (Nicholas C. Zakas)
  • c1391a4 Docs: Update README to reflect reality (fixes #36) (#49) (Nicholas C. Zakas)
  • 86af6a8 Fix: env var names are case-insensitive in windows (#48) (翠 / green)
  • c70860f Update: group commits by types in release log (fixes #46) (#47) (翠 / green)

v3.1.2 - September 1, 2020

  • f3a9411 Fix: Version number (Nicholas C. Zakas)
  • 8fc924c 3.0.1 (ESLint Jenkins)
  • f609048 Build: changelog update for 3.0.1 (ESLint Jenkins)
  • 348f5f7 Fix: Use specific git command to push (#45) (Nicholas C. Zakas)

v3.0.1 - September 1, 2020

  • 348f5f7 Fix: Use specific git command to push (#45) (Nicholas C. Zakas)

v3.0.0 - August 14, 2020

  • 2a24936 Breaking: drop support for Node <10 (#41) (Kai Cataldo)
  • b13a435 Chore: typo in GitHub Actions CI workflow (#40) (Kai Cataldo)
  • 60eb528 Chore: move to GitHub Actions (Kai Cataldo)

v2.0.1 - July 14, 2020

  • d3884eb Fix: blank line between changelog and last version (#39) (Tony Brix)

v2.0.0 - May 8, 2020

  • d6439b3 Fix: use global-import shelljs (#38) (Kai Cataldo)
  • 3d05dc5 Update: Major version changelogs include all prereleases (#37) (Brandon Mills)
  • 13d962b Upgrade: github-api@3.2.2 (#35) (薛定谔的猫)
  • 8cde736 Breaking: require node >= 8.0 & upgrade eslint-config-eslint (#34) (薛定谔的猫) v1.2.0 - November 9, 2018

  • 1f776d1 Update: avoid printing TOTP to output when publishing (#31) (Teddy Katz)

  • 73b3f38 Update: include links to commits on GitHub in changelogs (#32) (Teddy Katz)

v1.1.0 - October 17, 2018

  • 34d6f55 Update: avoid unnecessary checks for environment variables (#29) (Teddy Katz)
  • 5c5c361 Fix: avoid overwriting the .npmrc file in a repository (#30) (Teddy Katz)

v1.0.0 - October 17, 2018

  • 7444907 Fix: avoid outputting broken publish command when OTP is provided (#28) (Teddy Katz)
  • 9d0445a Breaking: separate releases into "generate" and "publish" phase (#27) (Teddy Katz)

v0.11.1 - March 30, 2018

  • 628b493 Fix: Mark prerelease notes as "prereleases" on GitHub (#21) (Teddy Katz)

v0.11.0 - March 30, 2018

  • af2cac8 Update: publish release notes to GitHub when doing a prerelease (#20) (Teddy Katz)
  • 2731ce1 Fix: Check if file exists first (#19) (Ilya Volodin)

v0.10.3 - May 5, 2017

  • 6e4bd2d Fix: gracefully handle shorthashes longer than 7 characters (fixes #15) (#16) (Teddy Katz)

v0.10.2 - March 19, 2017

  • d5e1049 Fix: commit only modifies changelog (#13) (alberto)
  • 90537a5 Build: Add travis config (#14) (alberto)
  • 8e73497 Docs: Update license copyright (Nicholas C. Zakas)

v0.10.1 - September 16, 2016

  • f470e71 Fix: Pin github-api version (Nicholas C. Zakas)

v0.10.0 - August 12, 2016

  • 10eafdf New: CI release publishes to GitHub (Nicholas C. Zakas)

v0.9.3 - August 10, 2016

  • 8463836 Fix: Include eslint-gh-release bin entry (Nicholas C. Zakas)

v0.9.2 - August 2, 2016

  • 1dd0a5f Docs: Update README with CI info (Nicholas C. Zakas)

v0.9.1 - July 30, 2016

  • e2d4f16 Fix: Don't delete generated files (Nicholas C. Zakas)

v0.9.0 - July 30, 2016

  • cf8b300 New: eslint-gh-release script (Nicholas C. Zakas)

v0.8.4 - July 30, 2016

  • e8d94d5 Chore: Remove dependency bundling (Nicholas C. Zakas)

v0.8.3 - July 30, 2016

  • 79d39c8 Fix: Add commit hash to GitHub release (Nicholas C. Zakas)
  • f1a0cf8 Chore: Formatting changes (Nicholas C. Zakas)

v0.8.2 - July 30, 2016

  • da006bb Chore: Reformat a bit (Nicholas C. Zakas)
  • 035a6b7 0.8.1 (ESLint Jenkins)
  • 39c4d38 Build: package.json and changelog update for 0.8.1 (ESLint Jenkins)

v0.8.1 - July 30, 2016

  • e8e914a Fix: Ensure GitHub release is created (Nicholas C. Zakas)

v0.8.0 - July 30, 2016

  • b19005b Fix: Manually fix version (Nicholas C. Zakas)
  • 3a0a884 Fix: Publish to GitHub repository location (Nicholas C. Zakas)
  • 3733c93 Chore: Add JSDoc comment to appease ESLint (Nicholas C. Zakas)
  • 8ae2552 Fix: repository format check (Nicholas C. Zakas)
  • df3f595 New: Publish release notes to GitHub (Nicholas C. Zakas)
  • 9e47449 Update: Add checks for missing info in CI release (Nicholas C. Zakas)
  • c444056 Chore: Change repository string in package.json (Nicholas C. Zakas)

v0.6.4 - July 29, 2016

  • 24588f8 Docs: Update README (Nicholas C. Zakas)

v0.6.3 - July 29, 2016

  • ab47ccf Fix: CI release doesn't have to npm install (Nicholas C. Zakas)
  • 5c66639 Fix: Add bin eslint-ci-release (Nicholas C. Zakas)

v0.6.2 - July 28, 2016

  • da78663 Fix: Call git clean correctly (Nicholas C. Zakas)
  • 6e26c4f Fix: git clean typo (Nicholas C. Zakas)
  • 3728c40 Build: Manually update version (Nicholas C. Zakas)

v0.5.0 - March 28, 2016

  • f6c1c7b Update: Remove dep bundling (Nicholas C. Zakas)

v0.4.1 - March 26, 2016

  • 6ec439c Build: Pin ESLint to last good version (Nicholas C. Zakas)
  • 8af49ea Fix: Ensure bundled dependencies are correct (fixes #8) (Nicholas C. Zakas)

v0.4.0 - March 25, 2016

  • badd709 0.4.0-alpha.5 (Nicholas C. Zakas)
  • 3ec4fe5 Build: package.json and changelog update for 0.4.0-alpha.5 (Nicholas C. Zakas)
  • de0acb9 Fix: Parsing commits for changelog (fixes #5) (Brandon Mills)
  • 15a2bd8 Revert mistakenly pushed 0.4.0-alpha.5 changes (Brandon Mills)

v0.4.0-alpha.5 - March 25, 2016

  • de0acb9 Fix: Parsing commits for changelog (fixes #5) (Brandon Mills)
  • 15a2bd8 Revert mistakenly pushed 0.4.0-alpha.5 changes (Brandon Mills)

v0.4.0-alpha.4 - March 24, 2016

  • 2578f31 Fix: Changelog output (Nicholas C. Zakas)
  • a05950f Docs: Fix changelog (Nicholas C. Zakas)

v0.4.0-alpha.3 - March 24, 2016

  • db3a8a0 Update: Output changelog to console for easier debugging (Nicholas C. Zakas)

v0.4.0-alpha.2 - March 24, 2016

  • 1c6bd67 Fix: Lint errors (Nicholas C. Zakas)
  • 56e18d3 Update: Output commit range for easier debugging (Nicholas C. Zakas)

v0.4.0-alpha.1 - March 24, 2016

  • 3f0de1a Docs: Fix changelog (Nicholas C. Zakas)
  • 65f2236 Build: Remove unused dependencies (Nicholas C. Zakas)

v0.4.0-alpha.0 - March 24, 2016

  • d175571 New: Bundle dependencies (Nicholas C. Zakas)
  • 1ebdc4e Update: Exclude reverted commits (fixes #3) (Brandon Mills)

v0.3.0 - February 10, 2016

  • 304a51c Docs: Update README (Nicholas C. Zakas)

v0.3.0-beta.1 - February 10, 2016

  • ec06fa5 Fix: Change script names (Nicholas C. Zakas)

v0.3.0-beta.0 - February 10, 2016

  • 2ce0cdd Fix: Remove license check until it's sync (Nicholas C. Zakas)

v0.3.0-alpha.2 - February 10, 2016

  • 1bacf23 Update: Refactor to remove prerelease method (Nicholas C. Zakas)
  • 9899534 Build: Add ESLint and fix linting errors (Nicholas C. Zakas)
  • 1852ee3 Update: Better output from execSilent (Nicholas C. Zakas)

v0.3.0-alpha.1 - January 28, 2016

  • 84998af Docs: Fixed changelog error (Nicholas C. Zakas)
  • dac304e New: Refactor shell commands, add tests (Nicholas C. Zakas)

v0.3.0-alpha.0 - January 27, 2016

  • 2b049a4 Fix: Use correct version for npm version (Nicholas C. Zakas)
  • 510ed48 Docs: Autogenerated changelog for 0.3.0-alpha.0 (Nicholas C. Zakas)
  • 5e7bb49 Fix: Ensure linefix is working for prerelease (Nicholas C. Zakas)
  • f270343 New: Add eslint-prerelease and refactor (Nicholas C. Zakas)
  • a135fc2 New: Calculate prerelease version (Nicholas C. Zakas)
  • 5e7bb49 Fix: Ensure linefix is working for prerelease (Nicholas C. Zakas)
  • f270343 New: Add eslint-prerelease and refactor (Nicholas C. Zakas)
  • a135fc2 New: Calculate prerelease version (Nicholas C. Zakas)

v0.2.0 - January 25, 2016

  • 3685b90 Update: Run linefix in silent mode (Nicholas C. Zakas)

v0.1.5 - January 25, 2016

  • 8526da4 Fix: Ensure linefix works (fixes #1) (Nicholas C. Zakas)
  • 0bcaad1 Docs: Update README (Nicholas C. Zakas)

v0.1.4 - January 20, 2016

  • f258fd4 Fix: Binary script filename (Nicholas C. Zakas)

v0.1.3 - January 20, 2016

  • c783701 Fix: Add path to binary (Nicholas C. Zakas)

v0.1.2 - January 20, 2016

  • bed64d9 Fix: Another typo in the script (Nicholas C. Zakas)

v0.1.1 - January 20, 2016

  • 4e8adcd Fix: Typo on method (Nicholas C. Zakas)

v0.1.0 - January 20, 2016

  • 106ea59 Build: Include release script (Nicholas C. Zakas)
  • 2334e4a New: Initial commit (Nicholas C. Zakas)