Interface: TemplateConfigModule<TParentFinalSettings, TInputSettingsSchema, TFinalSettingsSchema, TAiResultsObject, TInputSettings, TFinalSettings>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:205
Interface representing the module to be exported from every templateConfig.ts file.
Template
The type of the schema used for template settings.
Type Parameters
TParentFinalSettings
TParentFinalSettings extends FinalTemplateSettings
TInputSettingsSchema
TInputSettingsSchema extends z.ZodObject<UserTemplateSettings>
TFinalSettingsSchema
TFinalSettingsSchema extends z.ZodObject<UserTemplateSettings> = TInputSettingsSchema
TAiResultsObject
TAiResultsObject extends AiResultsObject = { }
TInputSettings
TInputSettings extends UserTemplateSettings = z.output<TInputSettingsSchema>
TFinalSettings
TFinalSettings extends FinalTemplateSettings = z.output<TFinalSettingsSchema>
Properties
aiAutoGenerate?
optionalaiAutoGenerate:AiAutoGenerateSettings<TFinalSettings>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:314
Ai auto generation settings. This is invoked to add ai generated vars to the template. Provides the expected keys the ai will produce. In the template ai_results will be a Record string string where the expected keys are the ones provided here. These have to be provided to generate the template so this function needs to return these keys.
aiContext?
optionalaiContext:AnyOrCallback<TFinalSettings,AiContext>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:305
A description of this template. Usefull for the AI. When instantiating a child template this description will be used to describe the the things this template adds.
aiUserConversationSettings?
optionalaiUserConversationSettings:AiUserConversationSettings<TFinalSettings>[]
Defined in: ../../template-types-lib/src/types/template-config-types.ts:320
Ai user conversation settings. These settings are used to start a conversation with the user. After the conversation is resolved the ai will call the final conversation ending tool and the ai should provide the expected keys otherwise generation will fail. Allow the user to retry a conversation if the ai doesnt provide the keys or if the user wants to modify the keys. Show all results to user before actually using the ai generated results in the template. All ai results will also go inside the templateSettings. Bit ugly but otherwise needs to go in a hidden file or a subdir.
allowedOverwrites?
optionalallowedOverwrites:AnyOrCallback<TFinalSettings,AllowOverwrite[]>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:276
Overwrite Rules
assertions?
optionalassertions:AnyOrCallback<TFinalSettings,boolean>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:289
Assertions. Function must return true otherwise the template generation will fail.
autoInstantiatedSubtemplates?
optionalautoInstantiatedSubtemplates:AnyOrCallback<TFinalSettings,AutoInstantiatedSubtemplate<TFinalSettings>[]>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:281
Auto instantiate subtemplates.
commands?
optionalcommands:TemplateCommand<TFinalSettings>[]
Defined in: ../../template-types-lib/src/types/template-config-types.ts:299
A list of commands the user might want to run inside the project. Related to this template. Executed using bash.
handlebarHelpers?
optionalhandlebarHelpers:Record<string,HelperDelegate>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:294
A list of helper functions provided to handlebars before rendering the template.
mapFinalSettings()
mapFinalSettings: (
inputSettings) =>TFinalSettings
Defined in: ../../template-types-lib/src/types/template-config-types.ts:240
The final settings type mapping after the user inputted settings are merged with the template settings. This is the type that will be used to generate the template.
Parameters
inputSettings
aiResults
TAiResultsObject
fullProjectSettings
{ instantiatedTemplates: object[]; projectAuthor: string; projectRepositoryName: string; rootTemplateName: string; }
fullProjectSettings.instantiatedTemplates
object[] = ...
fullProjectSettings.projectAuthor
string = ...
fullProjectSettings.projectRepositoryName
string = ...
fullProjectSettings.rootTemplateName
string = ...
parentSettings?
TParentFinalSettings
templateSettings
TInputSettings
Returns
TFinalSettings
migrations?
optionalmigrations:TemplateMigration[]
Defined in: ../../template-types-lib/src/types/template-config-types.ts:253
parentFinalSettingsSchema?
optionalparentFinalSettingsSchema:ZodType<TParentFinalSettings,unknown,$ZodTypeInternals<TParentFinalSettings,unknown>>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:251
Schema describing the expected final settings from the parent template. Required when this template is referenced from a different repository.
possibleParentTemplates?
optionalpossibleParentTemplates:TemplateParentReference[]
Defined in: ../../template-types-lib/src/types/template-config-types.ts:325
Optional references to parent templates that may host this template as a detached subtree.
redirects?
optionalredirects:AnyOrCallback<TFinalSettings,RedirectFile[]>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:271
Redirects of files or directories to another location based from project root.
sideEffects?
optionalsideEffects:AnyOrCallback<TFinalSettings,SideEffect<TFinalSettings>[]>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:263
Side effects to be applied when generating the template.
targetPath?
optionaltargetPath:StringOrCallback<TFinalSettings>
Defined in: ../../template-types-lib/src/types/template-config-types.ts:219
The target path for the template. Must be set on subtemplates. relative to the project root
Default
"."
Example
"src"
templateConfig
templateConfig:
object
Defined in: ../../template-types-lib/src/types/template-config-types.ts:224
Template base configuration options.
author
author:
string
description?
optionaldescription:string
isRootTemplate?
optionalisRootTemplate:boolean
multiInstance?
optionalmultiInstance:boolean
name
name:
string
specVersion
specVersion:
string
templateFinalSettingsSchema
templateFinalSettingsSchema:
TFinalSettingsSchema
Defined in: ../../template-types-lib/src/types/template-config-types.ts:234
Schema expected when generating template. Might be same as templateSettingsSchema. Used to check template validity when loading.
templateSettingsSchema
templateSettingsSchema:
TInputSettingsSchema
Defined in: ../../template-types-lib/src/types/template-config-types.ts:229
Schema inputted by user before generating the template.
templatesThatDisableThis?
optionaltemplatesThatDisableThis:TemplateDisablingThis[]
Defined in: ../../template-types-lib/src/types/template-config-types.ts:258
Templates that when already existing in the project will disable the generation of this template.