multisite-cms-mcp 1.0.4 → 1.0.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-template.d.ts","sourceRoot":"","sources":["../../src/tools/validate-template.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,aAAa,CAAC;AA0E7J;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"validate-template.d.ts","sourceRoot":"","sources":["../../src/tools/validate-template.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,aAAa,CAAC;AA0E7J;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,CAgNjB"}
|
|
@@ -193,6 +193,21 @@ async function validateTemplate(html, templateType, collectionSlug) {
|
|
|
193
193
|
if (wrongAssetPaths.length > 5) {
|
|
194
194
|
warnings.push(`- ...and ${wrongAssetPaths.length - 5} more asset paths that may need /public/ prefix`);
|
|
195
195
|
}
|
|
196
|
+
// Validate site tokens
|
|
197
|
+
const siteTokens = html.match(/\{\{site\.(\w+)\}\}/g) || [];
|
|
198
|
+
for (const token of siteTokens) {
|
|
199
|
+
const fieldMatch = token.match(/\{\{site\.(\w+)\}\}/);
|
|
200
|
+
if (fieldMatch) {
|
|
201
|
+
const field = fieldMatch[1];
|
|
202
|
+
const validSiteFields = ['site_name', 'siteName', 'name'];
|
|
203
|
+
if (!validSiteFields.includes(field)) {
|
|
204
|
+
warnings.push(`- Unknown site token: ${token} - valid fields are: site_name, siteName, name`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (siteTokens.length > 0) {
|
|
209
|
+
suggestions.push(`- Found ${siteTokens.length} site token(s) like {{site.site_name}} - these come from manifest.json`);
|
|
210
|
+
}
|
|
196
211
|
// Build result
|
|
197
212
|
let output = '';
|
|
198
213
|
if (errors.length === 0 && warnings.length === 0) {
|
package/package.json
CHANGED