Powerful project scaffolding with template support and interactive prompts, powered by Funish.
- 🚀 Quick project setup
- 📦 Multiple template sources
- 🔧 Interactive configuration
- 🎨 Handlebars templating
- 💪 TypeScript support
- 🔄 Git repository support
- 🎯 Custom prompts
- ⚡ Fast and lightweight
- 🌟 Extensible design
# npm
$ npm install @funish/scaffolding
# yarn
$ yarn add @funish/scaffolding
# pnpm
$ pnpm add @funish/scaffoldingimport { createScaffolding } from "@funish/scaffolding";
// Create from GitHub template
await createScaffolding("github:user/repo", "./my-project", {
projectName: "my-awesome-project",
description: "An awesome project",
});
// Create from local template
await createScaffolding("./templates/vue-app", "./my-vue-app", {
name: "My Vue App",
version: "1.0.0",
});Create a scaffolding.config.ts file:
import { defineScaffoldingConfig } from "@funish/scaffolding";
export default defineScaffoldingConfig({
// Interactive prompts
prompts: {
projectName: {
type: "text",
placeholder: "Project name",
},
framework: {
type: "select",
options: ["vue", "react", "svelte"],
},
features: {
type: "multiselect",
options: ["typescript", "eslint", "prettier", "testing", "ci"],
},
},
});Supports multiple template sources through giget:
// GitHub repository
await createScaffolding("github:user/repo");
// GitLab repository
await createScaffolding("gitlab:user/repo");
// npm package
await createScaffolding("npm:package-name");
// Local directory
await createScaffolding("./path/to/template");Templates can use Handlebars syntax for dynamic content:
my-template/
├── package.json.hbs # Template files use .hbs extension
├── README.md.hbs
└── src/
├── {{name}}.ts # Dynamic file names
└── components/
└── {{pascalCase name}}.vue
Example template file (package.json.hbs):
{
"name": "{{projectName}}",
"version": "{{version}}",
"description": "{{description}}",
"author": "{{author}}",
"license": "{{license}}",
"dependencies": {
{{#each dependencies}}
"{{@key}}": "{{this}}"
{{/each}}
}
}Creates a new project from a template.
source(string): Template source (git repository, npm package, or local path)target(string): Directory where the project should be createdcontext(object): Template variablesoptions(object): Download options (auth tokens, branch name, etc)
Creates a type-safe scaffolding configuration.
config(ScaffoldingConfig): Configuration objectprompts: Interactive prompts configurationextends: Base configuration to extend
Templates have access to:
- User-provided context variables
- Built-in helpers:
camelCasepascalCasekebabCasesnakeCase- Date/time helpers
- Conditional helpers
Please read our Contributing Guide before submitting a Pull Request to the project.