mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-18 17:32:52 +00:00
Adds slug (uid) fields to all four content types so Strapi documents can be matched to files deterministically, plus: - apps/cms/src/utils/content-file.ts: read/write/delete the +++ TOML frontmatter files, using smol-toml's TomlDate so dates round-trip as bare local dates (matching the legacy Zola format), not quoted datetime strings. - apps/cms/src/utils/content-sync.ts: per-type frontmatter <-> Strapi field mappings, a boot-time importer that upserts every content/ file into Strapi by slug, and a Document Service middleware that writes any create/update/delete made through Strapi straight back to the same files. Strapi's SQLite DB is now genuinely a disposable cache: content/ stays buildable and readable with Strapi entirely absent, and restarting Strapi rebuilds its DB from content/ with no duplicates (matched by slug). Verified end-to-end: fresh boot imports all seed files once; a second boot re-imports idempotently (0 created, all matched by slug); create/ update/delete through the content-manager API all correctly write to and remove the corresponding file on disk.
44 lines
1.1 KiB
JSON
44 lines
1.1 KiB
JSON
{
|
|
"name": "cms",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "A Strapi application",
|
|
"scripts": {
|
|
"build": "strapi build",
|
|
"console": "strapi console",
|
|
"deploy": "strapi deploy",
|
|
"dev": "strapi develop",
|
|
"develop": "strapi develop",
|
|
"start": "strapi start",
|
|
"strapi": "strapi",
|
|
"upgrade": "npx @strapi/upgrade latest",
|
|
"upgrade:dry": "npx @strapi/upgrade latest --dry"
|
|
},
|
|
"dependencies": {
|
|
"@strapi/database": "5.52.2",
|
|
"@strapi/plugin-cloud": "5.52.2",
|
|
"@strapi/plugin-users-permissions": "5.52.2",
|
|
"@strapi/strapi": "5.52.2",
|
|
"better-sqlite3": "12.8.0",
|
|
"react": "^18.0.0",
|
|
"react-dom": "^18.0.0",
|
|
"react-router-dom": "^6.30.3",
|
|
"smol-toml": "^1.8.0",
|
|
"styled-components": "^6.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20",
|
|
"@types/react": "^18",
|
|
"@types/react-dom": "^18",
|
|
"typescript": "^5"
|
|
},
|
|
"engines": {
|
|
"node": ">=20.0.0 <=26.x.x",
|
|
"npm": ">=6.0.0"
|
|
},
|
|
"strapi": {
|
|
"uuid": "53c467c6-a64c-4883-b4df-0d96747d2cf3",
|
|
"installId": "dcf09d0c097e16db63c329dd9602949f9c4ae64f4e69a04dc6e105313d30b369"
|
|
}
|
|
}
|