A lightning-fast, Symfony Maker style CLI tool for generating SvelteKit routes, configs, and server files from the terminal.
Currently, Svelte Maker is available directly via GitHub.
Local Project Install:
npm install -D github:acaala/svelte-maker
If installed globally, you can run Svelte Maker using npx:
npx svelte-maker <command> [arguments] [flags]
init (Optional Setup)Initializes Svelte Maker in your project by safely injecting a make:route alias into your package.json scripts. This allows you to use the familiar Laravel/Symfony syntax for all future commands.
Syntax:
npx svelte-maker init
After running init, you can simply run: npm run make:route <path>
routeGenerates a new route directory along with its corresponding SvelteKit files (+page.svelte, +page.ts, and +page.server.ts).
Syntax:
npx svelte-maker route <path> [routeName] [options]
(Or npm run make:route <path> [routeName] [options] if initialized)
Arguments:
<path> (Required): The directory path inside src/routes/ where the files should be created. Supports deep nesting (e.g., admin/users/[id]).[routeName] (Optional): A unique name for your route. If provided, Svelte Maker will generate a +page.ts file exporting this config name.Options:
-n, --no-server: Skips generating the +page.server.ts file. Ideal for static or purely client-side pages.-js, --javascript: Generates standard JavaScript files (.js) and strips TypeScript types from the templates. Defaults to TypeScript.1. Create a standard full-stack route (TS by default):
npx svelte-maker route admin/dashboard
Generates:
src/routes/admin/dashboard/+page.sveltesrc/routes/admin/dashboard/+page.server.ts2. Create a deeply nested route with a Config Name:
npx svelte-maker route "admin/users/[id]/settings" user_settings
(Note: Use quotes around paths with brackets [] to prevent terminal globbing errors!)
Generates:
src/routes/admin/users/[id]/settings/+page.sveltesrc/routes/admin/users/[id]/settings/+page.ts (Contains name: 'user_settings')src/routes/admin/users/[id]/settings/+page.server.ts3. Create a frontend-only JavaScript route:
npx svelte-maker route marketing/about -n -js
Generates:
src/routes/marketing/about/+page.svelte (Without lang="ts")MIT