@thecms/cli 0.20.1-dev.122 → 0.20.1-dev.125
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.
|
@@ -175,7 +175,7 @@ function realContext(env = process.env) {
|
|
|
175
175
|
import { parseArgs } from "util";
|
|
176
176
|
|
|
177
177
|
// src/context.ts
|
|
178
|
-
var CLI_VERSION = "0.20.1-dev.
|
|
178
|
+
var CLI_VERSION = "0.20.1-dev.125";
|
|
179
179
|
function call(ctx, path, init = {}) {
|
|
180
180
|
const { token, client = "cli", ...rest } = init;
|
|
181
181
|
const headers = new Headers(rest.headers);
|
|
@@ -4824,7 +4824,7 @@ var STRUCTURES = [
|
|
|
4824
4824
|
tree("menu_item", "Menu item", "Menu items", [text("label", { i18n: true, required: true, label: "Label" }), { name: "link", type: "link", label: "Link" }]),
|
|
4825
4825
|
{ schema: "menu", name: "Menu", pluralName: "Menus", fields: [text("title", { i18n: true, required: true, label: "Title" }), { name: "menu_items", type: "relation", relatedEntity: "menu_item", cardinality: "many", label: "Items" }] }
|
|
4826
4826
|
],
|
|
4827
|
-
sets: [{ schema: "menu", shapes: [{ shape: "
|
|
4827
|
+
sets: [{ schema: "menu", shapes: [{ shape: "navbar" }, { shape: "columns" }], delivers: ["title", "menu_items"] }],
|
|
4828
4828
|
notes: [
|
|
4829
4829
|
"Create menu_item first (menu points at it); menu_item.menus, the inverse of menu.menu_items, is made by the platform \u2014 never declared",
|
|
4830
4830
|
"menu_item.menu_item is made by the platform (the item an entry is a sub-entry of, none for a first-level entry): read it, never declare or write it \u2014 the links change on menu_item.menu_items",
|
|
@@ -4845,9 +4845,9 @@ var STRUCTURES = [
|
|
|
4845
4845
|
],
|
|
4846
4846
|
sets: [{
|
|
4847
4847
|
schema: "service",
|
|
4848
|
-
shapes: [{ shape: "
|
|
4848
|
+
shapes: [{ shape: "cards" }],
|
|
4849
4849
|
delivers: ["title"],
|
|
4850
|
-
presets: [{ title: "See also", shape: "
|
|
4850
|
+
presets: [{ title: "See also", shape: "cards", limit: 3, filters: [
|
|
4851
4851
|
{ field: "service_category", op: "eq", value: "{context.service_category}" },
|
|
4852
4852
|
{ field: "_id", op: "neq", value: "{context._id}" }
|
|
4853
4853
|
] }]
|
|
@@ -4872,8 +4872,8 @@ var STRUCTURES = [
|
|
|
4872
4872
|
uses: ["tree", "position", "slugSource"],
|
|
4873
4873
|
what: "Pages inside pages (a section with its sub-pages) in ONE schema page as a tree, each with its address from the title",
|
|
4874
4874
|
schemas: [{ ...tree("page", "Page", "Pages", [text("title", { i18n: true, required: true, label: "Title" }), { name: "body", type: "markdown", i18n: true, label: "Body" }]), slugSource: ["title"] }],
|
|
4875
|
-
sets: [{ schema: "page", shapes: [{ shape: "
|
|
4876
|
-
notes: ["A template page shows each record at its address; the
|
|
4875
|
+
sets: [{ schema: "page", shapes: [{ shape: "list" }], delivers: ["title", "pages", "position"] }],
|
|
4876
|
+
notes: ["A template page shows each record at its address; the list block lists the sub-pages"]
|
|
4877
4877
|
},
|
|
4878
4878
|
{
|
|
4879
4879
|
structure: "footer",
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -195,18 +195,18 @@ A page's block reads the workspace as its set, shape and settings say; the model
|
|
|
195
195
|
| The sub-pages of a section | a tree of one schema (`page` and its `pages`) | `descendantsOf` on the section |
|
|
196
196
|
|
|
197
197
|
```json
|
|
198
|
-
{ "set": "service", "shape": "
|
|
198
|
+
{ "set": "service", "shape": "cards", "title": "See also", "limit": 3, "filters": [
|
|
199
199
|
{ "field": "service_category", "op": "eq", "value": "{context.service_category}" },
|
|
200
200
|
{ "field": "_id", "op": "neq", "value": "{context._id}" } ] }
|
|
201
201
|
```
|
|
202
202
|
```json
|
|
203
|
-
{ "set": "post", "shape": "
|
|
203
|
+
{ "set": "post", "shape": "cards", "filters": [{ "field": "tags", "op": "eq", "value": "{context._id}" }] }
|
|
204
204
|
```
|
|
205
205
|
```json
|
|
206
206
|
{ "set": "menu_item", "shape": "list", "sort": { "field": "position", "direction": "asc" } }
|
|
207
207
|
```
|
|
208
208
|
```json
|
|
209
|
-
{ "set": "page", "shape": "
|
|
209
|
+
{ "set": "page", "shape": "list", "filters": [{ "field": "section", "op": "descendantsOf", "value": "{context._id}" }] }
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
- `{context.<field>}` is the open record's value (a link → its id; a link to many → `in`); `{context._id}` is the open record itself: with `neq` it never lists itself. They hold only on a template page (a page of a record).
|
package/dist/method/method.md
CHANGED
|
@@ -221,6 +221,7 @@ Each module: **needs** (what must be there first) · **produces** (what is there
|
|
|
221
221
|
- **the words that introduce a list sit in the list**;
|
|
222
222
|
- order decided by the editor (`position`); languages: the main one without a prefix, the others `/xx/`; names in `snake_case`, schemas in the singular; a relation is named after the schema it points at — singular for one, plural for many, a second one to the same schema `<name>_<role>`;
|
|
223
223
|
- **the structure is in English**: schema and field names, their labels (`name`, `pluralName`, `label`), enum values, sets and shapes — a label left out is made from the name (`service_category` → "Service category", "Service categories"); the client's language lives in the contents and in the messages, the site translates; a label already in another language is a check of the plan and is listed by `realign` (a label changes at once, no record is touched);
|
|
224
|
+
- **a shape is named after its form** — how it looks on the page, with the words design systems use for components — never after what it is for (`related`, `featured`, `detail`, `deck`, `by_category`, `hero`, `cta`) nor where it sits (`header`, `footer`, `sidebar`). Navigation: `navbar` (a horizontal bar of entries, with dropdowns), `drawer` (a panel sliding in from the side), `columns` (columns of links under their titles), `bar` (one row of links or icons), `tabs`. One record: `banner` (a full-width band, text over an image or a video), `split` (text beside an image), `article` (a long text in a readable column), `stat` (one big number and its label). Several records: `cards` (equal boxes in a row), `grid` (a dense grid of small items), `bento` (boxes of different sizes), `list` (one row per record), `carousel`, `accordion`, `table`, `timeline` (steps joined by a line), `stats` (a row of big numbers), `logos`, `player`. Two forms on one set: a second word of form, never of use (`cards` and `cards_compact`, `banner` and `banner_video`). Where a block sits is the layout's: the containers are the page's regions and take those names, like HTML's landmarks (`header`, `footer`, `aside`); the navigation bar inside the header is a `navbar` (`menu · navbar`), the links at the bottom `menu · columns`, "See also" `service · cards`;
|
|
224
225
|
- **everything the site shows comes from the workspace**: contents, menu, footer, the organisation's data (globals), the interface's texts (messages), SEO, redirects; the site's name is the application's *Site name*.
|
|
225
226
|
- **How to check**: `thecms verify`; running the script again changes nothing.
|
|
226
227
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecms/cli",
|
|
3
|
-
"version": "0.20.1-dev.
|
|
3
|
+
"version": "0.20.1-dev.125",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "theCMS. command line: the standard's starter, checks, brand, the method's docs, sign-in with a personal token",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
38
38
|
"@resvg/resvg-wasm": "2.6.2",
|
|
39
|
-
"@thecms/sdk": "0.20.1-dev.
|
|
39
|
+
"@thecms/sdk": "0.20.1-dev.125",
|
|
40
40
|
"libpg-query": "18.2.0",
|
|
41
41
|
"zod": "4.6.5"
|
|
42
42
|
},
|