cici 0.4.1 → 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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +21 -21
- package/.next/app-path-routes-manifest.json +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mile/prompts.body +1 -1
- package/.next/server/app/atom.xml.body +1 -1
- package/.next/server/app/blog/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/blog/page_client-reference-manifest.js +1 -1
- package/.next/server/app/editor/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/memos/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/rss.xml.body +1 -1
- package/.next/server/app/sitemap.xml/route.js +1 -1
- package/.next/server/app/sitemap.xml.body +5 -5
- package/.next/server/app/unavailable/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +7 -7
- package/.next/server/chunks/3607.js +1 -1
- package/.next/server/chunks/3844.js +1 -1
- package/.next/server/chunks/719.js +1 -1
- package/.next/server/chunks/9715.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +21 -21
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/mile/prompts.body +1 -1
- package/.next/standalone/.next/server/app/atom.xml.body +1 -1
- package/.next/standalone/.next/server/app/blog/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/blog/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/editor/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/memos/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/rss.xml.body +1 -1
- package/.next/standalone/.next/server/app/sitemap.xml/route.js +1 -1
- package/.next/standalone/.next/server/app/sitemap.xml.body +5 -5
- package/.next/standalone/.next/server/app/unavailable/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +7 -7
- package/.next/standalone/.next/server/chunks/3607.js +1 -1
- package/.next/standalone/.next/server/chunks/3844.js +1 -1
- package/.next/standalone/.next/server/chunks/719.js +1 -1
- package/.next/standalone/.next/server/chunks/9715.js +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/package.json +1 -1
- package/.next/trace +120 -120
- package/README.md +77 -67
- package/bin/cici.js +12 -0
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{EVdo6WxGjsfWSi0PYx0v3 → v9qou3KOjBLcMsh9D_4gA}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{EVdo6WxGjsfWSi0PYx0v3 → v9qou3KOjBLcMsh9D_4gA}/_ssgManifest.js +0 -0
- /package/.next/static/{EVdo6WxGjsfWSi0PYx0v3 → v9qou3KOjBLcMsh9D_4gA}/_buildManifest.js +0 -0
- /package/.next/static/{EVdo6WxGjsfWSi0PYx0v3 → v9qou3KOjBLcMsh9D_4gA}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -1,101 +1,111 @@
|
|
|
1
1
|
# cici
|
|
2
2
|
|
|
3
|
-
A beautifully simple blog
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
28
|
+
Run cici against a local folder or a GitHub repo — no clone, no build:
|
|
21
29
|
|
|
22
30
|
```bash
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
35
|
+
# Serve a GitHub content repo (reads its data/ automatically, read-only)
|
|
36
|
+
npx cici --repo owner/name
|
|
29
37
|
|
|
30
|
-
|
|
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
|
-
|
|
42
|
+
Options: `--port, -p` (default 3000), `--host` (default 127.0.0.1). Run `npx cici --help`.
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
behind one content contract. Point the CLI at either:
|
|
44
|
+
## Deploy on Vercel
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
42
|
-
npx cici --repo metrue/cici
|
|
49
|
+
**1.** In your content repo, add `package.json`:
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"private": true,
|
|
54
|
+
"scripts": { "build": "cici build" },
|
|
55
|
+
"dependencies": { "cici": "^0.4.3" }
|
|
56
|
+
}
|
|
46
57
|
```
|
|
47
58
|
|
|
48
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
npx cici start
|
|
61
|
+
```json
|
|
62
|
+
{ "framework": null, "buildCommand": "cici build" }
|
|
57
63
|
```
|
|
58
64
|
|
|
59
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
-
|
|
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
|
-
|
|
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
|
-
|
|
88
|
+
## Editing
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
+
## Documentation
|
|
100
110
|
|
|
101
|
-
|
|
111
|
+
**[→ The Complete cici Guide](/blog/cofe)** — setup, customization, GraphQL API, deployment, and tips.
|
package/bin/cici.js
CHANGED
|
@@ -235,12 +235,24 @@ function runBuild() {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
// 5. Top-level build output config: serve files first, else the function.
|
|
238
|
+
// `images` lets Vercel's built-in Image Optimization serve `/_next/image`
|
|
239
|
+
// (the standalone function has no `sharp`, so without this next/image 404s).
|
|
240
|
+
// remotePatterns mirror next.config (any host); sizes are the Next defaults.
|
|
238
241
|
const config = {
|
|
239
242
|
version: 3,
|
|
240
243
|
routes: [
|
|
241
244
|
{ handle: 'filesystem' },
|
|
242
245
|
{ src: '/(.*)', dest: '/index' },
|
|
243
246
|
],
|
|
247
|
+
images: {
|
|
248
|
+
sizes: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
249
|
+
remotePatterns: [
|
|
250
|
+
{ protocol: 'https', hostname: '**' },
|
|
251
|
+
{ protocol: 'http', hostname: '**' },
|
|
252
|
+
],
|
|
253
|
+
minimumCacheTTL: 60,
|
|
254
|
+
formats: ['image/webp'],
|
|
255
|
+
},
|
|
244
256
|
}
|
|
245
257
|
fs.writeFileSync(path.join(outDir, 'config.json'), JSON.stringify(config, null, 2) + '\n')
|
|
246
258
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cici",
|
|
3
|
-
"version": "0.4.
|
|
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": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|