Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency esmock to v2.6.0 #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 7, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
esmock 2.3.8 -> 2.6.0 age adoption passing confidence

Release Notes

iambumblehead/esmock (esmock)

v2.6.0: typings <T = any> MockFunction

Compare Source

typings: make MockFunction generic, thanks @​uwinkelvos

v2.5.9: mock Array-type default export

Compare Source

v2.5.8: catch yarn PnP exception @​koshic

Compare Source

catch yarn PnP exception @​koshic

v2.5.7: resolve critical error

Compare Source

mainly this issue resolves a critical error reported here https://github.com/iambumblehead/esmock/issues/260

v2.5.6: increment resolver

Compare Source

update resolver to latest version, resolves a resolution error that seems to have been introduced by a previous update from the past week.

v2.5.5: support yarn PnP @​koshic

Compare Source

support yarn PnP @​koshic

v2.5.4: call resolver with builtin moduleIds

Compare Source

This change affects custom resolvers, which are supported from v2.5.2. Per the spec, resolvers will be called with the builtin moduleIds, such as "node:path" and "fs"

v2.5.3: add support for custom resolver

Compare Source

This release adds support for custom using a custom resolver. Specifically, a yarn PnP resolver can be passed to esmock, so that yarn PnP moduleIds can be resolved.

const modulePnP = await esmock('../src/parent.js', {
  '../src/PnPchild.js' : () => ['a', 'b']
}, null, {
  resolver: pnpapi.resolveRequest
})

v2.5.2: lookup export type based on package.json type

Compare Source

This release updates the resolver to improve module resolution. See resolvewithplus tags v2.0.6 and v2.0.7.

Essentially, the resolver is updated to lookup the export type based on package.json type. For example, if package.json type is "module", the "import" definition is resolved, else if package.json type is undefined or "commonjs", the "require" definition is resolved. Previous versions of esmock usually reslved commonjs/require when those were defined and because most packages are published as commonjs, the issues resolved at this release likely did not affect anyone,

  • resolve "exports" before "main". The spec says: 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 where changed to use type "module", the older resolver would return "index.js" rather than "index.esm.js"

v2.5.1: improve ts resolution

Compare Source

resolve existing ".ts" files, rather than ".js" files, when typescript is detected, thanks @​tpluscode

v2.5.0: use initialize loader hook

Compare Source

esmock is updated to use the new "initialize" node loader hook https://nodejs.org/api/esm.html#initialize and, essentially, esmock no longer requires --loader=esmock when used with current releases of node

v2.4.1: detect null and undefined loader-returned sources

Compare Source

Detects null AND undefined loader-returned source definitions

diff --git a/src/esmockLoader.js b/src/esmockLoader.js
index 69dedd4..e835ec3 100644
--- a/src/esmockLoader.js
+++ b/src/esmockLoader.js
@&#8203;@&#8203; -145,7 +145,8 @&#8203;@&#8203; const load = async (url, context, nextLoad) => {
       if (!/^(commonjs|module)$/.test(nextLoadRes.format))
         return nextLoad(url, context)
 
-      const source = nextLoadRes.source === null
+      // nextLoadRes.source sometimes 'undefined' and other times 'null' :(
+      const source = nextLoadRes.source === null || nextLoadRes.source === undefined
         ? String(await fs.readFile(new URL(url)))
         : String(nextLoadRes.source)
       const hbang = (source.match(hashbangRe) || [])[0] || ''

v2.4.0: node v20.6 solutions

Compare Source

node v20.6 caused some issues. The primary issue was that the newest import.meta.resolve defined by node has significantly and suddenly changed. The newer import.meta.resolve is less useful and no longer supports the parent param as in the call import.meta.resolve(moduleId, parent),


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/esmock-2.x branch from 1684177 to 124b11c Compare September 7, 2023 23:22
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.4.0 chore(deps): update dependency esmock to v2.4.1 Sep 7, 2023
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.4.1 chore(deps): update dependency esmock to v2.5.0 Sep 11, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from 124b11c to 4d39915 Compare September 11, 2023 18:10
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.0 chore(deps): update dependency esmock to v2.5.1 Sep 13, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from 4d39915 to cf25864 Compare September 13, 2023 20:30
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.1 chore(deps): update dependency esmock to v2.5.2 Oct 8, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from cf25864 to a062fad Compare October 8, 2023 19:41
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.2 chore(deps): update dependency esmock to v2.5.3 Oct 13, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from a062fad to 62f2abc Compare October 13, 2023 19:07
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.3 chore(deps): update dependency esmock to v2.5.4 Oct 13, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from 62f2abc to 51a9523 Compare October 13, 2023 21:20
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.4 chore(deps): update dependency esmock to v2.5.5 Oct 15, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch 2 times, most recently from c303006 to 01dcc8c Compare October 15, 2023 16:06
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.5 chore(deps): update dependency esmock to v2.5.6 Oct 15, 2023
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.6 chore(deps): update dependency esmock to v2.5.7 Oct 20, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch 2 times, most recently from ba35960 to c872de1 Compare October 23, 2023 17:02
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.7 chore(deps): update dependency esmock to v2.5.8 Oct 23, 2023
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.8 chore(deps): update dependency esmock to v2.5.9 Nov 4, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from c872de1 to 5dd5da9 Compare November 4, 2023 03:32
@renovate renovate bot changed the title chore(deps): update dependency esmock to v2.5.9 chore(deps): update dependency esmock to v2.6.0 Nov 7, 2023
@renovate renovate bot force-pushed the renovate/esmock-2.x branch from 5dd5da9 to 7e4d84d Compare November 7, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants