Support for User Defined Templates

Open
#641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cli, tooling

Research direction

Start in the @salesforce/templates dependency and its createUtil.js class, then trace how the org-custom-metadata-templates configuration is read. Done means user-defined template names from the configured directory are available to the CLI in addition to the existing base templates.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
3
Forks
21
Avg merge
1d 1h
Merged PRs (30d)
7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.