Skip to content

Conversation

@chaoticbear
Copy link
Contributor

@chaoticbear chaoticbear commented Feb 23, 2022

Proposal

The current plop generator is a great workflow tool, and has some good standard files included with the template.

In some cases a group's workflow may want to include other files as part of the generation. For example in our case we wanted to add a component-name.props.ts file with a basic scaffold of props for a component.

To support that option I've added an option to add a custom template file for example component-name.props.ts

Usage

By default the templates are unchanged from the original set, and the config is not required to exist.

The steps for a new template file include:

  1. Add a new template file to your local project. eg. props.hbs
  2. Add the template as an additional template in the plopfile atomicGenerator config:
additionalTemplates: [
  {
    extension: 'props.ts',
    template: 'generators/atomic-component/templates/props.hbs',
  },
],

@chaoticbear chaoticbear force-pushed the jf/feature/add-config-custom-templates branch from e661fbf to e4cbe98 Compare February 23, 2022 07:17
@chaoticbear chaoticbear marked this pull request as ready for review March 3, 2022 17:39
@chaoticbear
Copy link
Contributor Author

@ahoendgen Let me know if you need anything else with this PR.

@chaoticbear chaoticbear changed the title [WIP][FEATURE] Add option to include custom template [FEATURE] Add option to include custom template Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant