Initial pass at templates for each LWC. #49
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For team discussion.
This is what I was thinking for "template files". Basically just placeholders in the file for the following variables we would need to programmatically substitute when generating the files. There's tons of possibilities, but this seems the simplest that I can think of.
VIEW TEMPLATE:
TEMPLATE_IMPORTS - actual imports from the @salesforce/schema namespace.
TEMPLATE_FIELDS - comma separated name of imported fields, ie NAME_FIELD, ACCOUNT_FIELD, etc
TEMPLATE_VIEW_LWC_LABEL - label for the view lwc
TEMPLATE_OBJECT_API_NAME
EDIT TEMPLATE:
TEMPLATE_LIGHTNING_INPUT_EDIT_FIELDS_HTML
TEMPLATE_OBJECT_API_NAME
TEMPLATE_VARIABLES
nameField = NAME_FIELD;
TEMPLATE_EDIT_LWC_LABEL - label for the edit lwc
CREATE TEMPLATE:
TEMPLATE_LIGHTNING_INPUT_CREATE_FIELDS_HTML
TEMPLATE_VARIABLE_ASSIGNMENTS
name_field = "";
TEMPLATE_CREATE_LWC_LABEL - label for the create lwc
Thoughts?
@khawkins @sfdctaka @maliroteh-sf