cici 0.4.2 → 0.4.3

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.
Files changed (63) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +13 -13
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/next-minimal-server.js.nft.json +1 -1
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/mile/prompts.body +1 -1
  10. package/.next/server/app/atom.xml.body +1 -1
  11. package/.next/server/app/blog/[id]/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/blog/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/editor/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/memos/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/rss.xml.body +1 -1
  18. package/.next/server/app/sitemap.xml/route.js +1 -1
  19. package/.next/server/app/sitemap.xml.body +5 -5
  20. package/.next/server/app/unavailable/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app-paths-manifest.json +8 -8
  22. package/.next/server/chunks/3607.js +1 -1
  23. package/.next/server/chunks/3844.js +1 -1
  24. package/.next/server/chunks/719.js +1 -1
  25. package/.next/server/chunks/9715.js +1 -1
  26. package/.next/server/functions-config-manifest.json +1 -1
  27. package/.next/server/pages/500.html +1 -1
  28. package/.next/server/pages-manifest.json +1 -1
  29. package/.next/server/server-reference-manifest.json +1 -1
  30. package/.next/standalone/.next/BUILD_ID +1 -1
  31. package/.next/standalone/.next/app-build-manifest.json +13 -13
  32. package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
  33. package/.next/standalone/.next/build-manifest.json +2 -2
  34. package/.next/standalone/.next/prerender-manifest.json +1 -1
  35. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/mile/prompts.body +1 -1
  37. package/.next/standalone/.next/server/app/atom.xml.body +1 -1
  38. package/.next/standalone/.next/server/app/blog/[id]/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/blog/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/editor/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/memos/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/rss.xml.body +1 -1
  45. package/.next/standalone/.next/server/app/sitemap.xml/route.js +1 -1
  46. package/.next/standalone/.next/server/app/sitemap.xml.body +5 -5
  47. package/.next/standalone/.next/server/app/unavailable/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app-paths-manifest.json +8 -8
  49. package/.next/standalone/.next/server/chunks/3607.js +1 -1
  50. package/.next/standalone/.next/server/chunks/3844.js +1 -1
  51. package/.next/standalone/.next/server/chunks/719.js +1 -1
  52. package/.next/standalone/.next/server/chunks/9715.js +1 -1
  53. package/.next/standalone/.next/server/pages/500.html +1 -1
  54. package/.next/standalone/.next/server/pages-manifest.json +1 -1
  55. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  56. package/.next/standalone/package.json +1 -1
  57. package/.next/trace +120 -120
  58. package/README.md +77 -67
  59. package/package.json +1 -1
  60. /package/.next/standalone/.next/static/{CsV2H6n03Dh7kIQJcmDlJ → v9qou3KOjBLcMsh9D_4gA}/_buildManifest.js +0 -0
  61. /package/.next/standalone/.next/static/{CsV2H6n03Dh7kIQJcmDlJ → v9qou3KOjBLcMsh9D_4gA}/_ssgManifest.js +0 -0
  62. /package/.next/static/{CsV2H6n03Dh7kIQJcmDlJ → v9qou3KOjBLcMsh9D_4gA}/_buildManifest.js +0 -0
  63. /package/.next/static/{CsV2H6n03Dh7kIQJcmDlJ → v9qou3KOjBLcMsh9D_4gA}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -1,101 +1,111 @@
1
1
  # cici
2
2
 
