@luhtech/site-template 0.14.5 → 0.14.6
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.
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Usage: luhtech-page-lexicon <path-to-page.json> <path-to-brand-identity.json> [path-to-luhtech-business-brand-identity.json]
|
|
16
16
|
* Exit 0: clean. Exit 1: any prohibited term found, reported per field.
|
|
17
|
+
*
|
|
18
|
+
* Superseded for CI by the Vale package schema-registry generates from the
|
|
19
|
+
* brand-identity instances (tools/lexicon_vale.py -- one engine that also
|
|
20
|
+
* carries spellings, glosses and prohibitedPatterns, which this bin does
|
|
21
|
+
* not). Kept for local use; it reads surface-scoped items (v1.4.0+).
|
|
17
22
|
*/
|
|
18
23
|
import { readFileSync } from 'node:fs';
|
|
19
24
|
|
|
@@ -73,10 +78,21 @@ export function collectTextFields(page) {
|
|
|
73
78
|
* its own name constantly (seo.title alone guarantees it); that must never
|
|
74
79
|
* be a violation regardless of which source list it came from.
|
|
75
80
|
*/
|
|
81
|
+
/**
|
|
82
|
+
* brand-identity v1.4.0+: a prohibited[] item is a bare string (every
|
|
83
|
+
* surface) or {term, surfaces[]} (only the listed surfaces). This bin checks
|
|
84
|
+
* pages, so it keeps bare strings and items whose surfaces include "page".
|
|
85
|
+
*/
|
|
86
|
+
export function pageTerms(prohibited) {
|
|
87
|
+
return (prohibited ?? [])
|
|
88
|
+
.filter((item) => typeof item === 'string' || (item?.term && (item.surfaces ?? []).includes('page')))
|
|
89
|
+
.map((item) => (typeof item === 'string' ? item : item.term));
|
|
90
|
+
}
|
|
91
|
+
|
|
76
92
|
export function buildProhibitedTerms(brand, luhtechBrand) {
|
|
77
93
|
const terms = new Set([
|
|
78
|
-
...(brand.voice?.lexicon?.prohibited
|
|
79
|
-
...(luhtechBrand?.voice?.lexicon?.prohibited
|
|
94
|
+
...pageTerms(brand.voice?.lexicon?.prohibited),
|
|
95
|
+
...pageTerms(luhtechBrand?.voice?.lexicon?.prohibited),
|
|
80
96
|
]);
|
|
81
97
|
const ownNames = [brand.brandId, brand.identity?.name].filter(Boolean);
|
|
82
98
|
for (const own of ownNames) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luhtech/site-template",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.6",
|
|
4
4
|
"description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"content/site.schema.json": "1.1.0",
|
|
53
53
|
"content/capability-claim.schema.json": "0.2.0",
|
|
54
54
|
"content/tool.schema.json": "1.1.0",
|
|
55
|
-
"portfolio/brand-identity.schema.json": "1.
|
|
55
|
+
"portfolio/brand-identity.schema.json": "1.5.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
package/src/content/loadBrand.ts
CHANGED
|
@@ -3,7 +3,9 @@ import Ajv from 'ajv';
|
|
|
3
3
|
import addFormats from 'ajv-formats';
|
|
4
4
|
import { fetchSchema, fetchSupportSchema } from './schemaFetch.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// 1.5.0: voice.lexicon spellings/glosses/prohibitedPatterns and surface-scoped
|
|
7
|
+
// prohibited items (additive -- every 1.3.0 instance validates unchanged).
|
|
8
|
+
const BRAND_PIN = '1.5.0';
|
|
7
9
|
|
|
8
10
|
let validatorPromise: ReturnType<typeof buildValidator> | null = null;
|
|
9
11
|
|