Skip to content

Commit f099355

Browse files
committed
fix: address PR review threads and add regressions
1 parent a02b1a2 commit f099355

36 files changed

+517
-433
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
- name: Verify Dependency Integrity (Post-Install)
2828
run: npm run check:deps
2929

30+
- name: Configure Git User
31+
run: |
32+
git config --global user.email "ci@git-cms.local"
33+
git config --global user.name "CI Bot"
34+
git config --global init.defaultBranch main
35+
3036
- name: Run Local Integration Tests
3137
run: npm run test:local
3238

.github/workflows/test-setup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121

2222
steps:
2323
- name: Checkout code
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
- name: Run BATS tests
2727
run: npm run test:setup
2828

2929
- name: Upload test results
3030
if: always()
31-
uses: actions/upload-artifact@v3
31+
uses: actions/upload-artifact@v4
3232
with:
3333
name: bats-test-results
3434
path: test-results/

.gitignore

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

1111
# LaTeX artifacts
12-
*.aux
12+
*.aux
1313
*.log
1414
*.out
1515
*.toc
16+
*.synctex.gz
17+
*.fls
18+
*.fdb_latexmk
19+
*.bbl
20+
*.blg
21+
*.idx
22+
*.ind
23+
*.ilg
24+
*.lof
25+
*.lot

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
# Base stage
44
FROM node:22-slim AS base
55
ENV NODE_ENV=production
6-
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
6+
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
77
WORKDIR /app
88

