-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: service.resolvePackage not working properly while APP_ROOT specified #4044
Conversation
Ant Design Pro preview using the current branch umi Built with commit fd4313b |
Codecov Report
@@ Coverage Diff @@
## master #4044 +/- ##
=========================================
+ Coverage 83.87% 83.9% +0.02%
=========================================
Files 127 128 +1
Lines 2524 2528 +4
Branches 635 631 -4
=========================================
+ Hits 2117 2121 +4
- Misses 398 399 +1
+ Partials 9 8 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逻辑放外面吧,Service 还是精简点好,有 APP_ROOT 时,在外面 resovle 好 pkg 传给 Service。
那service里的 |
是的。 |
@@ -9,6 +11,7 @@ const args = yParser(process.argv.slice(2)); | |||
process.env.NODE_ENV = 'development'; | |||
const service = new Service({ | |||
cwd: getCwd(), | |||
pkg: getPkg(process.cwd()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不对,有 APP_ROOT 的时候,是不是也应该先找 APP_ROOT 下的 package.json,再找根节点的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有道理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checklist
npm test
passesDescription of change
While env
APP_ROOT
is specified,service.resolvePackageI()
returns info incorrectly.Check my repo: hosts-master
@umijs/plugin-model
will not be discovered properly