create-quadrokit
v0.3.23
Published
Scaffold a QuadroKit Vite + React app from a template
Readme
create-quadrokit
Scaffold a QuadroKit Vite app from a built-in template.
Usage (this monorepo)
# from repository root
bun create-quadrokit/src/index.ts --template dashboard --dir /path/to/my-appFlags
| Flag | Description |
|------|-------------|
| --template <name> | dashboard | website | ecommerce | admin-shell |
| --dir <path> | Target directory relative to cwd (created; must be empty if it already exists) |
| --name <name> | Same as --dir (project folder name); ignored if --dir is set |
| -y / --yes | Non-interactive: requires --template; uses quadro-<template> as the directory unless --dir / --name is set; copies .env.example → .env, runs git init and install without prompting (override with --no-copy-env / --no-git / --no-install) |
| -h / --help | Print usage and exit |
| --keep-workspace | Keep workspace:* in package.json (for development inside the QuadroKit monorepo only) |
| --git / --no-git | Initialize a git repo after scaffolding (skip the prompt) |
| --install / --no-install | Run bun install or npm install after scaffolding (skip the prompt) |
| --copy-env / --no-copy-env | Copy .env.example to .env after scaffolding (skip the prompt) |
The banner shows create-quadrokit’s package version (e.g. v0.2.2).
On start, the CLI prints a short prerequisites check (Node.js, Bun, Git). Node 18+ is required; Bun is optional (falls back to npm for installs). Git is only needed if you choose to init a repository.
Interactive mode: run without --template / --dir / --name to be prompted. If the project directory already exists and is not empty, you are asked again for a different name. You are then asked whether to copy .env.example → .env, then about git and install, unless -y or the explicit flags above apply.
What it does
- Copies the chosen template from
create-quadrokit/templates/<name>when installed from npm, orpackages/templates/<name>when you run the CLI from the monorepo (skipsnode_modules,dist,.quadrokit, lockfiles). - Overlays
template-common/(shared across all templates):.env.example,vite.config.ts,tailwind.config.ts,tsconfig*.json,postcss.config.js,biome.json,src/vite-env.d.ts,.github/workflows/ci.yml,.gitlab-ci.yml,.cursor/rules/commitlint-conventional.mdc,.agents/skills/**,skills-lock.json, etc. In the monorepo,packages/templates/*receives the same overlay viabun run sync:template-commonexcept.github/and.gitlab-ci.yml(those are for generated repos; the QuadroKit monorepo uses.github/workflows/ci.ymlat the repo root). Paths likevite.config.tsare gitignored underpackages/templates/so onlytemplate-common/is the source of truth in git. - Rewrites
src/lib/quadro-client.tsto import from@quadrokit/generated/client.gen.js(alias invite.config.ts/tsconfig.app.json). - Removes
@quadrokit/sample-clientand rewrites anyworkspace:…protocol on@quadrokit/*deps to published semver ranges.quadrokitScaffoldVersionsin this package’spackage.jsonpins^ranges for@quadrokit/clientand@quadrokit/ui(fallback:^<create-quadrokit version>). Use--keep-workspaceonly for development inside the QuadroKit repo.
Publishing create-quadrokit to npm
Before publishing a new create-quadrokit version, bump @quadrokit/client and @quadrokit/ui in the monorepo as needed, then quadrokitScaffoldVersions must match those releases so bunx create-quadrokit scaffolds apps that install the right packages from the registry.
- Automated:
prepublishOnlyrunsscripts/sync-scaffold-versions.ts, which setsquadrokitScaffoldVersionsfrompackages/client/package.jsonandpackages/ui/package.jsonversionfields (as^x.y.z). Runbun run scripts/sync-scaffold-versions.tsfromcreate-quadrokit/anytime to refresh the field before committing. - Manual: If you ever edit
quadrokitScaffoldVersionsby hand, align^ranges with the published@quadrokit/client/@quadrokit/uiversions users will install.
- Writes
QUADROKIT.mdwith Next steps: set the right.envvalues (see.env.example), then runbun run quadrokit:generateto type the REST client. Does not copy.quadrokit/generated— generation is required after install. - Adds a root
.gitignore(unless the template already shipped one). - Optionally copies
.env.exampleto.env(prompt, or defaults with-y; use--no-copy-envto skip). - Optionally runs
git init, installs dependencies (bunif available, otherwisenpm), thengit add -Aand an initial commit with messagechore: init projectsobun.lock/package-lock.jsonare included when install ran.
Published usage (future)
After publishing to npm:
bunx create-quadrokit@latest --template dashboardEnsure @quadrokit/client, @quadrokit/ui, etc. are published at compatible versions.
