From 4441c5f4687ac1c5ea7ec47aa670c1c6c677eaf9 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 15 Sep 2023 13:05:27 -0700 Subject: [PATCH 1/3] [actions] use reusable rebase action --- .github/workflows/rebase.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 5b6d04b..b9e1712 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -4,12 +4,6 @@ on: [pull_request_target] jobs: _: - name: "Automatic Rebase" - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: ljharb/rebase@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ljharb/actions/.github/workflows/rebase.yml@main + secrets: + token: ${{ secrets.GITHUB_TOKEN }} From 343ea4417a4443bcc99b14bb71c8b29440b836e1 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 15 Sep 2023 13:07:59 -0700 Subject: [PATCH 2/3] [Fix] allow `npx resolve` to work (#316) Fixes #316. --- .github/workflows/executable.yml | 19 +++++++++++++++++++ bin/resolve | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/executable.yml diff --git a/.github/workflows/executable.yml b/.github/workflows/executable.yml new file mode 100644 index 0000000..cbbb147 --- /dev/null +++ b/.github/workflows/executable.yml @@ -0,0 +1,19 @@ +name: resolve executable + +on: [push, pull_request] + +jobs: + _: + name: cli + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@main + - run: "[ $(./bin/resolve fs) = 'fs' ]" + name: run inside the package with a direct path + - run: "npm link && [ $(resolve fs) = 'fs' ] && npm uninstall -g resolve" + name: run linked as a global in the PATH + - run: "[ $(npx resolve fs) = 'fs' ]" + name: run via npx diff --git a/bin/resolve b/bin/resolve index 4c1884a..21d1a87 100755 --- a/bin/resolve +++ b/bin/resolve @@ -11,7 +11,7 @@ if ( !process.argv || process.argv.length < 2 || (process.argv[1] !== __filename && fs.statSync(process.argv[1]).ino !== fs.statSync(__filename).ino) - || (process.env._ && fs.realpathSync(path.resolve(process.env._)) !== __filename) + || (process.env.npm_lifecycle_event !== 'npx' && process.env._ && fs.realpathSync(path.resolve(process.env._)) !== __filename) ) ) { console.error('Error: `resolve` must be run directly as an executable'); From 2ae67c11e6009b9c94932fc552f688204168edd7 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 15 Sep 2023 14:32:23 -0700 Subject: [PATCH 3/3] v1.22.6 - [Fix] allow `npx resolve` to work (#316) - [actions] use reusable rebase action --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 354f527..05304ad 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "resolve", "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", - "version": "1.22.5", + "version": "1.22.6", "repository": { "type": "git", "url": "git://github.com/browserify/resolve.git"