# veryfront/scaffold

## Import

```ts
import {
  listScaffoldTemplates,
  materializeScaffold,
  resolveScaffoldTemplate,
  SCAFFOLD_TEMPLATE_ALIASES,
} from "veryfront/scaffold";
```

## Examples

### Create a project and store its files

```ts
import { materializeScaffold } from "veryfront/scaffold";

const { files } = await materializeScaffold({
  template: "minimal",
  projectName: "my-app",
});

for (const file of files) {
  console.log(file.path, file.content.length);
}
```

## Exports

### Components

| Name                        | Description                                                                 | Source                                                                                         |
| --------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `SCAFFOLD_TEMPLATE_ALIASES` | Slugs other product surfaces use for a template this CLI names differently. | [source](https://github.com/veryfront/veryfront-code/blob/main/cli/shared/project-creation.ts) |

### Functions

| Name                      | Description                                                             | Source                                                                                         |
| ------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `listScaffoldTemplates`   | Every template slug a caller may ask for, canonical names and aliases.  | [source](https://github.com/veryfront/veryfront-code/blob/main/cli/shared/project-creation.ts) |
| `materializeScaffold`     | Produce the complete contents of a new project without touching a disk. | [source](https://github.com/veryfront/veryfront-code/blob/main/cli/shared/project-creation.ts) |
| `resolveScaffoldTemplate` | Canonical starter template for a slug, or `null` when nothing matches.  | [source](https://github.com/veryfront/veryfront-code/blob/main/cli/shared/project-creation.ts) |

### Types

| Name                         | Description                                                                       | Source                                                                                         |
| ---------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `MaterializedScaffold`       | A new project: every file it starts with, plus anything worth telling the author. | [source](https://github.com/veryfront/veryfront-code/blob/main/cli/shared/project-creation.ts) |
| `MaterializeScaffoldRequest` | What to build: which starter, under what name, for which runtime.                 | [source](https://github.com/veryfront/veryfront-code/blob/main/cli/shared/project-creation.ts) |
| `TemplateFile`               |                                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/templates/types.ts)             |
