From 4fe8897b398deb4fe17a5e6712196e9093b3c3d3 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sat, 8 Mar 2025 17:01:01 -0800 Subject: [PATCH 1/4] test: add tests for shelljs glob expansion No change to logic. This adds unit tests for glob expansion. This includes one test case for behavior which was broken by v0.9.0 (probably due to the switch to fastglob). This behavior hasn't been fixed yet, so the test is marked as skipped. Issue #1197 --- test/config.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/config.js b/test/config.js index 30ee84e6..b505a643 100644 --- a/test/config.js +++ b/test/config.js @@ -84,6 +84,42 @@ test('config.globOptions expands directories by default', t => { t.deepEqual(result, expected); }); +test('config.globOptions handles non-wildcards by default', t => { + const result = common.expand(['test/resources/a.txt']); + const expected = [ + 'test/resources/a.txt', + ]; + t.deepEqual(result, expected); +}); + +test('config.globOptions expands "?" symbol by default', t => { + const result = common.expand(['test/resources/file?.t*']); + const expected = [ + 'test/resources/file1.txt', + 'test/resources/file2.txt', + ]; + t.deepEqual(result, expected); +}); + +test('config.globOptions expands "*" in multiple path segments by default', t => { + const result = common.expand(['test/r*sources/file?.txt']); + const expected = [ + 'test/resources/file1.txt', + 'test/resources/file2.txt', + ]; + t.deepEqual(result, expected); +}); + +// https://github.com/shelljs/shelljs/issues/1197 +test.skip('config.globOptions expands "?" in folder path by default', t => { + const result = common.expand(['test/r?sources/file*.txt']); + const expected = [ + 'test/resources/file1.txt', + 'test/resources/file2.txt', + ]; + t.deepEqual(result, expected); +}); + test('config.globOptions respects cwd', t => { // Both node-glob and fast-glob call this option 'cwd'. shell.config.globOptions = { cwd: 'test' }; From c94a3979d0d1ce9d1918d16793b1b2b34b535e4a Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sat, 8 Mar 2025 17:55:52 -0800 Subject: [PATCH 2/4] chore: remove unused env var No change to logic. This env variable isn't relevant since we dropped support for older node versions. --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f455517a..7cede0ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,8 +2,6 @@ name: CI on: - push - pull_request -env: - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true jobs: test: name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }} From 0a47587c92f1d77789d670ce7b27e11a3bc4a103 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sat, 8 Mar 2025 22:41:15 -0800 Subject: [PATCH 3/4] fix: add package.json to exports list No change to logic. shx has a dependency on shelljs/package.json so that it can read the ShellJS version number. This is useful for shx and probably harmless for other packages (we need to ship the package.json file anyway), so this adds it to the exports list as an optional export. Fixes #1195 Test: I ran `shx --version` with this copy of shelljs as the dependency --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index d6e8c016..89a5319f 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,8 @@ "./global.js": "./global.js", "./make": "./make.js", "./make.js": "./make.js", + "./package": "./package.json", + "./package.json": "./package.json", "./plugin": "./plugin.js", "./plugin.js": "./plugin.js" }, From b90139fb62b3188c290932d16169dd73e7643a85 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sun, 16 Mar 2025 17:50:04 -0700 Subject: [PATCH 4/4] 0.9.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index aab7c340..a50d8907 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shelljs", - "version": "0.9.1", + "version": "0.9.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shelljs", - "version": "0.9.1", + "version": "0.9.2", "license": "BSD-3-Clause", "dependencies": { "execa": "^1.0.0", diff --git a/package.json b/package.json index 89a5319f..732ef887 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shelljs", - "version": "0.9.1", + "version": "0.9.2", "description": "Portable Unix shell commands for Node.js", "keywords": [ "shelljs",