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

fix: nodejs deprecated api <DEP0148> #1585

Merged
merged 1 commit into from Sep 24, 2021
Merged

Conversation

hyj1991
Copy link
Contributor

@hyj1991 hyj1991 commented Sep 17, 2021

Subpath folder mappings will be removed in a future release, so we should use direct subpath patterns instead.

The warning message is like below (with node-v16.9.0) when executing require('koa/lib/response');:

(node:80100) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/hyj1991/git/eggjs/egg-core/node_modules/koa/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)

This PR is to be compatible with the omitted specifier path with require after fixing DEP0148:

require('koa/lib/application');
require('koa/lib/application.js');

require('koa/lib/response');
require('koa/lib/response.js');

require('koa/lib/request');
require('koa/lib/request.js');

require('koa/lib/context');
require('koa/lib/context.js');

require('koa/package.json');
require('koa/package');

Refs:

@codecov
Copy link

codecov bot commented Sep 17, 2021

Codecov Report

Merging #1585 (1276f22) into master (2400985) will not change coverage.
The diff coverage is n/a.

❗ Current head 1276f22 differs from pull request most recent head dc780ef. Consider uploading reports for the commit dc780ef to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1585   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files           5        5           
  Lines         507      507           
  Branches      142      142           
=======================================
  Hits          505      505           
  Misses          2        2           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2400985...dc780ef. Read the comment docs.

Copy link
Member

@3imed-jaberi 3imed-jaberi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@dead-horse dead-horse merged commit acb08e0 into koajs:master Sep 24, 2021
hyj1991 added a commit to hyj1991/koa that referenced this pull request Sep 24, 2021
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.

None yet

3 participants