@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 +55 -0
- package/dist/spa/assets/index-B6qfWiN0.js +97 -0
- package/dist/spa/assets/index-GbeaN-XG.css +1 -0
- package/dist/spa/index.html +17 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/server.d.ts +28 -0
- package/dist/types/server.d.ts.map +1 -0
- package/dist/types/spa-entry.d.ts +2 -0
- package/dist/types/spa-entry.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +64 -0
- package/src/cli.ts +149 -0
- package/src/index.ts +9 -0
- package/src/server.ts +95 -0
- package/src/spa/spa-entry.tsx +25 -0
- package/src/spa/tsconfig.json +14 -0
- package/src/spa/tsconfig.tsbuildinfo +1 -0
- package/src/tsconfig.json +15 -0
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
|
+
```
|