22. Files and folders

What ucm init creates, what ucm writes as it works, and what to keep in version control.

myproject/
  package.json            "#codebase" and "#ucm/server" imports; your npm dependencies
  tsconfig.json           compiler options (see compiler options)
  scratch.ts              where you write; any top-level .ts file is a scratch file
  .ucm/
    codebase.sqlite       the codebase: definitions, names, history, branches, patches, todo
    codebase/             the #codebase modules your scratch files import (generated)
    cache/                every definition as a runnable module, by hash (generated)
    data/                 app data: tables, sessions, jobs (created when an app first runs)
    apps/                 production builds, by hash (ucm build / ucm start)
    web/, build/          working files for ucm dev and ucm build (generated)
    examples/             doc examples, as runnable modules (generated)
    secret, tls/          the server's session secret and TLS certificate, once there are any
    .gitignore            ignores everything above except codebase.sqlite

22.1 What to keep

ucm init writes .ucm/.gitignore, which leaves only codebase.sqlite to commit: generated directories, app data and secrets are all ignored.

22.2 The two imports

ucm init adds these to package.json's imports:

22.3 Generated modules

.ucm/cache/<hash>.ts holds each definition as a module, with current names spliced in and imports by hash. Node runs these directly; there's no build step. You can read them, but there's no need to: ucm view, and in VS Code Go to Definition, show the source.

built from 5890e54f