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

Feat: loader and plugin command [2] #4225

Merged

Conversation

maverox
Copy link
Collaborator

@maverox maverox commented Jul 18, 2024

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

  • add loader command
  • add plugin command
  • add tests for each

Does this PR introduce a breaking change?

Other information

maverox added 20 commits July 9, 2024 16:15
- 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
- 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
…ction

- the factory function returns a variant of utils configured with the
path passed as argument
@maverox maverox requested a review from a team as a code owner July 18, 2024 14:13
@@ -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 => {
Copy link
Member

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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'?

Copy link
Member

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

@snitin315 snitin315 changed the title Feat: loader and plugin command Feat: loader and plugin command [2] Aug 21, 2024
@snitin315 snitin315 merged commit 2c5bfb3 into gsoc/create-webpack-app-package Aug 25, 2024
3 checks passed
@snitin315 snitin315 deleted the feat/loader-and-plugin-command branch August 25, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants