tcmts.cli.pack

Types

Exported type
PackOptions type
Sibling type
Another package of the codebase, and what its releases export.

Server

appSchedules (cb: Codebase, app: string) => NameRow[]
An app's recurring jobs: the definitions beside it, in its namespace, whose value `every(...)` makes.
pack (cb: Codebase, opts: PackOptions) => { dir: string; modules: number; dependencies: Record<string, s…
packApp (cb: Codebase, app: string, out: string) => number
Ship an app of the codebase (`app`, a name) in a package: a codebase holding only it and what it uses, everything it runs on pinned as here, the app named `app`, written to `out/codebase.sqlite`. `tcm start app` there runs it (building it the first time), with the recurring jobs (`every(...)`) of its namespace, named as there (the app's `ns.ingest` as `ingest`), so `tcm start` runs them too, and its HTTP routes (`appRoutes`: `ns.http.oauth.client` as `http.oauth.client`), and the manifests giving what it uses a role (the react library's `Stylesheet`), named as here with what they give one, so its build treats them as here. Says how many definitions it holds.
packLibraries (cb: Codebase, libraries: string[], out: string) => number
Ship tcm libraries of the codebase (`libraries`, packages with `npm: false`) in a package: a codebase holding each one's newest release, its namespace named as it was there and the release recorded at it, so its namespace has the same hash, written to `out/codebase.sqlite`. `tcm lib add tcm <name>` mounts one from there. Says how many definitions it holds.
shipCodebase (cb: Codebase, roots: string[], out: string, name: (target: Codebase) => void) => number
A codebase of its own holding only what `roots` use, everything it runs on pinned as here, named by `name`, written to `out/codebase.sqlite`: what a package ships of the codebase (its apps, its libraries). Says how many definitions it holds.

Shared

SHIPPED_APP "app"
The name a package's shipped app has in the codebase it ships as: what `tcm start` is given.
appRoutes (cb: Codebase, app: string) => NameRow[]
An app's plain HTTP routes: the functions in its namespace's `http` namespace (`hub.http.oauth.client`), shipped with it as `http.…` (`http.oauth.client`), for `tcm start --http http.oauth=/oauth` to serve. Tests aren't routes.
exportsOf (all: NameRow[], targets: string[]) => Exported[]
What a subpath exports: definitions under their last names, namespaces' definitions under theirs. A type and a value can share a name; two of either can't.
forPackage (text: string, aliases: Map<string, string>) => string
Emitted code and declarations, for outside the cache: packages by name rather than the cache's aliases (where that's unambiguous; TypeScript calls an alias's DefinitelyTyped types `@npm/<alias>`), other modules by their `.js` files (declaration emit keeps `.ts`), and no JSX pragmas naming aliases.
fromSiblings (text: string, kept: Set<string>, provided: Map<string, { module: string; name: string; }>) => stri…
Imports of modules another package provides, rewritten to import from that package by name.
provide (cb: Codebase, roots: string[], siblings: Sibling[]) => { kept: Set<string>; provided: Map<string, …
Which components the package carries, and what it takes from its sibling packages instead: a definition one of them exports comes from the oldest release of it that exports every such definition used, as it is here. One a sibling keeps to itself (it doesn't export it) is carried, like the package's own code: two packages of one codebase can share code without either publishing it.