Skip to content

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

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/esmock-2.x
Open

chore(deps): update dependency esmock to v2.6.0#441
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/esmock-2.x

Conversation

@renovate

@renovate renovate Bot commented Sep 7, 2023

Copy link
Copy Markdown
Contributor

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 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 6e872b8 to 1452a8a Compare September 11, 2023 19:00
@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 1452a8a to df2d76b Compare September 13, 2023 23:15
@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 2 times, most recently from e01c62c to 9bff1c3 Compare October 13, 2023 19:31
@renovate renovate Bot changed the title chore(deps): update dependency esmock to v2.5.2 chore(deps): update dependency esmock to v2.5.4 Oct 13, 2023
@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 from 9bff1c3 to cd0e17f Compare October 15, 2023 01:42
@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 force-pushed the renovate/esmock-2.x branch from cd0e17f to 7d1a593 Compare October 15, 2023 16:01
@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 from 7d1a593 to 0d3b838 Compare October 20, 2023 19:21
@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 force-pushed the renovate/esmock-2.x branch from 0d3b838 to f5eadcd Compare October 23, 2023 20:21
@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 f5eadcd to 40c32a7 Compare November 4, 2023 03:59
@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 40c32a7 to c72b42d Compare November 7, 2023 19:37
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