popeye-cli 1.4.7 → 1.5.0
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 +222 -63
- package/dist/adapters/gemini.d.ts +1 -0
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +9 -4
- package/dist/adapters/gemini.js.map +1 -1
- package/dist/adapters/grok.d.ts +1 -0
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +9 -4
- package/dist/adapters/grok.js.map +1 -1
- package/dist/adapters/openai.d.ts +1 -1
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +35 -9
- package/dist/adapters/openai.js.map +1 -1
- package/dist/cli/interactive.d.ts.map +1 -1
- package/dist/cli/interactive.js +42 -0
- package/dist/cli/interactive.js.map +1 -1
- package/dist/generators/all.d.ts +4 -1
- package/dist/generators/all.d.ts.map +1 -1
- package/dist/generators/all.js +2 -1
- package/dist/generators/all.js.map +1 -1
- package/dist/generators/doc-parser.d.ts +49 -0
- package/dist/generators/doc-parser.d.ts.map +1 -0
- package/dist/generators/doc-parser.js +336 -0
- package/dist/generators/doc-parser.js.map +1 -0
- package/dist/generators/templates/index.d.ts +4 -0
- package/dist/generators/templates/index.d.ts.map +1 -1
- package/dist/generators/templates/index.js +4 -0
- package/dist/generators/templates/index.js.map +1 -1
- package/dist/generators/templates/website-components.d.ts +33 -0
- package/dist/generators/templates/website-components.d.ts.map +1 -0
- package/dist/generators/templates/website-components.js +278 -0
- package/dist/generators/templates/website-components.js.map +1 -0
- package/dist/generators/templates/website-config.d.ts +41 -0
- package/dist/generators/templates/website-config.d.ts.map +1 -0
- package/dist/generators/templates/website-config.js +283 -0
- package/dist/generators/templates/website-config.js.map +1 -0
- package/dist/generators/templates/website-conversion.d.ts +27 -0
- package/dist/generators/templates/website-conversion.d.ts.map +1 -0
- package/dist/generators/templates/website-conversion.js +326 -0
- package/dist/generators/templates/website-conversion.js.map +1 -0
- package/dist/generators/templates/website-seo.d.ts +76 -0
- package/dist/generators/templates/website-seo.d.ts.map +1 -0
- package/dist/generators/templates/website-seo.js +326 -0
- package/dist/generators/templates/website-seo.js.map +1 -0
- package/dist/generators/templates/website.d.ts +14 -47
- package/dist/generators/templates/website.d.ts.map +1 -1
- package/dist/generators/templates/website.js +412 -499
- package/dist/generators/templates/website.js.map +1 -1
- package/dist/generators/website-context.d.ts +83 -0
- package/dist/generators/website-context.d.ts.map +1 -0
- package/dist/generators/website-context.js +190 -0
- package/dist/generators/website-context.js.map +1 -0
- package/dist/generators/website.d.ts +3 -0
- package/dist/generators/website.d.ts.map +1 -1
- package/dist/generators/website.js +73 -10
- package/dist/generators/website.js.map +1 -1
- package/dist/state/index.d.ts +27 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +30 -0
- package/dist/state/index.js.map +1 -1
- package/dist/types/consensus.d.ts +3 -0
- package/dist/types/consensus.d.ts.map +1 -1
- package/dist/types/consensus.js +1 -0
- package/dist/types/consensus.js.map +1 -1
- package/dist/types/website-strategy.d.ts +263 -0
- package/dist/types/website-strategy.d.ts.map +1 -0
- package/dist/types/website-strategy.js +105 -0
- package/dist/types/website-strategy.js.map +1 -0
- package/dist/types/workflow.d.ts +15 -0
- package/dist/types/workflow.d.ts.map +1 -1
- package/dist/types/workflow.js +6 -0
- package/dist/types/workflow.js.map +1 -1
- package/dist/workflow/consensus.d.ts.map +1 -1
- package/dist/workflow/consensus.js +2 -0
- package/dist/workflow/consensus.js.map +1 -1
- package/dist/workflow/execution-mode.d.ts.map +1 -1
- package/dist/workflow/execution-mode.js +18 -0
- package/dist/workflow/execution-mode.js.map +1 -1
- package/dist/workflow/index.d.ts +3 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +25 -0
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/overview.d.ts +89 -0
- package/dist/workflow/overview.d.ts.map +1 -0
- package/dist/workflow/overview.js +354 -0
- package/dist/workflow/overview.js.map +1 -0
- package/dist/workflow/plan-mode.d.ts +2 -1
- package/dist/workflow/plan-mode.d.ts.map +1 -1
- package/dist/workflow/plan-mode.js +83 -5
- package/dist/workflow/plan-mode.js.map +1 -1
- package/dist/workflow/website-strategy.d.ts +70 -0
- package/dist/workflow/website-strategy.d.ts.map +1 -0
- package/dist/workflow/website-strategy.js +238 -0
- package/dist/workflow/website-strategy.js.map +1 -0
- package/dist/workflow/website-updater.d.ts +17 -0
- package/dist/workflow/website-updater.d.ts.map +1 -0
- package/dist/workflow/website-updater.js +105 -0
- package/dist/workflow/website-updater.js.map +1 -0
- package/dist/workflow/workflow-logger.d.ts +1 -1
- package/dist/workflow/workflow-logger.d.ts.map +1 -1
- package/dist/workflow/workflow-logger.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/gemini.ts +10 -4
- package/src/adapters/grok.ts +10 -4
- package/src/adapters/openai.ts +38 -6
- package/src/cli/interactive.ts +47 -0
- package/src/generators/all.ts +6 -1
- package/src/generators/doc-parser.ts +372 -0
- package/src/generators/templates/index.ts +4 -0
- package/src/generators/templates/website-components.ts +305 -0
- package/src/generators/templates/website-config.ts +291 -0
- package/src/generators/templates/website-conversion.ts +341 -0
- package/src/generators/templates/website-seo.ts +370 -0
- package/src/generators/templates/website.ts +451 -505
- package/src/generators/website-context.ts +265 -0
- package/src/generators/website.ts +109 -19
- package/src/state/index.ts +42 -0
- package/src/types/consensus.ts +3 -0
- package/src/types/website-strategy.ts +243 -0
- package/src/types/workflow.ts +15 -0
- package/src/workflow/consensus.ts +2 -0
- package/src/workflow/execution-mode.ts +21 -0
- package/src/workflow/index.ts +25 -0
- package/src/workflow/overview.ts +469 -0
- package/src/workflow/plan-mode.ts +115 -4
- package/src/workflow/website-strategy.ts +305 -0
- package/src/workflow/website-updater.ts +131 -0
- package/src/workflow/workflow-logger.ts +1 -0
- package/tests/adapters/persona-switching.test.ts +63 -0
- package/tests/generators/website-components.test.ts +159 -0
- package/tests/generators/website-context.test.ts +222 -0
- package/tests/generators/website-seo-quality.test.ts +246 -0
- package/tests/workflow/overview.test.ts +392 -0
- package/tests/workflow/website-strategy.test.ts +191 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lead capture and conversion templates
|
|
3
|
+
* Generates API route handlers for lead capture and contact form components
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Escape a string for safe use inside JSX template literals
|
|
7
|
+
*/
|
|
8
|
+
function escapeJsx(str) {
|
|
9
|
+
return str
|
|
10
|
+
.replace(/\\/g, '\\\\')
|
|
11
|
+
.replace(/'/g, "\\'")
|
|
12
|
+
.replace(/`/g, '\\`')
|
|
13
|
+
.replace(/\$/g, '\\$');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generate lead capture API route handler
|
|
17
|
+
*
|
|
18
|
+
* @param provider - Lead capture provider type
|
|
19
|
+
* @returns API route source code (src/app/api/lead/route.ts)
|
|
20
|
+
*/
|
|
21
|
+
export function generateLeadCaptureRoute(provider = 'webhook') {
|
|
22
|
+
if (provider === 'none') {
|
|
23
|
+
return `import { NextResponse } from 'next/server';
|
|
24
|
+
|
|
25
|
+
export async function POST() {
|
|
26
|
+
return NextResponse.json(
|
|
27
|
+
{ error: 'Lead capture not configured' },
|
|
28
|
+
{ status: 501 }
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
if (provider === 'resend') {
|
|
34
|
+
return `import { NextResponse } from 'next/server';
|
|
35
|
+
|
|
36
|
+
interface LeadPayload {
|
|
37
|
+
name: string;
|
|
38
|
+
email: string;
|
|
39
|
+
message?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function POST(request: Request) {
|
|
43
|
+
try {
|
|
44
|
+
const body: LeadPayload = await request.json();
|
|
45
|
+
|
|
46
|
+
if (!body.name || !body.email) {
|
|
47
|
+
return NextResponse.json(
|
|
48
|
+
{ error: 'Name and email are required' },
|
|
49
|
+
{ status: 400 }
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const apiKey = process.env.RESEND_API_KEY;
|
|
54
|
+
if (!apiKey) {
|
|
55
|
+
console.error('RESEND_API_KEY not configured');
|
|
56
|
+
return NextResponse.json(
|
|
57
|
+
{ error: 'Lead capture not configured' },
|
|
58
|
+
{ status: 500 }
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const response = await fetch('https://api.resend.com/emails', {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Type': 'application/json',
|
|
66
|
+
'Authorization': \`Bearer \${apiKey}\`,
|
|
67
|
+
},
|
|
68
|
+
body: JSON.stringify({
|
|
69
|
+
from: process.env.RESEND_FROM_EMAIL || 'onboarding@resend.dev',
|
|
70
|
+
to: process.env.LEAD_NOTIFICATION_EMAIL || 'team@example.com',
|
|
71
|
+
subject: \`New lead: \${body.name}\`,
|
|
72
|
+
text: \`Name: \${body.name}\\nEmail: \${body.email}\\nMessage: \${body.message || 'N/A'}\`,
|
|
73
|
+
}),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
console.error('Resend API error:', await response.text());
|
|
78
|
+
return NextResponse.json({ error: 'Failed to send' }, { status: 500 });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return NextResponse.json({ success: true });
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('Lead capture error:', error);
|
|
84
|
+
return NextResponse.json({ error: 'Internal error' }, { status: 500 });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
if (provider === 'postmark') {
|
|
90
|
+
return `import { NextResponse } from 'next/server';
|
|
91
|
+
|
|
92
|
+
interface LeadPayload {
|
|
93
|
+
name: string;
|
|
94
|
+
email: string;
|
|
95
|
+
message?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export async function POST(request: Request) {
|
|
99
|
+
try {
|
|
100
|
+
const body: LeadPayload = await request.json();
|
|
101
|
+
|
|
102
|
+
if (!body.name || !body.email) {
|
|
103
|
+
return NextResponse.json(
|
|
104
|
+
{ error: 'Name and email are required' },
|
|
105
|
+
{ status: 400 }
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const apiKey = process.env.POSTMARK_API_KEY;
|
|
110
|
+
if (!apiKey) {
|
|
111
|
+
console.error('POSTMARK_API_KEY not configured');
|
|
112
|
+
return NextResponse.json(
|
|
113
|
+
{ error: 'Lead capture not configured' },
|
|
114
|
+
{ status: 500 }
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const response = await fetch('https://api.postmarkapp.com/email', {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
headers: {
|
|
121
|
+
'Content-Type': 'application/json',
|
|
122
|
+
'X-Postmark-Server-Token': apiKey,
|
|
123
|
+
},
|
|
124
|
+
body: JSON.stringify({
|
|
125
|
+
From: process.env.POSTMARK_FROM_EMAIL || 'no-reply@example.com',
|
|
126
|
+
To: process.env.LEAD_NOTIFICATION_EMAIL || 'team@example.com',
|
|
127
|
+
Subject: \`New lead: \${body.name}\`,
|
|
128
|
+
TextBody: \`Name: \${body.name}\\nEmail: \${body.email}\\nMessage: \${body.message || 'N/A'}\`,
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (!response.ok) {
|
|
133
|
+
console.error('Postmark API error:', await response.text());
|
|
134
|
+
return NextResponse.json({ error: 'Failed to send' }, { status: 500 });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return NextResponse.json({ success: true });
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error('Lead capture error:', error);
|
|
140
|
+
return NextResponse.json({ error: 'Internal error' }, { status: 500 });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
// Default: webhook provider
|
|
146
|
+
return `import { NextResponse } from 'next/server';
|
|
147
|
+
|
|
148
|
+
interface LeadPayload {
|
|
149
|
+
name: string;
|
|
150
|
+
email: string;
|
|
151
|
+
message?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export async function POST(request: Request) {
|
|
155
|
+
try {
|
|
156
|
+
const body: LeadPayload = await request.json();
|
|
157
|
+
|
|
158
|
+
if (!body.name || !body.email) {
|
|
159
|
+
return NextResponse.json(
|
|
160
|
+
{ error: 'Name and email are required' },
|
|
161
|
+
{ status: 400 }
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const webhookUrl = process.env.LEAD_WEBHOOK_URL;
|
|
166
|
+
if (!webhookUrl) {
|
|
167
|
+
console.error('LEAD_WEBHOOK_URL not configured');
|
|
168
|
+
return NextResponse.json(
|
|
169
|
+
{ error: 'Lead capture not configured' },
|
|
170
|
+
{ status: 500 }
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const response = await fetch(webhookUrl, {
|
|
175
|
+
method: 'POST',
|
|
176
|
+
headers: { 'Content-Type': 'application/json' },
|
|
177
|
+
body: JSON.stringify({
|
|
178
|
+
name: body.name,
|
|
179
|
+
email: body.email,
|
|
180
|
+
message: body.message || '',
|
|
181
|
+
timestamp: new Date().toISOString(),
|
|
182
|
+
source: 'website',
|
|
183
|
+
}),
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
if (!response.ok) {
|
|
187
|
+
console.error('Webhook error:', response.status);
|
|
188
|
+
return NextResponse.json({ error: 'Failed to submit' }, { status: 500 });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return NextResponse.json({ success: true });
|
|
192
|
+
} catch (error) {
|
|
193
|
+
console.error('Lead capture error:', error);
|
|
194
|
+
return NextResponse.json({ error: 'Internal error' }, { status: 500 });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
`;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Generate contact form component
|
|
201
|
+
*
|
|
202
|
+
* @param strategy - Optional strategy for CTA text
|
|
203
|
+
* @returns ContactForm component source code
|
|
204
|
+
*/
|
|
205
|
+
export function generateContactForm(strategy) {
|
|
206
|
+
const ctaText = strategy?.conversionStrategy.primaryCta.text || 'Get Started';
|
|
207
|
+
return `'use client';
|
|
208
|
+
|
|
209
|
+
import { useState, type FormEvent } from 'react';
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Lead capture contact form
|
|
213
|
+
* Submits to /api/lead endpoint
|
|
214
|
+
*/
|
|
215
|
+
export default function ContactForm() {
|
|
216
|
+
const [status, setStatus] = useState<'idle' | 'submitting' | 'success' | 'error'>('idle');
|
|
217
|
+
|
|
218
|
+
async function handleSubmit(e: FormEvent<HTMLFormElement>) {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
setStatus('submitting');
|
|
221
|
+
|
|
222
|
+
const formData = new FormData(e.currentTarget);
|
|
223
|
+
const data = {
|
|
224
|
+
name: formData.get('name') as string,
|
|
225
|
+
email: formData.get('email') as string,
|
|
226
|
+
message: formData.get('message') as string,
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
try {
|
|
230
|
+
const response = await fetch('/api/lead', {
|
|
231
|
+
method: 'POST',
|
|
232
|
+
headers: { 'Content-Type': 'application/json' },
|
|
233
|
+
body: JSON.stringify(data),
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
if (response.ok) {
|
|
237
|
+
setStatus('success');
|
|
238
|
+
e.currentTarget.reset();
|
|
239
|
+
} else {
|
|
240
|
+
setStatus('error');
|
|
241
|
+
}
|
|
242
|
+
} catch {
|
|
243
|
+
setStatus('error');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (status === 'success') {
|
|
248
|
+
return (
|
|
249
|
+
<div className="rounded-lg bg-green-50 p-6 text-center">
|
|
250
|
+
<p className="text-lg font-medium text-green-800">Thank you for reaching out!</p>
|
|
251
|
+
<p className="mt-2 text-sm text-green-700">We will get back to you shortly.</p>
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<form onSubmit={handleSubmit} className="space-y-4">
|
|
258
|
+
<div>
|
|
259
|
+
<label htmlFor="name" className="block text-sm font-medium text-gray-700">
|
|
260
|
+
Name
|
|
261
|
+
</label>
|
|
262
|
+
<input
|
|
263
|
+
type="text"
|
|
264
|
+
id="name"
|
|
265
|
+
name="name"
|
|
266
|
+
required
|
|
267
|
+
className="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500"
|
|
268
|
+
/>
|
|
269
|
+
</div>
|
|
270
|
+
<div>
|
|
271
|
+
<label htmlFor="email" className="block text-sm font-medium text-gray-700">
|
|
272
|
+
Email
|
|
273
|
+
</label>
|
|
274
|
+
<input
|
|
275
|
+
type="email"
|
|
276
|
+
id="email"
|
|
277
|
+
name="email"
|
|
278
|
+
required
|
|
279
|
+
className="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500"
|
|
280
|
+
/>
|
|
281
|
+
</div>
|
|
282
|
+
<div>
|
|
283
|
+
<label htmlFor="message" className="block text-sm font-medium text-gray-700">
|
|
284
|
+
Message
|
|
285
|
+
</label>
|
|
286
|
+
<textarea
|
|
287
|
+
id="message"
|
|
288
|
+
name="message"
|
|
289
|
+
rows={4}
|
|
290
|
+
className="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500"
|
|
291
|
+
/>
|
|
292
|
+
</div>
|
|
293
|
+
<button
|
|
294
|
+
type="submit"
|
|
295
|
+
disabled={status === 'submitting'}
|
|
296
|
+
className="w-full rounded-md bg-primary-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-primary-500 disabled:opacity-50"
|
|
297
|
+
>
|
|
298
|
+
{status === 'submitting' ? 'Sending...' : '${escapeJsx(ctaText)}'}
|
|
299
|
+
</button>
|
|
300
|
+
{status === 'error' && (
|
|
301
|
+
<p className="text-sm text-red-600">Something went wrong. Please try again.</p>
|
|
302
|
+
)}
|
|
303
|
+
</form>
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Generate .env.example entries for lead capture provider
|
|
310
|
+
*
|
|
311
|
+
* @param provider - Lead capture provider type
|
|
312
|
+
* @returns Environment variable example lines
|
|
313
|
+
*/
|
|
314
|
+
export function generateLeadCaptureEnvExample(provider) {
|
|
315
|
+
switch (provider) {
|
|
316
|
+
case 'webhook':
|
|
317
|
+
return 'LEAD_WEBHOOK_URL=https://your-webhook-endpoint.com/leads\n';
|
|
318
|
+
case 'resend':
|
|
319
|
+
return 'RESEND_API_KEY=re_xxxxxxxxxxxx\nRESEND_FROM_EMAIL=onboarding@resend.dev\nLEAD_NOTIFICATION_EMAIL=team@example.com\n';
|
|
320
|
+
case 'postmark':
|
|
321
|
+
return 'POSTMARK_API_KEY=xxxxxxxxxxxx\nPOSTMARK_FROM_EMAIL=no-reply@example.com\nLEAD_NOTIFICATION_EMAIL=team@example.com\n';
|
|
322
|
+
default:
|
|
323
|
+
return '';
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
//# sourceMappingURL=website-conversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-conversion.js","sourceRoot":"","sources":["../../../src/generators/templates/website-conversion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG;SACP,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACtC,WAAuD,SAAS;IAEhE,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,OAAO;;;;;;;;CAQV,CAAC;IACA,CAAC;IAED,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDV,CAAC;IACA,CAAC;IAED,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDV,CAAC;IACA,CAAC;IAED,4BAA4B;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDR,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAkC;IAElC,MAAM,OAAO,GAAG,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,IAAI,IAAI,aAAa,CAAC;IAE9E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDA2F4C,SAAS,CAAC,OAAO,CAAC;;;;;;;;CAQtE,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAoD;IAEpD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,SAAS;YACZ,OAAO,4DAA4D,CAAC;QACtE,KAAK,QAAQ;YACX,OAAO,qHAAqH,CAAC;QAC/H,KAAK,UAAU;YACb,OAAO,qHAAqH,CAAC;QAC/H;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEO infrastructure templates for Next.js marketing websites
|
|
3
|
+
* Generates JSON-LD components, enhanced sitemap, robots.txt,
|
|
4
|
+
* error pages, web manifest, and meta helpers
|
|
5
|
+
*/
|
|
6
|
+
import type { WebsiteContentContext } from '../website-context.js';
|
|
7
|
+
import type { WebsiteStrategyDocument } from '../../types/website-strategy.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate reusable JSON-LD component
|
|
10
|
+
*
|
|
11
|
+
* @returns JsonLd component source code
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateJsonLdComponent(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generate Organization JSON-LD schema data
|
|
16
|
+
*
|
|
17
|
+
* @param projectName - Product name
|
|
18
|
+
* @param context - Optional content context
|
|
19
|
+
* @returns Organization schema as string constant
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateOrganizationJsonLd(projectName: string, context?: WebsiteContentContext): string;
|
|
22
|
+
/**
|
|
23
|
+
* Generate SoftwareApplication JSON-LD schema data
|
|
24
|
+
*
|
|
25
|
+
* @param projectName - Product name
|
|
26
|
+
* @param context - Optional content context
|
|
27
|
+
* @returns Software application schema as string constant
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateProductJsonLd(projectName: string, context?: WebsiteContentContext): string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate enhanced sitemap with all strategy pages
|
|
32
|
+
*
|
|
33
|
+
* @param projectName - Project name for base URL fallback
|
|
34
|
+
* @param strategy - Optional strategy for page list
|
|
35
|
+
* @returns Enhanced sitemap.ts source code
|
|
36
|
+
*/
|
|
37
|
+
export declare function generateEnhancedSitemap(projectName: string, strategy?: WebsiteStrategyDocument): string;
|
|
38
|
+
/**
|
|
39
|
+
* Generate enhanced robots.txt
|
|
40
|
+
*
|
|
41
|
+
* @param projectName - Project name for base URL fallback
|
|
42
|
+
* @returns robots.ts source code
|
|
43
|
+
*/
|
|
44
|
+
export declare function generateEnhancedRobots(projectName: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate branded 404 Not Found page
|
|
47
|
+
*
|
|
48
|
+
* @param projectName - Product name for branding
|
|
49
|
+
* @param context - Optional content context
|
|
50
|
+
* @returns not-found.tsx source code
|
|
51
|
+
*/
|
|
52
|
+
export declare function generate404Page(projectName: string, context?: WebsiteContentContext): string;
|
|
53
|
+
/**
|
|
54
|
+
* Generate error boundary page (500)
|
|
55
|
+
*
|
|
56
|
+
* @param projectName - Product name for branding
|
|
57
|
+
* @returns error.tsx source code
|
|
58
|
+
*/
|
|
59
|
+
export declare function generate500Page(_projectName: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Generate PWA web manifest
|
|
62
|
+
*
|
|
63
|
+
* @param projectName - Product name
|
|
64
|
+
* @param context - Optional content context
|
|
65
|
+
* @returns manifest.webmanifest JSON content
|
|
66
|
+
*/
|
|
67
|
+
export declare function generateWebManifest(projectName: string, context?: WebsiteContentContext): string;
|
|
68
|
+
/**
|
|
69
|
+
* Generate shared metadata helper utility
|
|
70
|
+
*
|
|
71
|
+
* @param projectName - Product name
|
|
72
|
+
* @param strategy - Optional strategy for SEO data
|
|
73
|
+
* @returns Metadata helper source code
|
|
74
|
+
*/
|
|
75
|
+
export declare function generateMetaHelper(projectName: string, strategy?: WebsiteStrategyDocument): string;
|
|
76
|
+
//# sourceMappingURL=website-seo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-seo.d.ts","sourceRoot":"","sources":["../../../src/generators/templates/website-seo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAa/E;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAoBhD;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CAWR;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CAaR;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,uBAAuB,GACjC,MAAM,CAuDR;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAkBlE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CA8BR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CA8B5D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CA2BR;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,uBAAuB,GACjC,MAAM,CAoDR"}
|