-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
refactor(cli): call setup hook in run command with more args #6353
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #6353 +/- ##
==========================================
- Coverage 95.71% 95.71% -0.01%
==========================================
Files 79 79
Lines 2663 2661 -2
Branches 682 681 -1
==========================================
- Hits 2549 2547 -2
Misses 98 98
Partials 16 16
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## dev #6353 +/- ##
==========================================
- Coverage 95.71% 95.71% -0.01%
==========================================
Files 79 79
Lines 2663 2661 -2
Branches 682 681 -1
==========================================
- Hits 2549 2547 -2
Misses 98 98
Partials 16 16
Continue to review full report at Codecov.
|
await this.callHook('setup', { | ||
argv: this._argv, | ||
cmd: this.cmd, | ||
rootDir: path.resolve(this.argv._[0] || '.') |
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.
That's a duplicated logic here but at least more consistent to be into the core :)
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.
T.N.X 👍
@@ -35,6 +36,12 @@ export default class NuxtCommand extends Hookable { | |||
} | |||
|
|||
async run () { | |||
await this.callHook('setup', { |
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.
I hope no one complains about hook name 😆 It is inside run so could be called like run:before
but with logical perspective, it is really a setup step and internal hook so looks good and also not breaking users.
Types of changes
Description
It's overall a fix (where the setup hook is called) that will make TypeScript Runtime shine by not relying anymore on
process.argv
to find therootDir
which was not optimal (glitchy and not secure regarding new potential CLI Options).See : nuxt/typescript#97
Checklist: