Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
node-version: 24
registry-url: https://registry.npmjs.org
# trusted publishing needs npm 11.5.1 or later; not npm 12, which refuses by default the dependencies fetched from a URL (vue3-shortkey is one)
- run: npm install -g 'npm@^11.5.1'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v7
with:
node-version: 22
node-version: 24
- name: Commits of the pull request
if: github.event_name == 'pull_request'
run: node scripts/commitlint.js --range "$BASE..$HEAD"
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
node-version: 24
cache: npm
- run: npm ci
- name: Lint
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
node-version: 24
cache: npm
- run: npm ci
- name: Driver contract suite
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ What changed in each version of Embed CMS, from 3.0.0 on, newest first. The vers

## [Unreleased]

### Changed

- **Node 24 is the version Embed CMS requires, and Node 22 no longer is.** `engines` was `^22.12.0`. It is now `^24.0.0`, so installing on Node 22 prints an engine warning. CI runs every job on Node 24, and the Docker example runs on `node:24-bookworm-slim`. Running the tests on Node 24 found one bug, now fixed: `cms-import` and `cms-import-remote` crashed on Node 24, instead of answering no, when their input ended right after a wrong answer (a pipe that closes right after the answer).

## [3.1.0] - 2026-10-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Thanks for helping. This page gets you from a clone to a change that passes CI:

## Setting up

You need Node.js 22.12 or later (CI runs Node 22) and git.
You need Node.js 24 (the version CI runs) and git.

```sh
git clone https://github.com/xiaodoudou/embed-cms.git embed-cms
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> A headless CMS for Node.js: describe your content in JavaScript files, get an admin app, a REST API and a JavaScript API

[![License](https://img.shields.io/badge/License-GPL--3.0--only-blue?style=flat-square)](LICENSE) [![Node](https://img.shields.io/badge/Node-%3E%3D22.12-339933?style=flat-square)](#try-it-in-five-minutes) [![Storage](https://img.shields.io/badge/Storage-JSON%20%7C%20MongoDB%20%7C%20PostgreSQL-orange?style=flat-square)](docs/reference/CONFIG.md) [![Express](https://img.shields.io/badge/Express-mountable-lightgrey?style=flat-square)](docs/start/GETTING_STARTED.md) [![Locales](https://img.shields.io/badge/Content-translatable-blueviolet?style=flat-square)](docs/start/CONCEPTS.md) [![Tests](https://img.shields.io/badge/Tests-unit%20%7C%20security%20%7C%20frontend-brightgreen?style=flat-square)](docs/contributing/TESTING.md)
[![License](https://img.shields.io/badge/License-GPL--3.0--only-blue?style=flat-square)](LICENSE) [![Node](https://img.shields.io/badge/Node-24-339933?style=flat-square)](#try-it-in-five-minutes) [![Storage](https://img.shields.io/badge/Storage-JSON%20%7C%20MongoDB%20%7C%20PostgreSQL-orange?style=flat-square)](docs/reference/CONFIG.md) [![Express](https://img.shields.io/badge/Express-mountable-lightgrey?style=flat-square)](docs/start/GETTING_STARTED.md) [![Locales](https://img.shields.io/badge/Content-translatable-blueviolet?style=flat-square)](docs/start/CONCEPTS.md) [![Tests](https://img.shields.io/badge/Tests-unit%20%7C%20security%20%7C%20frontend-brightgreen?style=flat-square)](docs/contributing/TESTING.md)

You describe your content in plain JavaScript files, one per resource, and Embed CMS gives you three things from them: an admin app where editors write and translate that content, a REST API that serves it to your sites and apps, and a JavaScript API for your own server code.

Expand All @@ -18,7 +18,7 @@ It keeps your content in a LevelDB database on disk by default, so there is no d

## Try it in five minutes

You need [Node.js](https://nodejs.org/) 22.12 or later and git.
You need [Node.js](https://nodejs.org/) 24 and git.

```sh
git clone https://github.com/xiaodoudou/embed-cms.git embed-cms
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# Built by scripts/build.sh.

# --- the modules: the only stage that needs the network and a compiler's worth of tools -----------------------------------
FROM node:22-bookworm-slim AS modules
FROM node:24-bookworm-slim AS modules
WORKDIR /app
# the lock file first: this layer is only made again when the dependencies change
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --no-audit --no-fund

