@greatcms/conformance 0.1.0 → 0.1.2
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/README.md +3 -3
- package/bin/greatcms-conformance.mjs +4 -4
- package/expected/entries/blog/publish-from-anywhere.json +1 -0
- package/expected/regions/home.featured.json +4 -0
- package/fixtures/.cms/schema.yaml +9 -2
- package/fixtures/content/blog/publish-from-anywhere.md +1 -0
- package/fixtures/content/cms/home.featured.json +8 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
> Built with an AI coding assistant and reviewed by a human. Treat it as you would any new dependency.
|
|
2
|
-
|
|
3
1
|
# @greatcms/conformance
|
|
4
2
|
|
|
3
|
+
[](https://github.com/uwenayoallain/thegreatcms#ai-assistance "Built with an AI coding assistant and reviewed by a human")
|
|
4
|
+
|
|
5
5
|
What "reads the GreatCMS standard correctly" means, as a fixture site and the
|
|
6
6
|
documents any reader must resolve it to. The fixture deliberately holds the
|
|
7
7
|
awkward cases: a region with no content file, content written before a field
|
|
@@ -19,4 +19,4 @@ A reader writes one JSON file per region to a folder, plus
|
|
|
19
19
|
`verify` compares them with `expected/`. The repository's Python reader
|
|
20
20
|
passes it, which is how the format stays language-agnostic.
|
|
21
21
|
|
|
22
|
-
Documentation: https://
|
|
22
|
+
Documentation: https://github.com/uwenayoallain/thegreatcms/blob/main/apps/docs/content/docs/any-language.md · Source: https://github.com/uwenayoallain/thegreatcms
|
|
@@ -22,14 +22,14 @@ if (command === "fixtures") {
|
|
|
22
22
|
if (command !== "verify") {
|
|
23
23
|
process.stdout.write(
|
|
24
24
|
[
|
|
25
|
-
"greatcms-conformance
|
|
25
|
+
"greatcms-conformance: prove a tool reads the GreatCMS standard",
|
|
26
26
|
"",
|
|
27
27
|
" fixtures print the path to the fixture site",
|
|
28
28
|
" verify <dir> compare a reader's output against the expected documents",
|
|
29
29
|
" verify --self verify the reference reader in @greatcms/conformance",
|
|
30
30
|
"",
|
|
31
|
-
"<dir> holds one JSON file per region, named <region-id>.json, and
|
|
32
|
-
"reader implements collections
|
|
31
|
+
"<dir> holds one JSON file per region, named <region-id>.json, and: if the",
|
|
32
|
+
"reader implements collections: <dir>/entries/<collection>/<slug>.json,",
|
|
33
33
|
'each `{ "slug": …, "data": … }`. Collections are reported separately, so a',
|
|
34
34
|
"regions-only reader still gets a useful answer.",
|
|
35
35
|
"",
|
|
@@ -113,7 +113,7 @@ function readJson(path) {
|
|
|
113
113
|
try {
|
|
114
114
|
return JSON.parse(readFileSync(path, "utf8"));
|
|
115
115
|
} catch (err) {
|
|
116
|
-
process.stderr.write(`${path}: not valid JSON
|
|
116
|
+
process.stderr.write(`${path}: not valid JSON: ${err.message}\n`);
|
|
117
117
|
process.exit(2);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"title": "Publish from anywhere",
|
|
5
5
|
"date": "2026-08-12",
|
|
6
6
|
"tags": ["release", "git"],
|
|
7
|
+
"related": ["yaml-scalars"],
|
|
7
8
|
"draft": false,
|
|
8
9
|
"content": "\nContent lives in the repository, so a publish is a commit and a deploy is whatever\nCI you already had.\n\nThe CMS never becomes a runtime dependency of your site.\n"
|
|
9
10
|
}
|
|
@@ -57,14 +57,14 @@ regions:
|
|
|
57
57
|
default:
|
|
58
58
|
heading: Welcome
|
|
59
59
|
|
|
60
|
-
# Edited before `badge` existed
|
|
60
|
+
# Edited before `badge` existed: proves new schema fields still render.
|
|
61
61
|
home.notice:
|
|
62
62
|
fields:
|
|
63
63
|
message: { type: text, required: true }
|
|
64
64
|
badge: { type: text, default: New }
|
|
65
65
|
dismissible: { type: boolean, default: true }
|
|
66
66
|
|
|
67
|
-
# Never edited
|
|
67
|
+
# Never edited: proves a site builds before the CMS has touched it.
|
|
68
68
|
about.intro:
|
|
69
69
|
fields:
|
|
70
70
|
heading: { type: text, default: About us }
|
|
@@ -106,6 +106,12 @@ regions:
|
|
|
106
106
|
default:
|
|
107
107
|
- { _type: card, title: First card }
|
|
108
108
|
|
|
109
|
+
# References store slugs as written; a multiple one nobody filled in is `[]`.
|
|
110
|
+
home.featured:
|
|
111
|
+
fields:
|
|
112
|
+
post: { type: reference, collection: blog }
|
|
113
|
+
guides: { type: reference, collection: guides, multiple: true }
|
|
114
|
+
|
|
109
115
|
collections:
|
|
110
116
|
# MDX: stored exactly like Markdown, read exactly like Markdown. The
|
|
111
117
|
# difference is the extension, and that an editor must not reformat the body.
|
|
@@ -130,5 +136,6 @@ collections:
|
|
|
130
136
|
title: { type: text, required: true, max: 120 }
|
|
131
137
|
date: { type: date, required: true }
|
|
132
138
|
tags: { type: list, of: { type: text }, max: 5 }
|
|
139
|
+
related: { type: reference, collection: blog, multiple: true }
|
|
133
140
|
draft: { type: boolean, default: false }
|
|
134
141
|
content: { type: richtext }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greatcms/conformance",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Fixtures and a verifier that define what reading the GreatCMS standard correctly means, in any language.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@greatcms/spec": "0.1.
|
|
47
|
+
"@greatcms/spec": "0.1.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"vitest": "^4.1.11"
|