@aitrien/motifspec 1.18.0 → 1.18.1
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/CHANGELOG.md +5 -0
- package/dist/codex.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +1 -1
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
- package/scripts/check.mjs +39 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
|
|
4
4
|
|
|
5
|
+
## [1.18.1] - 2026-11-04
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- The checker read a Hugo site's `[params.motifspec]` only when the table started at the beginning of a line. An indented table, such as one under `[params]` in a config that indents its tables, was ignored, so the site was checked as portfolio whatever it declared. It now reads the table indented or not, and also dotted keys (`motifspec.layout = "dashboard"` under `[params]`, or `params.motifspec.layout` at the top) and inline tables (`motifspec = { layout = "dashboard" }`).
|
|
9
|
+
|
|
5
10
|
## [1.18.0] - 2026-11-04
|
|
6
11
|
|
|
7
12
|
### Added
|
package/dist/codex.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
|
|
3
3
|
@font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
|
|
4
4
|
|
|
5
|
-
/* MotifSpec 1.18.
|
|
5
|
+
/* MotifSpec 1.18.1 — generated from tokens/*.json. Do not edit.
|
|
6
6
|
Themes: semantic colours use light-dark(); color-scheme follows the system unless
|
|
7
7
|
<html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
|
|
8
8
|
:root {
|
package/dist/tokens.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* MotifSpec 1.18.
|
|
1
|
+
/* MotifSpec 1.18.1 — generated from tokens/*.json. Do not edit.
|
|
2
2
|
Themes: semantic colours use light-dark(); color-scheme follows the system unless
|
|
3
3
|
<html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
|
|
4
4
|
:root {
|
package/dist/tokens.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by npm run build. Do not edit.
|
|
2
|
-
export const version = "1.18.
|
|
2
|
+
export const version = "1.18.1";
|
|
3
3
|
export const changelog = "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md";
|
|
4
4
|
export const showcase = "https://motifspec.com";
|
|
5
5
|
export const tokens = [
|
package/dist/tokens.json
CHANGED
package/package.json
CHANGED
package/scripts/check.mjs
CHANGED
|
@@ -214,8 +214,7 @@ export function declaredLayout(root) {
|
|
|
214
214
|
const json = JSON.parse(text);
|
|
215
215
|
found = (isParams ? json : json.params)?.motifspec;
|
|
216
216
|
} else if (f.endsWith('.toml')) {
|
|
217
|
-
|
|
218
|
-
if (table) found = { layout: table.match(/^\s*layout\s*=\s*["']([^"']+)["']/m)?.[1], components: list(table.match(/^\s*components\s*=\s*\[([\s\S]*?)\]/m)?.[1]) };
|
|
217
|
+
found = tomlMotifspec(text, isParams ? '' : 'params');
|
|
219
218
|
} else {
|
|
220
219
|
const block = text.match(isParams ? /^motifspec:\s*\n((?:[ \t]+.*\n?)*)/m : /^[ \t]+motifspec:\s*\n((?:[ \t]+.*\n?)*)/m)?.[1];
|
|
221
220
|
if (block) {
|
|
@@ -229,6 +228,44 @@ export function declaredLayout(root) {
|
|
|
229
228
|
return {};
|
|
230
229
|
}
|
|
231
230
|
|
|
231
|
+
/**
|
|
232
|
+
* [params.motifspec] from Hugo TOML, however it's written: as its own table (indented or not), as dotted keys
|
|
233
|
+
* (motifspec.layout = "…" under [params], or params.motifspec.layout at the top), or as an inline table
|
|
234
|
+
* (motifspec = { layout = "…" }). `parent` is "params" for a site config, "" for a params file.
|
|
235
|
+
*/
|
|
236
|
+
function tomlMotifspec(text, parent) {
|
|
237
|
+
const sections = new Map([['', '']]);
|
|
238
|
+
let current = '';
|
|
239
|
+
for (const line of text.split('\n')) {
|
|
240
|
+
const header = line.match(/^\s*\[\s*([^\[\]]+?)\s*\]\s*(?:#.*)?$/);
|
|
241
|
+
if (header) { current = header[1]; sections.set(current, sections.get(current) ?? ''); continue; }
|
|
242
|
+
sections.set(current, sections.get(current) + line + '\n');
|
|
243
|
+
}
|
|
244
|
+
const own = parent ? `${parent}.motifspec` : 'motifspec';
|
|
245
|
+
const value = (body, key) => body.match(new RegExp(`^\\s*${key.replace(/\./g, '\\.')}\\s*=\\s*["']([^"']+)["']`, 'm'))?.[1];
|
|
246
|
+
const array = (body, key) => body.match(new RegExp(`^\\s*${key.replace(/\./g, '\\.')}\\s*=\\s*\\[([\\s\\S]*?)\\]`, 'm'))?.[1];
|
|
247
|
+
const list = (v) => v?.split(',').map((x) => x.replace(/#.*$/gm, '').trim().replace(/^["']|["']$/g, '')).filter(Boolean);
|
|
248
|
+
// Its own table.
|
|
249
|
+
if (sections.has(own)) {
|
|
250
|
+
const body = sections.get(own);
|
|
251
|
+
return { layout: value(body, 'layout'), components: list(array(body, 'components')) };
|
|
252
|
+
}
|
|
253
|
+
// Dotted keys or an inline table, in the parent table or (for a site config) at the top level.
|
|
254
|
+
for (const [section, prefix] of [[parent, 'motifspec.'], ...(parent ? [['', `${parent}.motifspec.`]] : [])]) {
|
|
255
|
+
const body = sections.get(section);
|
|
256
|
+
if (!body) continue;
|
|
257
|
+
const inline = body.match(new RegExp(`^\\s*${prefix.replace(/\./g, '\\.').replace(/\\\.$/, '')}\\s*=\\s*\\{([\\s\\S]*?)\\}`, 'm'))?.[1];
|
|
258
|
+
if (inline) {
|
|
259
|
+
const lines = inline.replace(/,\s*(?=[a-z]+\s*=)/g, '\n');
|
|
260
|
+
return { layout: value(lines, 'layout'), components: list(array(lines, 'components')) };
|
|
261
|
+
}
|
|
262
|
+
const layout = value(body, `${prefix}layout`);
|
|
263
|
+
const components = list(array(body, `${prefix}components`));
|
|
264
|
+
if (layout || components) return { layout, components };
|
|
265
|
+
}
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
|
|
232
269
|
/**
|
|
233
270
|
* Check a project that uses MotifSpec: no stylesheets anywhere (except an à la carte project's own, held to tokens),
|
|
234
271
|
* and every file in `dirs` checked by checkText against the project's layout.
|