3
- A beautifully simple blog and memo app that just works.
3
+ A beautifully simple, git-backed blog & memo app. Write Markdown, keep everything in
4
+ your own Git repo, serve it anywhere. Inspired by [tinymind](https://github.com/mazzzystar/tinymind);
5
+ live at [blog.minghe.me](https://blog.minghe.me).
4
6
 
5
- Write thoughts. Share ideas. Let GitHub handle the rest. Originally inspired by [tinymind](https://github.com/mazzzystar/tinymind), now see it in action at [blog.minghe.me](https://blog.minghe.me).
7
+ **cici is pure tooling.** Your content posts, memos, config lives in *your* repo or
8
+ folder. You install cici (`npm i cici` / `npx cici`) and point it at that content. This
9
+ repo ships only the app plus a tiny `sample-content/` demo used for local dev and tests.
6
10
 
7
- > **cici is pure tooling.** Your blog *content* — posts, memos, site config — lives in
8
- > a **separate content repo** (or a local folder), not here. This repo ships only the
9
- > app plus a small `sample-content/` demo fixture used for `next dev` and tests.
11
+ ## Content layout
10
12
 
13
+ Your content lives under a **`data/`** folder — in a Git repo this sits at the repo root,
14
+ and it's exactly what a deploy serves:
11
15
 
12
- ## What You Get
16
+ ```
17
+ data/
18
+ blog/ # one <slug>.md per post (front-matter + Markdown)
19
+ memos.json # short-form memos
20
+ site-config.json # title, author, social links (optional)
21
+ highlights/ # one <slug>.json per post (optional)
22
+ likes.json # like counts (optional)
23
+ assets/ # images uploaded from the editor (local mode)
24
+ ```
13
25
 
14
- - **Rich Blog Posts** - Markdown, syntax highlighting, math, images
15
- - **Quick Memos** - Instant thoughts with location tagging
16
- - **Discussion Integration** - Auto-connect HN, Reddit, V2EX comments
17
- - **GitHub Powered** - Your data, your control, always
18
- - **Works Everywhere** - Mobile-first, lightning fast
26
+ ## Use it locally
19
27
 
20
- ## Get Started in 2 Minutes
28
+ Run cici against a local folder or a GitHub repo — no clone, no build:
21
29
 
22
30
  ```bash
23
- git clone https://github.com/metrue/cici.git
24
- cd cici && npm install && npm run dev
25
- ```
31
+ # Serve AND edit local content (open /editor to write; changes save to disk).
32
+ # --dir points at the folder that contains blog/ — in a content repo that's data/:
33
+ npx cici --dir ./data
26
34
 
27
- **That's it.** Visit `localhost:3000` `next dev` serves the shipped `sample-content/`
28
- demo fixture. Point cici at your own content repo/folder (below) to write for real.
35
+ # Serve a GitHub content repo (reads its data/ automatically, read-only)
36
+ npx cici --repo owner/name
29
37
 
30
- [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/metrue/cici)
38
+ # ...with a token, edit it too (commits back to the repo)
39
+ npx cici --repo owner/name --token ghp_xxx --port 4000
40
+ ```
31
41
 
32
- ## Run it anywhere with `npx` (no deploy)
42
+ Options: `--port, -p` (default 3000), `--host` (default 127.0.0.1). Run `npx cici --help`.
33
43
 
34
- cici has a runtime layer with two backends — **local files** and a **GitHub repo** —
35
- behind one content contract. Point the CLI at either:
44
+ ## Deploy on Vercel
36
45
 
37
- ```bash
38
- # Local folder serve AND edit, straight from disk (no GitHub, no sign-in)
39
- npx cici --dir ~/my-blog
46
+ Your **content repo** is the thing you deploy — it just depends on cici. No app source,
47
+ no fork of this repo.
40
48
 
41
- # Any GitHub content repo read-only viewer
42
- npx cici --repo metrue/cici
49
+ **1.** In your content repo, add `package.json`:
43
50
 
44
- # ...with a token, edit that repo too
45
- npx cici --repo owner/name --token ghp_xxx --port 4000
51
+ ```json
52
+ {
53
+ "private": true,
54
+ "scripts": { "build": "cici build" },
55
+ "dependencies": { "cici": "^0.4.3" }
56
+ }
46
57
  ```
47
58
 
48
- Two more commands for deploying cici *with* a content repo on a host (e.g. Vercel):
49
-
50
- ```bash
51
- # From inside a content repo: stage cici's prebuilt Next output into ./ for the host
52
- npx cici build
59
+ **2.** Add `vercel.json` (so Vercel serves cici's output instead of running its own Next build):
53
60
 
54
- # Boot the server from preset env (CICI_REPO/CICI_TOKEN/CICI_DIR/PORT/HOST) —
55
- # no --dir/--repo needed; the host supplies the backend via env
56
- npx cici start
61
+ ```json
62
+ { "framework": null, "buildCommand": "cici build" }
57
63
  ```
58
64
 
59
- The content contract (same for `--dir` and `--repo`):
65
+ `cici build` emits Vercel's Build Output API (`.vercel/output/`) cici's prebuilt server
66
+ as one function plus static assets. Vercel serves it directly.
60
67
 
61
- ```
62
- <root>/
63
- blog/ # one <slug>.md per post (front-matter + markdown)
64
- memos.json # your memos
65
- site-config.json # optional site settings
66
- likes.json # optional
67
- highlights/ # optional, one <slug>.json per post
68
- assets/ # images uploaded from the editor land here (local mode)
69
- ```
68
+ **3.** Set environment variables on the Vercel project:
70
69
 
71
- When editing is available (local mode, or a GitHub repo with a token) open `/editor`
72
- to write posts and memos — everything is written back through the provider: to disk
73
- in `--dir` mode, or committed to the repo in `--repo --token` mode.
70
+ | Var | Value |
71
+ |-----|-------|
72
+ | `CICI_REPO` | `owner/name` of your content repo |
73
+ | `GITHUB_ID` / `GITHUB_SECRET` | a [GitHub OAuth app](https://github.com/settings/developers) (callback `<site>/api/auth/callback/github`) — `/editor` sign-in |
74
+ | `NEXTAUTH_SECRET` | any random string (signs the session) |
75
+ | `NEXTAUTH_URL` | your site URL, e.g. `https://blog.example.com` |
76
+ | `CICI_TOKEN` | **Optional — private repos only.** GitHub token with **Contents: read & write**. A public content repo needs no token: cici reads it anonymously, and `/editor` commits with your GitHub sign-in. |
74
77
 
75
- ### Architecture
78
+ If your content repo is **public**, that's the recommended setup — no server token to
79
+ manage, and only you (the repo owner, via sign-in) can publish. Reads work for everyone,
80
+ writes only for whoever can push to the repo.
76
81
 
77
- - **Runtime layer** (`lib/runtime/`): a `ContentProvider` interface with `LocalProvider`
78
- and `GitHubProvider` implementations; `getProvider()` is the single factory that picks
79
- one from `CICI_DIR` / `CICI_REPO` / `GITHUB_USERNAME`.
80
- - **Render layer** (`app/`, `components/`): depends only on `getProvider()` — never on
81
- `fs` or Octokit directly.
82
+ Deploy. cici reads your content from `CICI_REPO` at request time, so edits (via `/editor`
83
+ or a `git push`) show up without a redeploy.
82
84
 
83
- ## Documentation
85
+ > Prefer a plain Node host (Railway / Render / Fly / a VPS / Docker)? Skip `cici build`
86
+ > and run `cici start` with the same `CICI_*` env — it boots the server directly.
84
87
 
85
- **[→ Complete cici Guide](/blog/cofe)** - Everything you need in one place:
88
+ ## Editing
86
89
 
87
- - Quick start & GitHub OAuth setup
88
- - Customization & analytics integration
89
- - API reference & GraphQL queries
90
- - Deployment & performance tips
91
- - Migration from other platforms
92
- - Troubleshooting & best practices
90
+ Open `/editor` to write posts and memos. In `--dir` mode it writes to disk; with a token
91
+ (`--repo --token`, or `CICI_TOKEN` on a deploy) it commits back to your content repo.
93
92
 
93
+ ## Develop cici itself
94
94
 
95
- ## Screenshots
95
+ ```bash
96
+ git clone https://github.com/metrue/cici.git
97
+ cd cici && npm install && npm run dev # serves the bundled sample-content/
98
+ npm test
99
+ ```
96
100
 
97
- ![Home Desktop](https://github.com/metrue/cici/blob/main/assets/images/home_desktop.png?raw=true)
101
+ ### Architecture
102
+
103
+ - **Runtime layer** (`lib/runtime/`): a `ContentProvider` interface with `LocalProvider`
104
+ and `GitHubProvider`; `getProvider()` picks one from `CICI_DIR` / `CICI_REPO` env.
105
+ - **Render layer** (`app/`, `components/`): depends only on `getProvider()` — never on
106
+ `fs` or Octokit directly.
107
+ - **CLI** (`bin/cici.js`): `--dir` / `--repo` (serve), `build` (Vercel Build Output), `start` (boot from env).
98
108
 
99
- ![Memos Desktop](https://github.com/metrue/cici/blob/main/assets/images/memos_desktop.png?raw=true)
109
+ ## Documentation
100
110
 
101
- ![Memo Editor](https://github.com/metrue/cici/blob/main/assets/images/memo_editor.png?raw=true)
111
+ **[ The Complete cici Guide](/blog/cofe)** — setup, customization, GraphQL API, deployment, and tips.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cici",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "private": false,
5
5
  "description": "cici — a git-backed blog CMS (pure tooling; your posts live in a separate content repo). Run `npx cici --dir <dir>` or `--repo <owner/name>` to serve/edit, or `cici build` / `cici start` to deploy.",
6
6
  "repository": {