From 5fa3c0b20c599e7410c942bf7bc7fcb4efc28735 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 6 Oct 2023 09:21:23 -0700 Subject: [PATCH 1/5] update resolver to improve module resolution --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f407cd83..376d6303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # changelog + * 2.5.2 _Oct.06.2023_ + * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See [resolvewithplus/releases/tag/v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) * 2.5.1 _Sep.13.2023_ * [resolve existing ".ts" files,](https://github.com/iambumblehead/esmock/pull/243) rather than ".js" files, when typescript detected, thanks @tpluscode * 2.5.0 _Sep.09.2023_ diff --git a/package.json b/package.json index 9a9dde77..116135ca 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "node": ">=14.16.0" }, "dependencies": { - "resolvewithplus": "^2.0.4" + "resolvewithplus": "^2.0.6" }, "devDependencies": { "c8": "^8.0.1", From c603e11df648b50f2a2f258dab7a5c8a620f6ce6 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 6 Oct 2023 15:11:51 -0700 Subject: [PATCH 2/5] increment resolver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 116135ca..ffa7a8af 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "node": ">=14.16.0" }, "dependencies": { - "resolvewithplus": "^2.0.6" + "resolvewithplus": "^2.0.7" }, "devDependencies": { "c8": "^8.0.1", From b7ac847f442a45e89b522a340c57fa6b7fd4dc9c Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 6 Oct 2023 15:36:12 -0700 Subject: [PATCH 3/5] update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 376d6303..c7f5ff8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # changelog * 2.5.2 _Oct.06.2023_ - * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See [resolvewithplus/releases/tag/v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) + * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See [resolvewithplus/releases/tag/v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) and [resolvewithplus/releases/tag/v2.0.7.](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.7) Experiments with esmock's resolver indicated incorrect resolutions. The [spec says:](https://nodejs.org/api/packages.html#package-entry-points) _the "exports" field takes precedence over "main" in supported versions of Node.js._ The updated resolver correctly returns "main" before "exports". The updated resolver uses package.json "type" to determine resolution of "import" or "require" where the older resolver sometimes returned "require" values for type "module" packages... for example, if this [inferno package]( https://www.npmjs.com/package/inferno) were updated to use `{ "type": "module" }` esmock's updated resolver would return the correct "import" paths, where the old resolver did not. * 2.5.1 _Sep.13.2023_ * [resolve existing ".ts" files,](https://github.com/iambumblehead/esmock/pull/243) rather than ".js" files, when typescript detected, thanks @tpluscode * 2.5.0 _Sep.09.2023_ From 23b84751cc221957fbe6fca2683b71e23c7b9b81 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 6 Oct 2023 15:46:57 -0700 Subject: [PATCH 4/5] udpate changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7f5ff8d..49f631e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # changelog * 2.5.2 _Oct.06.2023_ - * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See [resolvewithplus/releases/tag/v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) and [resolvewithplus/releases/tag/v2.0.7.](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.7) Experiments with esmock's resolver indicated incorrect resolutions. The [spec says:](https://nodejs.org/api/packages.html#package-entry-points) _the "exports" field takes precedence over "main" in supported versions of Node.js._ The updated resolver correctly returns "main" before "exports". The updated resolver uses package.json "type" to determine resolution of "import" or "require" where the older resolver sometimes returned "require" values for type "module" packages... for example, if this [inferno package]( https://www.npmjs.com/package/inferno) were updated to use `{ "type": "module" }` esmock's updated resolver would return the correct "import" paths, where the old resolver did not. + * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See [resolvewithplus/releases/tag/v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) and [resolvewithplus/releases/tag/v2.0.7.](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.7) + * **Resolve "exports" before "main".** The [spec says:](https://nodejs.org/api/packages.html#package-entry-points) _the "exports" field takes precedence over "main" in supported versions of Node.js._ The updated resolver correctly returns "main" before "exports" (older resolver did not). + * **Use package.json "type" to return "import" or "require".** The older resolver did not read package.json type and returned incorrect "require" values for some packages. For example, if this [inferno package]( https://www.npmjs.com/package/inferno) where changed to use type "module", the older resolver would return "index.js" rather than "index.esm.js", * 2.5.1 _Sep.13.2023_ * [resolve existing ".ts" files,](https://github.com/iambumblehead/esmock/pull/243) rather than ".js" files, when typescript detected, thanks @tpluscode * 2.5.0 _Sep.09.2023_ From 63d868091db80b94bd1597aaeac59ee8e1ccd4b6 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 6 Oct 2023 15:50:37 -0700 Subject: [PATCH 5/5] update changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49f631e3..54d589fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # changelog * 2.5.2 _Oct.06.2023_ - * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See [resolvewithplus/releases/tag/v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) and [resolvewithplus/releases/tag/v2.0.7.](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.7) - * **Resolve "exports" before "main".** The [spec says:](https://nodejs.org/api/packages.html#package-entry-points) _the "exports" field takes precedence over "main" in supported versions of Node.js._ The updated resolver correctly returns "main" before "exports" (older resolver did not). - * **Use package.json "type" to return "import" or "require".** The older resolver did not read package.json type and returned incorrect "require" values for some packages. For example, if this [inferno package]( https://www.npmjs.com/package/inferno) where changed to use type "module", the older resolver would return "index.js" rather than "index.esm.js", + * [update resolver](https://github.com/iambumblehead/esmock/pull/243) to improve module resolution. See resolvewithplus tags [v2.0.6](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.6) and [v2.0.7.](https://github.com/iambumblehead/resolvewithplus/releases/tag/v2.0.7) + * **resolve "exports" before "main".** The [spec says:](https://nodejs.org/api/packages.html#package-entry-points) _the "exports" field takes precedence over "main" in supported versions of Node.js._ The updated resolver correctly returns "main" before "exports" (older resolver did not). + * **use package.json "type" to return "import" or "require".** The older resolver did not read package.json type and returned incorrect "require" values for some packages. For example, if this [inferno package]( https://www.npmjs.com/package/inferno) where changed to use type "module", the older resolver would return "index.js" rather than "index.esm.js" * 2.5.1 _Sep.13.2023_ * [resolve existing ".ts" files,](https://github.com/iambumblehead/esmock/pull/243) rather than ".js" files, when typescript detected, thanks @tpluscode * 2.5.0 _Sep.09.2023_