specweave 0.30.12 → 0.30.14
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/.claude-plugin/marketplace.json +0 -11
- package/CLAUDE.md +1 -1
- package/bin/fix-marketplace-errors.sh +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +13 -0
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/helpers/ado-area-selector.d.ts.map +1 -1
- package/dist/src/cli/helpers/ado-area-selector.js +13 -0
- package/dist/src/cli/helpers/ado-area-selector.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +7 -2
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts +7 -0
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +33 -2
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
- package/dist/src/cli/workers/clone-worker.js +19 -3
- package/dist/src/cli/workers/clone-worker.js.map +1 -1
- package/dist/src/core/living-docs/board-matcher.d.ts +120 -0
- package/dist/src/core/living-docs/board-matcher.d.ts.map +1 -0
- package/dist/src/core/living-docs/board-matcher.js +466 -0
- package/dist/src/core/living-docs/board-matcher.js.map +1 -0
- package/dist/src/core/living-docs/foundation-builder.js +1 -1
- package/dist/src/core/living-docs/foundation-builder.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +19 -8
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +148 -52
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/living-docs/suggestions-generator.js +1 -1
- package/dist/src/core/living-docs/suggestions-generator.js.map +1 -1
- package/dist/src/core/living-docs/umbrella-detector.d.ts +4 -0
- package/dist/src/core/living-docs/umbrella-detector.d.ts.map +1 -1
- package/dist/src/core/living-docs/umbrella-detector.js +20 -1
- package/dist/src/core/living-docs/umbrella-detector.js.map +1 -1
- package/dist/src/core/living-docs/workitem-matcher.js +5 -5
- package/dist/src/core/living-docs/workitem-matcher.js.map +1 -1
- package/dist/src/importers/item-converter.d.ts +4 -0
- package/dist/src/importers/item-converter.d.ts.map +1 -1
- package/dist/src/importers/item-converter.js +4 -0
- package/dist/src/importers/item-converter.js.map +1 -1
- package/dist/src/init/repo/types.d.ts +1 -1
- package/dist/src/living-docs/enterprise-analyzer.d.ts.map +1 -1
- package/dist/src/living-docs/enterprise-analyzer.js +70 -19
- package/dist/src/living-docs/enterprise-analyzer.js.map +1 -1
- package/dist/src/living-docs/epic-id-allocator.d.ts +4 -0
- package/dist/src/living-docs/epic-id-allocator.d.ts.map +1 -1
- package/dist/src/living-docs/epic-id-allocator.js +4 -0
- package/dist/src/living-docs/epic-id-allocator.js.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.d.ts +4 -0
- package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.js +4 -0
- package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
- package/dist/src/living-docs/smart-doc-organizer.d.ts +114 -0
- package/dist/src/living-docs/smart-doc-organizer.d.ts.map +1 -0
- package/dist/src/living-docs/smart-doc-organizer.js +535 -0
- package/dist/src/living-docs/smart-doc-organizer.js.map +1 -0
- package/package.json +13 -13
- package/plugins/PLUGINS-INDEX.md +2 -3
- package/plugins/specweave/commands/specweave-judge.md +265 -0
- package/plugins/specweave/commands/specweave-organize-docs.md +185 -0
- package/plugins/specweave/hooks/hooks.json +3 -3
- package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -0
- package/plugins/specweave/hooks/universal/hook-wrapper.sh +67 -0
- package/plugins/specweave-ado/commands/{specweave-ado-close-workitem.md → close.md} +9 -5
- package/plugins/specweave-ado/commands/{specweave-ado-create-workitem.md → create.md} +9 -5
- package/plugins/specweave-ado/commands/pull.md +459 -0
- package/plugins/specweave-ado/commands/push.md +361 -0
- package/plugins/specweave-ado/commands/{specweave-ado-status.md → status.md} +12 -0
- package/plugins/specweave-ado/commands/{specweave-ado-sync.md → sync.md} +64 -3
- package/plugins/specweave-ado/hooks/README.md +1 -1
- package/plugins/specweave-docs/commands/build.md +158 -0
- package/plugins/specweave-docs/commands/{docs-generate.md → generate.md} +10 -5
- package/plugins/specweave-docs/commands/health.md +268 -0
- package/plugins/specweave-docs/commands/{docs-init.md → init.md} +11 -6
- package/plugins/specweave-docs/commands/organize.md +184 -0
- package/plugins/specweave-docs/commands/preview.md +138 -0
- package/plugins/specweave-docs/skills/preview/SKILL.md +105 -0
- package/plugins/specweave-github/agents/user-story-updater/AGENT.md +1 -1
- package/plugins/specweave-github/commands/{specweave-github-close-issue.md → close.md} +2 -2
- package/plugins/specweave-github/commands/{specweave-github-create-issue.md → create.md} +2 -2
- package/plugins/specweave-github/commands/pull.md +142 -0
- package/plugins/specweave-github/commands/push.md +154 -0
- package/plugins/specweave-github/commands/{specweave-github-sync.md → sync.md} +19 -5
- package/plugins/specweave-github/commands/{specweave-github-update-user-story.md → update-user-story.md} +1 -1
- package/plugins/specweave-github/hooks/README.md +1 -1
- package/plugins/specweave-jira/commands/pull.md +164 -0
- package/plugins/specweave-jira/commands/push.md +170 -0
- package/plugins/specweave-jira/commands/{specweave-jira-sync.md → sync.md} +18 -3
- package/plugins/specweave-jira/hooks/README.md +1 -1
- package/plugins/specweave-kafka/README.md +20 -0
- package/plugins/specweave-kafka/benchmarks/kafka-throughput.benchmark.ts +551 -0
- package/plugins/specweave-kafka/examples/README.md +191 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/.env.example +8 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/README.md +69 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/consumer.js +37 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/package.json +14 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/producer.js +57 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/.env.example +5 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/README.md +30 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/eos-pipeline.js +79 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/package.json +11 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/.env.example +4 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/README.md +30 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/package.json +11 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/windowed-aggregation.js +66 -0
- package/plugins/specweave-kafka/examples/n8n-workflow/README.md +54 -0
- package/plugins/specweave-kafka/examples/n8n-workflow/docker-compose.yml +19 -0
- package/plugins/specweave-kafka/examples/n8n-workflow/kafka-to-slack.json +50 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/.env.example +15 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/README.md +183 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/consumer.js +60 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/docker-compose.yml +30 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/package.json +18 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/producer.js +52 -0
- package/plugins/specweave-release/commands/specweave-release-npm.md +26 -239
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +0 -21
- package/plugins/specweave-docs-preview/commands/build.md +0 -489
- package/plugins/specweave-docs-preview/commands/preview.md +0 -355
- package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +0 -386
- /package/plugins/specweave-ado/commands/{specweave-ado-clone-repos.md → clone.md} +0 -0
- /package/plugins/specweave-ado/commands/{specweave-ado-import-areas.md → import-areas.md} +0 -0
- /package/plugins/specweave-ado/commands/{specweave-ado-import-projects.md → import-projects.md} +0 -0
- /package/plugins/specweave-github/commands/{specweave-github-cleanup-duplicates.md → cleanup-duplicates.md} +0 -0
- /package/plugins/specweave-github/commands/{specweave-github-reconcile.md → reconcile.md} +0 -0
- /package/plugins/specweave-github/commands/{specweave-github-status.md → status.md} +0 -0
- /package/plugins/specweave-jira/commands/{specweave-jira-import-boards.md → import-boards.md} +0 -0
- /package/plugins/specweave-jira/commands/{specweave-jira-import-projects.md → import-projects-full.md} +0 -0
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: specweave-docs-preview:build
|
|
3
|
-
description: Build static documentation site for deployment. Generates production-ready HTML/CSS/JS files optimized for static hosting.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Documentation Build Command
|
|
7
|
-
|
|
8
|
-
Build a production-ready static documentation site from your SpecWeave living documentation.
|
|
9
|
-
|
|
10
|
-
## Your Task
|
|
11
|
-
|
|
12
|
-
Execute the following workflow to build the static documentation site:
|
|
13
|
-
|
|
14
|
-
### Step 1: Load the Build Utilities
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
import { buildStaticSite, isSetupNeeded } from '../../../src/utils/docs-preview/index.js';
|
|
18
|
-
import * as fs from 'fs-extra';
|
|
19
|
-
import * as path from 'path';
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Step 2: Check Prerequisites
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
const projectRoot = process.cwd();
|
|
26
|
-
|
|
27
|
-
// Check if docs preview is configured
|
|
28
|
-
const configPath = path.join(projectRoot, '.specweave', 'config.json');
|
|
29
|
-
let config: any = {};
|
|
30
|
-
if (fs.existsSync(configPath)) {
|
|
31
|
-
config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const docsConfig = config.documentation?.preview || {};
|
|
35
|
-
|
|
36
|
-
console.log('\n📦 Building Documentation Site...\n');
|
|
37
|
-
|
|
38
|
-
// Check if Docusaurus is installed
|
|
39
|
-
const setupNeeded = await isSetupNeeded(projectRoot);
|
|
40
|
-
|
|
41
|
-
if (setupNeeded) {
|
|
42
|
-
console.error('❌ Docusaurus not installed\n');
|
|
43
|
-
console.log('💡 Solution:');
|
|
44
|
-
console.log(' Run: /specweave-docs-preview:preview');
|
|
45
|
-
console.log(' This will install Docusaurus first\n');
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Step 3: Build the Static Site
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
try {
|
|
54
|
-
console.log('ℹ️ Building production site...');
|
|
55
|
-
console.log(' • Compiling React components');
|
|
56
|
-
console.log(' • Optimizing assets');
|
|
57
|
-
console.log(' • Generating static HTML\n');
|
|
58
|
-
|
|
59
|
-
await buildStaticSite(projectRoot);
|
|
60
|
-
|
|
61
|
-
const buildPath = path.join(projectRoot, '.specweave', 'docs-site-internal', 'build');
|
|
62
|
-
const buildStats = await getBuildStats(buildPath);
|
|
63
|
-
|
|
64
|
-
console.log('\n✅ Build Complete!\n');
|
|
65
|
-
console.log('📊 Build Statistics:');
|
|
66
|
-
console.log(` • Pages: ${buildStats.pages} HTML files`);
|
|
67
|
-
console.log(` • Size: ${buildStats.totalSize}`);
|
|
68
|
-
console.log(` • Location: ${buildPath}\n`);
|
|
69
|
-
|
|
70
|
-
console.log('🚀 Deployment Options:\n');
|
|
71
|
-
console.log('1️⃣ Netlify:');
|
|
72
|
-
console.log(' cd .specweave/docs-site-internal');
|
|
73
|
-
console.log(' npx netlify deploy --dir=build --prod\n');
|
|
74
|
-
|
|
75
|
-
console.log('2️⃣ Vercel:');
|
|
76
|
-
console.log(' cd .specweave/docs-site-internal');
|
|
77
|
-
console.log(' npx vercel --prod\n');
|
|
78
|
-
|
|
79
|
-
console.log('3️⃣ GitHub Pages:');
|
|
80
|
-
console.log(' cp -r build/* docs/');
|
|
81
|
-
console.log(' git add docs/ && git commit -m "docs: update"');
|
|
82
|
-
console.log(' git push\n');
|
|
83
|
-
|
|
84
|
-
console.log('4️⃣ Static Server (local test):');
|
|
85
|
-
console.log(' npx serve build/\n');
|
|
86
|
-
|
|
87
|
-
console.log('5️⃣ Your own server:');
|
|
88
|
-
console.log(' scp -r build/* user@server:/var/www/docs/\n');
|
|
89
|
-
|
|
90
|
-
} catch (error: any) {
|
|
91
|
-
console.error('\n❌ Build Failed\n');
|
|
92
|
-
console.error(`Error: ${error.message}\n`);
|
|
93
|
-
|
|
94
|
-
console.log('💡 Troubleshooting:');
|
|
95
|
-
console.log(' • Check all markdown files have valid frontmatter');
|
|
96
|
-
console.log(' • Ensure no broken internal links');
|
|
97
|
-
console.log(' • Run preview first to catch errors: /specweave-docs-preview:preview');
|
|
98
|
-
console.log(' • Check build logs above for specific errors\n');
|
|
99
|
-
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Step 4: Helper Function - Get Build Statistics
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
async function getBuildStats(buildPath: string): Promise<{
|
|
108
|
-
pages: number;
|
|
109
|
-
totalSize: string;
|
|
110
|
-
}> {
|
|
111
|
-
let pages = 0;
|
|
112
|
-
let totalBytes = 0;
|
|
113
|
-
|
|
114
|
-
async function walk(dir: string) {
|
|
115
|
-
const files = await fs.readdir(dir);
|
|
116
|
-
for (const file of files) {
|
|
117
|
-
const filePath = path.join(dir, file);
|
|
118
|
-
const stats = await fs.stat(filePath);
|
|
119
|
-
if (stats.isDirectory()) {
|
|
120
|
-
await walk(filePath);
|
|
121
|
-
} else {
|
|
122
|
-
totalBytes += stats.size;
|
|
123
|
-
if (file.endsWith('.html')) {
|
|
124
|
-
pages++;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
await walk(buildPath);
|
|
131
|
-
|
|
132
|
-
const totalMB = (totalBytes / 1024 / 1024).toFixed(2);
|
|
133
|
-
return {
|
|
134
|
-
pages,
|
|
135
|
-
totalSize: `${totalMB} MB`
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## What Gets Built
|
|
141
|
-
|
|
142
|
-
### Output Directory Structure
|
|
143
|
-
```
|
|
144
|
-
.specweave/docs-site-internal/build/
|
|
145
|
-
├── index.html ← Landing page
|
|
146
|
-
├── docs/
|
|
147
|
-
│ ├── strategy/
|
|
148
|
-
│ │ ├── prd-001/
|
|
149
|
-
│ │ │ └── index.html
|
|
150
|
-
│ │ └── okrs/
|
|
151
|
-
│ │ └── index.html
|
|
152
|
-
│ ├── specs/
|
|
153
|
-
│ │ ├── spec-001-auth/
|
|
154
|
-
│ │ │ └── index.html
|
|
155
|
-
│ │ └── spec-002-payments/
|
|
156
|
-
│ │ └── index.html
|
|
157
|
-
│ └── architecture/
|
|
158
|
-
│ ├── hld-system/
|
|
159
|
-
│ │ └── index.html
|
|
160
|
-
│ └── adr/
|
|
161
|
-
│ └── 0001-database-choice/
|
|
162
|
-
│ └── index.html
|
|
163
|
-
├── assets/
|
|
164
|
-
│ ├── css/
|
|
165
|
-
│ │ └── styles.[hash].css ← Optimized CSS
|
|
166
|
-
│ ├── js/
|
|
167
|
-
│ │ └── runtime.[hash].js ← React runtime
|
|
168
|
-
│ └── images/ ← Optimized images
|
|
169
|
-
└── sitemap.xml ← Search engine sitemap
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Build Optimizations
|
|
173
|
-
1. **Code Splitting**: React chunks loaded on demand
|
|
174
|
-
2. **Asset Optimization**: CSS/JS minified and compressed
|
|
175
|
-
3. **Image Optimization**: Auto-resized and compressed
|
|
176
|
-
4. **Static HTML**: Pre-rendered pages for fast loading
|
|
177
|
-
5. **Search Index**: Pre-generated search index
|
|
178
|
-
6. **Sitemap**: Auto-generated for SEO
|
|
179
|
-
|
|
180
|
-
## Deployment Examples
|
|
181
|
-
|
|
182
|
-
### Netlify (Recommended)
|
|
183
|
-
|
|
184
|
-
**Option 1: CLI**
|
|
185
|
-
```bash
|
|
186
|
-
cd .specweave/docs-site-internal
|
|
187
|
-
npx netlify deploy --dir=build --prod
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
**Option 2: Drag & Drop**
|
|
191
|
-
1. Go to https://app.netlify.com/drop
|
|
192
|
-
2. Drag `.specweave/docs-site-internal/build/` folder
|
|
193
|
-
3. Done! Get instant URL
|
|
194
|
-
|
|
195
|
-
**Option 3: Git Integration**
|
|
196
|
-
1. Create `netlify.toml`:
|
|
197
|
-
```toml
|
|
198
|
-
[build]
|
|
199
|
-
base = ".specweave/docs-site-internal"
|
|
200
|
-
publish = "build"
|
|
201
|
-
command = "npm run build"
|
|
202
|
-
```
|
|
203
|
-
2. Connect GitHub repo
|
|
204
|
-
3. Auto-deploy on push
|
|
205
|
-
|
|
206
|
-
### Vercel
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
cd .specweave/docs-site-internal
|
|
210
|
-
npx vercel --prod
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### GitHub Pages
|
|
214
|
-
|
|
215
|
-
**Option 1: docs/ folder**
|
|
216
|
-
```bash
|
|
217
|
-
# 1. Copy build to docs/
|
|
218
|
-
cp -r .specweave/docs-site-internal/build/* docs/
|
|
219
|
-
|
|
220
|
-
# 2. Enable GitHub Pages
|
|
221
|
-
# Go to Settings → Pages → Source: main branch /docs folder
|
|
222
|
-
|
|
223
|
-
# 3. Push
|
|
224
|
-
git add docs/
|
|
225
|
-
git commit -m "docs: update documentation site"
|
|
226
|
-
git push
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
**Option 2: gh-pages branch**
|
|
230
|
-
```bash
|
|
231
|
-
# 1. Install gh-pages
|
|
232
|
-
npm install -g gh-pages
|
|
233
|
-
|
|
234
|
-
# 2. Deploy
|
|
235
|
-
gh-pages -d .specweave/docs-site-internal/build
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### AWS S3 + CloudFront
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
# 1. Sync to S3
|
|
242
|
-
aws s3 sync .specweave/docs-site-internal/build/ s3://your-bucket/ \
|
|
243
|
-
--delete \
|
|
244
|
-
--cache-control "max-age=31536000,public"
|
|
245
|
-
|
|
246
|
-
# 2. Invalidate CloudFront
|
|
247
|
-
aws cloudfront create-invalidation \
|
|
248
|
-
--distribution-id YOUR_DIST_ID \
|
|
249
|
-
--paths "/*"
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Docker + Nginx
|
|
253
|
-
|
|
254
|
-
**Dockerfile:**
|
|
255
|
-
```dockerfile
|
|
256
|
-
FROM nginx:alpine
|
|
257
|
-
COPY .specweave/docs-site-internal/build/ /usr/share/nginx/html/
|
|
258
|
-
EXPOSE 80
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
**Build and run:**
|
|
262
|
-
```bash
|
|
263
|
-
docker build -t docs .
|
|
264
|
-
docker run -p 80:80 docs
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Your Own Server
|
|
268
|
-
|
|
269
|
-
**Nginx config:**
|
|
270
|
-
```nginx
|
|
271
|
-
server {
|
|
272
|
-
listen 80;
|
|
273
|
-
server_name docs.example.com;
|
|
274
|
-
root /var/www/docs;
|
|
275
|
-
index index.html;
|
|
276
|
-
|
|
277
|
-
location / {
|
|
278
|
-
try_files $uri $uri/ /index.html;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
**Deploy:**
|
|
284
|
-
```bash
|
|
285
|
-
scp -r .specweave/docs-site-internal/build/* user@server:/var/www/docs/
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
## Testing Before Deployment
|
|
289
|
-
|
|
290
|
-
### Local Testing with Serve
|
|
291
|
-
|
|
292
|
-
```bash
|
|
293
|
-
# 1. Install serve
|
|
294
|
-
npm install -g serve
|
|
295
|
-
|
|
296
|
-
# 2. Serve build folder
|
|
297
|
-
cd .specweave/docs-site-internal
|
|
298
|
-
serve build/
|
|
299
|
-
|
|
300
|
-
# 3. Open browser
|
|
301
|
-
# Visit: http://localhost:3000
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
### Check Lighthouse Scores
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
# 1. Install lighthouse
|
|
308
|
-
npm install -g lighthouse
|
|
309
|
-
|
|
310
|
-
# 2. Run audit
|
|
311
|
-
lighthouse http://localhost:3000 \
|
|
312
|
-
--view \
|
|
313
|
-
--output html
|
|
314
|
-
|
|
315
|
-
# Expected scores:
|
|
316
|
-
# Performance: 100
|
|
317
|
-
# Accessibility: 100
|
|
318
|
-
# Best Practices: 100
|
|
319
|
-
# SEO: 100
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
## Expected Output
|
|
323
|
-
|
|
324
|
-
**Successful Build:**
|
|
325
|
-
```
|
|
326
|
-
📦 Building Documentation Site...
|
|
327
|
-
|
|
328
|
-
ℹ️ Building production site...
|
|
329
|
-
• Compiling React components
|
|
330
|
-
• Optimizing assets
|
|
331
|
-
• Generating static HTML
|
|
332
|
-
|
|
333
|
-
[==================================] 100%
|
|
334
|
-
|
|
335
|
-
✅ Build Complete!
|
|
336
|
-
|
|
337
|
-
📊 Build Statistics:
|
|
338
|
-
• Pages: 42 HTML files
|
|
339
|
-
• Size: 3.2 MB
|
|
340
|
-
• Location: /project/.specweave/docs-site-internal/build/
|
|
341
|
-
|
|
342
|
-
🚀 Deployment Options:
|
|
343
|
-
|
|
344
|
-
1️⃣ Netlify:
|
|
345
|
-
cd .specweave/docs-site-internal
|
|
346
|
-
npx netlify deploy --dir=build --prod
|
|
347
|
-
|
|
348
|
-
2️⃣ Vercel:
|
|
349
|
-
cd .specweave/docs-site-internal
|
|
350
|
-
npx vercel --prod
|
|
351
|
-
|
|
352
|
-
3️⃣ GitHub Pages:
|
|
353
|
-
cp -r build/* docs/
|
|
354
|
-
git add docs/ && git commit -m "docs: update"
|
|
355
|
-
git push
|
|
356
|
-
|
|
357
|
-
4️⃣ Static Server (local test):
|
|
358
|
-
npx serve build/
|
|
359
|
-
|
|
360
|
-
5️⃣ Your own server:
|
|
361
|
-
scp -r build/* user@server:/var/www/docs/
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
## Common Build Errors
|
|
365
|
-
|
|
366
|
-
### Invalid Frontmatter
|
|
367
|
-
```
|
|
368
|
-
Error: Invalid frontmatter in file: spec-001.md
|
|
369
|
-
```
|
|
370
|
-
**Fix:**
|
|
371
|
-
```markdown
|
|
372
|
-
---
|
|
373
|
-
title: User Authentication
|
|
374
|
-
sidebar_position: 1
|
|
375
|
-
---
|
|
376
|
-
|
|
377
|
-
Content here...
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### Broken Links
|
|
381
|
-
```
|
|
382
|
-
Error: Broken link in file: architecture/hld.md
|
|
383
|
-
Link: ../specs/missing-file.md
|
|
384
|
-
```
|
|
385
|
-
**Fix:** Update or remove broken links
|
|
386
|
-
|
|
387
|
-
### Missing Dependencies
|
|
388
|
-
```
|
|
389
|
-
Error: Module not found: 'react'
|
|
390
|
-
```
|
|
391
|
-
**Fix:**
|
|
392
|
-
```bash
|
|
393
|
-
cd .specweave/docs-site-internal
|
|
394
|
-
npm install
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
## Build vs Preview
|
|
398
|
-
|
|
399
|
-
| Aspect | Preview (`/specweave-docs-preview:preview`) | Build (`/specweave-docs-preview:build`) |
|
|
400
|
-
|--------|---------------------------------------------|----------------------------------------|
|
|
401
|
-
| **Purpose** | Development, hot reload | Production deployment |
|
|
402
|
-
| **Speed** | Instant start | 5-10 seconds build |
|
|
403
|
-
| **Output** | Dev server | Static files |
|
|
404
|
-
| **Hot Reload** | ✅ Yes | ❌ No |
|
|
405
|
-
| **Optimization** | ❌ No | ✅ Yes (minified, compressed) |
|
|
406
|
-
| **Search** | ✅ Works | ✅ Pre-generated index |
|
|
407
|
-
| **Use When** | Editing docs | Deploying to server |
|
|
408
|
-
|
|
409
|
-
## Best Practices
|
|
410
|
-
|
|
411
|
-
### 1. Build Before Every Deployment
|
|
412
|
-
Always build fresh before deploying:
|
|
413
|
-
```bash
|
|
414
|
-
/specweave-docs-preview:build
|
|
415
|
-
# Then deploy
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### 2. Test Build Locally
|
|
419
|
-
```bash
|
|
420
|
-
/specweave-docs-preview:build
|
|
421
|
-
cd .specweave/docs-site-internal
|
|
422
|
-
npx serve build/
|
|
423
|
-
# Visit http://localhost:3000 and test
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
### 3. Check All Pages
|
|
427
|
-
- Click through every page
|
|
428
|
-
- Test search functionality
|
|
429
|
-
- Verify all links work
|
|
430
|
-
- Check mobile responsiveness
|
|
431
|
-
|
|
432
|
-
### 4. Optimize Images
|
|
433
|
-
Before building, optimize images:
|
|
434
|
-
```bash
|
|
435
|
-
# Install sharp-cli
|
|
436
|
-
npm install -g sharp-cli
|
|
437
|
-
|
|
438
|
-
# Optimize images
|
|
439
|
-
sharp -i docs/images/*.png -o docs/images/optimized/ -q 80
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### 5. Update Sitemap
|
|
443
|
-
The sitemap is auto-generated, but verify it:
|
|
444
|
-
```bash
|
|
445
|
-
cat .specweave/docs-site-internal/build/sitemap.xml
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
## Integration with CI/CD
|
|
449
|
-
|
|
450
|
-
### GitHub Actions
|
|
451
|
-
|
|
452
|
-
**.github/workflows/docs.yml:**
|
|
453
|
-
```yaml
|
|
454
|
-
name: Deploy Docs
|
|
455
|
-
|
|
456
|
-
on:
|
|
457
|
-
push:
|
|
458
|
-
branches: [main]
|
|
459
|
-
paths:
|
|
460
|
-
- '.specweave/docs/**'
|
|
461
|
-
|
|
462
|
-
jobs:
|
|
463
|
-
deploy:
|
|
464
|
-
runs-on: ubuntu-latest
|
|
465
|
-
steps:
|
|
466
|
-
- uses: actions/checkout@v3
|
|
467
|
-
- uses: actions/setup-node@v3
|
|
468
|
-
with:
|
|
469
|
-
node-version: 20
|
|
470
|
-
|
|
471
|
-
- name: Install SpecWeave
|
|
472
|
-
run: npm install -g specweave
|
|
473
|
-
|
|
474
|
-
- name: Build Docs
|
|
475
|
-
run: specweave docs build
|
|
476
|
-
|
|
477
|
-
- name: Deploy to Netlify
|
|
478
|
-
run: |
|
|
479
|
-
cd .specweave/docs-site-internal
|
|
480
|
-
npx netlify deploy --dir=build --prod
|
|
481
|
-
env:
|
|
482
|
-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
## See Also
|
|
486
|
-
|
|
487
|
-
- `/specweave-docs-preview:preview` - Preview docs locally with hot reload
|
|
488
|
-
- `specweave-docs` plugin - Documentation workflow skills
|
|
489
|
-
- Docusaurus docs: https://docusaurus.io/docs/deployment
|