Skip to content

Commit 02593ba

Browse files
author
Robert Jackson
committed
Drop support for Node 6 and 11.
1 parent ba4abd8 commit 02593ba

4 files changed

Lines changed: 26 additions & 27 deletions

File tree

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
language: node_js
33
node_js:
4-
- "10"
4+
- "12"
55

66
sudo: false
77
dist: trusty
@@ -33,13 +33,13 @@ jobs:
3333

3434
- stage: additional tests
3535
env: NAME=floating dependencies
36-
install: yarn install --no-lockfile --non-interactive --ignore-engines
36+
install: yarn install --no-lockfile --non-interactive
3737
script: yarn test
3838

39-
- env: NAME=Node_6
40-
node_js: "6"
39+
- name: "Node 10"
40+
node_js: "10"
4141

42-
- env: NAME=Node_8
42+
- name: "Node 8"
4343
node_js: "8"
4444

4545

@@ -48,7 +48,7 @@ before_install:
4848
- export PATH=$HOME/.yarn/bin:$PATH
4949

5050
install:
51-
- yarn install --ignore-engines
51+
- yarn install
5252

5353
script:
5454
- yarn test

commands/global/new.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module.exports.handler = function handler(options) {
9393
---
9494
language: node_js
9595
node_js:
96-
- "6"
96+
- "8"
9797
9898
sudo: false
9999
dist: trusty

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"walk-sync": "^1.1.3"
6565
},
6666
"engines": {
67-
"node": "6.* || 8.* || >= 10"
67+
"node": "8.* || 10.* || >= 12"
6868
},
6969
"publishConfig": {
7070
"registry": "https://registry.npmjs.org"

src/bin-support.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
function runTransform(binRoot, transformName, args) {
3+
async function runTransform(binRoot, transformName, args) {
44
const globby = require('globby');
55
const execa = require('execa');
66
const chalk = require('chalk');
@@ -9,27 +9,26 @@ function runTransform(binRoot, transformName, args) {
99

1010
let { paths, options } = parseTransformArgs(args);
1111

12-
return globby(paths)
13-
.then(paths => {
14-
let transformPath = path.join(binRoot, '..', 'transforms', transformName, 'index.js');
12+
try {
13+
let foundPaths = await globby(paths);
14+
let transformPath = path.join(binRoot, '..', 'transforms', transformName, 'index.js');
1515

16-
let jscodeshiftPkg = require('jscodeshift/package');
17-
let jscodeshiftPath = path.dirname(require.resolve('jscodeshift/package'));
18-
let binPath = path.join(jscodeshiftPath, jscodeshiftPkg.bin.jscodeshift);
16+
let jscodeshiftPkg = require('jscodeshift/package');
17+
let jscodeshiftPath = path.dirname(require.resolve('jscodeshift/package'));
18+
let binPath = path.join(jscodeshiftPath, jscodeshiftPkg.bin.jscodeshift);
1919

20-
return execa(binPath, ['-t', transformPath, '--extensions', 'js,ts', ...paths], {
21-
stdio: 'inherit',
22-
env: {
23-
CODEMOD_CLI_ARGS: JSON.stringify(options),
24-
},
25-
});
26-
})
27-
.catch(error => {
28-
console.error(chalk.red(error.stack)); // eslint-disable-line no-console
29-
process.exitCode = 1;
30-
31-
throw error;
20+
return execa(binPath, ['-t', transformPath, '--extensions', 'js,ts', ...foundPaths], {
21+
stdio: 'inherit',
22+
env: {
23+
CODEMOD_CLI_ARGS: JSON.stringify(options),
24+
},
3225
});
26+
} catch (error) {
27+
console.error(chalk.red(error.stack)); // eslint-disable-line no-console
28+
process.exitCode = 1;
29+
30+
throw error;
31+
}
3332
}
3433

3534
module.exports = {

0 commit comments

Comments
 (0)