Skip to content

Support for User Defined Templates #641

@max-verifiable

Description

@max-verifiable

Describe the solution you'd like
Joined a new company and we're using salesforce enterprise patterns (fflib), which requires a lot of boilerplate. I'd like to be able to use the CLI to generate apex classes, but the issue is that I'm unable to customize the classes much so it isn't very useful.

The plugin actually supports this by setting sf config set org-custom-metadata-templates PATH_TO_CUSTOM_TEMPLATES. This allows me to define a directory and customize templates. However, I'm only able to have the base list of template names (ApexException, ApexUnitTest, BasicUnitTest, DefaultApexClass, InboundEmailService). I believe this could be fixed fairly easily in @salesforce/templates dependency inside the createUtil.js class. In here, they would need to reference the org-custom-metadata-templates path if it is available to collect the templates defined by the user.

Describe alternatives you've considered
There are various packages out there that have tried this, but they dont support the current versions of the sf cli.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions