Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eslint/eslint-release
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ea84e9838a766bc2e26f19de4ee0a16b10aa3a2b
Choose a base ref
...
head repository: eslint/eslint-release
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2135c05a6c6ddcd7b704ffa26f813140e75e07d7
Choose a head ref

Commits on Aug 10, 2020

  1. Chore: move to GitHub Actions

    Kai Cataldo committed Aug 10, 2020
    Copy the full SHA
    60eb528 View commit details

Commits on Aug 11, 2020

  1. Chore: typo in GitHub Actions CI workflow (#40)

    * Fix: typo in GitHub Actions CI workflow
    
    * Update ci.yml
    
    * Only run linting once
    
    * Update ci.yml
    
    * Update ci.yml
    Kai Cataldo authored Aug 11, 2020
    Copy the full SHA
    b13a435 View commit details

Commits on Aug 14, 2020

  1. Breaking: drop support for Node <10 (#41)

    Kai Cataldo authored Aug 14, 2020
    Copy the full SHA
    2a24936 View commit details
  2. Build: changelog update for 3.0.0

    ESLint Jenkins committed Aug 14, 2020
    Copy the full SHA
    d65c381 View commit details
  3. 3.0.0

    ESLint Jenkins committed Aug 14, 2020
    Copy the full SHA
    b2d4e47 View commit details

Commits on Aug 24, 2020

  1. Copy the full SHA
    7330f24 View commit details

Commits on Sep 1, 2020

  1. Copy the full SHA
    348f5f7 View commit details
  2. Build: changelog update for 3.0.1

    ESLint Jenkins committed Sep 1, 2020
    Copy the full SHA
    f609048 View commit details
  3. 3.0.1

    ESLint Jenkins committed Sep 1, 2020
    Copy the full SHA
    8fc924c View commit details
  4. Fix: Version number

    nzakas authored Sep 1, 2020
    Copy the full SHA
    f3a9411 View commit details
  5. Build: changelog update for 3.1.2

    ESLint Jenkins committed Sep 1, 2020
    Copy the full SHA
    518632d View commit details
  6. 3.1.2

    ESLint Jenkins committed Sep 1, 2020
    Copy the full SHA
    3826b57 View commit details

Commits on Nov 27, 2020

  1. Copy the full SHA
    c70860f View commit details
  2. Copy the full SHA
    86af6a8 View commit details

Commits on Feb 12, 2021

  1. Docs: Update README to reflect reality (fixes #36) (#49)

    * Docs: Update README to reflect reality (fixes #36)
    
    * Update README.md
    
    Co-authored-by: Antoine Leblanc <ant.leblanc@gmail.com>
    
    Co-authored-by: Antoine Leblanc <ant.leblanc@gmail.com>
    nzakas and antleblanc authored Feb 12, 2021
    Copy the full SHA
    c1391a4 View commit details

Commits on Apr 24, 2021

  1. Copy the full SHA
    4ea4f6b View commit details

Commits on Apr 26, 2021

  1. Copy the full SHA
    a968dff View commit details

Commits on Apr 29, 2021

  1. Fix: Omit sponsors sync from changelog (#53)

    * Fix: Make npm install work
    
    * Fix: Omit Sponsors Syncs from changelog (fixes #50)
    
    * Update .eslintrc.yml
    
    Co-authored-by: 薛定谔的猫 <weiran.zsd@outlook.com>
    
    Co-authored-by: 薛定谔的猫 <weiran.zsd@outlook.com>
    nzakas and aladdin-add authored Apr 29, 2021
    Copy the full SHA
    397557b View commit details

Commits on May 4, 2021

  1. Update: Support conventional commits (#55)

    * Update: Accept conventional commits
    
    * Formatting
    
    * Fix lint errors
    nzakas authored May 4, 2021
    Copy the full SHA
    0fdda4d View commit details

Commits on Oct 30, 2021

  1. Copy the full SHA
    182e1f3 View commit details

Commits on Nov 2, 2021

  1. Build: changelog update for 3.2.0

    ESLint Jenkins committed Nov 2, 2021
    Copy the full SHA
    ffa1c69 View commit details
  2. 3.2.0

    ESLint Jenkins committed Nov 2, 2021
    Copy the full SHA
    4a579bf View commit details

Commits on Feb 22, 2022

  1. Copy the full SHA
    198c7e7 View commit details

Commits on Jan 28, 2023

  1. Copy the full SHA
    e4cc0d1 View commit details

Commits on Aug 2, 2023

  1. chore: standardize npm script names (#60)

    * chore: standardize npm script names
    
    * chore: update scripts
    snitin315 authored Aug 2, 2023
    Copy the full SHA
    a453432 View commit details

Commits on Nov 15, 2023

  1. Build: changelog update for 3.2.1

    Jenkins committed Nov 15, 2023
    Copy the full SHA
    bec2601 View commit details
  2. 3.2.1

    Jenkins committed Nov 15, 2023
    Copy the full SHA
    c55858f View commit details

Commits on Feb 19, 2024

  1. chore: remove dependency shelljs (#61)

    * chore: remove dependency shelljs
    
    * delete temporary test directories
    fasttime authored Feb 19, 2024
    Copy the full SHA
    e419afd View commit details

Commits on Feb 21, 2024

  1. Build: changelog update for 3.2.2

    Jenkins committed Feb 21, 2024
    Copy the full SHA
    93b834a View commit details
  2. 3.2.2

    Jenkins committed Feb 21, 2024
    Copy the full SHA
    2135c05 View commit details
Showing with 436 additions and 94 deletions.
  1. +5 −1 .eslintrc.yml
  2. +18 −0 .github/workflows/add-to-triage.yml
  3. +38 −0 .github/workflows/ci.yml
  4. +0 −7 .travis.yml
  5. +38 −0 CHANGELOG.md
  6. +23 −36 README.md
  7. +83 −27 lib/release-ops.js
  8. +7 −2 lib/shell-ops.js
  9. +13 −12 package.json
  10. +211 −9 tests/lib/release-ops.js
6 changes: 5 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
env:
node: true
extends: "eslint-config-eslint"
parserOptions:
ecmaVersion: 2021
rules:
no-console: 0
no-console: 0
require-unicode-regexp: 0
node/no-process-exit: 0
18 changes: 18 additions & 0 deletions .github/workflows/add-to-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add to Triage

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.0
with:
project-url: https://github.com/orgs/eslint/projects/3
github-token: ${{ secrets.PROJECT_BOT_TOKEN }}
labeled: "triage:no"
label-operator: NOT
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Install dependencies
run: npm install
- name: Lint files
run: npm run lint
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
node: [16.x, 15.x, 14.x, 13.x, 12.x, 10.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
v3.2.2 - February 21, 2024

* [`e419afd`](https://github.com/eslint/eslint-release/commit/e419afdcb6465fe44ed23cbd93861a3757fbb56d) chore: remove dependency shelljs (#61) (Francesco Trotta)

v3.2.1 - November 15, 2023

* [`a453432`](https://github.com/eslint/eslint-release/commit/a4534320eb81cb49487c9df07acd41cecc19abbb) chore: standardize npm script names (#60) (Nitin Kumar)
* [`e4cc0d1`](https://github.com/eslint/eslint-release/commit/e4cc0d1901abd6d24f01ddca6aac9c4050886ee7) chore: add triage action (#59) (Milos Djermanovic)
* [`198c7e7`](https://github.com/eslint/eslint-release/commit/198c7e700e501f2762f41396635b74fdb7d04e06) docs: update badges (#58) (Milos Djermanovic)

v3.2.0 - November 2, 2021

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

v3.1.2 - September 1, 2020

* [`f3a9411`](https://github.com/eslint/eslint-release/commit/f3a9411d70a89509f130f0d205c1ac4c37465262) Fix: Version number (Nicholas C. Zakas)
* [`8fc924c`](https://github.com/eslint/eslint-release/commit/8fc924c4c82f1d6d154c82c9d4dc0e0108303686) 3.0.1 (ESLint Jenkins)
* [`f609048`](https://github.com/eslint/eslint-release/commit/f6090485223bb96802a3c55d25b0074663e6580c) Build: changelog update for 3.0.1 (ESLint Jenkins)
* [`348f5f7`](https://github.com/eslint/eslint-release/commit/348f5f78614dfc2077ea11d2ba4c44854e1960da) Fix: Use specific git command to push (#45) (Nicholas C. Zakas)

v3.0.1 - September 1, 2020

* [`348f5f7`](https://github.com/eslint/eslint-release/commit/348f5f78614dfc2077ea11d2ba4c44854e1960da) Fix: Use specific git command to push (#45) (Nicholas C. Zakas)

v3.0.0 - August 14, 2020

* [`2a24936`](https://github.com/eslint/eslint-release/commit/2a249361d032b5151489f991fae42e5bfce2d6c2) Breaking: drop support for Node <10 (#41) (Kai Cataldo)
* [`b13a435`](https://github.com/eslint/eslint-release/commit/b13a4354291702a96ab09c0e2b3d169a20b2c7a2) Chore: typo in GitHub Actions CI workflow (#40) (Kai Cataldo)
* [`60eb528`](https://github.com/eslint/eslint-release/commit/60eb52884c9d5a4e51001110d216959cc3974e57) Chore: move to GitHub Actions (Kai Cataldo)

v2.0.1 - July 14, 2020

* [`d3884eb`](https://github.com/eslint/eslint-release/commit/d3884eb56d11db9d169a87f3ea2969a6dff3effa) Fix: blank line between changelog and last version (#39) (Tony Brix)
59 changes: 23 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][downloads-url]
[![Join the chat at https://gitter.im/eslint/eslint](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/eslint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status][build-image]][build-url]

# ESLint Release Tool

@@ -18,52 +18,43 @@ You can install the ESLint release tool using [npm](https://npmjs.com):
$ npm install eslint-release --save-dev
```

## Local Usage
## Usage

The ESLint release tool is designed to be used on the command line and has two modes: regular release and prerelease.
To start, you'll need to define two environment variables:

To run a regular release:
* `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).

```
$ eslint-release
```
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 run a prerelease, you need to include the prerelease identifier:
To generate a regular release:

```
$ eslint-prerelease alpha
$ eslint-generate-release
```

You can optionally include the release tool in another Node.js script:
To generate a prerelease, you need to include the prerelease identifier:

```js
var ReleaseOps = require("eslint-release");
```
$ eslint-generate-prerelease alpha
```

## CI Usage

When run in a CI environment like Jenkins, the ESLint release tool has different commands that allow for incorporation into more complex release scripts. 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).
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.

To run a release in a CI environment:
For both releases and prereleases, you can then publish the release:

```
$ eslint-ci-release
$ eslint-publish-release
```

This will generate a new version, update the changelog, and publish to npm but will not push back to GitHub. It will also generate a `.releaseInfo.json` file.

Your CI system must manually push the repository changes to GitHub (including the version tag). After that, you can publish release notes by running:
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.

```
$ eslint-gh-release
```

This command looks for the `.releaseInfo.json` file and uses that information to determine where to post release notes and what to post.
You can optionally include the release tool in another Node.js script:

**Note:** In Jenkins, `eslint-gh-release` must be run as the last step in the build (typically in a post-build script that occurs after the GitHub repository has been updated).
```js
var ReleaseOps = require("eslint-release");
```

## What It Does

@@ -82,25 +73,21 @@ When you run the release tool for a regular release, the following steps take pl

When you do a prerelease, the same steps are taken except that package is published to npm under the `next` tag instead of `latest`.

## Team

These folks keep the project moving and are resources for help:

* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead

## Contributing

Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-release/issues).
Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](https://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-release/issues).

### License

MIT License

### Where to ask for help?

Join our [Chatroom](https://gitter.im/eslint/eslint)
Join our [Chatroom](https://eslint.org/chat/help)

[npm-image]: https://img.shields.io/npm/v/eslint-release.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/eslint-release
[downloads-image]: https://img.shields.io/npm/dm/eslint-release.svg?style=flat-square
[downloads-url]: https://www.npmjs.com/package/eslint-release
[build-image]: https://github.com/eslint/eslint-release/workflows/CI/badge.svg
[build-url]: https://github.com/eslint/eslint-release/actions
110 changes: 83 additions & 27 deletions lib/release-ops.js
Original file line number Diff line number Diff line change
@@ -5,17 +5,12 @@
* MIT License
*/

/* global test, cat, rm, mv */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

// TODO: Update to use non-global module to avoid prototype pollution.
require("shelljs/global");

const fs = require("fs"),
path = require("path"),
semver = require("semver"),
@@ -27,10 +22,43 @@ const fs = require("fs"),
// Private
//------------------------------------------------------------------------------

const commitTagMap = new Map([
["fix", "fix"],
["fix!", "breaking"],
["build", "build"],
["chore", "chore"],
["perf", "chore"],
["ci", "chore"],
["refactor", "chore"],
["test", "chore"],
["docs", "docs"],
["update", "update"],
["upgrade", "upgrade"],
["new", "new"],
["feat", "new"],
["breaking", "breaking"],
["feat!", "breaking"]
]);

// var OPEN_SOURCE_LICENSES = [
// /MIT/, /BSD/, /Apache/, /ISC/, /WTF/, /Public Domain/
// ];

/**
* Tests if a file exists.
* @param {string} file The path of the file to be tested.
* @returns {boolean} `true` if the specified path denotes an existing file, otherwise `false`.
*/
function fileExists(file) {

// We can't use the `throwIfNoEntry` option with `fs.statSync`, because it's not supported in Node.js 10,
// so we check if the file exists in advance.
if (!fs.existsSync(file)) {
return false;
}
return fs.statSync(file).isFile();
}

/**
* Loads the package.json file from the current directory.
* @returns {void}
@@ -48,7 +76,7 @@ function getPackageInfo() {
* @private
*/
function validateSetup() {
if (!test("-f", "package.json")) {
if (!fileExists("package.json")) {
console.error("Missing package.json file");
ShellOps.exit(1);
}
@@ -128,7 +156,7 @@ function getVersionTags() {
* @private
*/
function parseLogs(logs) {
const regexp = /^\* ([0-9a-f]{40}) ((?:([a-z]+): ?)?.*) \((.*)\)/i,
const regexp = /^\* ([0-9a-f]{40}) ((?:([a-z]+!?): ?)?.*) \((.*)\)/i,
parsed = [];

logs.forEach(log => {
@@ -139,13 +167,14 @@ function parseLogs(logs) {
raw: match[0],
sha: match[1],
title: match[2],
flag: match[3] ? match[3].toLowerCase() : null,
flag: commitTagMap.get(match[3] ? match[3].toLowerCase() : null),
author: match[4],
body: ""
});
} else if (parsed.length) {
parsed[parsed.length - 1].body += `${log}\n`;
}

});

return parsed;
@@ -157,7 +186,7 @@ function parseLogs(logs) {
* @param {Object[]} logs An array of parsed commit log messages.
* @returns {Object[]} An array of parsed commit log messages.
*/
function excludeReverts(logs) {
function excludeRevertsAndSponsorSyncs(logs) {
const newLogs = logs.slice();

const revertRegex = /This reverts commit ([0-9a-f]{40})/,
@@ -178,6 +207,8 @@ function excludeReverts(logs) {
newLogs[shaIndexMap[sha]] = null;
newLogs[i] = null;
}
} else if (/^Sponsors: Sync/.test(log.title)) {
newLogs[i] = null;
} else {
shaIndexMap[log.sha] = i;
}
@@ -197,7 +228,7 @@ function excludeReverts(logs) {
*/
function calculateReleaseFromGitLogs(currentVersion, logs, prereleaseId) {

const excludedLogs = excludeReverts(parseLogs(logs));
const excludedLogs = excludeRevertsAndSponsorSyncs(parseLogs(logs));

const changelog = {},
repository = getPackageInfo().repository;
@@ -312,27 +343,27 @@ function calculateReleaseInfo(prereleaseId) {
*/
function writeChangelog(releaseInfo) {

// get most recent two tags
// get today's date in "mmmm d, yyyy" format
const now = new Date(),
timestamp = dateformat(now, "mmmm d, yyyy");

// output header
(`v${releaseInfo.version} - ${timestamp}\n`).to("CHANGELOG.tmp");
today = dateformat(now, "mmmm d, yyyy");

// output changelog
(`\n${releaseInfo.rawChangelog}\n\n`).toEnd("CHANGELOG.tmp");
// output header and changelog
fs.writeFileSync(
"CHANGELOG.tmp",
`v${releaseInfo.version} - ${today}\n\n${releaseInfo.rawChangelog}\n\n`
);

// ensure there's a CHANGELOG.md file
if (!test("-f", "CHANGELOG.md")) {
if (!fileExists("CHANGELOG.md")) {
fs.writeFileSync("CHANGELOG.md", "");
}

// switch-o change-o
// `cat` returns a ShellString and `fs.writeFileSync` is throwing an error saying that this must be a String.
fs.writeFileSync("CHANGELOG.md.tmp", cat("CHANGELOG.tmp", "CHANGELOG.md").toString());
rm("CHANGELOG.tmp");
rm("CHANGELOG.md");
mv("CHANGELOG.md.tmp", "CHANGELOG.md");
const data = `${fs.readFileSync("CHANGELOG.tmp", "utf-8")}${fs.readFileSync("CHANGELOG.md", "utf-8")}`;

fs.writeFileSync("CHANGELOG.md.tmp", data);
fs.unlinkSync("CHANGELOG.tmp");
fs.unlinkSync("CHANGELOG.md");
fs.renameSync("CHANGELOG.md.tmp", "CHANGELOG.md");
}

/**
@@ -373,6 +404,30 @@ function generateRelease(prereleaseId) {
fs.writeFileSync(".eslint-release-info.json", JSON.stringify(releaseInfo, null, 4));
}

/**
* Creates release body text from a changelog information.
* @param {Object} [changelog] The changelog information.
* @returns {string} THe release body text
*/
function generateReleaseBody(changelog) {
const logFlags = [
{ flag: "breaking", title: "Breaking Changes" },
{ flag: "new", title: "Features" },
{ flag: "update", title: "Enhancements" },
{ flag: "fix", title: "Bug Fixes" },
{ flag: "docs", title: "Documentation" },
{ flag: "upgrade", title: "Dependency Upgrades" },
{ flag: "build", title: "Build Related" },
{ flag: "chore", title: "Chores" }
];

return logFlags
.map(({ flag, title }) => ({ title, logs: changelog[flag] }))
.filter(({ logs }) => logs && logs.length > 0)
.map(({ title, logs }) => `## ${title}\n${logs.join("\n")}`)
.join("\n\n");
}

/**
* Publishes the release information to GitHub.
* @param {Object} releaseInfo The release information object.
@@ -388,7 +443,7 @@ function publishReleaseToGitHub(releaseInfo) {

return repo.createRelease({
tag_name: tag, // eslint-disable-line camelcase
body: releaseInfo.rawChangelog,
body: generateReleaseBody(releaseInfo.changelog),
prerelease: !!semver.prerelease(releaseInfo.version)
}).then(() => {
console.log("Posted release notes to GitHub");
@@ -444,7 +499,7 @@ function publishRelease() {
}

console.log("Publishing to git");
ShellOps.exec("git push origin master --tags");
ShellOps.exec("git push origin HEAD --tags");

publishReleaseToGitHub(releaseInfo);

@@ -462,5 +517,6 @@ module.exports = {
calculateReleaseInfo,
getChangelogCommitRange,
calculateReleaseFromGitLogs,
writeChangelog
writeChangelog,
generateReleaseBody
};
9 changes: 7 additions & 2 deletions lib/shell-ops.js
Original file line number Diff line number Diff line change
@@ -30,10 +30,15 @@ module.exports = {
*/
getModifiedEnv(platform = process.platform, defaultEnv = process.env) {
const env = {},
pathSeparator = platform === "win32" ? ";" : ":";
isWindows = platform === "win32",
pathSeparator = isWindows ? ";" : ":";

Object.keys(defaultEnv).forEach(key => {
env[key] = defaultEnv[key];

// environmental variable names are case-insensitive in windows
const compatKey = isWindows ? key.toUpperCase() : key;

env[compatKey] = defaultEnv[key];
});

// modify PATH to use local node_modules
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "eslint-release",
"version": "2.0.1",
"version": "3.2.2",
"description": "ESLint Release Tools",
"main": "./lib/release-ops",
"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
},
"bin": {
"eslint-generate-release": "./bin/eslint-generate-release.js",
"eslint-generate-prerelease": "./bin/eslint-generate-prerelease.js",
"eslint-publish-release": "./bin/eslint-publish-release.js"
},
"scripts": {
"test": "npm run lint && mocha tests/lib/*.js",
"lint": "eslint .",
"generate-alpharelease": "node ./bin/eslint-generate-prerelease.js alpha",
"generate-betarelease": "node ./bin/eslint-generate-prerelease.js beta",
"generate-release": "node ./bin/eslint-generate-release.js",
"publish-release": "node ./bin/eslint-publish-release.js"
"release:generate:latest": "node ./bin/eslint-generate-release.js",
"release:generate:alpha": "node ./bin/eslint-generate-prerelease.js alpha",
"release:generate:beta": "node ./bin/eslint-generate-prerelease.js beta",
"release:generate:rc": "node ./bin/eslint-generate-prerelease.js rc",
"release:publish": "node ./bin/eslint-publish-release.js",
"test": "mocha tests/lib/*.js"
},
"files": [
"bin",
@@ -39,9 +40,10 @@
"homepage": "https://github.com/eslint/eslint-release#readme",
"devDependencies": {
"chai": "^4.2.0",
"eslint": "^5.16.0",
"eslint-config-eslint": "^5.0.1",
"eslint-plugin-node": "^9.1.0",
"eslint": "^7.25.0",
"eslint-config-eslint": "^7.0.0",
"eslint-plugin-jsdoc": "^32.3.1",
"eslint-plugin-node": "^11.1.0",
"leche": "^2.3.0",
"mocha": "^6.1.4",
"sinon": "^1.17.2"
@@ -50,7 +52,6 @@
"dateformat": "^3.0.3",
"github-api": "^3.2.2",
"linefix": "^0.1.1",
"semver": "^6.1.1",
"shelljs": "^0.8.3"
"semver": "^6.1.1"
}
}
220 changes: 211 additions & 9 deletions tests/lib/release-ops.js

Large diffs are not rendered by default.