import { type TemplateProps } from "https://dotland.deno.dev/x/scaffold@0.3.0/mod.ts";
Properties
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;
}
});
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.
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.
Files that match will be excluded.
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
}
})
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.