@purview-dev/pm-docs-site 0.0.0-stage → 0.1.0-pre.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.
Files changed (69) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +219 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +90 -0
  5. package/dist/index.d.ts +7 -0
  6. package/dist/index.js +118 -0
  7. package/dist/options.d.ts +5 -0
  8. package/dist/options.js +46 -0
  9. package/dist/repo-docs.d.ts +33 -0
  10. package/dist/repo-docs.js +94 -0
  11. package/dist/schema-version.d.ts +10 -0
  12. package/dist/schema-version.js +19 -0
  13. package/dist/sidebar.d.ts +10 -0
  14. package/dist/sidebar.js +30 -0
  15. package/dist/site-options.d.ts +9 -0
  16. package/dist/site-options.js +39 -0
  17. package/dist/types.d.ts +47 -0
  18. package/dist/types.js +4 -0
  19. package/lib/repo-docs.ts +124 -0
  20. package/lib/schema-version.ts +24 -0
  21. package/package.json +68 -5
  22. package/src/components/ExportStamp.astro +29 -0
  23. package/src/components/FeatureSummary.astro +160 -0
  24. package/src/components/FeatureTable.astro +64 -0
  25. package/src/components/ItemDetail.astro +16 -0
  26. package/src/components/ItemDialog.astro +16 -0
  27. package/src/components/LinkedFrom.astro +33 -0
  28. package/src/components/LinkedText.astro +12 -0
  29. package/src/components/PlanInteractions.astro +30 -0
  30. package/src/components/RefLink.astro +18 -0
  31. package/src/components/StateBadge.astro +15 -0
  32. package/src/components/board/Board.tsx +244 -0
  33. package/src/components/board/KanbanItemCard.tsx +129 -0
  34. package/src/components/board/LinkRuns.tsx +21 -0
  35. package/src/components/board/TaskKanbanCard.tsx +81 -0
  36. package/src/components/board/useBoardUrlState.ts +41 -0
  37. package/src/components/lib/KanbanItemCard.astro +264 -0
  38. package/src/components/lib/StatusTimelineFeed.astro +194 -0
  39. package/src/components/lib/TaskKanbanCard.astro +215 -0
  40. package/src/components/timeline/Timeline.tsx +159 -0
  41. package/src/components/timeline/useTimelineLayout.ts +39 -0
  42. package/src/content.config.ts +16 -0
  43. package/src/env.d.ts +7 -0
  44. package/src/lib/board-data.ts +84 -0
  45. package/src/lib/board.ts +209 -0
  46. package/src/lib/planning-types.ts +207 -0
  47. package/src/lib/planning.ts +415 -0
  48. package/src/lib/references.ts +360 -0
  49. package/src/lib/timeline.ts +156 -0
  50. package/src/loaders/repo-docs.ts +69 -0
  51. package/src/pages/index.astro +158 -0
  52. package/src/pages/plan/board.astro +41 -0
  53. package/src/pages/plan/log.astro +83 -0
  54. package/src/pages/plan/risks/[id].astro +72 -0
  55. package/src/pages/plan/risks.astro +263 -0
  56. package/src/pages/plan/roadmap.astro +108 -0
  57. package/src/routes/plan/briefs.astro +66 -0
  58. package/src/routes/plan/features/[id].astro +113 -0
  59. package/src/routes/plan/features/index.astro +29 -0
  60. package/src/routes/plan/inbox.astro +78 -0
  61. package/src/routes/plan/milestones/[milestone].astro +113 -0
  62. package/src/routes/plan/milestones/index.astro +56 -0
  63. package/src/routes/plan/now.astro +135 -0
  64. package/src/routes/plan/strategy.astro +194 -0
  65. package/src/scripts/plan.ts +40 -0
  66. package/src/styles/components.css +491 -0
  67. package/src/styles/kanban.css +277 -0
  68. package/src/styles/timeline.css +210 -0
  69. package/src/styles/width.css +4 -0
