@solidnumber/cli 1.5.0 → 1.6.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/README.md +41 -5
- package/dist/__tests__/commands/auth.test.d.ts +6 -0
- package/dist/__tests__/commands/auth.test.d.ts.map +1 -0
- package/dist/__tests__/commands/auth.test.js +91 -0
- package/dist/__tests__/commands/auth.test.js.map +1 -0
- package/dist/__tests__/commands/billing.test.d.ts +6 -0
- package/dist/__tests__/commands/billing.test.d.ts.map +1 -0
- package/dist/__tests__/commands/billing.test.js +141 -0
- package/dist/__tests__/commands/billing.test.js.map +1 -0
- package/dist/__tests__/commands/company.test.d.ts +6 -0
- package/dist/__tests__/commands/company.test.d.ts.map +1 -0
- package/dist/__tests__/commands/company.test.js +129 -0
- package/dist/__tests__/commands/company.test.js.map +1 -0
- package/dist/__tests__/commands/import.test.d.ts +4 -0
- package/dist/__tests__/commands/import.test.d.ts.map +1 -0
- package/dist/__tests__/commands/import.test.js +71 -0
- package/dist/__tests__/commands/import.test.js.map +1 -0
- package/dist/__tests__/commands/pages.test.d.ts +5 -0
- package/dist/__tests__/commands/pages.test.d.ts.map +1 -0
- package/dist/__tests__/commands/pages.test.js +103 -0
- package/dist/__tests__/commands/pages.test.js.map +1 -0
- package/dist/__tests__/commands/push.test.d.ts +6 -0
- package/dist/__tests__/commands/push.test.d.ts.map +1 -0
- package/dist/__tests__/commands/push.test.js +113 -0
- package/dist/__tests__/commands/push.test.js.map +1 -0
- package/dist/__tests__/commands/sandbox.test.d.ts +5 -0
- package/dist/__tests__/commands/sandbox.test.d.ts.map +1 -0
- package/dist/__tests__/commands/sandbox.test.js +132 -0
- package/dist/__tests__/commands/sandbox.test.js.map +1 -0
- package/dist/__tests__/commands/serve.test.d.ts +5 -0
- package/dist/__tests__/commands/serve.test.d.ts.map +1 -0
- package/dist/__tests__/commands/serve.test.js +115 -0
- package/dist/__tests__/commands/serve.test.js.map +1 -0
- package/dist/__tests__/commands/site.test.d.ts +5 -0
- package/dist/__tests__/commands/site.test.d.ts.map +1 -0
- package/dist/__tests__/commands/site.test.js +92 -0
- package/dist/__tests__/commands/site.test.js.map +1 -0
- package/dist/__tests__/integration/smoke.test.d.ts +7 -0
- package/dist/__tests__/integration/smoke.test.d.ts.map +1 -0
- package/dist/__tests__/integration/smoke.test.js +135 -0
- package/dist/__tests__/integration/smoke.test.js.map +1 -0
- package/dist/__tests__/lib/api-client.test.d.ts +6 -0
- package/dist/__tests__/lib/api-client.test.d.ts.map +1 -0
- package/dist/__tests__/lib/api-client.test.js +74 -0
- package/dist/__tests__/lib/api-client.test.js.map +1 -0
- package/dist/__tests__/lib/company-isolation.test.d.ts +19 -0
- package/dist/__tests__/lib/company-isolation.test.d.ts.map +1 -0
- package/dist/__tests__/lib/company-isolation.test.js +96 -0
- package/dist/__tests__/lib/company-isolation.test.js.map +1 -0
- package/dist/__tests__/lib/config.test.d.ts +6 -0
- package/dist/__tests__/lib/config.test.d.ts.map +1 -0
- package/dist/__tests__/lib/config.test.js +131 -0
- package/dist/__tests__/lib/config.test.js.map +1 -0
- package/dist/__tests__/setup.d.ts +4 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/setup.js +25 -0
- package/dist/__tests__/setup.js.map +1 -0
- package/dist/commands/company.js +93 -25
- package/dist/commands/company.js.map +1 -1
- package/dist/commands/diff.d.ts +14 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +286 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/import.d.ts +14 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +552 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/open.d.ts +15 -0
- package/dist/commands/open.d.ts.map +1 -0
- package/dist/commands/open.js +179 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/sandbox.d.ts +15 -0
- package/dist/commands/sandbox.d.ts.map +1 -0
- package/dist/commands/sandbox.js +321 -0
- package/dist/commands/sandbox.js.map +1 -0
- package/dist/commands/serve.d.ts +19 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +449 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/watch.d.ts +15 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +252 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +9 -4
- package/dist/lib/api-client.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Serve command for Solid CLI
|
|
4
|
+
*
|
|
5
|
+
* Local preview server that renders CMS pages from pulled layout_json files.
|
|
6
|
+
* Uses a built-in HTTP server + HTML renderer for the 25 block types.
|
|
7
|
+
*
|
|
8
|
+
* solid serve → Start at localhost:4000
|
|
9
|
+
* solid serve --port 3333 → Custom port
|
|
10
|
+
* solid serve --open → Auto-open browser
|
|
11
|
+
*
|
|
12
|
+
* Reads from:
|
|
13
|
+
* ./pages/*.json → Page layout_json
|
|
14
|
+
* ./solid.config.json → Company branding (name, colors, logo)
|
|
15
|
+
*
|
|
16
|
+
* Hot reloads on file changes.
|
|
17
|
+
*/
|
|
18
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
|
+
}
|
|
24
|
+
Object.defineProperty(o, k2, desc);
|
|
25
|
+
}) : (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
}));
|
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
+
}) : function(o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
+
var ownKeys = function(o) {
|
|
36
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
+
var ar = [];
|
|
38
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
return ownKeys(o);
|
|
42
|
+
};
|
|
43
|
+
return function (mod) {
|
|
44
|
+
if (mod && mod.__esModule) return mod;
|
|
45
|
+
var result = {};
|
|
46
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
+
__setModuleDefault(result, mod);
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.serveCommand = void 0;
|
|
56
|
+
const commander_1 = require("commander");
|
|
57
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
58
|
+
const fs = __importStar(require("fs"));
|
|
59
|
+
const path = __importStar(require("path"));
|
|
60
|
+
const http = __importStar(require("http"));
|
|
61
|
+
function renderSection(section, ctx) {
|
|
62
|
+
const type = section.type || 'text';
|
|
63
|
+
const content = section.content || section.props || section;
|
|
64
|
+
const primary = ctx.primary_color || '#4f46e5';
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 'hero':
|
|
67
|
+
case 'hero-image':
|
|
68
|
+
case 'hero-split':
|
|
69
|
+
return `
|
|
70
|
+
<section style="background:linear-gradient(135deg,${primary},${primary}dd);color:#fff;padding:80px 40px;text-align:center;">
|
|
71
|
+
<h1 style="font-size:2.5rem;margin-bottom:16px;">${esc(content.headline || content.title || ctx.name || '')}</h1>
|
|
72
|
+
<p style="font-size:1.2rem;opacity:0.9;max-width:600px;margin:0 auto 24px;">${esc(content.subheadline || content.subtitle || content.description || '')}</p>
|
|
73
|
+
${content.cta_text ? `<a href="${esc(content.cta_url || '#')}" style="display:inline-block;background:#fff;color:${primary};padding:12px 32px;border-radius:8px;font-weight:600;text-decoration:none;">${esc(content.cta_text)}</a>` : ''}
|
|
74
|
+
</section>`;
|
|
75
|
+
case 'features':
|
|
76
|
+
const features = content.features || content.items || [];
|
|
77
|
+
return `
|
|
78
|
+
<section style="padding:60px 40px;max-width:1000px;margin:0 auto;">
|
|
79
|
+
<h2 style="text-align:center;margin-bottom:40px;">${esc(content.title || 'Features')}</h2>
|
|
80
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:24px;">
|
|
81
|
+
${features.map((f) => `
|
|
82
|
+
<div style="padding:24px;border:1px solid #e5e7eb;border-radius:12px;">
|
|
83
|
+
<h3 style="margin-bottom:8px;">${esc(f.title || f.name || '')}</h3>
|
|
84
|
+
<p style="color:#6b7280;font-size:0.9rem;">${esc(f.description || f.text || '')}</p>
|
|
85
|
+
</div>
|
|
86
|
+
`).join('')}
|
|
87
|
+
</div>
|
|
88
|
+
</section>`;
|
|
89
|
+
case 'pricing':
|
|
90
|
+
const plans = content.plans || content.tiers || content.items || [];
|
|
91
|
+
return `
|
|
92
|
+
<section style="padding:60px 40px;background:#f9fafb;">
|
|
93
|
+
<h2 style="text-align:center;margin-bottom:40px;">${esc(content.title || 'Pricing')}</h2>
|
|
94
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px;max-width:1000px;margin:0 auto;">
|
|
95
|
+
${plans.map((p) => `
|
|
96
|
+
<div style="padding:32px;background:#fff;border-radius:12px;border:2px solid ${p.featured ? primary : '#e5e7eb'};text-align:center;">
|
|
97
|
+
<h3>${esc(p.name || p.title || '')}</h3>
|
|
98
|
+
<div style="font-size:2rem;font-weight:700;margin:16px 0;color:${primary};">${esc(p.price || '')}</div>
|
|
99
|
+
<p style="color:#6b7280;margin-bottom:16px;">${esc(p.description || '')}</p>
|
|
100
|
+
${(p.features || []).map((f) => `<div style="padding:4px 0;font-size:0.9rem;">\u2713 ${esc(typeof f === 'string' ? f : f.text || f.name || '')}</div>`).join('')}
|
|
101
|
+
</div>
|
|
102
|
+
`).join('')}
|
|
103
|
+
</div>
|
|
104
|
+
</section>`;
|
|
105
|
+
case 'cta':
|
|
106
|
+
return `
|
|
107
|
+
<section style="background:${primary};color:#fff;padding:60px 40px;text-align:center;">
|
|
108
|
+
<h2 style="margin-bottom:12px;">${esc(content.headline || content.title || 'Get Started')}</h2>
|
|
109
|
+
<p style="opacity:0.9;margin-bottom:24px;">${esc(content.subheadline || content.description || '')}</p>
|
|
110
|
+
${content.cta_text ? `<a href="${esc(content.cta_url || '#')}" style="display:inline-block;background:#fff;color:${primary};padding:14px 36px;border-radius:8px;font-weight:600;text-decoration:none;">${esc(content.cta_text || content.button_text || 'Contact Us')}</a>` : ''}
|
|
111
|
+
</section>`;
|
|
112
|
+
case 'testimonials':
|
|
113
|
+
const testimonials = content.testimonials || content.items || [];
|
|
114
|
+
return `
|
|
115
|
+
<section style="padding:60px 40px;max-width:900px;margin:0 auto;">
|
|
116
|
+
<h2 style="text-align:center;margin-bottom:40px;">${esc(content.title || 'What Our Customers Say')}</h2>
|
|
117
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px;">
|
|
118
|
+
${testimonials.map((t) => `
|
|
119
|
+
<div style="padding:24px;background:#f9fafb;border-radius:12px;border-left:4px solid ${primary};">
|
|
120
|
+
<p style="font-style:italic;margin-bottom:12px;">"${esc(t.quote || t.text || '')}"</p>
|
|
121
|
+
<p style="font-weight:600;font-size:0.9rem;">— ${esc(t.name || t.author || '')}</p>
|
|
122
|
+
</div>
|
|
123
|
+
`).join('')}
|
|
124
|
+
</div>
|
|
125
|
+
</section>`;
|
|
126
|
+
case 'faq':
|
|
127
|
+
case 'accordion':
|
|
128
|
+
const faqs = content.questions || content.items || content.faqs || [];
|
|
129
|
+
return `
|
|
130
|
+
<section style="padding:60px 40px;max-width:800px;margin:0 auto;">
|
|
131
|
+
<h2 style="text-align:center;margin-bottom:40px;">${esc(content.title || 'FAQ')}</h2>
|
|
132
|
+
${faqs.map((q) => `
|
|
133
|
+
<div style="border-bottom:1px solid #e5e7eb;padding:16px 0;">
|
|
134
|
+
<h3 style="font-size:1.1rem;margin-bottom:8px;">${esc(q.question || q.title || '')}</h3>
|
|
135
|
+
<p style="color:#6b7280;">${esc(q.answer || q.content || q.text || '')}</p>
|
|
136
|
+
</div>
|
|
137
|
+
`).join('')}
|
|
138
|
+
</section>`;
|
|
139
|
+
case 'contact':
|
|
140
|
+
case 'form':
|
|
141
|
+
return `
|
|
142
|
+
<section style="padding:60px 40px;max-width:600px;margin:0 auto;">
|
|
143
|
+
<h2 style="text-align:center;margin-bottom:32px;">${esc(content.title || 'Contact Us')}</h2>
|
|
144
|
+
<div style="background:#f9fafb;padding:32px;border-radius:12px;">
|
|
145
|
+
<div style="margin-bottom:16px;"><input placeholder="Name" style="width:100%;padding:10px;border:1px solid #d1d5db;border-radius:6px;" disabled></div>
|
|
146
|
+
<div style="margin-bottom:16px;"><input placeholder="Email" style="width:100%;padding:10px;border:1px solid #d1d5db;border-radius:6px;" disabled></div>
|
|
147
|
+
<div style="margin-bottom:16px;"><input placeholder="Phone" style="width:100%;padding:10px;border:1px solid #d1d5db;border-radius:6px;" disabled></div>
|
|
148
|
+
<div style="margin-bottom:16px;"><textarea placeholder="Message" rows="4" style="width:100%;padding:10px;border:1px solid #d1d5db;border-radius:6px;resize:vertical;" disabled></textarea></div>
|
|
149
|
+
<button style="width:100%;background:${primary};color:#fff;padding:12px;border:none;border-radius:6px;font-size:1rem;cursor:not-allowed;opacity:0.7;">${esc(content.button_text || 'Send Message')} (Preview)</button>
|
|
150
|
+
</div>
|
|
151
|
+
</section>`;
|
|
152
|
+
case 'stats':
|
|
153
|
+
const stats = content.stats || content.items || [];
|
|
154
|
+
return `
|
|
155
|
+
<section style="padding:60px 40px;background:#f9fafb;">
|
|
156
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:24px;max-width:800px;margin:0 auto;text-align:center;">
|
|
157
|
+
${stats.map((s) => `
|
|
158
|
+
<div>
|
|
159
|
+
<div style="font-size:2.5rem;font-weight:700;color:${primary};">${esc(s.value || s.number || '')}</div>
|
|
160
|
+
<div style="color:#6b7280;font-size:0.9rem;">${esc(s.label || s.title || '')}</div>
|
|
161
|
+
</div>
|
|
162
|
+
`).join('')}
|
|
163
|
+
</div>
|
|
164
|
+
</section>`;
|
|
165
|
+
case 'text':
|
|
166
|
+
return `
|
|
167
|
+
<section style="padding:40px;max-width:800px;margin:0 auto;">
|
|
168
|
+
${content.title ? `<h2 style="margin-bottom:16px;">${esc(content.title)}</h2>` : ''}
|
|
169
|
+
<div style="color:#374151;line-height:1.7;">${content.html || esc(content.text || content.body || JSON.stringify(content))}</div>
|
|
170
|
+
</section>`;
|
|
171
|
+
case 'gallery':
|
|
172
|
+
const images = content.images || content.items || [];
|
|
173
|
+
return `
|
|
174
|
+
<section style="padding:60px 40px;">
|
|
175
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;max-width:1000px;margin:0 auto;">
|
|
176
|
+
${images.map((img) => `
|
|
177
|
+
<div style="aspect-ratio:4/3;background:#e5e7eb;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#9ca3af;">
|
|
178
|
+
${typeof img === 'string' ? `<img src="${esc(img)}" style="width:100%;height:100%;object-fit:cover;border-radius:8px;">` : esc(img.alt || 'Image')}
|
|
179
|
+
</div>
|
|
180
|
+
`).join('')}
|
|
181
|
+
</div>
|
|
182
|
+
</section>`;
|
|
183
|
+
case 'team':
|
|
184
|
+
const members = content.members || content.items || [];
|
|
185
|
+
return `
|
|
186
|
+
<section style="padding:60px 40px;">
|
|
187
|
+
<h2 style="text-align:center;margin-bottom:40px;">${esc(content.title || 'Our Team')}</h2>
|
|
188
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:24px;max-width:1000px;margin:0 auto;text-align:center;">
|
|
189
|
+
${members.map((m) => `
|
|
190
|
+
<div>
|
|
191
|
+
<div style="width:80px;height:80px;border-radius:50%;background:#e5e7eb;margin:0 auto 12px;"></div>
|
|
192
|
+
<h3 style="font-size:1rem;">${esc(m.name || '')}</h3>
|
|
193
|
+
<p style="color:#6b7280;font-size:0.85rem;">${esc(m.role || m.title || '')}</p>
|
|
194
|
+
</div>
|
|
195
|
+
`).join('')}
|
|
196
|
+
</div>
|
|
197
|
+
</section>`;
|
|
198
|
+
case 'divider':
|
|
199
|
+
return `<hr style="border:none;border-top:1px solid #e5e7eb;margin:40px auto;max-width:800px;">`;
|
|
200
|
+
case 'video':
|
|
201
|
+
return `
|
|
202
|
+
<section style="padding:60px 40px;text-align:center;">
|
|
203
|
+
<div style="max-width:720px;margin:0 auto;aspect-ratio:16/9;background:#111;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.2rem;">
|
|
204
|
+
\u25B6 Video: ${esc(content.url || content.title || 'Video Player')}
|
|
205
|
+
</div>
|
|
206
|
+
</section>`;
|
|
207
|
+
case 'map':
|
|
208
|
+
case 'service-area':
|
|
209
|
+
return `
|
|
210
|
+
<section style="padding:40px;text-align:center;">
|
|
211
|
+
<div style="max-width:800px;margin:0 auto;height:300px;background:#e5e7eb;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#6b7280;">
|
|
212
|
+
Map: ${esc(content.address || ctx.address || 'Service Area')}
|
|
213
|
+
</div>
|
|
214
|
+
</section>`;
|
|
215
|
+
case 'logo-cloud':
|
|
216
|
+
return `
|
|
217
|
+
<section style="padding:40px;text-align:center;">
|
|
218
|
+
<p style="color:#6b7280;margin-bottom:16px;">${esc(content.title || 'Trusted By')}</p>
|
|
219
|
+
<div style="display:flex;gap:32px;justify-content:center;flex-wrap:wrap;opacity:0.5;">
|
|
220
|
+
${(content.logos || content.items || []).map((l) => `<span style="font-size:1.1rem;font-weight:600;">${esc(typeof l === 'string' ? l : l.name || 'Logo')}</span>`).join('')}
|
|
221
|
+
</div>
|
|
222
|
+
</section>`;
|
|
223
|
+
case 'booking':
|
|
224
|
+
return `
|
|
225
|
+
<section style="padding:60px 40px;text-align:center;background:#f9fafb;">
|
|
226
|
+
<h2 style="margin-bottom:16px;">${esc(content.title || 'Book an Appointment')}</h2>
|
|
227
|
+
<p style="color:#6b7280;margin-bottom:24px;">${esc(content.description || '')}</p>
|
|
228
|
+
<button style="background:${primary};color:#fff;padding:14px 36px;border:none;border-radius:8px;font-size:1rem;cursor:not-allowed;opacity:0.7;">${esc(content.button_text || 'Book Now')} (Preview)</button>
|
|
229
|
+
</section>`;
|
|
230
|
+
case 'process-steps':
|
|
231
|
+
const steps = content.steps || content.items || [];
|
|
232
|
+
return `
|
|
233
|
+
<section style="padding:60px 40px;max-width:800px;margin:0 auto;">
|
|
234
|
+
<h2 style="text-align:center;margin-bottom:40px;">${esc(content.title || 'How It Works')}</h2>
|
|
235
|
+
${steps.map((s, i) => `
|
|
236
|
+
<div style="display:flex;gap:16px;margin-bottom:24px;align-items:flex-start;">
|
|
237
|
+
<div style="width:36px;height:36px;border-radius:50%;background:${primary};color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0;">${i + 1}</div>
|
|
238
|
+
<div>
|
|
239
|
+
<h3 style="margin-bottom:4px;">${esc(s.title || s.name || '')}</h3>
|
|
240
|
+
<p style="color:#6b7280;">${esc(s.description || s.text || '')}</p>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
`).join('')}
|
|
244
|
+
</section>`;
|
|
245
|
+
default:
|
|
246
|
+
return `
|
|
247
|
+
<section style="padding:20px 40px;background:#fef3c7;border-left:4px solid #f59e0b;margin:20px 40px;border-radius:4px;">
|
|
248
|
+
<p style="color:#92400e;font-size:0.9rem;">Block type: <strong>${esc(type)}</strong></p>
|
|
249
|
+
<pre style="font-size:0.8rem;color:#6b7280;overflow-x:auto;">${esc(JSON.stringify(content, null, 2).slice(0, 300))}</pre>
|
|
250
|
+
</section>`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
function esc(s) {
|
|
254
|
+
return String(s || '')
|
|
255
|
+
.replace(/&/g, '&')
|
|
256
|
+
.replace(/</g, '<')
|
|
257
|
+
.replace(/>/g, '>')
|
|
258
|
+
.replace(/"/g, '"');
|
|
259
|
+
}
|
|
260
|
+
function renderPage(page, ctx, allPages) {
|
|
261
|
+
const sections = page.layout_json?.sections || page.layout_json?.blocks || [];
|
|
262
|
+
const title = page.title || 'Untitled Page';
|
|
263
|
+
const primary = ctx.primary_color || '#4f46e5';
|
|
264
|
+
const nav = allPages.map(p => `<a href="/${p.slug}" style="color:inherit;text-decoration:none;opacity:0.8;">${esc(p.title)}</a>`).join('');
|
|
265
|
+
return `<!DOCTYPE html>
|
|
266
|
+
<html lang="en">
|
|
267
|
+
<head>
|
|
268
|
+
<meta charset="UTF-8">
|
|
269
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
270
|
+
<title>${esc(title)} — ${esc(ctx.name || 'Preview')}</title>
|
|
271
|
+
<meta name="description" content="${esc(page.meta_description || page.description || '')}">
|
|
272
|
+
<style>
|
|
273
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
274
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #111827; }
|
|
275
|
+
a { color: ${primary}; }
|
|
276
|
+
img { max-width: 100%; }
|
|
277
|
+
</style>
|
|
278
|
+
</head>
|
|
279
|
+
<body>
|
|
280
|
+
${page.is_landing_page ? '' : `
|
|
281
|
+
<nav style="display:flex;align-items:center;justify-content:space-between;padding:16px 40px;border-bottom:1px solid #e5e7eb;">
|
|
282
|
+
<div style="font-weight:700;font-size:1.2rem;color:${primary};">${esc(ctx.name || 'Company')}</div>
|
|
283
|
+
<div style="display:flex;gap:24px;font-size:0.9rem;">${nav}</div>
|
|
284
|
+
${ctx.phone ? `<a href="tel:${esc(ctx.phone)}" style="font-weight:600;text-decoration:none;">${esc(ctx.phone)}</a>` : ''}
|
|
285
|
+
</nav>`}
|
|
286
|
+
|
|
287
|
+
<main>
|
|
288
|
+
${sections.map((s) => renderSection(s, ctx)).join('\n')}
|
|
289
|
+
</main>
|
|
290
|
+
|
|
291
|
+
${page.is_landing_page ? '' : `
|
|
292
|
+
<footer style="background:#111827;color:#9ca3af;padding:40px;text-align:center;font-size:0.85rem;">
|
|
293
|
+
<p>© ${new Date().getFullYear()} ${esc(ctx.name || '')}. All rights reserved.</p>
|
|
294
|
+
${ctx.address ? `<p style="margin-top:8px;">${esc(ctx.address)}</p>` : ''}
|
|
295
|
+
${ctx.email ? `<p style="margin-top:4px;">${esc(ctx.email)}</p>` : ''}
|
|
296
|
+
</footer>`}
|
|
297
|
+
|
|
298
|
+
<div style="position:fixed;bottom:0;left:0;right:0;background:#1e1b4b;color:#c7d2fe;padding:8px 16px;font-size:0.8rem;display:flex;justify-content:space-between;z-index:9999;">
|
|
299
|
+
<span>Solid# Local Preview — <strong>${esc(title)}</strong></span>
|
|
300
|
+
<span>${sections.length} sections · ${page.is_published ? 'Published' : 'Draft'} · ${esc(page.page_type || 'website')}</span>
|
|
301
|
+
</div>
|
|
302
|
+
</body>
|
|
303
|
+
</html>`;
|
|
304
|
+
}
|
|
305
|
+
// ─── Server ─────────────────────────────────────────────────────────
|
|
306
|
+
function loadPages(dir) {
|
|
307
|
+
const pagesDir = path.join(dir, 'pages');
|
|
308
|
+
if (!fs.existsSync(pagesDir))
|
|
309
|
+
return [];
|
|
310
|
+
return fs.readdirSync(pagesDir)
|
|
311
|
+
.filter(f => f.endsWith('.json'))
|
|
312
|
+
.map(f => {
|
|
313
|
+
try {
|
|
314
|
+
const data = JSON.parse(fs.readFileSync(path.join(pagesDir, f), 'utf-8'));
|
|
315
|
+
if (!data.slug)
|
|
316
|
+
data.slug = f.replace('.json', '');
|
|
317
|
+
return data;
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
})
|
|
323
|
+
.filter(Boolean);
|
|
324
|
+
}
|
|
325
|
+
function loadContext(dir) {
|
|
326
|
+
const configPath = path.join(dir, 'solid.config.json');
|
|
327
|
+
if (!fs.existsSync(configPath))
|
|
328
|
+
return {};
|
|
329
|
+
try {
|
|
330
|
+
const data = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
331
|
+
return {
|
|
332
|
+
name: data.name,
|
|
333
|
+
phone: data.phone,
|
|
334
|
+
email: data.email,
|
|
335
|
+
address: data.address,
|
|
336
|
+
logo_url: data.logo_url,
|
|
337
|
+
primary_color: data.website_settings?.primary_color || data.primary_color,
|
|
338
|
+
accent_color: data.website_settings?.accent_color || data.accent_color,
|
|
339
|
+
tagline: data.tagline,
|
|
340
|
+
industry: data.industry,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch {
|
|
344
|
+
return {};
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
exports.serveCommand = new commander_1.Command('serve')
|
|
348
|
+
.description('Start a local preview server for your pulled site')
|
|
349
|
+
.option('--port <number>', 'Server port', '4000')
|
|
350
|
+
.option('--dir <path>', 'Working directory', process.cwd())
|
|
351
|
+
.option('--open', 'Auto-open browser')
|
|
352
|
+
.action(async (options) => {
|
|
353
|
+
const dir = options.dir;
|
|
354
|
+
const port = parseInt(options.port);
|
|
355
|
+
// Verify we have pulled files
|
|
356
|
+
if (!fs.existsSync(path.join(dir, 'pages')) && !fs.existsSync(path.join(dir, 'solid.config.json'))) {
|
|
357
|
+
console.error(chalk_1.default.red('No pulled site found. Run `solid pull` first.'));
|
|
358
|
+
process.exit(1);
|
|
359
|
+
}
|
|
360
|
+
const server = http.createServer((req, res) => {
|
|
361
|
+
const pages = loadPages(dir);
|
|
362
|
+
const ctx = loadContext(dir);
|
|
363
|
+
const url = (req.url || '/').replace(/\?.*$/, '');
|
|
364
|
+
// Index page
|
|
365
|
+
if (url === '/' || url === '/index') {
|
|
366
|
+
// Find home page or first page
|
|
367
|
+
const home = pages.find(p => p.slug === 'home' || p.slug === 'index') || pages[0];
|
|
368
|
+
if (home) {
|
|
369
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
370
|
+
res.end(renderPage(home, ctx, pages));
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
374
|
+
res.end(renderIndex(pages, ctx));
|
|
375
|
+
}
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
// Page by slug
|
|
379
|
+
const slug = url.replace(/^\//, '').replace(/\/$/, '');
|
|
380
|
+
const page = pages.find(p => p.slug === slug);
|
|
381
|
+
if (page) {
|
|
382
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
383
|
+
res.end(renderPage(page, ctx, pages));
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
// 404
|
|
387
|
+
res.writeHead(404, { 'Content-Type': 'text/html' });
|
|
388
|
+
res.end(`<html><body style="font-family:system-ui;padding:60px;text-align:center;">
|
|
389
|
+
<h1>404</h1><p>Page "${esc(slug)}" not found.</p>
|
|
390
|
+
<p><a href="/">Go to index</a></p>
|
|
391
|
+
</body></html>`);
|
|
392
|
+
});
|
|
393
|
+
server.listen(port, () => {
|
|
394
|
+
const pages = loadPages(dir);
|
|
395
|
+
const ctx = loadContext(dir);
|
|
396
|
+
console.log('');
|
|
397
|
+
console.log(chalk_1.default.bold(` Solid# Local Preview`));
|
|
398
|
+
console.log(chalk_1.default.dim(` ${ctx.name || 'Your Site'} — ${pages.length} pages`));
|
|
399
|
+
console.log('');
|
|
400
|
+
console.log(` ${chalk_1.default.green('\u25CF')} http://localhost:${port}`);
|
|
401
|
+
console.log('');
|
|
402
|
+
pages.forEach(p => {
|
|
403
|
+
const status = p.is_published ? chalk_1.default.green('live') : chalk_1.default.yellow('draft');
|
|
404
|
+
console.log(` ${status} /${p.slug} ${chalk_1.default.dim(p.title)}`);
|
|
405
|
+
});
|
|
406
|
+
console.log('');
|
|
407
|
+
console.log(chalk_1.default.dim(' Edit pages/*.json and refresh to see changes.'));
|
|
408
|
+
console.log(chalk_1.default.dim(' Press Ctrl+C to stop.'));
|
|
409
|
+
console.log('');
|
|
410
|
+
if (options.open) {
|
|
411
|
+
const { exec } = require('child_process');
|
|
412
|
+
const cmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
413
|
+
exec(`${cmd} http://localhost:${port}`);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
// Watch for file changes and log
|
|
417
|
+
const pagesDir = path.join(dir, 'pages');
|
|
418
|
+
if (fs.existsSync(pagesDir)) {
|
|
419
|
+
fs.watch(pagesDir, { recursive: true }, (eventType, filename) => {
|
|
420
|
+
if (filename?.endsWith('.json')) {
|
|
421
|
+
console.log(chalk_1.default.dim(` [${new Date().toLocaleTimeString()}] ${filename} changed — refresh browser`));
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
// Index page listing all pages
|
|
427
|
+
function renderIndex(pages, ctx) {
|
|
428
|
+
const primary = ctx.primary_color || '#4f46e5';
|
|
429
|
+
return `<!DOCTYPE html>
|
|
430
|
+
<html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
431
|
+
<title>${esc(ctx.name || 'Site')} — Local Preview</title>
|
|
432
|
+
<style>*{margin:0;padding:0;box-sizing:border-box;}body{font-family:system-ui,sans-serif;padding:60px 40px;max-width:600px;margin:0 auto;}</style>
|
|
433
|
+
</head><body>
|
|
434
|
+
<h1 style="margin-bottom:8px;color:${primary};">${esc(ctx.name || 'Your Site')}</h1>
|
|
435
|
+
<p style="color:#6b7280;margin-bottom:32px;">${pages.length} pages available</p>
|
|
436
|
+
${pages.map(p => `
|
|
437
|
+
<a href="/${p.slug}" style="display:block;padding:16px;margin-bottom:8px;border:1px solid #e5e7eb;border-radius:8px;text-decoration:none;color:inherit;">
|
|
438
|
+
<strong>${esc(p.title)}</strong>
|
|
439
|
+
<span style="float:right;font-size:0.8rem;color:${p.is_published ? '#059669' : '#d97706'};">${p.is_published ? 'Published' : 'Draft'}</span>
|
|
440
|
+
<br><span style="color:#6b7280;font-size:0.85rem;">/${p.slug} \u2014 ${p.page_type || 'website'}</span>
|
|
441
|
+
</a>
|
|
442
|
+
`).join('')}
|
|
443
|
+
<div style="margin-top:40px;padding:16px;background:#f3f4f6;border-radius:8px;font-size:0.85rem;color:#6b7280;">
|
|
444
|
+
<p>Solid# Local Preview Server</p>
|
|
445
|
+
<p>Edit files in <code>pages/</code> and refresh the browser.</p>
|
|
446
|
+
</div>
|
|
447
|
+
</body></html>`;
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoC;AACpC,kDAA0B;AAC1B,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA6B;AAwB7B,SAAS,aAAa,CAAC,OAAgB,EAAE,GAAmB;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC;IAC5D,MAAM,OAAO,GAAG,GAAG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AE,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE;YAC9D,IAAI,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,KAAK,QAAQ,4BAA4B,CAAC,CAAC,CAAC;YACzG,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,+BAA+B;AAC/B,SAAS,WAAW,CAAC,KAAY,EAAE,GAAmB;IACpD,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC;IAC/C,OAAO;;SAEA,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC;;;uCAGO,OAAO,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,WAAW,CAAC;iDAC/B,KAAK,CAAC,MAAM;IACzD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACH,CAAC,CAAC,IAAI;gBACN,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;wDAC4B,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO;4DAC9E,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,IAAI,SAAS;;GAElG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;eAKE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Watch command for Solid CLI
|
|
3
|
+
*
|
|
4
|
+
* Watches local files for changes and auto-pushes to production.
|
|
5
|
+
* Like `solid push` on every save.
|
|
6
|
+
*
|
|
7
|
+
* solid watch → Watch and auto-push all changes
|
|
8
|
+
* solid watch --pages-only → Only watch pages/
|
|
9
|
+
* solid watch --kb-only → Only watch kb/
|
|
10
|
+
* solid watch --delay 3000 → Debounce delay in ms (default 2000)
|
|
11
|
+
* solid watch --dry-run → Show what would push, don't push
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from 'commander';
|
|
14
|
+
export declare const watchCommand: Command;
|
|
15
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,eAAO,MAAM,YAAY,SAwHrB,CAAC"}
|