# --- the image that runs -------------------------------------------------------------------------------------------------
FROM node:22-bookworm-slim
FROM node:24-bookworm-slim
ENV NODE_ENV=production \
PORT=3000 \
DATA_DIR=/data
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Put a proxy (nginx, Caddy or Traefik) on the machine and give it the https certi
|---|---|
| Change a secret (a leak, someone leaves) | Edit `.env`, or empty the line and run `./scripts/env.sh`. Then run `./scripts/start.sh`, and compose replaces the container with one that has the new value. Changing `AUTH_SECRET` or `SESSION_SECRET` signs everybody out and does nothing else. |
| Upgrade embed-cms | Raise `embed-cms` in `package.json` and run `npm install --package-lock-only`. Then run `./scripts/build.sh` and `./scripts/start.sh`. The data in the volume stays. |
| Back up | Stop the container first, because the databases are files that are written while it runs. Run `docker compose stop`, then `docker run --rm -v embed-cms-docker_data:/data -v "$PWD":/backup node:22-bookworm-slim tar czf /backup/data.tgz -C /data .`, then `./scripts/start.sh`. |
| Back up | Stop the container first, because the databases are files that are written while it runs. Run `docker compose stop`, then `docker run --rm -v embed-cms-docker_data:/data -v "$PWD":/backup node:24-bookworm-slim tar czf /backup/data.tgz -C /data .`, then `./scripts/start.sh`. |
| Use your own project | Copy this folder. Replace `resources/` and `content.json` (and add your site's routes to `server.js`). Keep the rest. Add every variable your code reads to `.env.example`. |
| Use another store | PostgreSQL and MongoDB read their credentials from the environment ([storage engines](../../reference/CONFIG.md#storage-engines)). Put `POSTGRES_USER` and `POSTGRES_PASSWORD` in `.env` like the other secrets, and add the database as one more service in `compose.yaml`. |

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/docker/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/examples/docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"express": "^4.18.2"
},
"engines": {
"node": "^22.12.0"
"node": "^24.0.0"
}
}
2 changes: 1 addition & 1 deletion docs/reference/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Every resource keeps its records in a store, and you choose which kind with `dbE
| `dbEngine.type` | What it is | Needs |
|---|---|---|
| `leveldb` (the default) | a LevelDB folder per resource, read from disk | nothing (the `classic-level` package comes with embed-cms) |
| `sqlite` | one SQLite file per resource, read from disk | nothing (it is part of Node 22; Node marks it experimental) |
| `sqlite` | one SQLite file per resource, read from disk | nothing (it is part of Node; Node marks it experimental) |
| `jsondown` | all records in memory, saved to one JSON file per resource | nothing |
| `mongodb` | one collection per resource | a MongoDB server |
| `postgres` | one table per resource | a PostgreSQL server |
Expand Down
8 changes: 7 additions & 1 deletion lib/util/confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const readline = require('readline')
*/
async function confirm (question, { input = process.stdin, output = process.stdout } = {}) {
const rl = readline.createInterface({ input, output })
// an input that ended in the same chunk as a wrong answer has closed the interface by the time the question is asked again, and Node 24
// throws when a closed interface is prompted
let closed = false
rl.on('close', () => { closed = true })
rl.setPrompt(`${question} `)
rl.prompt()
try {
Expand All @@ -19,7 +23,9 @@ async function confirm (question, { input = process.stdin, output = process.stdo
return text === 'yes'
}
output.write('yes / no\n')
rl.prompt()
if (!closed) {
rl.prompt()
}
}
return false
} finally {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"migrate-store": "node scripts/migrateStore.js"
},
"engines": {
"node": "^22.12.0"
"node": "^24.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion skills/embed-cms-create-site/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The docs are in the `docs/` folder of https://github.com/xiaodoudou/embed-cms, n

## Steps

1. **Ask only what you need**: what the site is for, the content types, one language or several (`enUS`, `zhCN`). Node must be `^22.12.0`.
1. **Ask only what you need**: what the site is for, the content types, one language or several (`enUS`, `zhCN`). Node must be 24.
2. **Scaffold** in the project folder:
```sh
npm init -y && npm install embed-cms express
Expand Down