The generator

tinycld/scripts/generate.ts (with its gen-*.ts helper modules) is the one piece of code that stitches feature members into the app shell. It reads tinycld.packages.ts (which enumerates the present workspace members), loads each feature’s manifest, and produces a tree of thin re-exports, one typed config file, symlinks, and Go wiring - everything the app shell needs to find and load each package. The generator runs automatically on the workspace-root pnpm install (via postinstall) and again before pnpm run dev; you rarely invoke it directly.

It is a thin step: rather than emitting a file per concern, it writes a single typed tinycld.config.ts, and the runtime derives the package stores, registry, sidebars/providers/settings, and seeds from it.

What it does

Each run, the generator produces the following outputs. Every one of these files (and their parent directories, where relevant) is gitignored - they regenerate on every run.

Config source of truth

Route re-exports

For each package with routes.directory, every .tsx/.ts/.jsx/.js file in that directory becomes a thin re-export under tinycld/app/a/[orgSlug]/<slug>/:

export { default } from '@tinycld/mail/screens/index'

Nested folders and layout files are preserved. Non-route extensions (helpers, styles) are ignored.

For each package with publicRoutes.directory, files are re-exported under tinycld/app/p/<slug>/<relpath>. drive/public-screens/share/[token].tsx becomes tinycld/app/p/drive/share/[token].tsx. The hand-written tinycld/app/p/_layout.tsx wraps the whole tree with a bare <Slot /> — no auth gate, since this is where pre-auth entry points live.

Other generated wiring under tinycld/lib/generated/

Server-side outputs under tinycld/server/

Cleanup is per-target: the generator wipes and rebuilds the migration/hook symlink dirs each run, and removes each present feature’s own tinycld/app/a/[orgSlug]/<slug>/ route dir before regenerating it. App-owned files in the route tree (_layout.tsx, index.tsx, settings/**) are left untouched.

When it runs

pnpm install                      # workspace root: postinstall → app packages:generate
cd tinycld && pnpm run dev            # dev.ts: packages:generate → expo + pocketbase + proxy
cd tinycld && pnpm run packages:generate  # manual re-run, sometimes useful after editing a manifest
cd tinycld && pnpm run export:web     # production web build (runs the generator first)

If a package’s manifest or directory layout changes and you haven’t restarted dev, pnpm run packages:generate (from tinycld/) by hand picks up the new output. Bringing a new member in or removing one is just pnpm install at the root.

Footguns

Reference

For the complete list of generated artifacts and where each lives, see Generated files. For the manifest fields that drive the generator, see Manifest schema.