/ opencodehub / scripts / generate-roadmap-issues.mjs
swadhinbiswas feat: OpenCodeHub v1.1.0 - Enterprise Features & Storage Adapters · 2/15/2026
719a1cb
81 lines · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env node
import fs from 'node:fs';
import path from 'node:path';

const repoRoot = process.cwd();
const checklistPath = path.join(repoRoot, 'github-issues-checklist.md');
const outputPath = path.join(repoRoot, 'data', 'github-roadmap-issues.json');

const source = fs.readFileSync(checklistPath, 'utf8');
const lines = source.split(/\r?\n/);

const issueLine = /^- \[ \] (G\d{3}) \| \[(Partial|Missing)\] (.+?) \| WS: `(WS\d+)` \| Phase: `(\d+)` \| Priority: `(low|medium|high)` \| Labels: `([^`]+)`$/;

const issues = [];

for (const line of lines) {
  const match = line.match(issueLine);
  if (!match) continue;

  const [, id, status, feature, ws, phase, priority, labelCsv] = match;
  const labels = labelCsv.split(',').map((label) => label.trim()).filter(Boolean);

  const title = `[${id}] ${feature}`;
  const body = [
    `<!-- roadmap-id:${id} -->`,
    '',
    `## Metadata`,
    `- Gap ID: ${id}`,
    `- Status: ${status}`,
    `- Workstream: ${ws}`,
    `- Phase: ${phase}`,
    `- Priority: ${priority}`,
    '',
    '## Problem',
    'Current state and gap from feature audit.',
    '',
    '## Scope',
    '- Backend/API changes',
    '- UI/UX changes',
    '- Data model/migrations',
    '- Docs updates (`docs/` + `docs-site/src/content/docs/`)',
    '',
    '## Acceptance Criteria',
    '- [ ] Feature behavior complete',
    '- [ ] Authorization/security checks in place',
    '- [ ] Unit/integration/e2e tests added',
    '- [ ] `lint` + `typecheck` + tests pass',
    '- [ ] Docs updated in both doc trees',
    '',
    '## Technical Notes',
    'Relevant files/modules, rollout/rollback plan, migration details.',
    '',
    '## Source',
    '- Checklist: `github-issues-checklist.md`',
    '- Roadmap: `notimplemented.md`',
  ].join('\n');

  issues.push({
    id,
    status: status.toLowerCase(),
    feature,
    ws,
    phase: Number(phase),
    priority,
    labels,
    title,
    body,
  });
}

if (issues.length === 0) {
  throw new Error('No issue rows parsed from github-issues-checklist.md');
}

issues.sort((a, b) => a.id.localeCompare(b.id));

fs.mkdirSync(path.dirname(outputPath), { recursive: true });
fs.writeFileSync(outputPath, `${JSON.stringify(issues, null, 2)}\n`, 'utf8');

console.log(`Generated ${issues.length} issues -> ${path.relative(repoRoot, outputPath)}`);