Project files

A crust app is a config, a backend entry, and a page. Everything else is optional.

The three that matter

filewhat it is
crust.config.tsapp identity, the windows array, and optional dev, build, plugins. crust.json is the same object
main.tsthe backend entry: register commands, mount plugins, then await app.run(). src/main.ts resolves too
the pagepublic/index.html by default, or a frontend's output when build.assets names it

The page may be anything a browser renders. Without dev.url the bridge serves the asset directory itself and injects window.crust; with dev.url the window loads that URL verbatim and crust/vite supplies the client.

A whole app

// crust.config.ts
import type { CrustConfig } from "crust";

export default {
	app: { id: "land.jyz.example", name: "Example", version: "0.1.0" },
	windows: [{ label: "main", url: "/", width: 900, height: 640, title: "Example" }],
} satisfies CrustConfig;
// main.ts
import { app } from "crust";

app.command("greet", ({ name }) => `hello ${name}`);

await app.run();

What each scaffold adds

scaffoldfiles
plaincrust.config.ts, main.ts, public/index.html, public/style.css, public/app.js, package.json, .gitignore
--reactcrust.config.ts, main.ts, vite.config.ts, index.html, src/main.tsx, package.json, .gitignore
--sveltecrust.config.ts, main.ts, vite.config.ts, index.html, src/main.ts, src/App.svelte, package.json, .gitignore
--vuecrust.config.ts, main.ts, vite.config.ts, index.html, src/main.ts, src/App.vue, package.json, .gitignore
--solidVite + Solid 2; not SolidStart, which Solid 2 retired — dev.url wants one SPA on one origin
--nextcrust.config.ts, main.ts, next.config.mjs, tsconfig.json, app/layout.tsx, app/page.tsx, app/about/page.tsx, package.json, .gitignore

package.json always carries a dev and a build script that call crust, so bun run dev and bun run build are the short forms.

The config surface, in brief

keydefaultnotes
app.idrequiredreverse-DNS bundle identifier; also seeds the bridge port
app.name, app.versionrequiredapp name, CFBundleShortVersionString
app.iconunsetresolved by crust build; a missing file fails the build
windowsrequirednon-empty array of window descriptors
windows[].labelrequiredthe handle every window command uses
windows[].url"/"appended to the bridge URL unless dev.url is set
windows[].width, height1100, 760
windows[].minWidth, minHeightunsetindependent minimums; a smaller width/height is clamped up
windows[].titleunsetwindow title
dev.urlunsetevery window loads it verbatim, windows[].url is ignored
build.assets"public"the directory a build embeds; must hold index.html
pluginsall built-insnaming any registers only those

Every key is validated at startup and extra keys are rejected, so a typo is a startup failure naming the key and the shape it expected — never a silently ignored option. The full table, plus dev.beforeDevCommand, build.beforeBuildCommand and security.csp, is in Config.

Folders crust uses

pathwhat it is
temp handshakethe dev handshake — bridge URL and token, named by CRUST_DEV_FILE / devHandshakePath()
.crust/single/the bundle for crust dev app.tsx
dist/build output: <name>.app, and dist/single/ for one-file builds

dist/single/ is cleaned before a successful write, so switching a one-file app from a bundled .tsx entry to plain .html cannot leave an old page.js embedded in the binary. A failed build leaves the last good page in place.

None of them belong in git.