99
# Deps stage
1010
FROM base AS deps
11+
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ && rm -rf /var/lib/apt/lists/*
1112
COPY package.json package-lock.json* ./
1213
RUN npm ci --include=dev
1314

@@ -16,17 +17,17 @@ FROM base AS dev
1617
ENV NODE_ENV=development
1718
COPY --from=deps /app/node_modules ./node_modules
1819
COPY . .
19-
RUN git config --global user.email "dev@git-cms.local"
20-
RUN git config --global user.name "Git CMS Dev"
21-
RUN git config --global init.defaultBranch main
20+
RUN git config --global user.email "dev@git-cms.local" \
21+
&& git config --global user.name "Git CMS Dev" \
22+
&& git config --global init.defaultBranch main
2223
CMD ["npm", "run", "serve"]
2324

2425
# Test stage
2526
FROM base AS test
2627
ENV NODE_ENV=test
2728
COPY --from=deps /app/node_modules ./node_modules
2829
COPY . .
29-
RUN git config --global user.email "bot@git-cms.local"
30-
RUN git config --global user.name "Git CMS Bot"
31-
RUN git config --global init.defaultBranch main
30+
RUN git config --global user.email "bot@git-cms.local" \
31+
&& git config --global user.name "Git CMS Bot" \
32+
&& git config --global init.defaultBranch main
3233
CMD ["npm", "run", "test:local"]

GETTING_STARTED.md

Lines changed: 44 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,73 @@
11
# Getting Started with Git CMS
22

3-
Welcome to **Git CMS**! This tool allows you to write and manage blog posts using Git—the same technology developers use to track code—but with a simple interface that works like a regular app.
4-
5-
Follow these steps to get up and running.
3+
This quick guide is the lightweight entry point. For the full walkthrough, use [`docs/GETTING_STARTED.md`](docs/GETTING_STARTED.md).
64

75
---
86

9-
## 1. Prerequisites
10-
11-
Before you start, you need two things installed on your computer:
7+
## Prerequisites
128

13-
1. **Git**: [Download and install Git here](https://git-scm.com/downloads). (Choose the default options during installation).
14-
2. **Node.js**: [Download and install Node.js here](https://nodejs.org/). (Choose the "LTS" version).
9+
- Git
10+
- Node.js 22+
11+
- Docker Desktop (recommended for safe testing)
1512

1613
---
1714

18-
## 2. Installation
19-
20-
You can install Git CMS directly on your computer or run it using **Docker**.
21-
22-
### Option A: Direct Installation
23-
1. Open your **Terminal** (on Mac/Linux) or **Command Prompt/PowerShell** (on Windows).
24-
2. Type the following commands one by one:
25-
```bash
26-
# Download the tool
27-
git clone https://github.com/clduab11/git-cms.git
28-
29-
# Enter the folder
30-
cd git-cms
31-
32-
# Install the helper files
33-
npm install
34-
35-
# Make the 'git-cms' command available everywhere on your computer
36-
npm link
37-
```
38-
39-
### Option B: Using Docker (Recommended for isolation)
40-
If you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed, you can run the CMS without installing Node.js:
41-
1. Download the tool: `git clone https://github.com/clduab11/git-cms.git`
42-
2. Enter the folder: `cd git-cms`
43-
3. Run with Docker: `docker compose up app`
44-
*Note: By default, this will save posts inside the `git-cms` folder. See Section 3 to change this.*
15+
## Installation
4516

46-
---
17+
### Option A: Local CLI Install
4718

48-
## 3. Setting Up Your "Content Home"
19+
```bash
20+
git clone https://github.com/flyingrobots/git-cms.git
21+
cd git-cms
22+
npm install
23+
npm link
24+
```
4925

50-
Git CMS doesn't save your posts inside the tool itself; it saves them in a "Repository" (a special folder) of your choice.
26+
### Option B: Docker (Recommended)
5127

52-
1. Create a new folder for your blog posts (e.g., `my-awesome-blog`).
53-
2. Enter that folder in your terminal and "initialize" it:
54-
```bash
55-
mkdir my-awesome-blog
56-
cd my-awesome-blog
57-
git init
58-
```
59-
3. **Crucial Step**: Tell Git CMS to use this folder. You do this by setting an "Environment Variable" named `GIT_CMS_REPO` to the path of this folder.
60-
* **Mac/Linux**: `export GIT_CMS_REPO=/Users/yourname/my-awesome-blog`
61-
* **Windows**: `$env:GIT_CMS_REPO="C:\Users\yourname\my-awesome-blog"`
28+
```bash
29+
git clone https://github.com/flyingrobots/git-cms.git
30+
cd git-cms
31+
npm run setup
32+
npm run dev
33+
```
6234

63-
---
35+
Open the UI at [http://localhost:4638/](http://localhost:4638/).
6436

65-
## 4. Running the CMS
37+
---
6638

67-
Now you are ready to start the interface!
39+
## First Article
6840

69-
1. In your terminal, type:
70-
```bash
71-
git-cms serve
72-
```
73-
2. You will see a message: `[git-cms] Admin UI: http://localhost:4638/`
74-
3. Open your web browser (Chrome, Safari, or Edge) and go to **http://localhost:4638/**.
41+
1. Click `+ New Article`.
42+
2. Set a slug like `my-first-post`.
43+
3. Add title + body content.
44+
4. Click `Save Draft`.
45+
5. Click `Publish` when ready.
7546

7647
---
7748

78-
## 5. Writing Your First Post
49+
## CLI Basics
7950

80-
1. Click the **+ New Article** button on the left.
81-
2. **Slug**: Enter a short ID for your post (e.g., `my-first-post`). No spaces!
82-
3. **Title**: Enter the title of your article.
83-
4. **Content**: Type your post in the large box. You can use [Markdown](https://www.markdownguide.org/basic-syntax/) to add formatting like **bold** or *italics*.
84-
5. Click **Save Draft**.
51+
```bash
52+
# Draft reads content from stdin
53+
echo "# Hello" | git cms draft hello-world "Hello World"
8554

86-
### To Make it Public:
87-
When you are happy with your post, click the **Publish** button. This marks the post as "live."
55+
# List drafts
56+
git cms list
8857

89-
---
90-
91-
## 6. Managing Images and Files
58+
# Publish
59+
git cms publish hello-world
9260

93-
You can add images to your posts easily:
94-
1. In the editor, click the **Attach File** button at the bottom.
95-
2. Select an image from your computer.
96-
3. Git CMS will "chunk" the image, store it safely in Git, and automatically add the code to your post so the image shows up.
61+
# Show article
62+
git cms show hello-world
63+
```
9764

9865
---
9966

100-
## 7. Advanced: CLI Power (Optional)
67+
## Safety Notes
10168

102-
If you prefer using the terminal instead of the web browser, you can use these commands:
103-
* `git-cms list`: See all your drafts.
104-
* `git-cms show <slug>`: Read a post in the terminal.
105-
* `git-cms publish <slug>`: Publish a draft.
106-
107-
---
69+
- Prefer Docker workflows while learning.
70+
- Use a dedicated test repository for local CLI experimentation.
71+
- Avoid running low-level Git plumbing in repositories you care about.
10872

109-
### Troubleshooting
110-
* **"Command not found"**: Ensure you ran `npm link` in the `git-cms` folder.
111-
* **"Not a git repository"**: Ensure you ran `git init` inside your content folder and that your `GIT_CMS_REPO` path is correct.
73+
See [`TESTING_GUIDE.md`](TESTING_GUIDE.md) for safety and cleanup procedures.

0 commit comments

Comments
 (0)