Skip to content

marmotte / cli/templates/types

cli/templates/types

Interfaces

Template

Defined in: src/cli/templates/types.ts:18

A project template that can scaffold a directory from scratch.

Built-in templates are identified by a short id string. Custom templates can be created by implementing this interface and passing the instance to bootstrapTypeDoc or using it directly.

Properties

id

id: string

Defined in: src/cli/templates/types.ts:20

Short identifier (e.g. "node-library"). Used to look up templates by name.

label

label: string

Defined in: src/cli/templates/types.ts:22

Human-readable label shown in the interactive prompt and spinner.

Methods

generate()

generate(dir, options): Promise<void>

Defined in: src/cli/templates/types.ts:28

Generate the project in dir.

Parameters
dir

string

Absolute path to the target directory (created if it doesn't exist).

options

TemplateOptions

Template context — name, marmotte version, example flag.

Returns

Promise<void>


TemplateOptions

Defined in: src/cli/templates/types.ts:2

Context passed to every template's generate function.

Properties

includeExamples

includeExamples: boolean

Defined in: src/cli/templates/types.ts:8

Whether to include example source files in the generated project.

marmotteVersion

marmotteVersion: string

Defined in: src/cli/templates/types.ts:6

Marmotte version substituted into package.json as the marmotte devDependency version.

name

name: string

Defined in: src/cli/templates/types.ts:4

Project name substituted into package.json and other template files.