a web app template with TypeScript + SvelteKit + optional Rust for the fuz-stack
- SvelteKit with Svelte and Vite and optional Rust
- fuz_css: semantic-first CSS framework and design system
- fuz_ui:
- Svelte UI library - ui.fuz.dev
- optional:
npm uninstall @fuzdev/fuz_uiand delete the imports to remove it
- Gro:
- extends SvelteKit and Vite
- integrated TypeScript with Svelte and svelte-check
- testing with Vitest
- formatting with tsv
- linting with ESLint
and
@ryanatkn/eslint-config - also has a task system with builtins, codegen, and other things
- optional utilities library
@fuzdev/fuz_util
This project uses SvelteKit with the static adapter
and Vite,
so the normal commands like vite dev work as expected.
It also uses Gro
for tasks like deploying and more.
If you're logged into GitHub, click "Use this template" above, or clone directly:
git clone https://github.com/fuzdev/fuz_template.git cooltoy
cd cooltoy
npm i
# then
vite dev
# or
npm run dev
# or
gro dev # npm i -g @fuzdev/gro
gro sync # called by `gro dev`, refreshes generated files and calls `svelte-kit sync`Windows will not be supported because it depends on sh, WSL is recommended
The template includes
@sveltejs/adapter-static
so it can deploy
with no further configuration.
To learn how to swap it out for another deployment target, see
the SvelteKit adapter docs.
To make it your own, run the molt wizard (it requires a clean git tree):
npm run molt # or `cargo molt` — twin implementations, identical resultsIt renames the project, strips the demo components, and deletes itself — see molt below.
To do the same by hand, change @fuzdev/fuz_template
and template.fuz.dev to your project name in the following files:
package.json— also remove or replace theglyph,logo, andlogo_altfieldssrc/routes/+layout.sveltesrc/routes/+page.sveltesrc/routes/about/+page.svelte- update or delete
static/CNAME, ./.github/FUNDING.yml, and ./.github/ISSUE_TEMPLATE/
To remove the Rust workspace, delete Cargo.toml, Cargo.lock, crates/,
.cargo/, rust-toolchain.toml, clippy.toml, and the rust job in
.github/workflows/check.yml.
To remove the docs system, delete src/routes/docs/ and
src/routes/library.ts, remove the docs link in
src/routes/+page.svelte, and drop the
svelte-docinfo devDependency along with its wiring in
vite.config.ts and src/app.d.ts.
Then run npm i to update package-lock.json.
The template is MIT-licensed (LICENSE, plus license fields in
package.json and Cargo.toml), copyright fuz.dev — to keep MIT for your
project, replace the copyright holder with your own; or swap in
another license.
molt is a wizard that transforms this clone into your own project, then
deletes itself. It ships as twin implementations at full behavior parity —
same flags, same prompts, byte-identical results — so either toolchain
suffices: src/lib/molt.ts runs on Node, and the molt crate comes with
the template's Rust workspace.
npm run molt # interactive wizard: prompts, prints the full plan, confirms
npm run molt -- check # verify molt's file anchors still match the template
cargo molt # the Rust twin — same flags and behavior
cargo molt checkThe plan, from the prompts or the equivalent flags:
- renames the project everywhere (
package.json, page titles, headings) - updates or removes
static/CNAME,homepage, andrepository - deletes the demo components and writes a minimal starting page (plus a
starter
src/lib/example.tswhen docs are kept — the API docs need a module to document) - regenerates
README.mdandCLAUDE.mdfor the new project - deletes the template's MIT
LICENSEandlicensefields — the new project chooses its own license - keeps or strips each optional feature, by prompt or by
--keep/--striplists (e.g.--strip rustor--keep github-extras --strip docs):rust— the whole workspacecli— the starter crate atcrates/app_cli, renamed to the project name; it rides withrust, and strippingclialone is rejected because a kept workspace needs a cratedocs— the docs system; keeping it needs a repository url (the API docs link to source) from--repoor a git origin that isn't the template's, and the wizard asks when there's nonegithub-extras— funding + issue templates, personalized when kept; stripped by default
- deletes both of its own implementations (the crate, the script, and its tests)
--repo takes an https, http, or ssh git url, normalizes it to its web url
with any credentials stripped, and refuses anything else with exit 2.
It refuses to run without a clean git tree, so an applied plan can be undone
with git reset --hard && git clean -fd (the tree was clean, so git clean
removes only files molt created). --force lets a dirty tree through for
planning, but applying to a dirty tree always requires an interactive
confirmation — without a terminal it refuses (exit 2), since there is no
clean undo point. Flags replace the prompts for non-interactive use
(npm run molt -- --help or cargo molt --help); in that mode nothing is
written without --wetrun. A terminal always confirms before applying, so
the only ungated write path is --wetrun on a clean tree without a terminal.
npm run build
# or
gro buildSee Gro's build docs for more.
npm test
# or
gro test
gro test filepattern1 filepatternB
gro test -- --forwarded-args 'to vitest'See Vitest,
src/test/example.test.ts,
and Gro's test docs for more.
Deploy
(build, commit, and push) to the deploy branch, e.g. for GitHub Pages:
npm run deploy
# or
gro deploySvelte ∙ SvelteKit ∙ Vite ∙ esbuild ∙ Vitest ∙ TypeScript ∙ ESLint ∙ tsv ∙ fuz_css ∙ Fuz ∙ Gro ∙ @fuzdev/fuz_util ∙ Zod ∙ & more