Skip to main content

Class: Template

Defined in: ../../skaff-lib/src/core/templates/Template.ts:50

Constructors

Constructor

new Template(init): Template

Defined in: ../../skaff-lib/src/core/templates/Template.ts:77

Parameters

init

TemplateInit

Returns

Template

Properties

absoluteBaseDir

absoluteBaseDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:57


absoluteDir

absoluteDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:58


absoluteFilesDir

absoluteFilesDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:61


absolutePartialsDir?

optional absolutePartialsDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:64


branch?

optional branch: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:71


commitHash?

optional commitHash: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:69


config

config: GenericTemplateConfigModule

Defined in: ../../skaff-lib/src/core/templates/Template.ts:51


foundPartials?

optional foundPartials: Record<string, string>

Defined in: ../../skaff-lib/src/core/templates/Template.ts:55


isDetachedSubtreeRoot

isDetachedSubtreeRoot: boolean = false

Defined in: ../../skaff-lib/src/core/templates/Template.ts:75


isLocal

isLocal: boolean = false

Defined in: ../../skaff-lib/src/core/templates/Template.ts:70


parentTemplate?

optional parentTemplate: Template

Defined in: ../../skaff-lib/src/core/templates/Template.ts:53


possibleParentTemplates

possibleParentTemplates: TemplateParentReference[] = []

Defined in: ../../skaff-lib/src/core/templates/Template.ts:74


relativeDir

relativeDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:59


relativeFilesDir

relativeFilesDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:62


relativePartialsDir?

optional relativePartialsDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:65


relativeRefDir?

optional relativeRefDir: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:67


repoUrl?

optional repoUrl: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:72


subTemplates

subTemplates: Record<string, Template[]> = {}

Defined in: ../../skaff-lib/src/core/templates/Template.ts:52


trackedRevision?

optional trackedRevision: string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:73

Methods

findAllPartials()

findAllPartials(): Promise<Result<Record<string, string>>>

Defined in: ../../skaff-lib/src/core/templates/Template.ts:258

Returns

Promise<Result<Record<string, string>>>


findCommitHash()

findCommitHash(): string

Defined in: ../../skaff-lib/src/core/templates/Template.ts:248

Returns

string


findRootTemplate()

findRootTemplate(): Template

Defined in: ../../skaff-lib/src/core/templates/Template.ts:241

Returns

Template


findSubTemplate()

findSubTemplate(templateName): Template | null

Defined in: ../../skaff-lib/src/core/templates/Template.ts:223

Parameters

templateName

string

Returns

Template | null


instantiateNewProject()

instantiateNewProject(rootTemplateSettings, destinationDir, projectRepositoryName, projectCreationOptions?, templateGeneratorService?): Promise<Result<ProjectCreationResult>>

Defined in: ../../skaff-lib/src/core/templates/Template.ts:147

Parameters

rootTemplateSettings

UserTemplateSettings

destinationDir

string

projectRepositoryName

string

projectCreationOptions?

ProjectCreationOptions

templateGeneratorService?

TemplateGeneratorService

Returns

Promise<Result<ProjectCreationResult>>


isValid()

isValid(): Promise<boolean>

Defined in: ../../skaff-lib/src/core/templates/Template.ts:301

Returns

Promise<boolean>


mapToDTO()

mapToDTO(): TemplateDTO

Defined in: ../../skaff-lib/src/core/templates/Template.ts:190

Returns

TemplateDTO


templateInExistingProject()

templateInExistingProject(userSettings, destinationProject, parentInstanceId): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/templates/Template.ts:110

Parameters

userSettings

UserTemplateSettings

destinationProject

Project

parentInstanceId

string

Returns

Promise<Result<string>>