Skip to main content
Module

x/scaffold/mod.ts>TemplateProps

scaffold your next project with style and 💗
Latest
interface TemplateProps
import { type TemplateProps } from "https://deno.land/x/scaffold@0.3.0/mod.ts";

Type Parameters

optional
Variables extends BaseVariables = BaseVariables

Properties

optional
getVariables: Callable<AnyVariables, BaseTemplateProps & PromptProps>

Use the prompt to ask the user for input to determine the variables.

This is not always called, if the user decided to skip the prompt then it will be skipped.

Further docs can be found here: https://cliffy.io/docs@v0.24.2/prompt

import { defineTemplate } from 'https://deno.land/x/scaffold/mod.ts';

export defineTemplate({
  gatherVariables: async (props) => {
    const { prompt,  } = props;
  }
});
optional
getPermissions: Callable<Partial<ScaffoldPermissions>, MatchProps<Variables>>

Gather the permissions for the worker.

Permissions that are approved will be cached so that the template can be without requesting new permissions every time.

optional
getIncluded: Callable<Match | Match[], MatchProps<Variables>>

These file will be included.

Starting a glob with the ! will negate the match. For clarity it is advised to use the exclude option instead.

optional
getExcluded: Callable<Match | Match[], MatchProps<Variables>>

Files that match will be excluded.

optional
getRenamed: Callable<Record<string, string> | undefined, MatchProps<Variables>>

A map of relative file names to their renamed counterparts.

import { defineTemplate } from 'https://deno.land/x/scaffold/mod.ts';

export defineTemplate({
  getRenamed: {
    "src/index.ts": "src/main.ts", // Rename index.ts to main.ts
  }
})
optional
getInstallCommand: Callable<() => MaybePromise<void>, MatchProps<Variables>>

Get an installation command which is run after the template is copied over.

This can be used to run an npm install and initialize git.