@girardmedia/bootspring 2.5.0 → 2.5.2
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 +9 -403
- package/bin/bootspring.js +1 -96
- package/dist/cli/index.js +65134 -0
- package/dist/cli-launcher.js +92 -0
- package/dist/core/index.d.ts +2110 -5582
- package/dist/core/index.js +2 -0
- package/dist/core.js +21123 -5413
- package/dist/mcp/index.d.ts +357 -1
- package/dist/mcp/index.js +2 -0
- package/dist/mcp-server.js +51948 -1976
- package/package.json +27 -63
- package/scripts/postinstall.cjs +144 -0
- package/LICENSE +0 -29
- package/dist/cli/index.cjs +0 -20776
- package/generators/api-docs.js +0 -827
- package/generators/decisions.js +0 -655
- package/generators/generate.js +0 -595
- package/generators/health.js +0 -942
- package/generators/index.ts +0 -82
- package/generators/presets/full.js +0 -28
- package/generators/presets/index.js +0 -12
- package/generators/presets/minimal.js +0 -29
- package/generators/presets/standard.js +0 -28
- package/generators/questionnaire.js +0 -414
- package/generators/sections/advanced.js +0 -136
- package/generators/sections/ai.js +0 -106
- package/generators/sections/auth.js +0 -89
- package/generators/sections/backend.js +0 -146
- package/generators/sections/business.js +0 -118
- package/generators/sections/content.js +0 -300
- package/generators/sections/deployment.js +0 -139
- package/generators/sections/features.js +0 -122
- package/generators/sections/frontend.js +0 -118
- package/generators/sections/identity.js +0 -76
- package/generators/sections/index.js +0 -40
- package/generators/sections/instructions.js +0 -146
- package/generators/sections/payments.js +0 -104
- package/generators/sections/plugins.js +0 -142
- package/generators/sections/pre-build.js +0 -130
- package/generators/sections/security.js +0 -127
- package/generators/sections/technical.js +0 -171
- package/generators/sections/testing.js +0 -125
- package/generators/sections/workflow.js +0 -104
- package/generators/sprint.js +0 -675
- package/generators/templates/agents.template.js +0 -199
- package/generators/templates/assistant-context.template.js +0 -83
- package/generators/templates/build-planning.template.js +0 -708
- package/generators/templates/claude.template.js +0 -379
- package/generators/templates/content.template.js +0 -819
- package/generators/templates/index.js +0 -16
- package/generators/templates/planning.template.js +0 -515
- package/generators/templates/seed.template.js +0 -109
- package/generators/visual-doc-generator.js +0 -910
- package/scripts/postinstall.js +0 -197
- /package/{claude-commands → assets/claude-commands}/agent.md +0 -0
- /package/{claude-commands → assets/claude-commands}/bs.md +0 -0
- /package/{claude-commands → assets/claude-commands}/build.md +0 -0
- /package/{claude-commands → assets/claude-commands}/skill.md +0 -0
- /package/{claude-commands → assets/claude-commands}/todo.md +0 -0
|
@@ -1,819 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Content Template Generator
|
|
3
|
-
*
|
|
4
|
-
* Generates content files for blogs, documentation, release notes, etc.
|
|
5
|
-
* Supports multiple content types and output formats.
|
|
6
|
-
*
|
|
7
|
-
* @package bootspring
|
|
8
|
-
* @module generators/templates/content
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const CONTENT_TYPES = {
|
|
12
|
-
'blog-post': {
|
|
13
|
-
name: 'Blog Post',
|
|
14
|
-
extension: '.md',
|
|
15
|
-
directory: 'content/blog'
|
|
16
|
-
},
|
|
17
|
-
'release-notes': {
|
|
18
|
-
name: 'Release Notes',
|
|
19
|
-
extension: '.md',
|
|
20
|
-
directory: 'content/releases'
|
|
21
|
-
},
|
|
22
|
-
'documentation': {
|
|
23
|
-
name: 'Documentation Page',
|
|
24
|
-
extension: '.mdx',
|
|
25
|
-
directory: 'content/docs'
|
|
26
|
-
},
|
|
27
|
-
'changelog': {
|
|
28
|
-
name: 'Changelog Entry',
|
|
29
|
-
extension: '.md',
|
|
30
|
-
directory: '.'
|
|
31
|
-
},
|
|
32
|
-
'readme': {
|
|
33
|
-
name: 'README',
|
|
34
|
-
extension: '.md',
|
|
35
|
-
directory: '.'
|
|
36
|
-
},
|
|
37
|
-
'landing-page': {
|
|
38
|
-
name: 'Landing Page Copy',
|
|
39
|
-
extension: '.md',
|
|
40
|
-
directory: 'content/marketing'
|
|
41
|
-
},
|
|
42
|
-
'email-template': {
|
|
43
|
-
name: 'Email Template',
|
|
44
|
-
extension: '.html',
|
|
45
|
-
directory: 'templates/email'
|
|
46
|
-
},
|
|
47
|
-
'social-post': {
|
|
48
|
-
name: 'Social Media Post',
|
|
49
|
-
extension: '.md',
|
|
50
|
-
directory: 'content/social'
|
|
51
|
-
},
|
|
52
|
-
'api-doc': {
|
|
53
|
-
name: 'API Documentation',
|
|
54
|
-
extension: '.mdx',
|
|
55
|
-
directory: 'content/docs/api'
|
|
56
|
-
},
|
|
57
|
-
'tutorial': {
|
|
58
|
-
name: 'Tutorial',
|
|
59
|
-
extension: '.mdx',
|
|
60
|
-
directory: 'content/docs/tutorials'
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Generate blog post template
|
|
66
|
-
*/
|
|
67
|
-
function generateBlogPost(options = {}) {
|
|
68
|
-
const {
|
|
69
|
-
title = 'Untitled Post',
|
|
70
|
-
description = '',
|
|
71
|
-
author = 'Team',
|
|
72
|
-
tags = [],
|
|
73
|
-
date = new Date().toISOString().split('T')[0]
|
|
74
|
-
} = options;
|
|
75
|
-
|
|
76
|
-
return `---
|
|
77
|
-
title: "${title}"
|
|
78
|
-
description: "${description}"
|
|
79
|
-
date: "${date}"
|
|
80
|
-
author: "${author}"
|
|
81
|
-
tags: [${tags.map(t => `"${t}"`).join(', ')}]
|
|
82
|
-
image: "/images/blog/${title.toLowerCase().replace(/[^a-z0-9]+/g, '-')}.png"
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Introduction
|
|
86
|
-
|
|
87
|
-
[Hook - Why should the reader care about this topic?]
|
|
88
|
-
|
|
89
|
-
[Problem statement - What pain point are we addressing?]
|
|
90
|
-
|
|
91
|
-
## What You'll Learn
|
|
92
|
-
|
|
93
|
-
- Point 1
|
|
94
|
-
- Point 2
|
|
95
|
-
- Point 3
|
|
96
|
-
|
|
97
|
-
## Main Content
|
|
98
|
-
|
|
99
|
-
### Section 1
|
|
100
|
-
|
|
101
|
-
[Content]
|
|
102
|
-
|
|
103
|
-
\`\`\`typescript
|
|
104
|
-
// Code example
|
|
105
|
-
\`\`\`
|
|
106
|
-
|
|
107
|
-
### Section 2
|
|
108
|
-
|
|
109
|
-
[Content]
|
|
110
|
-
|
|
111
|
-
### Section 3
|
|
112
|
-
|
|
113
|
-
[Content]
|
|
114
|
-
|
|
115
|
-
## Key Takeaways
|
|
116
|
-
|
|
117
|
-
1. **Takeaway 1** - Brief explanation
|
|
118
|
-
2. **Takeaway 2** - Brief explanation
|
|
119
|
-
3. **Takeaway 3** - Brief explanation
|
|
120
|
-
|
|
121
|
-
## Next Steps
|
|
122
|
-
|
|
123
|
-
[Call to action - What should the reader do next?]
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
*Have questions? Join our [Discord community](https://discord.gg/bootspring) or reach out on [Twitter](https://twitter.com/bootspring).*
|
|
128
|
-
`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Generate release notes template
|
|
133
|
-
*/
|
|
134
|
-
function generateReleaseNotes(options = {}) {
|
|
135
|
-
const {
|
|
136
|
-
version = '1.0.0',
|
|
137
|
-
date = new Date().toISOString().split('T')[0],
|
|
138
|
-
codename = ''
|
|
139
|
-
} = options;
|
|
140
|
-
|
|
141
|
-
const codenameSection = codename ? ` "${codename}"` : '';
|
|
142
|
-
|
|
143
|
-
return `---
|
|
144
|
-
title: "v${version} Release Notes"
|
|
145
|
-
version: "${version}"
|
|
146
|
-
date: "${date}"
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
# v${version}${codenameSection}
|
|
150
|
-
|
|
151
|
-
> Released on ${date}
|
|
152
|
-
|
|
153
|
-
## Highlights
|
|
154
|
-
|
|
155
|
-
Brief summary of the most important changes in this release.
|
|
156
|
-
|
|
157
|
-
- **Feature 1** - What it does and why it matters
|
|
158
|
-
- **Feature 2** - What it does and why it matters
|
|
159
|
-
- **Feature 3** - What it does and why it matters
|
|
160
|
-
|
|
161
|
-
## What's New
|
|
162
|
-
|
|
163
|
-
### Feature Name
|
|
164
|
-
|
|
165
|
-
Description of the feature and the value it provides to users.
|
|
166
|
-
|
|
167
|
-
**How to use it:**
|
|
168
|
-
|
|
169
|
-
\`\`\`bash
|
|
170
|
-
# Example command or code
|
|
171
|
-
bootspring new-command
|
|
172
|
-
\`\`\`
|
|
173
|
-
|
|
174
|
-
### Another Feature
|
|
175
|
-
|
|
176
|
-
Description of another feature.
|
|
177
|
-
|
|
178
|
-
## Improvements
|
|
179
|
-
|
|
180
|
-
- Improved X by doing Y
|
|
181
|
-
- Enhanced performance of Z
|
|
182
|
-
- Better error messages for W
|
|
183
|
-
|
|
184
|
-
## Bug Fixes
|
|
185
|
-
|
|
186
|
-
- Fixed issue where X caused Y (#123)
|
|
187
|
-
- Resolved crash when Z happened (#124)
|
|
188
|
-
- Corrected display of W in certain conditions
|
|
189
|
-
|
|
190
|
-
## Breaking Changes
|
|
191
|
-
|
|
192
|
-
> **Important:** Please review these changes before upgrading.
|
|
193
|
-
|
|
194
|
-
### Change Name
|
|
195
|
-
|
|
196
|
-
**What changed:** Description of the breaking change.
|
|
197
|
-
|
|
198
|
-
**Migration steps:**
|
|
199
|
-
1. Step 1
|
|
200
|
-
2. Step 2
|
|
201
|
-
3. Step 3
|
|
202
|
-
|
|
203
|
-
**Before:**
|
|
204
|
-
\`\`\`javascript
|
|
205
|
-
// Old code
|
|
206
|
-
\`\`\`
|
|
207
|
-
|
|
208
|
-
**After:**
|
|
209
|
-
\`\`\`javascript
|
|
210
|
-
// New code
|
|
211
|
-
\`\`\`
|
|
212
|
-
|
|
213
|
-
## Deprecations
|
|
214
|
-
|
|
215
|
-
| Deprecated | Use Instead | Removal Version |
|
|
216
|
-
|------------|-------------|-----------------|
|
|
217
|
-
| \`oldMethod()\` | \`newMethod()\` | v${parseInt(version) + 1}.0.0 |
|
|
218
|
-
|
|
219
|
-
## Upgrade Guide
|
|
220
|
-
|
|
221
|
-
### From v${(parseFloat(version) - 0.1).toFixed(1)}.x
|
|
222
|
-
|
|
223
|
-
\`\`\`bash
|
|
224
|
-
# Upgrade command
|
|
225
|
-
npm update @bootspring/cli
|
|
226
|
-
\`\`\`
|
|
227
|
-
|
|
228
|
-
### Compatibility
|
|
229
|
-
|
|
230
|
-
| Dependency | Minimum Version |
|
|
231
|
-
|------------|-----------------|
|
|
232
|
-
| Node.js | 18.0.0 |
|
|
233
|
-
| npm | 9.0.0 |
|
|
234
|
-
|
|
235
|
-
## Contributors
|
|
236
|
-
|
|
237
|
-
Thanks to all contributors who made this release possible!
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
[Full Changelog](https://github.com/bootspring/bootspring/compare/v${(parseFloat(version) - 0.1).toFixed(1)}...v${version})
|
|
242
|
-
`;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Generate documentation page template
|
|
247
|
-
*/
|
|
248
|
-
function generateDocumentation(options = {}) {
|
|
249
|
-
const {
|
|
250
|
-
title = 'Documentation',
|
|
251
|
-
description = '',
|
|
252
|
-
category = 'guides',
|
|
253
|
-
order = 1
|
|
254
|
-
} = options;
|
|
255
|
-
|
|
256
|
-
return `---
|
|
257
|
-
title: "${title}"
|
|
258
|
-
description: "${description}"
|
|
259
|
-
category: "${category}"
|
|
260
|
-
order: ${order}
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
# ${title}
|
|
264
|
-
|
|
265
|
-
${description || 'Introduction to this topic.'}
|
|
266
|
-
|
|
267
|
-
## Prerequisites
|
|
268
|
-
|
|
269
|
-
Before you begin, make sure you have:
|
|
270
|
-
|
|
271
|
-
- [ ] Requirement 1
|
|
272
|
-
- [ ] Requirement 2
|
|
273
|
-
- [ ] Requirement 3
|
|
274
|
-
|
|
275
|
-
## Overview
|
|
276
|
-
|
|
277
|
-
[Brief overview of what this guide covers]
|
|
278
|
-
|
|
279
|
-
## Quick Start
|
|
280
|
-
|
|
281
|
-
\`\`\`bash
|
|
282
|
-
# Get started quickly
|
|
283
|
-
npx bootspring command
|
|
284
|
-
\`\`\`
|
|
285
|
-
|
|
286
|
-
## Step-by-Step Guide
|
|
287
|
-
|
|
288
|
-
### Step 1: Setup
|
|
289
|
-
|
|
290
|
-
[Instructions]
|
|
291
|
-
|
|
292
|
-
\`\`\`typescript
|
|
293
|
-
// Code example
|
|
294
|
-
\`\`\`
|
|
295
|
-
|
|
296
|
-
### Step 2: Configuration
|
|
297
|
-
|
|
298
|
-
[Instructions]
|
|
299
|
-
|
|
300
|
-
### Step 3: Implementation
|
|
301
|
-
|
|
302
|
-
[Instructions]
|
|
303
|
-
|
|
304
|
-
## Examples
|
|
305
|
-
|
|
306
|
-
### Basic Example
|
|
307
|
-
|
|
308
|
-
\`\`\`typescript
|
|
309
|
-
// Basic usage
|
|
310
|
-
\`\`\`
|
|
311
|
-
|
|
312
|
-
### Advanced Example
|
|
313
|
-
|
|
314
|
-
\`\`\`typescript
|
|
315
|
-
// Advanced usage
|
|
316
|
-
\`\`\`
|
|
317
|
-
|
|
318
|
-
## Configuration Options
|
|
319
|
-
|
|
320
|
-
| Option | Type | Default | Description |
|
|
321
|
-
|--------|------|---------|-------------|
|
|
322
|
-
| \`option1\` | string | \`"default"\` | Description |
|
|
323
|
-
| \`option2\` | boolean | \`false\` | Description |
|
|
324
|
-
|
|
325
|
-
## Troubleshooting
|
|
326
|
-
|
|
327
|
-
### Common Issue 1
|
|
328
|
-
|
|
329
|
-
**Problem:** Description of the problem.
|
|
330
|
-
|
|
331
|
-
**Solution:** How to fix it.
|
|
332
|
-
|
|
333
|
-
### Common Issue 2
|
|
334
|
-
|
|
335
|
-
**Problem:** Description of the problem.
|
|
336
|
-
|
|
337
|
-
**Solution:** How to fix it.
|
|
338
|
-
|
|
339
|
-
## Related Resources
|
|
340
|
-
|
|
341
|
-
- [Related Guide 1](/docs/related-1)
|
|
342
|
-
- [Related Guide 2](/docs/related-2)
|
|
343
|
-
- [API Reference](/docs/api)
|
|
344
|
-
|
|
345
|
-
## Next Steps
|
|
346
|
-
|
|
347
|
-
- [ ] Action item 1
|
|
348
|
-
- [ ] Action item 2
|
|
349
|
-
|
|
350
|
-
---
|
|
351
|
-
|
|
352
|
-
<Callout type="info">
|
|
353
|
-
Need help? Join our [Discord community](https://discord.gg/bootspring) for support.
|
|
354
|
-
</Callout>
|
|
355
|
-
`;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Generate README template
|
|
360
|
-
*/
|
|
361
|
-
function generateReadme(options = {}) {
|
|
362
|
-
const {
|
|
363
|
-
name = 'Project',
|
|
364
|
-
description = 'A project built with Bootspring',
|
|
365
|
-
author = '',
|
|
366
|
-
license = 'MIT',
|
|
367
|
-
features = [],
|
|
368
|
-
tech = []
|
|
369
|
-
} = options;
|
|
370
|
-
|
|
371
|
-
const featuresSection = features.length > 0
|
|
372
|
-
? features.map(f => `- **${f.name}** - ${f.description}`).join('\n')
|
|
373
|
-
: '- Feature 1\n- Feature 2\n- Feature 3';
|
|
374
|
-
|
|
375
|
-
const techSection = tech.length > 0
|
|
376
|
-
? tech.map(t => `- ${t}`).join('\n')
|
|
377
|
-
: '- Next.js 14\n- TypeScript\n- Tailwind CSS\n- Prisma';
|
|
378
|
-
|
|
379
|
-
return `# ${name}
|
|
380
|
-
|
|
381
|
-
> ${description}
|
|
382
|
-
|
|
383
|
-
[}.svg)](https://www.npmjs.com/package/${name.toLowerCase()})
|
|
384
|
-
[](LICENSE)
|
|
385
|
-
|
|
386
|
-
## Features
|
|
387
|
-
|
|
388
|
-
${featuresSection}
|
|
389
|
-
|
|
390
|
-
## Tech Stack
|
|
391
|
-
|
|
392
|
-
${techSection}
|
|
393
|
-
|
|
394
|
-
## Quick Start
|
|
395
|
-
|
|
396
|
-
\`\`\`bash
|
|
397
|
-
# Clone the repository
|
|
398
|
-
git clone https://github.com/${author || 'username'}/${name.toLowerCase()}.git
|
|
399
|
-
|
|
400
|
-
# Install dependencies
|
|
401
|
-
npm install
|
|
402
|
-
|
|
403
|
-
# Start development server
|
|
404
|
-
npm run dev
|
|
405
|
-
\`\`\`
|
|
406
|
-
|
|
407
|
-
## Installation
|
|
408
|
-
|
|
409
|
-
\`\`\`bash
|
|
410
|
-
npm install ${name.toLowerCase()}
|
|
411
|
-
\`\`\`
|
|
412
|
-
|
|
413
|
-
## Usage
|
|
414
|
-
|
|
415
|
-
\`\`\`typescript
|
|
416
|
-
import { feature } from '${name.toLowerCase()}';
|
|
417
|
-
|
|
418
|
-
// Basic usage example
|
|
419
|
-
feature.doSomething();
|
|
420
|
-
\`\`\`
|
|
421
|
-
|
|
422
|
-
## Configuration
|
|
423
|
-
|
|
424
|
-
Create a \`config.js\` file in your project root:
|
|
425
|
-
|
|
426
|
-
\`\`\`javascript
|
|
427
|
-
module.exports = {
|
|
428
|
-
// Configuration options
|
|
429
|
-
};
|
|
430
|
-
\`\`\`
|
|
431
|
-
|
|
432
|
-
## Documentation
|
|
433
|
-
|
|
434
|
-
[Full documentation](https://docs.example.com)
|
|
435
|
-
|
|
436
|
-
## Contributing
|
|
437
|
-
|
|
438
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting a PR.
|
|
439
|
-
|
|
440
|
-
## License
|
|
441
|
-
|
|
442
|
-
${license} - see the [LICENSE](LICENSE) file for details.
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
Built with [Bootspring](https://bootspring.com)
|
|
447
|
-
`;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Generate changelog entry template
|
|
452
|
-
*/
|
|
453
|
-
function generateChangelog(options = {}) {
|
|
454
|
-
const {
|
|
455
|
-
version = '1.0.0',
|
|
456
|
-
date = new Date().toISOString().split('T')[0],
|
|
457
|
-
added = [],
|
|
458
|
-
changed = [],
|
|
459
|
-
deprecated = [],
|
|
460
|
-
removed = [],
|
|
461
|
-
fixed = [],
|
|
462
|
-
security = []
|
|
463
|
-
} = options;
|
|
464
|
-
|
|
465
|
-
const sections = [];
|
|
466
|
-
|
|
467
|
-
sections.push(`## [${version}] - ${date}`);
|
|
468
|
-
sections.push('');
|
|
469
|
-
|
|
470
|
-
if (added.length > 0) {
|
|
471
|
-
sections.push('### Added');
|
|
472
|
-
added.forEach(item => sections.push(`- ${item}`));
|
|
473
|
-
sections.push('');
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
if (changed.length > 0) {
|
|
477
|
-
sections.push('### Changed');
|
|
478
|
-
changed.forEach(item => sections.push(`- ${item}`));
|
|
479
|
-
sections.push('');
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
if (deprecated.length > 0) {
|
|
483
|
-
sections.push('### Deprecated');
|
|
484
|
-
deprecated.forEach(item => sections.push(`- ${item}`));
|
|
485
|
-
sections.push('');
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (removed.length > 0) {
|
|
489
|
-
sections.push('### Removed');
|
|
490
|
-
removed.forEach(item => sections.push(`- ${item}`));
|
|
491
|
-
sections.push('');
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
if (fixed.length > 0) {
|
|
495
|
-
sections.push('### Fixed');
|
|
496
|
-
fixed.forEach(item => sections.push(`- ${item}`));
|
|
497
|
-
sections.push('');
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (security.length > 0) {
|
|
501
|
-
sections.push('### Security');
|
|
502
|
-
security.forEach(item => sections.push(`- ${item}`));
|
|
503
|
-
sections.push('');
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return sections.join('\n');
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Generate API documentation template
|
|
511
|
-
*/
|
|
512
|
-
function generateApiDoc(options = {}) {
|
|
513
|
-
const {
|
|
514
|
-
endpoint = '/api/v1/resource',
|
|
515
|
-
method = 'GET',
|
|
516
|
-
title = 'Endpoint',
|
|
517
|
-
description = ''
|
|
518
|
-
} = options;
|
|
519
|
-
|
|
520
|
-
return `---
|
|
521
|
-
title: "${title}"
|
|
522
|
-
method: "${method}"
|
|
523
|
-
endpoint: "${endpoint}"
|
|
524
|
-
---
|
|
525
|
-
|
|
526
|
-
# ${title}
|
|
527
|
-
|
|
528
|
-
${description || 'Description of what this endpoint does.'}
|
|
529
|
-
|
|
530
|
-
## Endpoint
|
|
531
|
-
|
|
532
|
-
\`\`\`
|
|
533
|
-
${method} ${endpoint}
|
|
534
|
-
\`\`\`
|
|
535
|
-
|
|
536
|
-
## Authentication
|
|
537
|
-
|
|
538
|
-
This endpoint requires authentication via Bearer token.
|
|
539
|
-
|
|
540
|
-
| Header | Required | Description |
|
|
541
|
-
|--------|----------|-------------|
|
|
542
|
-
| \`Authorization\` | Yes | Bearer {token} |
|
|
543
|
-
| \`Content-Type\` | Yes | application/json |
|
|
544
|
-
|
|
545
|
-
## Request
|
|
546
|
-
|
|
547
|
-
### Parameters
|
|
548
|
-
|
|
549
|
-
| Parameter | Type | Required | Description |
|
|
550
|
-
|-----------|------|----------|-------------|
|
|
551
|
-
| \`param1\` | string | Yes | Description |
|
|
552
|
-
| \`param2\` | number | No | Description |
|
|
553
|
-
|
|
554
|
-
### Request Body
|
|
555
|
-
|
|
556
|
-
\`\`\`json
|
|
557
|
-
{
|
|
558
|
-
"field1": "value",
|
|
559
|
-
"field2": 123,
|
|
560
|
-
"nested": {
|
|
561
|
-
"property": "value"
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
\`\`\`
|
|
565
|
-
|
|
566
|
-
## Response
|
|
567
|
-
|
|
568
|
-
### Success Response
|
|
569
|
-
|
|
570
|
-
**Code:** 200 OK
|
|
571
|
-
|
|
572
|
-
\`\`\`json
|
|
573
|
-
{
|
|
574
|
-
"success": true,
|
|
575
|
-
"data": {
|
|
576
|
-
"id": "abc123",
|
|
577
|
-
"createdAt": "2024-01-01T00:00:00Z"
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
\`\`\`
|
|
581
|
-
|
|
582
|
-
### Error Responses
|
|
583
|
-
|
|
584
|
-
| Status | Code | Description |
|
|
585
|
-
|--------|------|-------------|
|
|
586
|
-
| 400 | \`INVALID_INPUT\` | Request validation failed |
|
|
587
|
-
| 401 | \`UNAUTHORIZED\` | Missing or invalid token |
|
|
588
|
-
| 403 | \`FORBIDDEN\` | Insufficient permissions |
|
|
589
|
-
| 404 | \`NOT_FOUND\` | Resource not found |
|
|
590
|
-
| 500 | \`INTERNAL_ERROR\` | Server error |
|
|
591
|
-
|
|
592
|
-
## Examples
|
|
593
|
-
|
|
594
|
-
### cURL
|
|
595
|
-
|
|
596
|
-
\`\`\`bash
|
|
597
|
-
curl -X ${method} "${endpoint}" \\
|
|
598
|
-
-H "Authorization: Bearer $TOKEN" \\
|
|
599
|
-
-H "Content-Type: application/json" \\
|
|
600
|
-
-d '{"field1": "value"}'
|
|
601
|
-
\`\`\`
|
|
602
|
-
|
|
603
|
-
### JavaScript
|
|
604
|
-
|
|
605
|
-
\`\`\`typescript
|
|
606
|
-
const response = await fetch('${endpoint}', {
|
|
607
|
-
method: '${method}',
|
|
608
|
-
headers: {
|
|
609
|
-
'Authorization': \`Bearer \${token}\`,
|
|
610
|
-
'Content-Type': 'application/json'
|
|
611
|
-
},
|
|
612
|
-
body: JSON.stringify({
|
|
613
|
-
field1: 'value'
|
|
614
|
-
})
|
|
615
|
-
});
|
|
616
|
-
|
|
617
|
-
const data = await response.json();
|
|
618
|
-
\`\`\`
|
|
619
|
-
|
|
620
|
-
## Rate Limiting
|
|
621
|
-
|
|
622
|
-
| Limit | Window | Scope |
|
|
623
|
-
|-------|--------|-------|
|
|
624
|
-
| 100 | 1 minute | Per API key |
|
|
625
|
-
| 1000 | 1 hour | Per API key |
|
|
626
|
-
|
|
627
|
-
## Changelog
|
|
628
|
-
|
|
629
|
-
| Version | Date | Changes |
|
|
630
|
-
|---------|------|---------|
|
|
631
|
-
| v1 | 2024-01-01 | Initial release |
|
|
632
|
-
`;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
/**
|
|
636
|
-
* Generate tutorial template
|
|
637
|
-
*/
|
|
638
|
-
function generateTutorial(options = {}) {
|
|
639
|
-
const {
|
|
640
|
-
title = 'Tutorial',
|
|
641
|
-
description = '',
|
|
642
|
-
difficulty = 'beginner',
|
|
643
|
-
duration = '15 minutes'
|
|
644
|
-
} = options;
|
|
645
|
-
|
|
646
|
-
return `---
|
|
647
|
-
title: "${title}"
|
|
648
|
-
description: "${description}"
|
|
649
|
-
difficulty: "${difficulty}"
|
|
650
|
-
duration: "${duration}"
|
|
651
|
-
---
|
|
652
|
-
|
|
653
|
-
# ${title}
|
|
654
|
-
|
|
655
|
-
${description || 'Learn how to accomplish a specific task.'}
|
|
656
|
-
|
|
657
|
-
<Callout type="info">
|
|
658
|
-
**Difficulty:** ${difficulty.charAt(0).toUpperCase() + difficulty.slice(1)} | **Duration:** ${duration}
|
|
659
|
-
</Callout>
|
|
660
|
-
|
|
661
|
-
## What You'll Build
|
|
662
|
-
|
|
663
|
-
[Screenshot or diagram of the end result]
|
|
664
|
-
|
|
665
|
-
## Prerequisites
|
|
666
|
-
|
|
667
|
-
Before starting this tutorial, you should have:
|
|
668
|
-
|
|
669
|
-
- [ ] Node.js 18+ installed
|
|
670
|
-
- [ ] Basic understanding of X
|
|
671
|
-
- [ ] Y configured
|
|
672
|
-
|
|
673
|
-
## Step 1: Project Setup
|
|
674
|
-
|
|
675
|
-
First, let's set up the project.
|
|
676
|
-
|
|
677
|
-
\`\`\`bash
|
|
678
|
-
# Create a new project
|
|
679
|
-
npx create-next-app@latest my-project
|
|
680
|
-
cd my-project
|
|
681
|
-
\`\`\`
|
|
682
|
-
|
|
683
|
-
## Step 2: Install Dependencies
|
|
684
|
-
|
|
685
|
-
\`\`\`bash
|
|
686
|
-
npm install package-name
|
|
687
|
-
\`\`\`
|
|
688
|
-
|
|
689
|
-
## Step 3: Configuration
|
|
690
|
-
|
|
691
|
-
Create a configuration file:
|
|
692
|
-
|
|
693
|
-
\`\`\`typescript
|
|
694
|
-
// config.ts
|
|
695
|
-
export const config = {
|
|
696
|
-
// Configuration here
|
|
697
|
-
};
|
|
698
|
-
\`\`\`
|
|
699
|
-
|
|
700
|
-
## Step 4: Implementation
|
|
701
|
-
|
|
702
|
-
Now let's implement the main functionality:
|
|
703
|
-
|
|
704
|
-
\`\`\`typescript
|
|
705
|
-
// Main implementation
|
|
706
|
-
export function feature() {
|
|
707
|
-
// Code here
|
|
708
|
-
}
|
|
709
|
-
\`\`\`
|
|
710
|
-
|
|
711
|
-
## Step 5: Testing
|
|
712
|
-
|
|
713
|
-
Verify everything works:
|
|
714
|
-
|
|
715
|
-
\`\`\`bash
|
|
716
|
-
npm run dev
|
|
717
|
-
\`\`\`
|
|
718
|
-
|
|
719
|
-
Then open http://localhost:3000 and you should see:
|
|
720
|
-
|
|
721
|
-
[Expected result]
|
|
722
|
-
|
|
723
|
-
## Troubleshooting
|
|
724
|
-
|
|
725
|
-
### Issue 1
|
|
726
|
-
|
|
727
|
-
**Problem:** Description of common issue.
|
|
728
|
-
|
|
729
|
-
**Solution:** How to fix it.
|
|
730
|
-
|
|
731
|
-
### Issue 2
|
|
732
|
-
|
|
733
|
-
**Problem:** Another common issue.
|
|
734
|
-
|
|
735
|
-
**Solution:** The fix.
|
|
736
|
-
|
|
737
|
-
## Next Steps
|
|
738
|
-
|
|
739
|
-
Now that you've completed this tutorial:
|
|
740
|
-
|
|
741
|
-
1. Try modifying the code to X
|
|
742
|
-
2. Explore the Y feature
|
|
743
|
-
3. Check out the [advanced tutorial](/docs/tutorials/advanced)
|
|
744
|
-
|
|
745
|
-
## Summary
|
|
746
|
-
|
|
747
|
-
In this tutorial, you learned how to:
|
|
748
|
-
|
|
749
|
-
- Set up the project
|
|
750
|
-
- Configure the dependencies
|
|
751
|
-
- Implement the feature
|
|
752
|
-
- Test your work
|
|
753
|
-
|
|
754
|
-
## Resources
|
|
755
|
-
|
|
756
|
-
- [Official Documentation](/docs)
|
|
757
|
-
- [API Reference](/docs/api)
|
|
758
|
-
- [GitHub Repository](https://github.com/bootspring/bootspring)
|
|
759
|
-
|
|
760
|
-
---
|
|
761
|
-
|
|
762
|
-
<Callout type="success">
|
|
763
|
-
Completed this tutorial? Share your results on [Twitter](https://twitter.com/bootspring)!
|
|
764
|
-
</Callout>
|
|
765
|
-
`;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* Generate content based on type
|
|
770
|
-
*/
|
|
771
|
-
function generate(type, options = {}) {
|
|
772
|
-
switch (type) {
|
|
773
|
-
case 'blog-post':
|
|
774
|
-
return generateBlogPost(options);
|
|
775
|
-
case 'release-notes':
|
|
776
|
-
return generateReleaseNotes(options);
|
|
777
|
-
case 'documentation':
|
|
778
|
-
return generateDocumentation(options);
|
|
779
|
-
case 'readme':
|
|
780
|
-
return generateReadme(options);
|
|
781
|
-
case 'changelog':
|
|
782
|
-
return generateChangelog(options);
|
|
783
|
-
case 'api-doc':
|
|
784
|
-
return generateApiDoc(options);
|
|
785
|
-
case 'tutorial':
|
|
786
|
-
return generateTutorial(options);
|
|
787
|
-
default:
|
|
788
|
-
throw new Error(`Unknown content type: ${type}`);
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
/**
|
|
793
|
-
* Get content type metadata
|
|
794
|
-
*/
|
|
795
|
-
function getContentType(type) {
|
|
796
|
-
return CONTENT_TYPES[type] || null;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
/**
|
|
800
|
-
* List all content types
|
|
801
|
-
*/
|
|
802
|
-
function listContentTypes() {
|
|
803
|
-
return CONTENT_TYPES;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
module.exports = {
|
|
807
|
-
generate,
|
|
808
|
-
getContentType,
|
|
809
|
-
listContentTypes,
|
|
810
|
-
CONTENT_TYPES,
|
|
811
|
-
// Individual generators for direct use
|
|
812
|
-
generateBlogPost,
|
|
813
|
-
generateReleaseNotes,
|
|
814
|
-
generateDocumentation,
|
|
815
|
-
generateReadme,
|
|
816
|
-
generateChangelog,
|
|
817
|
-
generateApiDoc,
|
|
818
|
-
generateTutorial
|
|
819
|
-
};
|