From 805e3077d0f6d9dc399908ddb3fec67a54810857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Wed, 19 Apr 2023 10:23:15 +0800 Subject: [PATCH 01/24] build: run tests on node.js v20 --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b67b04ae..f9b7d2bc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -18,7 +18,7 @@ jobs: # node-14's npm must be updated, but no longer updatable due to: # https://github.com/npm/cli/issues/2663 # because of this, node-14 test strategy is removed :( - node-version: [16.x, 18.x, 19.x] + node-version: [16.x, 18.x, 19.x, 20.x] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 From 9609ce65ff4a41e004c7c015bfb3f056d41fc4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Wed, 26 Apr 2023 09:57:35 +0800 Subject: [PATCH 02/24] build: add nightly build --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f9b7d2bc..86251146 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -18,7 +18,7 @@ jobs: # node-14's npm must be updated, but no longer updatable due to: # https://github.com/npm/cli/issues/2663 # because of this, node-14 test strategy is removed :( - node-version: [16.x, 18.x, 19.x, 20.x] + node-version: [16.x, 18.x, 19.x, 20.x, nightly] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 From 9d790afdbb615a506d282334a6598997540a2e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Wed, 26 Apr 2023 09:59:20 +0800 Subject: [PATCH 03/24] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 86251146..0e192441 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -18,7 +18,7 @@ jobs: # node-14's npm must be updated, but no longer updatable due to: # https://github.com/npm/cli/issues/2663 # because of this, node-14 test strategy is removed :( - node-version: [16.x, 18.x, 19.x, 20.x, nightly] + node-version: [16.x, 18.x, 19.x, 20.x, 20-nightly] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 From 77799d478abb4d48087d9abf5180310d37bddf09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Wed, 26 Apr 2023 10:09:29 +0800 Subject: [PATCH 04/24] Update node.js.yml --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0e192441..b401575d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -14,6 +14,7 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 12 strategy: + fail-fast: false matrix: # node-14's npm must be updated, but no longer updatable due to: # https://github.com/npm/cli/issues/2663 From 783b6034cf2fcd9a60283d38f9bfb58a4f930f4d Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 9 May 2023 10:24:47 -0700 Subject: [PATCH 05/24] remove maximum node version condition from package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 294e14d8..4b69c3c3 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "rewire" ], "engines": { - "node": ">=14.16.0 <=19.9.0" + "node": ">=14.16.0" }, "dependencies": { "resolvewithplus": "^2.0.1" From 3286b55414b01ba5320d7ca5dd05a3d718179fea Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 14 May 2023 09:57:01 -0700 Subject: [PATCH 06/24] mv node.js.yml test.yml --- .github/workflows/{node.js.yml => test.yml} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename .github/workflows/{node.js.yml => test.yml} (89%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/test.yml similarity index 89% rename from .github/workflows/node.js.yml rename to .github/workflows/test.yml index b401575d..66876813 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,8 @@ jobs: # node-14's npm must be updated, but no longer updatable due to: # https://github.com/npm/cli/issues/2663 # because of this, node-14 test strategy is removed :( - node-version: [16.x, 18.x, 19.x, 20.x, 20-nightly] + # node-version: [16.x, 18.x, 19.x, 20.x, 20-nightly] + node-version: [16.x, 18.x, 19.x, 20-nightly] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 From 95da39b0c409423d7067aba771759bd657fd5a1e Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 14 May 2023 10:31:22 -0700 Subject: [PATCH 07/24] try 21-nightly --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66876813..8fceb3a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: # https://github.com/npm/cli/issues/2663 # because of this, node-14 test strategy is removed :( # node-version: [16.x, 18.x, 19.x, 20.x, 20-nightly] - node-version: [16.x, 18.x, 19.x, 20-nightly] + node-version: [16.x, 18.x, 19.x, 21-nightly] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 From 0a2a93a2093421534714487d65131f56f722e859 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 15 May 2023 23:36:36 -0700 Subject: [PATCH 08/24] adding worker thread messaging (try) --- src/esmockCache.js | 2 ++ src/esmockLoader.js | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/esmockCache.js b/src/esmockCache.js index c092086a..67452496 100644 --- a/src/esmockCache.js +++ b/src/esmockCache.js @@ -7,6 +7,8 @@ const esmockCache = { } const esmockTreeIdSet = (key, keylong) => ( + (typeof global.postMessageEsmk === 'function') + && global.postMessageEsmk({ key, keylong }), global.mockKeys[String(key)] = keylong) const esmockTreeIdGet = key => ( diff --git a/src/esmockLoader.js b/src/esmockLoader.js index 6b5c3d74..1c0d1f97 100644 --- a/src/esmockLoader.js +++ b/src/esmockLoader.js @@ -1,4 +1,5 @@ import process from 'process' +import { isMainThread } from 'node:worker_threads' import urlDummy from './esmockDummy.js' import esmockErr from './esmockErr.js' @@ -16,6 +17,13 @@ const withHashRe = /.*#-#/ const isesmRe = /isesm=true/ const isnotfoundRe = /isfound=false/ +const globalPreload = isMainThread && (({ port }) => ( + port.addEventListener('message', ev => ( + global.mockKeys[ev.data.key] = ev.data.keylong)), + port.unref(), + 'global.postMessageEsmk = d => port.postMessage(d)' +)) + // new versions of node: when multiple loaders are used and context // is passed to nextResolve, the process crashes in a recursive call // see: /esmock/issues/#48 @@ -123,4 +131,4 @@ const load = async (url, context, nextLoad) => { // node lt 16.12 require getSource, node gte 16.12 warn remove getSource const getSource = isLT1612 && load -export {load, resolve, getSource, loaderIsVerified} +export {load, resolve, getSource, loaderIsVerified, globalPreload} From 84c7b54f6a1456e7721196798e302dc907275c9c Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 01:09:12 -0700 Subject: [PATCH 09/24] remove check for isMainThread --- src/esmockLoader.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/esmockLoader.js b/src/esmockLoader.js index 1c0d1f97..a0df90e6 100644 --- a/src/esmockLoader.js +++ b/src/esmockLoader.js @@ -1,5 +1,4 @@ import process from 'process' -import { isMainThread } from 'node:worker_threads' import urlDummy from './esmockDummy.js' import esmockErr from './esmockErr.js' @@ -17,7 +16,7 @@ const withHashRe = /.*#-#/ const isesmRe = /isesm=true/ const isnotfoundRe = /isfound=false/ -const globalPreload = isMainThread && (({ port }) => ( +const globalPreload = (({ port }) => ( port.addEventListener('message', ev => ( global.mockKeys[ev.data.key] = ev.data.keylong)), port.unref(), From b666d73c16d37de8f2c9eb91344c258dda37bb59 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 01:35:30 -0700 Subject: [PATCH 10/24] try moving ava to test:nodelt20 --- tests/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 8b936552..6b47a20c 100644 --- a/tests/package.json +++ b/tests/package.json @@ -26,6 +26,7 @@ "scripts": { "mini": "cd .. && cd src && npx esbuild esmock.js --minify --bundle --allow-overwrite --platform=node --format=esm --outfile=esmock.js", "isnodelt18": "node -e \"+process.versions.node.split('.')[0] < 18 || process.exit(1)\"", + "isnodegt19": "node -e \"+process.versions.node.split('.')[0] > 19 || process.exit(1)\"", "install:esmock": "cd .. && npm install", "install:test-ava": "cd tests-ava && npm install", "install:test-uvu": "cd tests-uvu && npm install", @@ -38,7 +39,6 @@ "install:test-nodets": "cd tests-nodets && npm install", "install:test-mocha": "cd tests-mocha && npm install", "install:all": "node --version && npm install && npm-run-all install:test*", - "test:test-ava": "cd tests-ava && npm test", "test:test-uvu": "cd tests-uvu && npm test", "test:test-mocha": "cd tests-mocha && npm test", "test:node18-test-tsm": "cd tests-tsm && npm test", @@ -49,6 +49,8 @@ "test:node18-test-source-map": "cd tests-source-map && npm test", "test:node18-test-no-loader": "cd tests-no-loader && npm test", "test:node18:all": "npm run isnodelt18 || npm-run-all test:node18-test*", + "test:nodelt20-test-ava": "cd tests-ava && npm test", + "test:nodelt20:all": "npm run isnodegt19 || npm-run-all test:nodelt20-test*", "test:all": "npm-run-all test:test* && npm run test:node18:all", "test:all-cover": "c8 --src=../src/* npm run test:all", "test:all-ci": "npm run mini && npm run test:all" From e29b6bc9043d8f4156fd66d4e51da5affae9da07 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 01:38:18 -0700 Subject: [PATCH 11/24] add nodelt20 to test:all --- tests/package.json | 2 +- tests/tests-ava/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/package.json b/tests/package.json index 6b47a20c..e3d20233 100644 --- a/tests/package.json +++ b/tests/package.json @@ -51,7 +51,7 @@ "test:node18:all": "npm run isnodelt18 || npm-run-all test:node18-test*", "test:nodelt20-test-ava": "cd tests-ava && npm test", "test:nodelt20:all": "npm run isnodegt19 || npm-run-all test:nodelt20-test*", - "test:all": "npm-run-all test:test* && npm run test:node18:all", + "test:all": "npm-run-all test:test* && npm run test:node18:all && npm run test:nodelt20:all", "test:all-cover": "c8 --src=../src/* npm run test:all", "test:all-ci": "npm run mini && npm run test:all" } diff --git a/tests/tests-ava/package.json b/tests/tests-ava/package.json index 366e37d3..42a43ceb 100644 --- a/tests/tests-ava/package.json +++ b/tests/tests-ava/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/iambumblehead/esmock.git" }, "dependencies": { - "ava": "^4.3.3", + "ava": "^5.2.0", "esmock": "file:..", "sinon": "file:../node_modules/sinon", "eslint": "file:../node_modules/eslint", From d3ae523b630ed1266435157a0c81a636ca063e43 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 01:45:08 -0700 Subject: [PATCH 12/24] try disabling node-tsm tests for nodelt20 --- tests/package.json | 2 +- tests/tests-tsm/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/package.json b/tests/package.json index e3d20233..c36e5604 100644 --- a/tests/package.json +++ b/tests/package.json @@ -41,7 +41,7 @@ "install:all": "node --version && npm install && npm-run-all install:test*", "test:test-uvu": "cd tests-uvu && npm test", "test:test-mocha": "cd tests-mocha && npm test", - "test:node18-test-tsm": "cd tests-tsm && npm test", + "test:node18-test-tsm": "cd tests-tsm && npm run isnodegt19 || npm test", "test:node18-test-node": "cd tests-node && npm test", "test:node18-test-jest": "cd tests-jest && npm test", "test:node18-test-jest-ts": "cd tests-jest-ts && npm test", diff --git a/tests/tests-tsm/package.json b/tests/tests-tsm/package.json index 8600df41..5c76b27c 100644 --- a/tests/tests-tsm/package.json +++ b/tests/tests-tsm/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/iambumblehead/esmock.git" }, "dependencies": { - "tsm": "^2.2.2", + "tsm": "^2.3.0", "esmock": "file:..", "pg": "file:../node_modules/pg", "sinon": "file:../node_modules/sinon", From 0dff031e298de90df79110f95cf4ffa3e8ea54e9 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 01:56:59 -0700 Subject: [PATCH 13/24] try updating script command to disable tests-tsm --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index c36e5604..69acce99 100644 --- a/tests/package.json +++ b/tests/package.json @@ -41,7 +41,7 @@ "install:all": "node --version && npm install && npm-run-all install:test*", "test:test-uvu": "cd tests-uvu && npm test", "test:test-mocha": "cd tests-mocha && npm test", - "test:node18-test-tsm": "cd tests-tsm && npm run isnodegt19 || npm test", + "test:node18-test-tsm": "npm run isnodegt19 || cd tests-tsm && npm test", "test:node18-test-node": "cd tests-node && npm test", "test:node18-test-jest": "cd tests-jest && npm test", "test:node18-test-jest-ts": "cd tests-jest-ts && npm test", From 62840de34379d167f96e25d48e7a260d418290ac Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:01:41 -0700 Subject: [PATCH 14/24] added isnodenight for test-tsm --- tests/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 69acce99..ee8f4c8c 100644 --- a/tests/package.json +++ b/tests/package.json @@ -27,6 +27,7 @@ "mini": "cd .. && cd src && npx esbuild esmock.js --minify --bundle --allow-overwrite --platform=node --format=esm --outfile=esmock.js", "isnodelt18": "node -e \"+process.versions.node.split('.')[0] < 18 || process.exit(1)\"", "isnodegt19": "node -e \"+process.versions.node.split('.')[0] > 19 || process.exit(1)\"", + "isnodenight": "node -e \"\/nightly\/.test(process.versions.node) || process.exit(1)\"", "install:esmock": "cd .. && npm install", "install:test-ava": "cd tests-ava && npm install", "install:test-uvu": "cd tests-uvu && npm install", @@ -41,7 +42,7 @@ "install:all": "node --version && npm install && npm-run-all install:test*", "test:test-uvu": "cd tests-uvu && npm test", "test:test-mocha": "cd tests-mocha && npm test", - "test:node18-test-tsm": "npm run isnodegt19 || cd tests-tsm && npm test", + "test:node18-test-tsm": "npm run isnodenight || cd tests-tsm && npm test", "test:node18-test-node": "cd tests-node && npm test", "test:node18-test-jest": "cd tests-jest && npm test", "test:node18-test-jest-ts": "cd tests-jest-ts && npm test", From a0cb36e560aacd2328848211bd7642b41f51ea64 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:07:08 -0700 Subject: [PATCH 15/24] try includes('night') --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index ee8f4c8c..0f254d55 100644 --- a/tests/package.json +++ b/tests/package.json @@ -27,7 +27,7 @@ "mini": "cd .. && cd src && npx esbuild esmock.js --minify --bundle --allow-overwrite --platform=node --format=esm --outfile=esmock.js", "isnodelt18": "node -e \"+process.versions.node.split('.')[0] < 18 || process.exit(1)\"", "isnodegt19": "node -e \"+process.versions.node.split('.')[0] > 19 || process.exit(1)\"", - "isnodenight": "node -e \"\/nightly\/.test(process.versions.node) || process.exit(1)\"", + "isnodenight": "node -e \"process.versions.node.includes('night') || process.exit(1)\"", "install:esmock": "cd .. && npm install", "install:test-ava": "cd tests-ava && npm install", "install:test-uvu": "cd tests-uvu && npm install", From ead7bae3aa20b4ea8e37004ad69dbedcede29ef2 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:13:34 -0700 Subject: [PATCH 16/24] change script commands for running tsm tests --- tests/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 0f254d55..5832811f 100644 --- a/tests/package.json +++ b/tests/package.json @@ -42,7 +42,8 @@ "install:all": "node --version && npm install && npm-run-all install:test*", "test:test-uvu": "cd tests-uvu && npm test", "test:test-mocha": "cd tests-mocha && npm test", - "test:node18-test-tsm": "npm run isnodenight || cd tests-tsm && npm test", + "test:node19-tsm": " cd tests-tsm && npm test", + "test:node18-test-tsm": "npm run isnodenight || npm run test:node19-tsm", "test:node18-test-node": "cd tests-node && npm test", "test:node18-test-jest": "cd tests-jest && npm test", "test:node18-test-jest-ts": "cd tests-jest-ts && npm test", From 9e63f9722219dce3cc38be855050ecbcd2525e4f Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:26:07 -0700 Subject: [PATCH 17/24] update README with ava incompatibility message --- README.md | 4 ++++ src/esmockCache.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 74962a40..cc7aa145 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ "test-ts": "node --loader=ts-node/esm --loader=esmock --test *ts", "test-jest": "NODE_OPTIONS=--loader=esmock jest" }, + "ava": [ + "incompatible with --loader and node version 20 or greater", + "see: https://github.com/avajs/ava/issues/3195" + ], "jest": { "runner": "jest-light-runner" } diff --git a/src/esmockCache.js b/src/esmockCache.js index 67452496..51c625b6 100644 --- a/src/esmockCache.js +++ b/src/esmockCache.js @@ -7,7 +7,7 @@ const esmockCache = { } const esmockTreeIdSet = (key, keylong) => ( - (typeof global.postMessageEsmk === 'function') + typeof global.postMessageEsmk === 'function' && global.postMessageEsmk({ key, keylong }), global.mockKeys[String(key)] = keylong) From d81021d4ba695c5cc680e93f5afb54ef76a8a41b Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:35:53 -0700 Subject: [PATCH 18/24] update comment in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc7aa145..cc2569c0 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ "test-jest": "NODE_OPTIONS=--loader=esmock jest" }, "ava": [ - "incompatible with --loader and node version 20 or greater", - "see: https://github.com/avajs/ava/issues/3195" + "ava is incompatible w/ --loader and node v20 or greater", + "https://github.com/avajs/ava/issues/3195" ], "jest": { "runner": "jest-light-runner" From 32726cc6fe89255cc4d3e423782fd31ebce53219 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:41:24 -0700 Subject: [PATCH 19/24] try unary --- src/esmockCache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esmockCache.js b/src/esmockCache.js index 51c625b6..0420787d 100644 --- a/src/esmockCache.js +++ b/src/esmockCache.js @@ -8,8 +8,8 @@ const esmockCache = { const esmockTreeIdSet = (key, keylong) => ( typeof global.postMessageEsmk === 'function' - && global.postMessageEsmk({ key, keylong }), - global.mockKeys[String(key)] = keylong) + ? global.postMessageEsmk({ key, keylong }) + : global.mockKeys[String(key)] = keylong) const esmockTreeIdGet = key => ( global.mockKeys[String(key)]) From d1ec7e4e37753342a812c67be595dd32505c5d99 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 02:47:30 -0700 Subject: [PATCH 20/24] remove unary, revert --- src/esmockCache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esmockCache.js b/src/esmockCache.js index 0420787d..51c625b6 100644 --- a/src/esmockCache.js +++ b/src/esmockCache.js @@ -8,8 +8,8 @@ const esmockCache = { const esmockTreeIdSet = (key, keylong) => ( typeof global.postMessageEsmk === 'function' - ? global.postMessageEsmk({ key, keylong }) - : global.mockKeys[String(key)] = keylong) + && global.postMessageEsmk({ key, keylong }), + global.mockKeys[String(key)] = keylong) const esmockTreeIdGet = key => ( global.mockKeys[String(key)]) From 3f3be608c4bc2fc22268f0a1ad9b6711d27b6205 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 03:12:25 -0700 Subject: [PATCH 21/24] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f53a21ff..b63316e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # changelog + * 2.2.3 _May.16.2023_ + * [add node v21 nightly](https://github.com/iambumblehead/esmock/pull/199) to test ci pipeline + * [encountered upstream error](https://github.com/nodejs/node/issues/47614) when attempting to add node v20 tests * 2.2.2 _May.06.2023_ * [detect async import.meta.resolve](https://github.com/iambumblehead/esmock/pull/201) and handle in a separate way * remove un-necessary usage of await keyword in README example From 8bd74196aaac4f701d2855d7fbddf9d2015763c6 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 03:13:58 -0700 Subject: [PATCH 22/24] increment minor version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b69c3c3..7c3e7f5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "esmock", "type": "module", - "version": "2.2.2", + "version": "2.2.3", "license": "ISC", "readmeFilename": "README.md", "description": "provides native ESM import mocking for unit tests", From d45521cadfd9890955fe87ac3bb1d14550e6227d Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 03:17:26 -0700 Subject: [PATCH 23/24] add loader worker line to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63316e6..dd28749e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * 2.2.3 _May.16.2023_ * [add node v21 nightly](https://github.com/iambumblehead/esmock/pull/199) to test ci pipeline + * send wide uri definitions to loader using loader worker * [encountered upstream error](https://github.com/nodejs/node/issues/47614) when attempting to add node v20 tests * 2.2.2 _May.06.2023_ * [detect async import.meta.resolve](https://github.com/iambumblehead/esmock/pull/201) and handle in a separate way From d6f181ba03a4e19b64aa0fd9e77fe83f2094350b Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 16 May 2023 04:40:20 -0700 Subject: [PATCH 24/24] remove un-necessary await keyword --- src/esmockIsLoader.js | 2 +- src/esmockLoader.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/esmockIsLoader.js b/src/esmockIsLoader.js index 2714ab45..3aa07def 100644 --- a/src/esmockIsLoader.js +++ b/src/esmockIsLoader.js @@ -1,4 +1,4 @@ import { loaderIsVerified } from './esmockLoader.js' export default (c => async () => - c || (c = await loaderIsVerified(import.meta.url)))() + (c = c || loaderIsVerified(import.meta.url)))() diff --git a/src/esmockLoader.js b/src/esmockLoader.js index a0df90e6..aa2342df 100644 --- a/src/esmockLoader.js +++ b/src/esmockLoader.js @@ -35,8 +35,8 @@ const nextResolveCall = async (nextResolve, specifier, context) => ( context.parentURL && (context.conditions.slice(-1)[0] === 'node-addons' || context.importAssertions || isLT1612) - ? await nextResolve(specifier, context) - : await nextResolve(specifier)) + ? nextResolve(specifier, context) + : nextResolve(specifier)) const resolve = async (specifier, context, nextResolve) => { const { parentURL } = context