@karaoke-cms/create
v0.18.1
Published
Scaffold a new karaoke-cms project
Maintainers
Readme
@karaoke-cms/create
Scaffolding tool for karaoke-cms. Creates a complete new project from scratch with a single command, then optionally deploys a live preview to Cloudflare Pages.
Usage
npm create @karaoke-cms@latest
# or
npm create @karaoke-cms@latest my-siteThe wizard asks for your project name, site title, URL, and description, then generates everything and installs dependencies.
At the end you're offered a one-step deploy to Cloudflare Pages (defaults to yes — your site can be live before you open your code editor).
What gets created
my-site/
package.json # @karaoke-cms/* deps pinned to current version
astro.config.mjs # karaoke() integration, site URL
karaoke.config.ts # title, description, theme, blog module
src/
content.config.ts # makeCollections() wired to vault/
env.d.ts # TypeScript types for virtual:karaoke-cms/config
tsconfig.json
.gitignore
.env.default # KARAOKE_VAULT=./vault/
public/_redirects # Cloudflare Pages 404 config
vault/ # Obsidian vault with sample blog posts
blog/ # 30 demo posts (publish: true)
docs/
_website/ # nav config and page templates
menus.yamlA git repository is initialised with an initial commit. Opening vault/ in Obsidian lets you write content immediately.
Generated karaoke.config.ts
import { defineConfig } from '@karaoke-cms/astro';
import { blog } from '@karaoke-cms/module-blog';
import { themeDefault } from '@karaoke-cms/theme-default';
import { loadEnv } from '@karaoke-cms/astro/env';
const env = loadEnv(new URL('.', import.meta.url));
export default defineConfig({
vault: env.KARAOKE_VAULT,
title: 'My Site',
description: 'What this site is about.',
modules: [blog({ mount: '/blog' })],
theme: themeDefault(),
});Local dev
cd my-site
npm run dev # → http://localhost:4321Deploy
npm run deploy # publishes to Cloudflare PagesRequires a Cloudflare account and the wrangler CLI. The wizard handles the first deploy interactively.
What's new in 0.18.1
menus.yamlmoved to_website/— the scaffolded vault now puts the navigation config atvault/_website/menus.yamlinstead ofvault/karaoke-cms/config/menus.yaml. Existing projects should move the file to match.- Landing page included — the scaffolded project now includes a "Your site is live" home page with a hero and your three most recent posts visible on first run.
What's new in 0.18.0
No user-facing changes in this release.
What's new in 0.10.3
- Directory traversal rejected — passing a project name like
../../outsidethat resolves outside the current working directory now exits with a clear error instead of creating files at an unexpected location.
What's new in 0.10.2
sharpin devDependencies — scaffolded projects now includesharpso Astro's image optimisation works without a manual install step.- Scaffolded
content.config.tspasses the full karaoke config tomakeCollections, so new projects are multi-docs-section-ready from day one.
What's new in 0.9.5
- Deploy defaults to yes — the Cloudflare Pages deploy prompt now defaults to YES, so new sites are live by the end of the wizard
- Three success screens — distinct output for deploy success, declined, and failed (failed surfaces the error and next steps)
- isTTY color guard — ANSI color codes are disabled in CI and piped output
- 30 demo blog posts included in the scaffolded vault so the site is populated on first visit
- Generated
karaoke.config.tsusesthemeDefault()+blog()module API (replaces the old string-based theme config)
