Skip to content

Commit b70e666

Browse files
committed
chore: update shelljs and drop old node support
This updates the ShellJS peer dependency to the latest release. This also drops support for all node versions prior to v18 to match ShellJS's version range. This includes some changes due to the latest shelljs version: * `shx sed -i` will now run silently. This is compatible with unix behavior. See shelljs/shelljs#959 * `shx --version` no longer prints the ShellJS version. This is a consequence of the switch to an explicit "exports" list in shelljs (see shelljs/shelljs#1195 and shelljs/shelljs#1135). Test: npm test
1 parent f8b0b37 commit b70e666

File tree

6 files changed

+9
-22
lines changed

6 files changed

+9
-22
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
node-version:
15-
- 6
16-
- 7
17-
- 8
18-
- 9
19-
- 10
20-
- 11
21-
- 12
22-
- 13
23-
- 14
24-
- 15
25-
- 16
26-
- 17
2715
- 18
2816
- 19
2917
- 20

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
commands, providing an easy solution for simple Unix-like, cross-platform
1010
commands in npm package scripts.
1111

12-
`shx` is proudly tested on every node release since <!-- start minVersion -->`v6`<!-- stop minVersion -->!
12+
`shx` is proudly tested on every node release since <!-- start minVersion -->`v18`<!-- stop minVersion -->!
1313

1414
## Difference Between ShellJS and shx
1515

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@
5656
"babel-register": "^6.7.2",
5757
"concurrently": "^5.3.0",
5858
"eslint": "^5.16.0",
59-
"eslint-import-resolver-node": "0.3.7",
6059
"eslint-config-airbnb-base": "^14.2.1",
60+
"eslint-import-resolver-node": "0.3.7",
6161
"eslint-plugin-import": "^2.26.0",
6262
"js-yaml": "^4.1.0",
6363
"mocha": "^6.2.3",
6464
"nyc": "^14.1.1",
6565
"rimraf": "^2.5.2",
6666
"shelljs-changelog": "^0.2.6",
67-
"shelljs-plugin-open": "^0.2.1",
67+
"shelljs-plugin-open": "^0.3.0",
6868
"shelljs-release": "^0.5.2",
6969
"should": "^13.2.3",
7070
"watch": "^1.0.2"
7171
},
7272
"dependencies": {
7373
"minimist": "^1.2.6",
74-
"shelljs": "^0.8.5"
74+
"shelljs": "^0.9.1"
7575
},
7676
"engines": {
77-
"node": ">=6"
77+
"node": ">=18"
7878
}
7979
}

scripts/check-node-support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var yaml = require('js-yaml');
88
var shell = require('shelljs');
99

1010
// This is the authoritative list of supported node versions.
11-
var MIN_NODE_VERSION = 6;
11+
var MIN_NODE_VERSION = 18;
1212
var MAX_NODE_VERSION = 22;
1313

1414
function checkReadme(minNodeVersion) {

src/shx.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ export function shx(argv) {
4343
const parsedArgs = minimist(argv.slice(2), { stopEarly: true, boolean: true });
4444
if (parsedArgs.version) {
4545
const shxVersion = require('../package.json').version;
46-
const shelljsVersion = require('shelljs/package.json').version;
47-
console.log(`shx v${shxVersion} (using ShellJS v${shelljsVersion})`);
46+
console.log(`shx v${shxVersion}`);
4847
return EXIT_CODES.SUCCESS;
4948
}
5049
const [fnName, ...args] = parsedArgs._;

test/specs/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('cli', () => {
122122
describe('global flags', () => {
123123
it('supports --version', () => {
124124
const output = cli('--version');
125-
output.stdout.should.match(/shx v\S+ \(using ShellJS v\S+\)\n/);
125+
output.stdout.should.match(/shx v\S+\n/);
126126
output.stderr.should.equal('');
127127
output.code.should.equal(0);
128128
});
@@ -351,7 +351,7 @@ describe('cli', () => {
351351
it('works with /g and -i', () => {
352352
const output = cli('sed', '-i', 's/foo/bar/g', testFileName1);
353353
const expected = 'bar\nbarsomething\nbarbarsomething\n';
354-
output.stdout.should.equal(expected);
354+
output.stdout.should.equal('');
355355
shell.cat(testFileName1).stdout.should.equal(expected);
356356
});
357357

0 commit comments

Comments
 (0)