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

Bump esmock from 2.5.1 to 2.6.0 in /server #182

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 13, 2023

Bumps esmock from 2.5.1 to 2.6.0.

Release notes

Sourced from esmock's releases.

typings MockFunction

typings: make MockFunction generic, thanks @​uwinkelvos

mock Array-type default export

catch yarn PnP exception @​koshic

catch yarn PnP exception @​koshic

resolve critical error

mainly this issue resolves a critical error reported here iambumblehead/esmock#260

increment resolver

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

support yarn PnP @​koshic

support yarn PnP @​koshic

call resolver with builtin moduleIds

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"

add support for custom resolver

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
})

lookup export type based on package.json type

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"
Changelog

Sourced from esmock's changelog.

changelog

... (truncated)

Commits
  • cbe83c1 Merge pull request #268 from iambumblehead/increment-version-release-notes
  • c6691dd increment package.json and update CHANGELOG.md
  • b95fdb1 re-add dist to .eslintrc, prevent lint warnings at tests/tests-source-map/dist/*
  • b88ab9c Merge pull request #267 from uwinkelvos/main
  • 994a02f make generic default to any
  • a65bc9e typings: make MockFunction generic
  • 6f2a207 Merge pull request #247 from iambumblehead/add-import-json-test
  • 97993ad update changelog
  • 9b94cff do not test json mock if node version 18 or 20
  • 19cb491 try running json-mockng tests in latest node 18 and 20, to see if upstream is...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [esmock](https://github.com/iambumblehead/esmock) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/iambumblehead/esmock/releases)
- [Changelog](https://github.com/iambumblehead/esmock/blob/main/CHANGELOG.md)
- [Commits](iambumblehead/esmock@v2.5.1...v2.6.0)

---
updated-dependencies:
- dependency-name: esmock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Nov 13, 2023
Copy link

API Coverage LCOV of commit c9b8989 during Tests #620

Summary coverage rate:
  lines......: 88.3% (406 of 460 lines)
  functions..: 88.3% (128 of 145 functions)
  branches...: 81.5% (163 of 200 branches)

Files changed coverage rate: n/a

Copy link

Website Coverage LCOV of commit c9b8989 during Tests #620

Summary coverage rate:
  lines......: 97.1% (885 of 911 lines)
  functions..: 95.1% (366 of 385 functions)
  branches...: 84.2% (149 of 177 branches)

Files changed coverage rate: n/a

@AlphaSheep AlphaSheep merged commit 4b81fed into master Nov 13, 2023
7 checks passed
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/server/esmock-2.6.0 branch November 13, 2023 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant