2.3 KiB
2.3 KiB
_app_template_ (scaffold-resident)
Skeleton for every user app. Lives in the scaffold container, not the user's repo. Users never see this directly — the scaffold instantiates from it when a new app is needed.
How it gets instantiated
pikku create-app <name> (landed in #58) reads this directory from the scaffold's known path (/opt/fabric/_app_template_/ inside the container) and:
- Copies every file to
apps/<name>/in the user's repo - Substitutes placeholders —
app,@project/app,5001,App,0.0.1,2026-04-17T11:42:52Z - Adds to yarn workspaces, runs
yarn install - Regenerates Caddyfile to route to the new app's dev server
- Stamps
package.json→fabric.templateVersionwith the current skeleton version (for 3-way merge on laterupgrade-app)
On first scaffold boot against an empty apps/ dir, the scaffold auto-runs create-app app to seed the default.
Placeholders
| Placeholder | Example | Notes |
|---|---|---|
app |
admin |
Dir name + workspace slug |
@project/app |
@project/admin |
package.json name |
5001 |
5002 |
Next free port from 5001+ |
App |
Admin |
<title>, app header |
0.0.1 |
0.0.1 |
Version at instantiation — ancestor for upgrade-app |
2026-04-17T11:42:52Z |
ISO timestamp | Audit |
What's here
- Vite + Mantine + TypeScript + ESLint + Stylelint config
- Root providers wiring (
main.tsx) — react-query, router, i18next, Pikku RPC - Theme entry (
src/theme.css) — imports@project/components/themes/default.css, allows local overrides - Default routes:
/login,/logout,/hello - Auth config scaffold (Auth0 active; GitHub / Google / Microsoft / Passwordless as
.ts.inactivetemplates) - EN locale baseline
What's NOT here
- Widgets / components / themes →
@project/componentsin the user's template repo (shared across every app) - Backend functions →
@project/functions - App-specific pages / wirings — land in the instantiated
apps/<name>/src/pages/after creation
Upgrading an app to this skeleton version
pikku upgrade-app app # 3-way merge (see #57)
Uses package.json → fabric.templateVersion as the ancestor. Untouched files update; edited files get conflict markers or interactive diff.