@decohere/create 0.0.1-dev.20261123.374 → 0.0.1-dev.20261123.379
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 +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,7 +107,7 @@ USER node
|
|
|
107
107
|
|
|
108
108
|
#### The app and its test
|
|
109
109
|
|
|
110
|
-
`src/app.ts` is the app's composition, written out so you can see and change every part: Pino logging, `http(FastifyProvider, …)` with an OpenAPI document, `config(…)` from `config/` and the environment, and `health()`. To use another HTTP provider or logger, edit that line; nothing is hidden behind a preset ([architecture: progressive](../../docs/architecture/README.md#4-progressive-new-apps-start-from-a-recipe-the-app-owns)). `src/main.ts` only starts it:
|
|
110
|
+
`src/app.ts` is the app's composition, written out so you can see and change every part: Pino logging, `http(FastifyProvider, …)` with an OpenAPI document, `config(…)` from `config/` and the environment, and `health()`. To use another HTTP provider or logger, edit that line; nothing is hidden behind a preset ([architecture: progressive](../../docs/contributing/architecture/README.md#4-progressive-new-apps-start-from-a-recipe-the-app-owns)). `src/main.ts` only starts it:
|
|
111
111
|
|
|
112
112
|
```ts
|
|
113
113
|
import { createApp } from "./app.js";
|
|
@@ -218,7 +218,7 @@ npx @decohere/create webapi -d my-app --name api --name billing --database postg
|
|
|
218
218
|
|
|
219
219
|
`config.yaml` lists one datasource per API (`name: billing` → `mikroOrm({ name: "billing" })`). Locally they share host `postgres` port `5432`. Point `BILLING_DB_HOST` / `BILLING_DB_PORT` at another server to split later. `webapi add billing --database postgres/mikro-orm` appends a datasource; the bootstrap `CREATE DATABASE`s it on first run.
|
|
220
220
|
|
|
221
|
-
Each API builds in `src/app.ts` (`createApp()`) and starts in `src/main.ts`. Its migrations are in `src/migrations/`, starting with one per table the scaffold maps, and development applies them on start. `pnpm decohere db <command>` runs `src/db.ts` (add `--api billing` when there are several APIs): `generate <name>` writes a migration from your mapping changes, and `migrate`, `status`, `revert` and `new` do what they say. See [Migrations](../../docs/recipes/migrations.md).
|
|
221
|
+
Each API builds in `src/app.ts` (`createApp()`) and starts in `src/main.ts`. Its migrations are in `src/migrations/`, starting with one per table the scaffold maps, and development applies them on start. `pnpm decohere db <command>` runs `src/db.ts` (add `--api billing` when there are several APIs): `generate <name>` writes a migration from your mapping changes, and `migrate`, `status`, `revert` and `new` do what they say. See [Migrations](../../docs/guide/recipes/migrations.md).
|
|
222
222
|
|
|
223
223
|
#### Health probes
|
|
224
224
|
|
|
@@ -259,7 +259,7 @@ While the API is running, `http://localhost:3000/openapi.json` describes every r
|
|
|
259
259
|
| `--name <slug>` | `webapi` | API directory under `projects/` (repeatable; default `api`) |
|
|
260
260
|
| `add api <name>` | `decohere add api` | Add an API to an existing Decohere workspace |
|
|
261
261
|
| `add auth0` | `decohere add auth0` | Add Auth0 to an existing workspace |
|
|
262
|
-
| `auth0 login` | `decohere auth0` | Device/URL login; keeps
|
|
262
|
+
| `auth0 login` | `decohere auth0` | Device/URL login; keeps the login in the project's own folder on your machine (see [`auth0`](#auth0)) |
|
|
263
263
|
| `auth0 configure` | `decohere auth0` | Update the Auth0 API, login app and token app for an existing workspace |
|
|
264
264
|
| `auth0 token` | `decohere auth0` | Print an access token for calling the API in development |
|
|
265
265
|
| `--database <provider>` | `webapi` / `add` | `none` \| `postgres/mikro-orm` \| `postgres/typeorm` |
|
|
@@ -308,3 +308,15 @@ gh auth status -t
|
|
|
308
308
|
```
|
|
309
309
|
|
|
310
310
|
If you still get `403` after adding `read:packages`, ask an org admin to grant your user/team access to the `typesmiths/decohere/create` package.
|
|
311
|
+
|
|
312
|
+
## Working on this package
|
|
313
|
+
|
|
314
|
+
For contributors to Decohere: how the package is laid out and tested. Using it needs nothing below.
|
|
315
|
+
|
|
316
|
+
`@decohere/create` is the launcher: its `create-decohere` bin (`npm create @decohere`) works out where a command runs and starts it there. The scaffolder itself is [`@decohere/scaffold`](../scaffold/README.md). `src/` is flat:
|
|
317
|
+
|
|
318
|
+
- `resolve-launch.ts`: maps what the user typed onto the product CLI's command line (`create webapi`, `add api`).
|
|
319
|
+
- `runner.ts`: `launch` runs the command here when this container has Decohere's tools (`tools.ts`, `DECOHERE_TOOLS`), otherwise `runInBuilder` runs it in the scaffolder image, `ghcr.io/typesmiths/decohere/create:<version>`, and copies the project out.
|
|
320
|
+
- `cli.ts` is the bin, and `version.ts` the version the image and scaffold package are pinned to. The image is built from `Dockerfile`, with `pack-builder-tgz.mjs` packing the scaffolder into it.
|
|
321
|
+
|
|
322
|
+
The canonical suite for what a user installs is `e2e/real-install.e2e.spec.ts`, against a temporary registry, in CI's `verify-release` job on `main`; `runInBuilder` and its argv are covered in `tests/runner.spec.ts` ([testing](../../docs/contributing/testing/README.md#canonical-suite-ownership)). Specs are in `tests/` today and move beside the code ([ADR 0027](../../docs/contributing/adr/0027-code-design.md)).
|