Skip to content

lelabdev/svelteForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

πŸ§ͺ SVELTE-FORGE

A CLI boilerplate generator for SvelteKit projects using modular fragments.
Install a fresh SvelteKit app and enrich it with optional features like auth, UI libraries, state management, and more β€” all from one command.

🌐 ## Landing Page https://svelteforge.lelab.dev/



πŸš€ How It Works

This CLI tool:

  1. Prompts you for your project name.
  2. Bootstraps a fresh SvelteKit app using pnpm create svelte@latest.
  3. Installs dependencies via pnpm install.
  4. Asks which optional fragments (features) you want to add.
  5. Copies relevant code from fragments/ and installs required packages.

πŸ›  Usage

pnpm dlx tsx index.ts
p dlx tsx ~/1Dev/Projects/Lelab/SvelteForge/svelteForge/index.ts

Then follow the prompts:

πŸ“¦ Project name

βœ… Choose optional features


πŸ“ Project Structure

. β”œβ”€β”€ index.ts # Main CLI entry β”œβ”€β”€ fragments.json # List of available fragments β”œβ”€β”€ fragments/ β”‚ β”œβ”€β”€ sessionstore/ β”‚ β”‚ └── src/ # Code to inject into the generated SvelteKit project β”‚ β”œβ”€β”€ skeletonui/ β”‚ └── betterauth/ └── ...


🧩 How to Add or Update a Fragment

When adding a new fragment or updating an existing one, follow these steps:

  1. Create or update the code in fragments//src/

This folder should mirror the structure you want injected into the src/ of the generated project.

Example: fragments/supabase/src/lib/supabase.ts will end up in my-project/src/lib/supabase.ts.

  1. Add or update the entry in fragments.json

Each fragment must be declared in this file with:

name: folder name inside /fragments

label: question shown to the user

default: whether to pre-select it

dependencies: list of NPM packages (optional)

Example:

{
  "name": "supabase",
  "label": "Add Supabase integration?",
  "default": false,
  "dependencies": ["@supabase/supabase-js"]
}

πŸ”₯ Don’t forget: if you don’t add the fragment here, it won’t show up in the CLI!

  1. (Optional) Update package.json of the CLI itself

If your CLI needs runtime dependencies (e.g. uuid, prompts, etc.), add them with:

pnpm add your-package

But most fragment-specific dependencies are handled during project generation, not in the CLI's own package.json.


πŸ“¦ Dependencies

All dependencies defined in fragments.json are automatically installed with:

pnpm add ...

You don’t need to install them manually.


🧽 Tips

Keep fragments atomic and reusable

Avoid mixing unrelated logic in one fragment

Test fragment installation after updating it

Use meaningful labels so users understand what they’re enabling


πŸ“£ License

MIT β€” build cool things and share freely!


Created by LeLab
Code & issues: github.com/lelab Created by LeLab
Code & issues: github.com/lelab

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published