Preset Templates
Preset templates are pre-configured combinations of registries for quickly initializing specific types of projects.
What Are Templates?
Preset templates package a set of commonly used registries together to form complete project templates. Using templates allows you to install all required registries at once without adding them individually.
bash
# Without template - bootstrap from a single registry, then add the rest
rk init -t runtimes/node -n my-project
cd my-project
rk add frameworks/vue
rk add build/vite
rk add features/vue-router
rk add features/pinia
rk add quality/eslint
# With template - done in one step
rk init -t @presets/tutorial-project -n my-projectUsing Templates
Initialize Project
bash
rk init -t @presets/tutorial-projectSpecify Project Name
bash
rk init -t @presets/tutorial-project -n my-projectCI Mode
Skip interactive prompts in CI environments.
bash
rk init -t @presets/tutorial-project --ciCreating Templates
1. Create preset.json
json
{
"$schema": "https://rackjs.com/schema/preset.json",
"name": "my-preset",
"version": "1.0.0",
"description": "My custom preset",
"author": "Your Name",
"tags": ["custom", "preset"],
"registries": [
"runtimes/node",
"frameworks/vue",
"build/vite",
"features/vue-router"
]
}2. Directory Structure
bash
my-presets/
└── my-preset/
└── preset.json3. Deploy Template
Similar to registries, deploy templates to a static file server.
bash
# Access URL after deployment
https://registry.company.com/presets/my-preset/preset.json4. Configure and Use
bash
# Configure private source
rk config set @mypresets --url https://registry.company.com
# Use custom template
rk init -t @mypresets/my-preset
