sanoma 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -13
- package/dist/check.d.ts +6 -15
- package/dist/check.js +7 -6
- package/dist/check.js.map +1 -1
- package/dist/cli.js +204 -67
- package/dist/cli.js.map +1 -1
- package/dist/env.js +5 -3
- package/dist/env.js.map +1 -1
- package/dist/events.d.ts +29 -0
- package/dist/events.js +12 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +3 -4
- package/dist/init.js +4 -6
- package/dist/init.js.map +1 -1
- package/dist/postgres-bin.d.ts +31 -0
- package/dist/postgres-bin.js +93 -0
- package/dist/postgres-bin.js.map +1 -0
- package/dist/postgres.d.ts +35 -21
- package/dist/postgres.js +308 -72
- package/dist/postgres.js.map +1 -1
- package/dist/serve.d.ts +24 -3
- package/dist/serve.js +62 -14
- package/dist/serve.js.map +1 -1
- package/dist/source.d.ts +9 -4
- package/dist/source.js +230 -27
- package/dist/source.js.map +1 -1
- package/dist/wakeup.d.ts +14 -0
- package/dist/wakeup.js +63 -0
- package/dist/wakeup.js.map +1 -0
- package/oxlint.json +3 -1
- package/package.json +14 -6
- package/template/.env.example +1 -1
- package/template/AGENTS.md +3 -2
- package/template/package.json +1 -1
- package/template/pnpm-workspace.yaml +5 -0
- package/template/policies/changes.cedar +8 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ mkdir acme && cd acme
|
|
|
9
9
|
npx sanoma
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
In an empty directory (dotfiles aside), `sanoma` starts a company there, then runs it: it copies the template this package ships (`template/`: `sanoma.config.ts`, a `publish-post` workflow with its scenarios, `policies/policy.cedar
|
|
12
|
+
In an empty directory (dotfiles aside), `sanoma` starts a company there, then runs it: it copies the template this package ships (`template/`: `sanoma.config.ts`, a `publish-post` workflow with its scenarios, `policies/policy.cedar` and `policies/changes.cedar` (every change waits for `admin`), `resources/people.ts` with you as its first person (your GitHub login as `gh` is signed in, else this machine's user name, named as git's `user.name`), an empty `resources/` tree, `AGENTS.md`, `.env.example`), names the package after the directory, writes `.env` with a new `SANOMA_SECRETS_KEY` (keeping what a `.env` there already sets; no database URL, so the company runs on [its own Postgres](#postgres)), commits what it wrote (never a dotfile that was already there) as the first commit of a git repository on `main`, "Start a Sanoma company", as your git user, then installs with the package manager that ran it (`npm_config_user_agent`; pnpm when it names none), with `sanoma` at its own version and each other package the template names at `latest`, and adds the lockfile to that commit. The `sanoma` it installed then serves the company. Without git or a git user it stops before writing anything; a failed install leaves the commit, to install and run `sanoma` again in. A directory holding anything else and no `sanoma.config.ts` is refused, as for every command.
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ In an empty directory (dotfiles aside), `sanoma` starts a company there, then ru
|
|
|
17
17
|
npm install sanoma @sanoma-ai/connector-ghost
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
`sanoma` brings `@sanoma-ai/workflows`, `@sanoma-ai/app`, `zod`, `typescript`, `@types/node` and `oxlint` with it: a repo installs nothing else but its connectors. Node's types reach the repo's `tsc` through `sanoma` itself (its declarations reference them, resolved from where it is installed), under pnpm, npm or a link alike, so a repo lists no `@types/node`. A repo that lists its own of another major gets two sets of Node's declarations, which conflict: keep one, by matching sanoma's or letting the installer dedupe them. A tsconfig project that imports nothing from `sanoma` (a scripts directory with a tsconfig of its own, say) gets none this way: it sets `"types": ["node"]` and lists `@types/node` itself. Node
|
|
20
|
+
`sanoma` brings `@sanoma-ai/workflows`, `@sanoma-ai/app`, `zod`, `typescript`, `@types/node` and `oxlint` with it: a repo installs nothing else but its connectors. Node's types reach the repo's `tsc` through `sanoma` itself (its declarations reference them, resolved from where it is installed), under pnpm, npm or a link alike, so a repo lists no `@types/node`. A repo that lists its own of another major gets two sets of Node's declarations, which conflict: keep one, by matching sanoma's or letting the installer dedupe them. A tsconfig project that imports nothing from `sanoma` (a scripts directory with a tsconfig of its own, say) gets none this way: it sets `"types": ["node"]` and lists `@types/node` itself. Node 26 or later. Nothing else: the [Postgres](#postgres) it starts comes with it, as `@sanoma-ai/postgres-<platform>`, an optional dependency.
|
|
21
21
|
|
|
22
22
|
A repo holds `sanoma.config.ts` at its root, with `workflows/`, optional `policies/` (Cedar files), `resources/` (data files, the people among them) and `scenarios/` (feature files) beside it, and a `tsconfig.json` that extends the one this package ships:
|
|
23
23
|
|
|
@@ -98,20 +98,34 @@ Only a declared person signs in to the app (on this machine by picking their nam
|
|
|
98
98
|
|
|
99
99
|
Run them from the directory that holds `sanoma.config.ts`. Each loads `.env` there first, when there is one (a variable already set wins), then the config.
|
|
100
100
|
|
|
101
|
-
| Command | What it does
|
|
102
|
-
| --------------------------------------------- |
|
|
103
|
-
| `sanoma` | Makes `SANOMA_SECRETS_KEY`, which encrypts the stored credentials, when the environment and `.env` have none, appending it to `.env` with one line saying so; makes sure Postgres answers (see [Postgres](#postgres)), then starts the worker (promoted, so a local worker takes every queued run) and the app in one process, and prints `<appName> running <workflows>` and `<appName> at http://127.0.0.1:3000; ctrl-c to stop`; the worker says `sanoma: 2 of 5 connectors not configured yet: ghost, resend; …` first when some vendors' variables are missing or invalid (a call to one fails, naming them, until they are set; nothing when all are set). When the repo has [sites](#sites), it serves the app and the sites from a dev server that shows each edit as it is saved (see [Developing a site](#developing-a-site)). In [dev mode](#dev-mode) it runs them in a child it restarts. In an empty directory it first [starts a company](#start-a-company). The worker and the app are given the repo's git checkout as their `source`, which commits to the current branch.
|
|
104
|
-
| `sanoma worker`, `sanoma app` | One of the two alone, for a deployment that runs them apart (`app` builds the app with the [sites](#sites)). Neither
|
|
105
|
-
| `sanoma
|
|
106
|
-
| `sanoma
|
|
107
|
-
| `sanoma
|
|
108
|
-
| `sanoma --
|
|
101
|
+
| Command | What it does |
|
|
102
|
+
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `sanoma` | Makes `SANOMA_SECRETS_KEY`, which encrypts the stored credentials, when the environment and `.env` have none, appending it to `.env` with one line saying so; makes sure Postgres answers, starting the company's own when no URL is named (see [Postgres](#postgres)), then starts the worker (promoted, so a local worker takes every queued run) and the app in one process, and prints `<appName> running <workflows>` and `<appName> at http://127.0.0.1:3000; ctrl-c to stop`; the worker says `sanoma: 2 of 5 connectors not configured yet: ghost, resend; …` first when some vendors' variables are missing or invalid (a call to one fails, naming them, until they are set; nothing when all are set). When the repo has [sites](#sites), it serves the app and the sites from a dev server that shows each edit as it is saved (see [Developing a site](#developing-a-site)). In [dev mode](#dev-mode) it runs them in a child it restarts. In an empty directory it first [starts a company](#start-a-company). The worker and the app are given the repo's git checkout as their `source`, which commits to the current branch, and opens drafts: a git worktree each, at `.sanoma/drafts/<id>` on the branch `draft/<id>` from the checked-out commit, with the repo's `node_modules` linked in (a link, which `node_modules/` in `.gitignore` does not match, so `.git/info/exclude` names it), where a writer that must not touch the live checkout commits instead, and whose `sanoma check` the app runs as a child holding only `PATH`, `HOME` and the database URL. A draft is open while `git worktree list` lists it; merging its branch is by hand. |
|
|
104
|
+
| `sanoma worker`, `sanoma app` | One of the two alone, for a deployment that runs them apart (`app` builds the app with the [sites](#sites)). Neither starts or probes Postgres: a URL named is the runtime's to reach; with none they use the company's own only while another `sanoma` runs it, and exit 2 otherwise. |
|
|
105
|
+
| `sanoma wakeup` | The [wakeup service](#the-wakeup-service) alone, on the config's database (found as `worker` and `app` find it, never started), at `SANOMA_APP_HOST` and `SANOMA_APP_PORT` (default 3100), with `/healthz`. |
|
|
106
|
+
| `sanoma check` | Writes [`.sanoma/api.ts`](#sites) and `.sanoma/schema.cedarschema` first, each when it changed; then `tsc -p tsconfig.json`; oxlint over `workflows/`, `resources/` and `sites/` (those that exist) with the repo's `.oxlintrc.json`, written when missing (see [the lint](#the-lint)); every problem `describeConfig` finds (an import a workflow may not make, what its graph cannot draw, a data file outside the subset: what the worker would refuse; a site's call to a workflow, collection or operation the config does not have, or a public site's start or direct call no `permit` lets a visitor make; a domain a host gives a site that is not public, or gives two sites); every problem in the [policies](#people-and-policies), at its `file:line:col` with the policy's id; with [sites](#sites), the app built with them, `tsc -p sites/tsconfig.json` and what is wrong under `content/`; then, unless the policies have a problem, every scenario against the fakes, on a database of its own (`<database>_check`, on the company's own Postgres when no URL is named, stopped after when `check` started it), each step that did not hold a problem. Prints each problem on a line, `file:line:col: message` or `scenario › step: message`, and exits 1 when there is one; before them each warning, `file:line:col: warning: message` (a public site's page the sitemap cannot list the entries of), which never fails it. No vitest. |
|
|
107
|
+
| `sanoma env [--check]` | Writes `.env.example`: the variables `sanoma` reads, then every variable the connectors' drivers declare, by vendor, with its description; optional ones commented out. `--check` writes nothing and exits 1 with "`.env.example` is out of date: run `sanoma env`" when the file differs, for CI. |
|
|
108
|
+
| `sanoma ledger export <runId> [--out <file>]` | A run's ledger records from the config's store (the Postgres ledger on its database when it names none, the company's own started for the read when no URL is named), as JSON lines (the shape `jsonlLedger` keeps), to stdout or `--out`. |
|
|
109
|
+
| `sanoma --help` | The usage. |
|
|
109
110
|
|
|
110
|
-
Exit codes: 2 for a mistake in the call or the repo (no `sanoma.config.ts`, an unknown command or option, a bad argument), printed with the usage where it helps; 1 for failed checks and failures while running; 0 otherwise. `SANOMA_APP_PORT` is the app's port (default 3000; 0 for any free port, which the printed address reports). `SANOMA_APP_HOST` is its address (default 127.0.0.1); `SANOMA_DOMAINS` gives a [public site](../app/README.md#public-sites) its domain, `<site>=<hostname>[,<site>=<hostname>…]` (`www=sanoma.example`, which a host resource's `domains` sets), and a malformed one exits 2; any other needs [GitHub sign-in](../app/README.md#github), which `SANOMA_GITHUB_CLIENT_ID` and `SANOMA_GITHUB_CLIENT_SECRET` turn on (both or neither, with `SANOMA_SECRETS_KEY` set; on a host beyond this machine, or with one of them set, the other may be the stored one the app's Go live page saved when it created the GitHub App); a mistake in them exits 2 before anything starts, as does a problem in the policies. On SIGINT or SIGTERM the app, then the worker, stop, and the process exits 0.
|
|
111
|
+
Exit codes: 2 for a mistake in the call or the repo (no `sanoma.config.ts`, an unknown command or option, a bad argument), printed with the usage where it helps; 1 for failed checks and failures while running; 0 otherwise. `SANOMA_APP_PORT` is the app's port (default 3000; 0 for any free port, which the printed address reports). `SANOMA_APP_HOST` is its address (default 127.0.0.1); `SANOMA_DOMAINS` gives a [public site](../app/README.md#public-sites) its domain, `<site>=<hostname>[,<site>=<hostname>…]` (`www=sanoma.example`, which a host resource's `domains` sets), and a malformed one exits 2; any other needs [GitHub sign-in](../app/README.md#github), which `SANOMA_GITHUB_CLIENT_ID` and `SANOMA_GITHUB_CLIENT_SECRET` turn on (both or neither, with `SANOMA_SECRETS_KEY` set; on a host beyond this machine, or with one of them set, the other may be the stored one the app's Go live page saved when it created the GitHub App); a mistake in them exits 2 before anything starts, as does a problem in the policies. On SIGINT or SIGTERM the app, then the worker, then the Postgres it started, stop, and the process exits 0.
|
|
112
|
+
|
|
113
|
+
### For a parent process
|
|
114
|
+
|
|
115
|
+
A parent process, such as a desktop shell, runs `sanoma` with `SANOMA_EVENTS=1` and reads its stdout line by line: beside the lines a person reads, each event is one JSON object on a line of its own, `{"sanoma":1,"event":…}`; logs stay on stderr.
|
|
116
|
+
|
|
117
|
+
- `{"sanoma":1,"event":"ready","url":"http://127.0.0.1:3000","sites":{"www":"http://www.localhost:3000"}}`: the app listens, right after the `at <url>; ctrl-c to stop` line, each time it starts (in [dev mode](#dev-mode), after each restart); `url` is where the app listens, on the port `SANOMA_APP_PORT` names (the free one it took, for 0), and `sites` is `{}` without public sites. `sanoma worker` has no address and prints none.
|
|
118
|
+
- `{"sanoma":1,"event":"error","message":"…"}`: the launcher cannot start or stop, with the message it printed on stderr, then exits 2 for a mistake in the call or the config, 1 for a failure. In dev mode a child that fails prints it too, and the launcher waits for the next build to start it again.
|
|
119
|
+
- `{"sanoma":1,"event":"checked","ok":false,"problems":["…"],"warnings":[]}`: `sanoma check`'s result, the lines it printed as two lists, before it exits; a check that cannot read the config ends with `error` instead. Read it rather than the printed lines: DBOS logs on stdout too.
|
|
120
|
+
- `{"sanoma":1,"event":"database","how":"started","url":"postgresql://postgres:…@127.0.0.1:54012/sanoma","place":"this-computer"}`: the company's own [Postgres](#postgres) answers, once, before the worker starts (in dev mode, from the parent, not each child): `how` is `created` (made first), `started`, or `answered` (another `sanoma` runs it), and `url` holds its password, so a parent never logs it. None when a URL is named.
|
|
121
|
+
|
|
122
|
+
With the variable, the end of stdin (the parent closing it, or exiting), or an error reading it, stops `sanoma` as SIGTERM does, so the parent keeps stdin open while it runs. `sanoma` never prompts and, without the variable, never reads stdin; it opens no browser. SIGTERM stops everything it started (the app, then the worker; in dev mode its child and the watch builds), then the company's own [Postgres](#postgres) when it started it and no other client is connected, and it exits 0.
|
|
111
123
|
|
|
112
124
|
## Postgres
|
|
113
125
|
|
|
114
|
-
The worker and the app run on
|
|
126
|
+
The worker and the app run on the config's `databaseUrl`, else `SANOMA_DATABASE_URL` (from the environment or `.env`; an empty value is none). A URL named is used as it is: `sanoma` (through `sanoma serve`), `sanoma check` and `sanoma ledger export` probe it first (`SELECT 1` on its server's `postgres` database, as its user), and stop with a message when nothing answers there or the server refuses the user. For `postgresql://postgres:dbos@localhost:5433/sanoma`, which earlier versions wrote into `.env` and started in Docker, the message says to start that container to keep its records, or to remove the line to move to the company's own.
|
|
127
|
+
|
|
128
|
+
With none named, a company runs on its own PostgreSQL 18, from the `@sanoma-ai/postgres-<platform>` package installed with `sanoma` (macOS and Linux on arm64 and x64; Windows untested), extracted once into the OS's cache (`~/Library/Caches/sanoma/postgres/<version>-<platform>-<sha>` on macOS, under `$XDG_CACHE_HOME` or `~/.cache` on Linux, `%LOCALAPPDATA%` on Windows), or from `SANOMA_POSTGRES_DIR`, a directory holding its `bin/`. Its cluster is `.sanoma/postgres` in the company's directory of the main checkout (beside git's common directory, so a worktree of the repo uses the same one): `data/`, `server.log`, `password` (random, readable by its owner alone) and a `.gitignore` of its own. It listens on 127.0.0.1 alone, at a port picked when it was made (another when that one is taken), at `postgresql://postgres:<password>@127.0.0.1:<port>/sanoma`, which `sanoma` sets as its own `SANOMA_DATABASE_URL` for the runtime and every child it starts, never in `.env`. `sanoma` creates it on the first run (`initdb`, saying once where the records live), starts it on the next, and uses it as it is while another `sanoma` on the repo runs it; `check` runs its scenarios on `sanoma_check` beside the company's `sanoma`. It runs in a process group of its own, so a terminal's ctrl-c reaches `sanoma` alone, which stops it after the app and the worker when it started it and no other client is connected (another `sanoma`'s worker), and leaves it up otherwise. `sanoma worker` and `sanoma app` never start it: they exit 2 when it does not run. Deleting `.sanoma/postgres` deletes the company's records. PostgreSQL refuses to run as root: there, set `SANOMA_DATABASE_URL`. A synced folder (iCloud Drive, Dropbox) may copy the files of a running database half-written: keep the repo out of one (`sanoma` warns in iCloud Drive).
|
|
115
129
|
|
|
116
130
|
## `.env.example`
|
|
117
131
|
|
|
@@ -169,10 +183,18 @@ When the repo's `node_modules/sanoma` or any `node_modules/@sanoma-ai/*` is a li
|
|
|
169
183
|
|
|
170
184
|
Linking a core package while another still comes from a tarball (`@sanoma-ai/workflows` linked and `sanoma` not, or a declared `@sanoma-ai/app` left installed beside a linked `sanoma`) works, with two copies of a package in one process (the linked one, and the one an installed package depends on), and `sanoma` says which still come from their tarballs before it starts the child: `dev mode: sanoma, @sanoma-ai/app, @sanoma-ai/bridge still come from their tarballs, so edits to them in the checkout will not show`. [`@sanoma-ai/dev`](../dev/README.md)'s `sanoma-dev link` links `sanoma` and every declared `@sanoma-ai/*` package the checkout has.
|
|
171
185
|
|
|
186
|
+
## The wakeup service
|
|
187
|
+
|
|
188
|
+
An instance whose worker stops when nothing can run (a host that scales to zero) still has what is due at a time: a schedule's next run, a sleep until a date. The wakeup service keeps that time for it while it is stopped, and calls the instance's `GET {url}/wake` then; any answer but a 2xx is tried again (after 1 s, 2 s, 4 s and so on, at most 5 minutes apart) until one is, so a wake is late at worst, never lost. `sanoma wakeup` runs it on its own; a config with `wakeup: true` runs it inside `sanoma serve` instead, its routes in the app (as sanoma-ops does for its customers). It keeps its two tables, `sanoma_wakeup_accounts` and `sanoma_wakeup_instances`, in that database, and only the sha256 of each token.
|
|
189
|
+
|
|
190
|
+
Whoever runs it mints an account with `sanoma wakeup account <label>`, which prints `{"id","token"}` on stdout (or `mintAccount(label)` on [`startWakeupService`](../workflows/README.md#the-wakeup-service)); its token (`swa_…`) registers instances: `POST /wakeup/instances { url, token }` takes the instance's own token (`swi_` and 43 or more base64url characters), which the company minted (`/setup` does, as `SANOMA_WAKEUP_TOKEN`), and answers `201 { id }`; posted again by the same account, the token names the same instance, now at the URL given, and answers `200 { id }` (its registered wake kept only when the URL is unchanged), and another account's is a 409; `GET` and `DELETE /wakeup/instances/{id}` with the account's token show and remove one. Before it stops, the instance sends `PUT /wakeup/wake { at }` with its own token, which names it: a 204, which replaces what it registered. A wake is resume if stopped, so one that a retry or a replaced registration sends early or twice starts at most a worker with nothing to do. Every response is JSON and `no-store`; a missing or unknown token is a 401, another account's instance a 403, a bad body a 400.
|
|
191
|
+
|
|
192
|
+
A company uses one through the runtime's own wakeup, `sanoma.wakeup({ host })` (`import { sanoma } from "sanoma/resources"`), which every config with a host type has, no connector installed: `/setup` asks for the service's URL and an account's token (`SANOMA_WAKEUP_URL`, `SANOMA_WAKEUP_ACCOUNT_TOKEN`), and going live declares it when the host's own vendor has no wakeup of its own, the host given `SANOMA_WAKEUP_URL` and `SANOMA_WAKEUP_TOKEN`.
|
|
193
|
+
|
|
172
194
|
## Hosting it yourself
|
|
173
195
|
|
|
174
196
|
`sanoma worker` and `sanoma app` are the deployment's two processes. A host that composes its own process keeps `startWorker` from `@sanoma-ai/workflows` and `startApp` from `@sanoma-ai/app`, which the bin runs.
|
|
175
197
|
|
|
176
|
-
[`runtime/`](runtime/Dockerfile) is the image a container host runs: Node
|
|
198
|
+
[`runtime/`](runtime/Dockerfile) is the image a container host runs: Node 26, git, pnpm and `provider-bridge`, and no company code. At start it clones `SANOMA_SOURCE` at `SANOMA_REVISION` (with `SANOMA_SOURCE_TOKEN` as an HTTP header when set), runs `pnpm install --frozen-lockfile` and `sanoma serve` on `0.0.0.0` and `PORT` (default 3000); the host passes `SANOMA_DATABASE_URL`, `SANOMA_SECRETS_KEY` and, as the app is not on loopback, the `SANOMA_GITHUB_*` sign-in variables too. Its health check is the app's `/healthz`. `sanoma serve` (not `sanoma app`, which runs no worker) also answers a [wakeup](../workflows/README.md#hosts)'s `GET /wake` before any login: 204, never cached, whatever the query. Its worker runs under a supervisor (`superviseWorker`): with a wakeup declared and the app beyond loopback (on this machine alone, the wakeup would wake the deployed instance) it stops itself when nothing can run soon, and a fresh one starts on a wake (resume if stopped), or on a write from the app (a run's start, apply, an approval's decision), never on a page read. `sanoma worker` never stops its worker: nothing in its process would start it again. A repo with [sites](#sites) is built at start, as `sanoma serve` does anywhere, into `.sanoma/app/` in the clone: the app listens once the build is done (the health check's start period allows 5 minutes for the clone, the install and the build); the image itself holds no build. `provider-bridge` is built from source at a pinned commit; `--build-arg BRIDGE_FROM=release --build-arg BRIDGE_VERSION=<x.y.z>` downloads a release instead. CI builds the image without pushing it; it runs no company in it, so it builds no site either. A release pushes it to Docker Hub as `sanomaai/runtime:<sanoma version>` ([Release](../../README.md#release) has the hand command).
|
|
177
199
|
|
|
178
200
|
Status: early (0.x). License: FSL-1.1-ALv2.
|
package/dist/check.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
+
import { type CheckResult } from "@sanoma-ai/workflows";
|
|
1
2
|
import type { Loaded } from "./config.ts";
|
|
2
|
-
export interface CheckResult {
|
|
3
|
-
ok: boolean;
|
|
4
|
-
/** One printable line each: `<file>:<line>:<col>: <message>`, or `<scenario> › <step>: <message>`. */
|
|
5
|
-
problems: string[];
|
|
6
|
-
/** What is worth fixing but not wrong, one line each, `<file>:<line>:<col>: warning: <message>`: the sites' `warnings`. */
|
|
7
|
-
warnings: string[];
|
|
8
|
-
}
|
|
9
3
|
export interface CheckOptions {
|
|
10
|
-
/** The Postgres the scenarios' worker runs on: a database of its own, never the config's. */
|
|
4
|
+
/** The Postgres the scenarios' worker runs on, answering already: a database of its own, never the config's. */
|
|
11
5
|
databaseUrl: string;
|
|
12
|
-
/**
|
|
13
|
-
* Settles once Postgres answers at `databaseUrl`'s server (the bin's `ensurePostgres`, started
|
|
14
|
-
* before `check`): awaited only before the scenarios, so tsc, oxlint and the config's reading
|
|
15
|
-
* do not wait on it. A failure is the check's only when there are scenarios to run.
|
|
16
|
-
*/
|
|
17
|
-
ready?: Promise<unknown>;
|
|
18
6
|
log: (line: string) => void;
|
|
19
7
|
}
|
|
20
8
|
/**
|
|
@@ -30,5 +18,8 @@ export interface CheckOptions {
|
|
|
30
18
|
* wrong under `content/` (as `writeSiteFiles` reads it). Their problems in the order tsc, the sites' tsc, oxlint,
|
|
31
19
|
* the policies, the config, the folders refused as sites, the content's problems, the sites' build. Then, unless the policies do not hold, every scenario against the fakes (`runScenarios`), each step that did not hold a
|
|
32
20
|
* problem. `ok` when there are no problems; the sites' `warnings` beside them never make it not.
|
|
21
|
+
* With them, the repo's Permissions grid (`permissionsGrid`, as the app's Permissions page has
|
|
22
|
+
* it), from the same config and description, which a change is reviewed by: none when the
|
|
23
|
+
* policies do not hold, since every cell would be the refusing policy's deny.
|
|
33
24
|
*/
|
|
34
|
-
export declare function check({ config, root, resolved }: Loaded, { databaseUrl,
|
|
25
|
+
export declare function check({ config, root, resolved }: Loaded, { databaseUrl, log }: CheckOptions): Promise<CheckResult>;
|
package/dist/check.js
CHANGED
|
@@ -4,7 +4,7 @@ import { join, relative } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import { errorMessage } from "@sanoma-ai/workflows";
|
|
7
|
-
import { describeConfig, readPeople, schemaOf, writeGenerated, } from "@sanoma-ai/workflows/describe";
|
|
7
|
+
import { describeConfig, permissionsGrid, readPeople, schemaOf, writeGenerated, } from "@sanoma-ai/workflows/describe";
|
|
8
8
|
import { problemLine, warningLine } from "@sanoma-ai/workflows/shared";
|
|
9
9
|
import { runScenarios } from "@sanoma-ai/workflows/scenarios";
|
|
10
10
|
import { runtimeFrom, siteBuild } from "./sites.js";
|
|
@@ -23,10 +23,11 @@ const LINTED = ["workflows", "resources", "sites"];
|
|
|
23
23
|
* wrong under `content/` (as `writeSiteFiles` reads it). Their problems in the order tsc, the sites' tsc, oxlint,
|
|
24
24
|
* the policies, the config, the folders refused as sites, the content's problems, the sites' build. Then, unless the policies do not hold, every scenario against the fakes (`runScenarios`), each step that did not hold a
|
|
25
25
|
* problem. `ok` when there are no problems; the sites' `warnings` beside them never make it not.
|
|
26
|
+
* With them, the repo's Permissions grid (`permissionsGrid`, as the app's Permissions page has
|
|
27
|
+
* it), from the same config and description, which a change is reviewed by: none when the
|
|
28
|
+
* policies do not hold, since every cell would be the refusing policy's deny.
|
|
26
29
|
*/
|
|
27
|
-
export async function check({ config, root, resolved }, { databaseUrl,
|
|
28
|
-
// Awaited below when there are scenarios; otherwise its failure is nobody's.
|
|
29
|
-
ready.catch(() => { });
|
|
30
|
+
export async function check({ config, root, resolved }, { databaseUrl, log }) {
|
|
30
31
|
log("config");
|
|
31
32
|
const policies = resolved.policyProblems;
|
|
32
33
|
const description = describeConfig(config);
|
|
@@ -61,14 +62,14 @@ export async function check({ config, root, resolved }, { databaseUrl, ready = P
|
|
|
61
62
|
log("no scenarios: the policies do not hold");
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
|
-
await ready;
|
|
65
65
|
log("scenarios");
|
|
66
66
|
const { failed } = await runScenarios(config, { databaseUrl, log });
|
|
67
67
|
for (const f of failed)
|
|
68
68
|
problems.push(`${f.scenario} › ${f.step}: ${f.message}`);
|
|
69
69
|
}
|
|
70
70
|
const warnings = description.sites.flatMap((site) => site.warnings.map(warningLine));
|
|
71
|
-
|
|
71
|
+
const grid = policies.length ? undefined : permissionsGrid(resolved, description);
|
|
72
|
+
return { ok: problems.length === 0, problems, warnings, ...(grid && { grid }) };
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* The sites: the app built with them (`buildApp`, reused when nothing changed), so two pages
|
package/dist/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAoB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAEL,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