-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Feat: loader and plugin command [2] #4225
Feat: loader and plugin command [2] #4225
Conversation
- break plopfile generator and action logic in generators and actions - loading them asynchronously - modularity reduces redundancy and increases scalability
…en template - change defaultValues and generator function to be based on --template flag - add fallback prompt when template is invalid or unsupported
…d of just file name
- change default to resemble the design pattern of react generator - simple conditional flow for file creation and manipulation
- unpacked size decreased from ~60kb to 19kb
- for better ux added emojis according to type of log
- introduce a directory structure of commandName/[template1, template2] - move default and react template generators in init/* - avoid namespace issues and cleaner structure
…es and generator imports
…ction - the factory function returns a variant of utils configured with the path passed as argument
@@ -1,16 +1,16 @@ | |||
import { WebpackCLILogger } from "webpack-cli"; | |||
import { green, yellow, Color, red, cyan, cyanBright, blue, blueBright } from "colorette"; | |||
import { PlopActionHooksChanges, PlopActionHooksFailures } from "../types"; | |||
import { basename } from "path"; | |||
import { relative } from "path"; | |||
|
|||
const prefix: string = blueBright("create-webpack"); | |||
const getLogger = (): WebpackCLILogger => { |
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.
Can't we use the logger like below?
import webpackCLI from "webpack-cli"
const cli = new webpackCLI();
cli.logger()
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 think that I am using logger only and defining it is easier than importing the whole webpackCLI().
also earlier I tried doing it but was getting into a lot of dependency complexities.
So this method was easier.
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.
Also I told you last time that the issue was that webpack-cli doesnt exports cli, only definitions.
error| '"webpack-cli"' has no exported member named 'webpackCLI'. Did you mean 'IWebpackCLI'?
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.
We should avoid code duplication wherever possible
Co-authored-by: Anshuman Verma <[email protected]>
What kind of change does this PR introduce?
feature
Did you add tests for your changes?
Yes
If relevant, did you update the documentation?
Summary
Does this PR introduce a breaking change?
Other information