create-fluixi
v1.0.0-alpha.115
Published
Scaffold a new Fluixi app — `npm create fluixi <dir>`.
Readme
create-fluixi
Scaffold a new Fluixi app: npm create fluixi <dir>.
✨ Overview
Run via your package manager's create shortcut: no install needed:
npm create fluixi my-app
# or
pnpm create fluixi my-app
# or
yarn create fluixi my-appnpm keeps options for itself unless they follow --: npm create fluixi@alpha -- my-app --spa,
or npm create fluixi@alpha -- --help for the list. pnpm and Yarn pass them through.
It prompts for a project name, a mode and an authoring format, or takes them on the command line:
create-fluixi my-app --ssr # SSR app (@fluixi/start: file routing + SSR + hydration)
create-fluixi my-app --spa # SPA (@fluixi/start with ssr: false, rendered in the browser)
create-fluixi my-app --spa --html # same app, html`` templates instead of JSX--jsx (default) or --html picks how you write components. The html`` variant is
JSX-free: plain .ts files, no jsxImportSource, and @fluixi/ts-plugin
wired up so the editor still understands the templates. Both compile to the same thing.
Then:
cd my-app
pnpm install
pnpm dev🗂️ Templates
| Mode | Stack | Entry |
| --- | --- | --- |
| SSR | @fluixi/start + @fluixi/cli | src/entry-{server,client}, src/routes/, fluixi.config.ts |
| SPA | @fluixi/start + @fluixi/cli, ssr: false | src/entry-{server,client}, src/routes/, fluixi.config.ts |
Each comes in a JSX and an html`` variant (template-ssr, template-ssr-html, and the same
two for SPA).
Both list @fluixi/start and every runtime package it shares with the app, on the alpha
dist-tag, and set jsxImportSource: "@fluixi/jsx".
🧱 Scaffolding pieces
To add components, routes, or middleware inside an existing app, use fluixi generate
from @fluixi/cli:
fluixi g component Button
fluixi g route about