@nuasite/cms-studio 0.43.0-beta.7

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 ADDED
@@ -0,0 +1,55 @@
1
+ # @nuasite/cms-studio
2
+
3
+ The standalone, batteries-included Nua CMS. One `bunx` process serves the
4
+ collections **admin UI** and the **`/cms/v1` API** for a project, on a single
5
+ origin — no build step, no host framework, no CORS.
6
+
7
+ ```bash
8
+ bunx @nuasite/cms-studio --root . --content-dir src/content
9
+ # → http://localhost:4400
10
+ ```
11
+
12
+ It is the standalone composition of the headless pieces:
13
+
14
+ - [`@nuasite/cms-sidecar`](../cms-sidecar) — the `/cms/v1` HTTP API, run in-process
15
+ over `createCmsCore(createNodeFs(root))`.
16
+ - [`@nuasite/collections-admin`](../collections-admin) — the React admin SPA,
17
+ prebuilt into `dist/spa/` and served as static assets.
18
+
19
+ Because the UI, the API and the project's `public/` assets share one origin,
20
+ `local`-adapter media previews (`/uploads/…`) just work.
21
+
22
+ ## Usage
23
+
24
+ ```
25
+ cms-studio [--root <dir>] [--port <port>] [--content-dir <dir>] [--components-dir <a,b>]
26
+ ```
27
+
28
+ | Flag | Default | Meaning |
29
+ | ------------------ | ---------------- | ------------------------------------------------ |
30
+ | `--root` | `cwd` | Project root (the site being edited). |
31
+ | `--port` | `4400` | Listen port (`PORT` env also honoured). |
32
+ | `--content-dir` | `src/content` | Content collections directory, relative to root. |
33
+ | `--components-dir` | `src/components` | Comma-separated component dirs (MDX resolution). |
34
+
35
+ ## Media
36
+
37
+ Media defaults to the **`local`** adapter, writing to `<root>/public/uploads`.
38
+ Point it at a hosted backend with the same env vars the sidecar reads:
39
+
40
+ ```bash
41
+ CMS_MEDIA_ADAPTER=s3 CMS_MEDIA_S3_BUCKET=… CMS_MEDIA_S3_REGION=… bunx @nuasite/cms-studio --root .
42
+ ```
43
+
44
+ See [`@nuasite/cms-sidecar`'s `mediaFromEnv`](../cms-sidecar/src/media-from-env.ts)
45
+ for the full set (`contember` / `s3` / `local` / `none`).
46
+
47
+ ## Programmatic use
48
+
49
+ ```ts
50
+ import { createServer } from '@nuasite/cms-sidecar'
51
+ import { createStudioServer } from '@nuasite/cms-studio'
52
+
53
+ const studio = createStudioServer({ sidecar, spaDir, publicDir })
54
+ Bun.serve({ port: 4400, fetch: studio.fetch })
55
+ ```