@@ -0,0 +1,135 @@
1
+ ---
2
+ // The active item from planning.json's `now` and `plan`: its Done when checks,
3
+ // the last checkpoint, and one task card per task in its plan.
4
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
5
+
6
+ import ExportStamp from '../../components/ExportStamp.astro';
7
+ import LinkedText from '../../components/LinkedText.astro';
8
+ import TaskKanbanCard from '../../components/lib/TaskKanbanCard.astro';
9
+ import RefLink from '../../components/RefLink.astro';
10
+ import { docsHref, initials, loadPlanning, planProgress, sizeToPriority } from '../../lib/planning';
11
+ import { siteRefs } from '../../lib/references';
12
+ import '../../styles/components.css';
13
+
14
+ const planning = loadPlanning();
15
+ const { now, plan } = planning;
16
+ const card = planning.board.columns.now[0];
17
+ const priority = ({ low: 'low', medium: 'med', high: 'high' } as const)[sizeToPriority(card?.size ?? null)];
18
+
19
+ const paths = [
20
+ { label: 'Brief', path: now.brief },
21
+ { label: 'Spec', path: now.spec },
22
+ { label: 'Plan', path: now.plan },
23
+ ].filter((entry): entry is { label: string; path: string } => entry.path !== null);
24
+
25
+ const checkpoint = now.checkpoint
26
+ ? [
27
+ { label: 'Stopped at', value: now.checkpoint.stoppedAt },
28
+ { label: 'Next action', value: now.checkpoint.nextAction },
29
+ { label: 'Start with', value: now.checkpoint.startWith },
30
+ { label: 'Decisions', value: now.checkpoint.decisions },
31
+ { label: 'Context', value: now.checkpoint.context },
32
+ { label: 'Open question', value: now.checkpoint.openQuestion },
33
+ ].filter((entry) => entry.value !== null)
34
+ : [];
35
+ ---
36
+
37
+ <StarlightPage frontmatter={{ title: 'Now', description: 'The active item: its Done when checks, the last checkpoint, and its plan.', tableOfContents: false }}>
38
+ <ExportStamp />
39
+
40
+ {!now.item && <p class="plan-empty">Nothing is in progress.</p>}
41
+
42
+ {
43
+ now.item && (
44
+ <>
45
+ <h2>
46
+ <RefLink ref={now.item.id} />
47
+ </h2>
48
+ <dl class="plan-facts">
49
+ <div>
50
+ <dt>Stage</dt>
51
+ <dd>{now.stage ?? '–'}</dd>
52
+ </div>
53
+ <div>
54
+ <dt>Started</dt>
55
+ <dd>{now.started ?? '–'}</dd>
56
+ </div>
57
+ <div>
58
+ <dt>Session</dt>
59
+ <dd>{now.session ?? '–'}</dd>
60
+ </div>
61
+ <div>
62
+ <dt>Plan steps</dt>
63
+ <dd>{plan ? `${plan.checked} of ${plan.total} (${planProgress(plan)}%)` : 'No plan'}</dd>
64
+ </div>
65
+ </dl>
66
+
67
+ {paths.length > 0 && (
68
+ <ul>
69
+ {paths.map((entry) => {
70
+ const href = docsHref(entry.path);
71
+ return (
72
+ <li>
73
+ {entry.label}:{' '}
74
+ {siteRefs().known.get(entry.path)?.href ? <RefLink ref={entry.path} label="id" /> : href ? <a href={href}>{entry.path}</a> : <code>{entry.path}</code>}
75
+ </li>
76
+ );
77
+ })}
78
+ </ul>
79
+ )}
80
+
81
+ <section>
82
+ <h2>Done when</h2>
83
+ {now.doneWhen.length === 0 ? (
84
+ <p class="plan-empty">No checks recorded.</p>
85
+ ) : (
86
+ <ul>
87
+ {now.doneWhen.map((check) => (
88
+ <li>
89
+ <LinkedText text={check} />
90
+ </li>
91
+ ))}
92
+ </ul>
93
+ )}
94
+ </section>
95
+
96
+ <section>
97
+ <h2>{now.checkpoint ? `Checkpoint ${now.checkpoint.at}` : 'Checkpoint'}</h2>
98
+ {checkpoint.length === 0 ? (
99
+ <p class="plan-empty">No checkpoint yet.</p>
100
+ ) : (
101
+ <dl class="plan-facts">
102
+ {checkpoint.map((entry) => (
103
+ <div>
104
+ <dt>{entry.label}</dt>
105
+ <dd>
106
+ <LinkedText text={entry.value} />
107
+ </dd>
108
+ </div>
109
+ ))}
110
+ </dl>
111
+ )}
112
+ </section>
113
+
114
+ <section>
115
+ <h2>Plan tasks</h2>
116
+ {!plan || plan.tasks.length === 0 ? (
117
+ <p class="plan-empty">{plan ? 'The plan has no Task headings.' : 'No plan in this export.'}</p>
118
+ ) : (
119
+ <div class="plan-cards not-content">
120
+ {plan.tasks.map((task) => (
121
+ <TaskKanbanCard
122
+ task={`Task ${task.number}: ${task.title}`}
123
+ date={`${task.checked}/${task.total} steps`}
124
+ assigneeInitials={initials(card?.owner ?? null)}
125
+ priority={priority}
126
+ progress={planProgress(task)}
127
+ />
128
+ ))}
129
+ </div>
130
+ )}
131
+ </section>
132
+ </>
133
+ )
134
+ }
135
+ </StarlightPage>
@@ -0,0 +1,194 @@
1
+ ---
2
+ // The vision and the strategy from planning.json's `vision` and `strategy`:
3
+ // the problem, the V lines, the focus, bets, assumptions, what is not being
4
+ // done, and the decisions, newest first.
5
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
6
+
7
+ import ExportStamp from '../../components/ExportStamp.astro';
8
+ import LinkedText from '../../components/LinkedText.astro';
9
+ import RefLink from '../../components/RefLink.astro';
10
+ import { loadPlanning, milestoneId } from '../../lib/planning';
11
+ import '../../styles/components.css';
12
+
13
+ const planning = loadPlanning();
14
+ const { vision, strategy } = planning;
15
+ const focusId = milestoneId(strategy.focus.milestone, strategy.milestones);
16
+ const constraints = [
17
+ { label: 'Time available', value: vision.constraints.timeAvailable },
18
+ { label: 'Budget', value: vision.constraints.budget },
19
+ { label: 'Stack', value: vision.constraints.stack },
20
+ ];
21
+ ---
22
+
23
+ <StarlightPage frontmatter={{ title: 'Strategy', description: 'The vision, the focus, bets, assumptions, what is not being done, and the decisions.', tableOfContents: false }}>
24
+ <ExportStamp />
25
+
26
+ <section>
27
+ <h2>Vision</h2>
28
+ <p><strong>Problem:</strong> {vision.problem ? <LinkedText text={vision.problem} /> : 'Not set.'}</p>
29
+ <p><strong>Customer:</strong> {vision.customer ? <LinkedText text={vision.customer} /> : 'Not set.'}</p>
30
+ <h3>v1 is done when</h3>
31
+ {vision.outcomes.length === 0 && <p class="plan-empty">No V lines.</p>}
32
+ <ul>
33
+ {
34
+ vision.outcomes.map((outcome) => (
35
+ <li>
36
+ <strong>{outcome.id}</strong> <LinkedText text={outcome.text} />
37
+ </li>
38
+ ))
39
+ }
40
+ </ul>
41
+ {
42
+ vision.outOfScope.length > 0 && (
43
+ <>
44
+ <h3>Out of scope</h3>
45
+ <ul>
46
+ {vision.outOfScope.map((line) => (
47
+ <li><LinkedText text={line} /></li>
48
+ ))}
49
+ </ul>
50
+ </>
51
+ )
52
+ }
53
+ <dl class="plan-facts">
54
+ {
55
+ constraints.map((entry) => (
56
+ <div>
57
+ <dt>{entry.label}</dt>
58
+ <dd>{entry.value ? <LinkedText text={entry.value} /> : '–'}</dd>
59
+ </div>
60
+ ))
61
+ }
62
+ </dl>
63
+ </section>
64
+
65
+ <section>
66
+ <h2>Focus</h2>
67
+ <p>
68
+ <strong>
69
+ {focusId ? <RefLink ref={focusId} /> : strategy.focus.milestone ? <LinkedText text={strategy.focus.milestone} /> : 'No focus set'}
70
+ </strong>
71
+ </p>
72
+ {strategy.focus.whyNow && (
73
+ <p>
74
+ <LinkedText text={strategy.focus.whyNow} />
75
+ </p>
76
+ )}
77
+ </section>
78
+
79
+ <section>
80
+ <h2>Bets</h2>
81
+ {strategy.bets.length === 0 && <p class="plan-empty">No bets.</p>}
82
+ {
83
+ strategy.bets.length > 0 && (
84
+ <table class="plan-table">
85
+ <thead>
86
+ <tr>
87
+ <th scope="col">Bet</th>
88
+ <th scope="col">Evidence</th>
89
+ <th scope="col">We will know when</th>
90
+ <th scope="col">Status</th>
91
+ </tr>
92
+ </thead>
93
+ <tbody>
94
+ {strategy.bets.map((bet) => (
95
+ <tr>
96
+ <td>
97
+ <strong>{bet.id}</strong> <LinkedText text={bet.statement} />
98
+ </td>
99
+ <td>{bet.evidence ? <LinkedText text={bet.evidence} /> : '–'}</td>
100
+ <td>{bet.signal ? <LinkedText text={bet.signal} /> : '–'}</td>
101
+ <td>{bet.status ? <LinkedText text={bet.status} /> : '–'}</td>
102
+ </tr>
103
+ ))}
104
+ </tbody>
105
+ </table>
106
+ )
107
+ }
108
+ </section>
109
+
110
+ <section>
111
+ <h2>Assumptions</h2>
112
+ {strategy.assumptions.length === 0 && <p class="plan-empty">No assumptions.</p>}
113
+ {
114
+ strategy.assumptions.length > 0 && (
115
+ <table class="plan-table">
116
+ <thead>
117
+ <tr>
118
+ <th scope="col">Assumption</th>
119
+ <th scope="col">Test</th>
120
+ <th scope="col">Status</th>
121
+ </tr>
122
+ </thead>
123
+ <tbody>
124
+ {strategy.assumptions.map((assumption) => (
125
+ <tr>
126
+ <td>
127
+ <strong>{assumption.id}</strong> <LinkedText text={assumption.statement} />
128
+ </td>
129
+ <td>{assumption.test ? <LinkedText text={assumption.test} /> : '–'}</td>
130
+ <td>{assumption.status ? <LinkedText text={assumption.status} /> : '–'}</td>
131
+ </tr>
132
+ ))}
133
+ </tbody>
134
+ </table>
135
+ )
136
+ }
137
+ </section>
138
+
139
+ <section>
140
+ <h2>Not doing</h2>
141
+ {strategy.notDoing.length === 0 && <p class="plan-empty">Nothing ruled out.</p>}
142
+ {
143
+ strategy.notDoing.length > 0 && (
144
+ <table class="plan-table">
145
+ <thead>
146
+ <tr>
147
+ <th scope="col">Not doing</th>
148
+ <th scope="col">Why</th>
149
+ <th scope="col">Revisit</th>
150
+ </tr>
151
+ </thead>
152
+ <tbody>
153
+ {strategy.notDoing.map((entry) => (
154
+ <tr>
155
+ <td><LinkedText text={entry.thing} /></td>
156
+ <td>{entry.why ? <LinkedText text={entry.why} /> : '–'}</td>
157
+ <td>{entry.revisit ? <LinkedText text={entry.revisit} /> : '–'}</td>
158
+ </tr>
159
+ ))}
160
+ </tbody>
161
+ </table>
162
+ )
163
+ }
164
+ </section>
165
+
166
+ <section>
167
+ <h2>Decisions</h2>
168
+ {strategy.decisions.length === 0 && <p class="plan-empty">No decisions recorded.</p>}
169
+ {
170
+ strategy.decisions.length > 0 && (
171
+ <table class="plan-table">
172
+ <thead>
173
+ <tr>
174
+ <th scope="col">Date</th>
175
+ <th scope="col">Decision</th>
176
+ <th scope="col">Why</th>
177
+ <th scope="col">Rejected</th>
178
+ </tr>
179
+ </thead>
180
+ <tbody>
181
+ {strategy.decisions.map((entry) => (
182
+ <tr>
183
+ <td class="plan-nowrap">{entry.date ? <LinkedText text={entry.date} /> : '–'}</td>
184
+ <td><LinkedText text={entry.decision} /></td>
185
+ <td>{entry.why ? <LinkedText text={entry.why} /> : '–'}</td>
186
+ <td>{entry.rejected ? <LinkedText text={entry.rejected} /> : '–'}</td>
187
+ </tr>
188
+ ))}
189
+ </tbody>
190
+ </table>
191
+ )
192
+ }
193
+ </section>
194
+ </StarlightPage>
@@ -0,0 +1,40 @@
1
+ // The Board and Roadmap in the browser: a plain click on a card opens its item
2
+ // popup (any other click is the browser's). Without this script every card is
3
+ // a link. The Board's column collapse lives in its island
4
+ // (src/components/board/Board.tsx).
5
+
6
+ function openItem(link: HTMLAnchorElement): void {
7
+ const dialog = document.querySelector<HTMLDialogElement>('dialog[data-item-dialog]');
8
+ const template = document.querySelector<HTMLTemplateElement>(`template[data-item-detail="${CSS.escape(link.dataset.item ?? '')}"]`);
9
+
10
+ if (!dialog || !template) {
11
+ window.location.assign(link.href);
12
+ return;
13
+ }
14
+
15
+ dialog.querySelector('#plan-dialog-title')!.textContent = link.textContent?.trim() ?? '';
16
+ dialog.querySelector('[data-item-dialog-body]')!.replaceChildren(template.content.cloneNode(true));
17
+ dialog.querySelector('[data-item-dialog-open]')!.setAttribute('href', link.getAttribute('href') ?? '');
18
+ dialog.addEventListener('close', () => link.focus(), { once: true });
19
+ dialog.showModal();
20
+ }
21
+
22
+ function start(): void {
23
+ document.addEventListener('click', (event) => {
24
+ const target = event.target as Element | null;
25
+ const link = target?.closest<HTMLAnchorElement>('a[data-item]');
26
+
27
+ if (link) {
28
+ if (event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
29
+ event.preventDefault();
30
+ openItem(link);
31
+ return;
32
+ }
33
+
34
+ if (target?.closest('[data-item-dialog-close]')) {
35
+ target.closest('dialog')?.close();
36
+ }
37
+ });
38
+ }
39
+
40
+ start();