@deneb-ui/create-template 2.0.53 → 2.0.55
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/package.json
CHANGED
|
@@ -5,8 +5,32 @@
|
|
|
5
5
|
"contractVersion": 1,
|
|
6
6
|
"mode": "strict",
|
|
7
7
|
"controlOnlyPaths": [
|
|
8
|
-
"
|
|
8
|
+
"__fivoraIntake.tone",
|
|
9
|
+
"__fivoraIntake.outputLanguage",
|
|
10
|
+
"__fivoraIntake.businessSummary",
|
|
11
|
+
"__fivoraIntake.additionalBusinessDetails",
|
|
12
|
+
"__fivoraIntake.referenceWebsiteUrl",
|
|
13
|
+
"additionalPages[*].id",
|
|
14
|
+
"additionalPages[*].route",
|
|
15
|
+
"common.currency",
|
|
16
|
+
"common.whatsappNumber",
|
|
17
|
+
"common.whatsapp",
|
|
18
|
+
"common.email",
|
|
19
|
+
"common.address",
|
|
20
|
+
"common.contactNumber",
|
|
21
|
+
"common.openingHours",
|
|
22
|
+
"common.newsletterTitle",
|
|
23
|
+
"common.newsletterDescription",
|
|
24
|
+
"contact.contactNumber",
|
|
25
|
+
"contact.googleMapLink",
|
|
26
|
+
"contact.whatsapp",
|
|
9
27
|
"products[*].id",
|
|
28
|
+
"products[*].isAvailable",
|
|
29
|
+
"products[*].measurement",
|
|
30
|
+
"products[*].unit",
|
|
31
|
+
"testimonials[*].id",
|
|
32
|
+
"categories[*].slug",
|
|
33
|
+
"services[*].id",
|
|
10
34
|
"products[*].currency",
|
|
11
35
|
"about.collageImages[*].id"
|
|
12
36
|
]
|
package/template/package.json
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
7
|
+
"build": "node scripts/merge-platform-contract.js && next build",
|
|
8
8
|
"lint": "eslint",
|
|
9
9
|
"lab": "deneb lab .",
|
|
10
|
-
"validate": "deneb validate .",
|
|
10
|
+
"validate": "node scripts/merge-platform-contract.js && deneb validate .",
|
|
11
11
|
"zip": "deneb zip .",
|
|
12
12
|
"validate-and-zip": "deneb validate-and-zip .",
|
|
13
13
|
"package:template": "deneb package .",
|
|
@@ -18,22 +18,26 @@
|
|
|
18
18
|
"next": "15.5.23",
|
|
19
19
|
"react": "19.2.8",
|
|
20
20
|
"react-dom": "19.2.8",
|
|
21
|
-
"@deneb-ui/ui": "^2.0.
|
|
21
|
+
"@deneb-ui/ui": "^2.0.55"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@eslint/eslintrc": "3.3.6",
|
|
25
|
-
"@types/node": "
|
|
25
|
+
"@types/node": "^20",
|
|
26
26
|
"@types/react": "^19.2.0",
|
|
27
27
|
"@types/react-dom": "^19.2.0",
|
|
28
28
|
"eslint": "9.39.5",
|
|
29
29
|
"eslint-config-next": "15.5.23",
|
|
30
30
|
"typescript": "5.8.3",
|
|
31
|
-
"@deneb-ui/cli": "^2.0.
|
|
31
|
+
"@deneb-ui/cli": "^2.0.55",
|
|
32
32
|
"tailwindcss": "^3.4.17",
|
|
33
33
|
"postcss": "8.5.26",
|
|
34
34
|
"autoprefixer": "^10.4.20"
|
|
35
35
|
},
|
|
36
36
|
"overrides": {
|
|
37
|
-
"sharp": "0.35.3"
|
|
37
|
+
"sharp": "0.35.3",
|
|
38
|
+
"content-type": "2.1.0",
|
|
39
|
+
"@octokit/request": {
|
|
40
|
+
"content-type": "2.1.0"
|
|
41
|
+
}
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* merge-platform-contract.js
|
|
4
|
+
* ──────────────────────────
|
|
5
|
+
* Merges Fivora platform-controlled controlOnlyPaths into fivora-template.json
|
|
6
|
+
* BEFORE every validate and build run.
|
|
7
|
+
*
|
|
8
|
+
* WHY THIS EXISTS
|
|
9
|
+
* ───────────────
|
|
10
|
+
* The Fivora strict visual-editing contract requires every field in site-data.json
|
|
11
|
+
* to have either a rendered data-preview-field-path marker OR appear in
|
|
12
|
+
* controlOnlyPaths. Platform-managed fields (AI intake, system keys) must be
|
|
13
|
+
* controlOnly but are NOT template-specific — they are the same for every template.
|
|
14
|
+
*
|
|
15
|
+
* Without this script:
|
|
16
|
+
* - Every template manually copy-pastes the same 25+ controlOnlyPaths entries
|
|
17
|
+
* - When Fivora adds a new __fivoraIntake field, EVERY template breaks
|
|
18
|
+
* - AI agents keep re-adding forbidden entries
|
|
19
|
+
*
|
|
20
|
+
* With this script:
|
|
21
|
+
* - fivora-template.json stays lean (only template-specific paths)
|
|
22
|
+
* - Update PLATFORM_PATHS here → all templates stay in sync
|
|
23
|
+
* - Zero manual maintenance per template
|
|
24
|
+
*
|
|
25
|
+
* USAGE: already wired into package.json:
|
|
26
|
+
* "validate": "node scripts/merge-platform-contract.js && fivora validate"
|
|
27
|
+
*/
|
|
28
|
+
'use strict';
|
|
29
|
+
const fs = require('fs');
|
|
30
|
+
const path = require('path');
|
|
31
|
+
|
|
32
|
+
// ─── Platform-Controlled Paths ───────────────────────────────────────────────
|
|
33
|
+
// Fivora PLATFORM writes these to site-data.json. Templates NEVER render them
|
|
34
|
+
// as inline editable HTML — they are managed via the Fivora control panel.
|
|
35
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
const PLATFORM_PATHS = [
|
|
37
|
+
// AI Intake — written by Website Agent during onboarding
|
|
38
|
+
'__fivoraIntake.tone',
|
|
39
|
+
'__fivoraIntake.outputLanguage',
|
|
40
|
+
'__fivoraIntake.businessSummary',
|
|
41
|
+
'__fivoraIntake.additionalBusinessDetails',
|
|
42
|
+
'__fivoraIntake.referenceWebsiteUrl',
|
|
43
|
+
// Additional Pages — platform manages routing, template renders label only
|
|
44
|
+
'additionalPages[*].id',
|
|
45
|
+
'additionalPages[*].route',
|
|
46
|
+
// Common fields used as href/tel logic, not rendered text
|
|
47
|
+
'common.currency',
|
|
48
|
+
'common.whatsappNumber',
|
|
49
|
+
'common.whatsapp',
|
|
50
|
+
'common.email',
|
|
51
|
+
'common.address',
|
|
52
|
+
'common.contactNumber',
|
|
53
|
+
'common.openingHours',
|
|
54
|
+
'common.newsletterTitle',
|
|
55
|
+
'common.newsletterDescription',
|
|
56
|
+
// Contact fields used as action links (href attributes)
|
|
57
|
+
'contact.contactNumber',
|
|
58
|
+
'contact.googleMapLink',
|
|
59
|
+
'contact.whatsapp',
|
|
60
|
+
// Product system fields
|
|
61
|
+
'products[*].id',
|
|
62
|
+
'products[*].isAvailable',
|
|
63
|
+
'products[*].measurement',
|
|
64
|
+
'products[*].unit',
|
|
65
|
+
// List item system keys
|
|
66
|
+
'testimonials[*].id',
|
|
67
|
+
'categories[*].slug',
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const manifestPath = path.resolve(__dirname, '..', 'fivora-template.json');
|
|
71
|
+
if (!fs.existsSync(manifestPath)) {
|
|
72
|
+
console.error('merge-platform-contract: fivora-template.json not found at', manifestPath);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
77
|
+
if (!manifest.visualEditing) manifest.visualEditing = {};
|
|
78
|
+
|
|
79
|
+
const existing = Array.isArray(manifest.visualEditing.controlOnlyPaths)
|
|
80
|
+
? manifest.visualEditing.controlOnlyPaths : [];
|
|
81
|
+
|
|
82
|
+
const merged = [...new Set([...PLATFORM_PATHS, ...existing])];
|
|
83
|
+
const added = merged.length - existing.length;
|
|
84
|
+
manifest.visualEditing.controlOnlyPaths = merged;
|
|
85
|
+
|
|
86
|
+
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
|
|
87
|
+
console.log(`merge-platform-contract: +${added} platform paths merged (${merged.length} total)`);
|