Skip to content

Commit 9b192c0

Browse files
author
CI Bot
committed
chore: resolve remaining PR review nits and CLI hardening
1 parent 13cd970 commit 9b192c0

11 files changed

Lines changed: 48 additions & 38 deletions

File tree

.gitignore

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ git-cms-test-*/
99
.obsidian/
1010

1111
# LaTeX artifacts
12-
*.aux
13-
*.log
14-
*.out
15-
*.toc
16-
*.synctex.gz
17-
*.fls
18-
*.fdb_latexmk
19-
*.bbl
20-
*.blg
21-
*.idx
22-
*.ind
23-
*.ilg
24-
*.lof
25-
*.lot
12+
docs/adr-tex-2/*.aux
13+
docs/adr-tex-2/*.log
14+
docs/adr-tex-2/*.out
15+
docs/adr-tex-2/*.toc
16+
docs/adr-tex-2/*.synctex.gz
17+
docs/adr-tex-2/*.fls
18+
docs/adr-tex-2/*.fdb_latexmk
19+
docs/adr-tex-2/*.bbl
20+
docs/adr-tex-2/*.blg
21+
docs/adr-tex-2/*.idx
22+
docs/adr-tex-2/*.ind
23+
docs/adr-tex-2/*.ilg
24+
docs/adr-tex-2/*.lof
25+
docs/adr-tex-2/*.lot

GETTING_STARTED.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting Started with Git CMS
22

3-
This quick guide is the lightweight entry point. For the full walkthrough, use [`docs/GETTING_STARTED.md`](docs/GETTING_STARTED.md).
3+
This quick guide is the lightweight entry point. For the full Docker-focused walkthrough in the docs folder, see [`docs/GETTING_STARTED.md`](docs/GETTING_STARTED.md).
44

55
---
66

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ docker compose run --rm test
7272
## Installation
7373

7474
```bash
75-
npm install -g git-cms
76-
# or linked locally
75+
# From source (recommended until npm publish):
7776
git clone https://github.com/flyingrobots/git-cms.git
7877
cd git-cms
7978
npm link
79+
80+
# After publish, global install will work:
81+
# npm install -g git-cms
8082
```
8183

8284
## Usage
@@ -114,13 +116,13 @@ Content is stored in `refs/_blog/articles/<slug>`.
114116
echo "# Hello World" | git cms draft hello-world "My First Post"
115117
```
116118

117-
### 3. List Articles
119+
### 4. List Articles
118120
```bash
119121
git cms list
120122
# -> refs/_blog/articles/hello-world My First Post
121123
```
122124

123-
### 4. Publish
125+
### 5. Publish
124126
Publishing fast-forwards `refs/_blog/published/<slug>` to match the draft.
125127

126128
```bash

TESTING_GUIDE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,15 @@ docker compose run --rm test
203203

204204
## Advanced: Local Installation (Not Recommended Initially)
205205

206-
If you understand what git-cms does and want to install it globally on your host:
206+
If you understand what git-cms does and want host CLI access:
207207

208208
```bash
209-
npm install -g git-cms
210-
# OR
211-
cd git-cms && npm link
209+
# From source (recommended until npm publish is complete):
210+
cd git-cms
211+
npm link
212+
213+
# After publish, global install will work:
214+
# npm install -g git-cms
212215
```
213216

214217
**⚠️ WARNING:** Only use git-cms in dedicated repositories:

bin/git-cms.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,22 @@ async function main() {
1010
const cwd = process.cwd();
1111
const refPrefix = process.env.CMS_REF_PREFIX || DEFAULT_REF_PREFIX;
1212

13-
const cms = new CmsService({ cwd, refPrefix });
14-
1513
try {
14+
const cms = new CmsService({ cwd, refPrefix });
1615
switch (cmd) {
1716
case 'draft': {
1817
const [rawSlug, title] = args;
1918
if (!rawSlug || !title) throw new Error('Usage: git cms draft <slug> "Title" < content.md');
2019
const slug = canonicalizeSlug(rawSlug);
21-
20+
21+
if (process.stdin.isTTY) {
22+
throw new Error('Usage: git cms draft <slug> "Title" < content.md');
23+
}
24+
2225
const chunks = [];
2326
for await (const chunk of process.stdin) chunks.push(chunk);
2427
const body = Buffer.concat(chunks).toString('utf8');
25-
28+
2629
const res = await cms.saveSnapshot({ slug, title, body });
2730
console.log(`Saved draft: ${res.sha} (${res.ref})`);
2831
break;
@@ -31,7 +34,7 @@ async function main() {
3134
const [rawSlug] = args;
3235
if (!rawSlug) throw new Error('Usage: git cms publish <slug>');
3336
const slug = canonicalizeSlug(rawSlug);
34-
37+
3538
const res = await cms.publishArticle({ slug });
3639
console.log(`Published: ${res.sha} (${res.ref})`);
3740
break;
@@ -66,12 +69,12 @@ async function main() {
6669
process.exit(1);
6770
}
6871
} catch (err) {
69-
console.error(`Error: ${err.message}`);
72+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
7073
process.exit(1);
7174
}
7275
}
7376

7477
main().catch((err) => {
75-
console.error(`Error: ${err.message}`);
78+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
7679
process.exit(1);
7780
});

docs/ADR.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,9 +764,11 @@ graph TB
764764

765765
**Deployment Steps:**
766766
```bash
767+
# One-time setup (from your cloned git-cms repo):
768+
# npm link
769+
767770
cd ~/blog
768771
git init
769-
npm install -g git-cms
770772
echo "# My Post" | git cms draft my-post "Title"
771773
git cms publish my-post
772774
```

docs/adr-tex-2/figures/context.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
\node [block] (Author) {Author\\(Human)};
33
\node [block, below=1cm of Author] (GitCMS) {\textbf{git-cms}\\(Node.js App)};
44
\node [block, right=2cm of GitCMS] (Stargate) {git-stargate\\(Git Gateway)};
5-
\node [block, below=1cm of GitCMS] (LocalRepo) {.git/objects/\\(Local Repository)};
5+
\node [block, below=1cm of GitCMS] (LocalRepo) {\texttt{.git/objects/}\\(Local Repository)};
66
\node [block, right=2cm of Stargate] (PublicMirror) {Public Mirror\\(GitHub/GitLab)};
77

88
\draw [line] (Author) -- node [align=center, scale=0.8] {CLI/HTTP API} (GitCMS);

docs/adr-tex-2/figures/responsibilities.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
\draw [line] (CMS.east |- CAS.west) -- (CAS.west);
1313
\draw [line] (CMS.east |- V.west) -- (V.west);
1414

15-
\draw [dashed-line] (EG.east) -- ++(0.5,0) |- (PL.east);
16-
\draw [dashed-line] (CAS.east) -- ++(0.5,0) |- (PL.east);
15+
\draw [dashed-line] (EG.east) -- ++(0.5,0) |- (PL.north east);
16+
\draw [dashed-line] (CAS.east) -- ++(0.5,0) |- (PL.south east);
1717
\end{tikzpicture}

docs/adr-tex-2/sections/02-constraints.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ \subsection{Technical Constraints}
2020
\textbf{TC-4: No Database Indexes} \\
2121
Traditional databases provide B-tree indexes for fast lookups. Git's ref enumeration is linear (\texttt{O(n)} for listing all refs in a namespace).
2222

23-
\textbf{Mitigation:} Use ref namespaces strategically (e.g., \texttt{refs/\_blog/articles/<slug>}) to avoid polluting the global ref space.
23+
\textbf{Mitigation:} Use ref namespaces strategically (e.g., \texttt{refs/\_blog/articles/\textless slug\textgreater}) to avoid polluting the global ref space.
2424

2525
\subsection{Regulatory Constraints}
2626

docs/adr-tex-2/sections/03-context.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ \subsubsection{In Scope}
8080
\item Encrypted asset storage (images, PDFs)
8181
\item Full version history via Git log
8282
\item CLI and HTTP API access
83-
\item Multi-runtime support (Node, Bun, Deno)
83+
\item Aspirational: Multi-runtime support (Node, Bun, Deno)
8484
\end{itemize}
8585

8686
\subsubsection{Out of Scope}

0 commit comments

Comments
 (0)