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

enhancement: plop.load all assets #326

Closed
RobinKnipe opened this issue Sep 25, 2020 · 8 comments
Closed

enhancement: plop.load all assets #326

RobinKnipe opened this issue Sep 25, 2020 · 8 comments

Comments

@RobinKnipe
Copy link
Contributor

RobinKnipe commented Sep 25, 2020

Due to a bug in the code, the load function doesn't load any plopfile assets when the config option is true.

The proposed change would allow

plop.load('plopfile', {}, true)

...as a shorthand for the following:

plop.load('plopfile', {}, {
    generators: true,
    helpers: true,
    partials: true,
    actionTypes: true
})
@RobinKnipe
Copy link
Contributor Author

There is a PR to fix this plopjs/node-plop#187

@amwmedia
Copy link
Member

According to the documentation, the include should always be an object. There are 4 valid properties for that object and "each of these properties should have an IncludeDefinition as its value."

@RobinKnipe
Copy link
Contributor Author

@amwmedia I'm not sure what documentation you're reading, but this says otherwise: https://github.com/plopjs/plop/blob/master/plop-load.md#interface-includedefinition

@amwmedia
Copy link
Member

That's the documentation I'm reading. It clearly needs to be updated, because the way it's written now is confusing. Above the IncludeDefinition interface description it reads: "include is an object that can contain 4 properties (generators, helpers, partials, and actionTypes). Each of these properties should have an IncludeDefinition as its value."

@RobinKnipe
Copy link
Contributor Author

Hi @amwmedia - yes I see your point! You're right, I've misunderstood the Boolean part of that doc... Well in that case I guess this is a potential feature? I'll add a commit to update the documentation in line with my proposed change and then the maintainers can decide what they want to do about it... thanks!

@RobinKnipe RobinKnipe changed the title plop.load('plopfile', {}, true) loads nothing enhancement: IncludeDefinition or true Sep 25, 2020
@RobinKnipe RobinKnipe changed the title enhancement: IncludeDefinition or true WIP: enhancement: IncludeDefinition or true Sep 25, 2020
@RobinKnipe RobinKnipe changed the title WIP: enhancement: IncludeDefinition or true WIP: enhancement: plop.load all assets Sep 25, 2020
@RobinKnipe RobinKnipe changed the title WIP: enhancement: plop.load all assets enhancement: plop.load all assets Sep 25, 2020
@crutchcorn
Copy link
Member

Given the quality of the contributions (code quality, tests added, documentation written, etc), I'd be happy to merge this (both PRs for node-plop and plop alike) in. @amwmedia, what do you think?

@crutchcorn
Copy link
Member

Transfering this issue to https://github.com/plopjs/plop/ since we're migrating all of node-plop to that repo as a monorepo

@crutchcorn
Copy link
Member

This has now been released as-of plop@3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants