Skip to content

fuzdev/fuz_template

Repository files navigation

@fuzdev/fuz_template ❄

a friendly pixelated spider facing you

a static web app template with optional Rust for the fuz-stack

template.fuz.dev

contents

usage

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`

learn more about SvelteKit, Vite, Gro, and fuz_ui

Windows will not be supported because I chose Bash instead - Fuz recommends WSL

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 (requires Rust and a clean git tree — commit or stash first):

cargo molt

It renames the project, strips the demo components, and deletes itself — see molt below.

Prefer to do it by hand (or skip installing Rust)? Change @fuzdev/fuz_template and template.fuz.dev to your project name in the following files:

And 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

The template doubles as a Rust workspace, and crates/fuz_template is molt, a simple wizard that transforms this clone into your own project, then deletes itself.

cargo molt        # interactive wizard: prompts, prints the full plan, confirms
cargo molt check  # verify molt's file anchors still match the template

What it does, driven by your answers:

  • renames the project everywhere (package.json, page titles, headings)
  • updates or removes static/CNAME, homepage, and repository
  • deletes the demo components and writes a minimal starting page
  • regenerates README.md and CLAUDE.md for your project
  • deletes the template's MIT LICENSE and license fields — your project chooses its own license
  • keeps or strips each optional feature — rust (the whole workspace), cli (the starter crate at crates/app_cli, renamed to your project name), docs (the docs system), and github-extras (funding + issue templates, personalized when kept) — via prompts or --keep/--strip lists (e.g. --strip rust or --keep github-extras --strip docs); stripping cli alone is rejected — a kept workspace needs a crate
  • deletes its own crate

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), because there'd be no clean undo point. Run with flags instead of prompts for non-interactive use (cargo molt --help); in that mode nothing is written without --wetrun.

build

npm run build
# or
gro build

See Gro's build docs for more.

test

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

Deploy (build, commit, and push) to the deploy branch, e.g. for GitHub Pages:

npm i -D @sveltejs/package # enables Gro's library plugin by default
npm run deploy
# or
gro deploy

credits 🐢🐢🐢

SvelteSvelteKitViteesbuildVitestTypeScriptESLintPrettierfuz_cssFuzGro@fuzdev/fuz_utilZod ∙ & more

About

a static web app template with optional Rust for the fuz-stack

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Sponsor this project

  •  

Contributors