@purview-dev/pm-docs-site 0.0.0-stage → 0.1.0-pre.1
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/LICENSE.md +9 -0
- package/README.md +167 -2
- package/cli.mjs +120 -0
- package/index.d.ts +49 -0
- package/index.mjs +97 -0
- package/lib/options.mjs +67 -0
- package/lib/repo-docs.mjs +148 -0
- package/lib/schema-version.mjs +29 -0
- package/lib/sidebar.mjs +47 -0
- package/lib/site-options.mjs +38 -0
- package/package.json +62 -5
- package/src/components/ExportStamp.astro +29 -0
- package/src/components/FeatureSummary.astro +160 -0
- package/src/components/FeatureTable.astro +64 -0
- package/src/components/ItemDetail.astro +16 -0
- package/src/components/ItemDialog.astro +16 -0
- package/src/components/LinkedFrom.astro +33 -0
- package/src/components/LinkedText.astro +12 -0
- package/src/components/PlanInteractions.astro +18 -0
- package/src/components/RefLink.astro +18 -0
- package/src/components/StateBadge.astro +15 -0
- package/src/components/lib/KanbanItemCard.astro +264 -0
- package/src/components/lib/StatusTimelineFeed.astro +194 -0
- package/src/components/lib/TaskKanbanCard.astro +215 -0
- package/src/content.config.ts +16 -0
- package/src/env.d.ts +7 -0
- package/src/lib/planning-types.ts +207 -0
- package/src/lib/planning.ts +387 -0
- package/src/lib/references.ts +360 -0
- package/src/loaders/repo-docs.ts +69 -0
- package/src/pages/index.astro +158 -0
- package/src/pages/plan/board.astro +140 -0
- package/src/pages/plan/log.astro +83 -0
- package/src/pages/plan/risks/[id].astro +72 -0
- package/src/pages/plan/risks.astro +263 -0
- package/src/pages/plan/roadmap.astro +90 -0
- package/src/routes/plan/briefs.astro +66 -0
- package/src/routes/plan/features/[id].astro +113 -0
- package/src/routes/plan/features/index.astro +29 -0
- package/src/routes/plan/inbox.astro +78 -0
- package/src/routes/plan/milestones/[milestone].astro +113 -0
- package/src/routes/plan/milestones/index.astro +56 -0
- package/src/routes/plan/now.astro +135 -0
- package/src/routes/plan/strategy.astro +194 -0
- package/src/scripts/plan.ts +86 -0
- package/src/styles/components.css +374 -0
- package/src/styles/width.css +4 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// The pm-export schemaVersions this package reads, declared once. A new export
|
|
3
|
+
// format is supported by adding its version here, with the page changes it needs.
|
|
4
|
+
|
|
5
|
+
/** @type {readonly number[]} */
|
|
6
|
+
export const SUPPORTED_SCHEMA_VERSIONS = Object.freeze([3]);
|
|
7
|
+
|
|
8
|
+
/** The plan export is missing, unreadable, or in a format this package does not read. */
|
|
9
|
+
export class PlanningExportError extends Error {
|
|
10
|
+
/** @param {string} message */
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(`${message} Run the pm-export skill to write planning.json.`);
|
|
13
|
+
this.name = 'PlanningExportError';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Throw unless the export's schemaVersion is one this package reads.
|
|
19
|
+
* @param {unknown} version
|
|
20
|
+
* @param {string} path the export's path, for the message
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
export function checkSchemaVersion(version, path) {
|
|
24
|
+
if (typeof version === 'number' && SUPPORTED_SCHEMA_VERSIONS.includes(version)) return;
|
|
25
|
+
|
|
26
|
+
throw new PlanningExportError(
|
|
27
|
+
`${path} has schemaVersion ${String(version)}; this site reads schemaVersion ${SUPPORTED_SCHEMA_VERSIONS.join(', ')}.`,
|
|
28
|
+
);
|
|
29
|
+
}
|
package/lib/sidebar.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// The Starlight sidebar: the plan, its optional views switched on in the
|
|
3
|
+
// options, then one group per docs source that has pages.
|
|
4
|
+
|
|
5
|
+
import { pagesOf } from './repo-docs.mjs';
|
|
6
|
+
|
|
7
|
+
/** @typedef {import('../index').ResolvedOptions} ResolvedOptions */
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {string | { label: string; link: string } | { label: string; items: SidebarItem[]; collapsed?: boolean }} SidebarItem
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ResolvedOptions} options
|
|
14
|
+
* @returns {SidebarItem[]}
|
|
15
|
+
*/
|
|
16
|
+
export function buildSidebar(options) {
|
|
17
|
+
const { views, docs } = options;
|
|
18
|
+
|
|
19
|
+
/** @type {(SidebarItem | false)[]} */
|
|
20
|
+
const plan = [
|
|
21
|
+
views.now && { label: 'Now', link: '/plan/now/' },
|
|
22
|
+
{ label: 'Board', link: '/plan/board/' },
|
|
23
|
+
{ label: 'Roadmap', link: '/plan/roadmap/' },
|
|
24
|
+
views.milestones && { label: 'Milestones', link: '/plan/milestones/' },
|
|
25
|
+
views.features && { label: 'Features', link: '/plan/features/' },
|
|
26
|
+
{ label: 'Log', link: '/plan/log/' },
|
|
27
|
+
{ label: 'Risks', link: '/plan/risks/' },
|
|
28
|
+
views.inbox && { label: 'Inbox', link: '/plan/inbox/' },
|
|
29
|
+
views.briefs && { label: 'Briefs', link: '/plan/briefs/' },
|
|
30
|
+
views.strategy && { label: 'Strategy', link: '/plan/strategy/' },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
/** @type {SidebarItem[]} */
|
|
34
|
+
const groups = docs
|
|
35
|
+
? docs.sources
|
|
36
|
+
.filter((source) => !source.hidden)
|
|
37
|
+
.map((source) => ({
|
|
38
|
+
label: source.label,
|
|
39
|
+
collapsed: source.collapsed ?? false,
|
|
40
|
+
items: pagesOf(source, docs.root).map((page) => page.id),
|
|
41
|
+
}))
|
|
42
|
+
// Starlight rejects an empty group.
|
|
43
|
+
.filter((group) => group.items.length > 0)
|
|
44
|
+
: [];
|
|
45
|
+
|
|
46
|
+
return [{ label: 'Plan', items: plan.filter((item) => item !== false) }, ...groups];
|
|
47
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// The options a site gives the integration, read the way the CLI needs them:
|
|
3
|
+
// from its astro.config file when it has one, else from command-line flags.
|
|
4
|
+
|
|
5
|
+
import { existsSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { pathToFileURL } from 'node:url';
|
|
8
|
+
|
|
9
|
+
/** @typedef {import('../index').PmDocsSiteOptions} PmDocsSiteOptions */
|
|
10
|
+
|
|
11
|
+
const CONFIG_FILES = ['astro.config.mjs', 'astro.config.js', 'astro.config.ts', 'astro.config.mts'];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} siteDir absolute
|
|
15
|
+
* @param {{ title?: string; planning?: string }} flags
|
|
16
|
+
* @returns {Promise<{ options: PmDocsSiteOptions; configFile: string | null }>}
|
|
17
|
+
*/
|
|
18
|
+
export async function loadSiteOptions(siteDir, flags) {
|
|
19
|
+
const configFile = CONFIG_FILES.map((name) => join(siteDir, name)).find((file) => existsSync(file)) ?? null;
|
|
20
|
+
|
|
21
|
+
if (!configFile) {
|
|
22
|
+
return {
|
|
23
|
+
options: { title: flags.title ?? 'Project plan', ...(flags.planning ? { planning: flags.planning } : {}) },
|
|
24
|
+
configFile: null,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const config = (await import(pathToFileURL(configFile).href)).default ?? {};
|
|
29
|
+
/** @type {unknown[]} */
|
|
30
|
+
const integrations = (Array.isArray(config.integrations) ? config.integrations : []).flat(Infinity);
|
|
31
|
+
const ours = /** @type {{ pmDocsSiteOptions?: PmDocsSiteOptions } | undefined} */ (
|
|
32
|
+
integrations.find((entry) => /** @type {{ name?: string } | null} */ (entry)?.name === 'pm-docs-site')
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
if (!ours?.pmDocsSiteOptions) throw new Error(`pm-docs-site: no pm-docs-site integration in ${configFile}`);
|
|
36
|
+
|
|
37
|
+
return { options: ours.pmDocsSiteOptions, configFile };
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@purview-dev/pm-docs-site",
|
|
3
|
+
"version": "0.1.0-pre.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A local, searchable project site for pm-skills: the board, roadmap, milestones, features, log, and risks from pm-export's planning.json, with the repository's Markdown, as an Astro and Starlight integration.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Kieron Lanning",
|
|
9
|
+
"url": "https://kieronlanning.dev/"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://purview.dev/projects/pm-skills/",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/purview-dev/pm-skills/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/purview-dev/pm-skills.git",
|
|
18
|
+
"directory": "packages/pm-docs-site"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"pm-skills",
|
|
22
|
+
"project-management",
|
|
23
|
+
"roadmap",
|
|
24
|
+
"kanban",
|
|
25
|
+
"documentation",
|
|
26
|
+
"astro",
|
|
27
|
+
"astro-integration",
|
|
28
|
+
"withastro",
|
|
29
|
+
"starlight"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=22"
|
|
36
|
+
},
|
|
37
|
+
"bin": {
|
|
38
|
+
"pm-docs-site": "./cli.mjs"
|
|
39
|
+
},
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./index.d.ts",
|
|
43
|
+
"default": "./index.mjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": ["index.mjs", "index.d.ts", "cli.mjs", "lib", "src", "README.md", "LICENSE.md"],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"prepublishOnly": "node scripts/check-exports.mjs",
|
|
49
|
+
"test": "bun test",
|
|
50
|
+
"check": "astro-check --root .",
|
|
51
|
+
"test:browser": "playwright test"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@astrojs/starlight": "0.42.10",
|
|
55
|
+
"astro": "7.4.8"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@astrojs/check": "0.9.12",
|
|
59
|
+
"@playwright/test": "1.65.1",
|
|
60
|
+
"@types/bun": "1.4.4",
|
|
61
|
+
"typescript": "6.0.3"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
// When the plan on this page was exported, and from which commit, so a stale
|
|
3
|
+
// planning.json is visible. Run the pm-export skill to refresh it.
|
|
4
|
+
//
|
|
5
|
+
// It also labels the page for search: Pagefind reads the hidden filter spans
|
|
6
|
+
// (Kind, and for an item its State and Milestone) and offers them as filters.
|
|
7
|
+
import config from 'virtual:pm-docs-site/config';
|
|
8
|
+
|
|
9
|
+
import { loadPlanning } from '../lib/planning';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
/** The search filter `Kind`: `Plan` for a plan page, `Feature` or `Milestone` for an item's or a milestone's page. */
|
|
13
|
+
kind?: string;
|
|
14
|
+
state?: string;
|
|
15
|
+
milestone?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { kind = 'Plan', state, milestone } = Astro.props;
|
|
19
|
+
const planning = loadPlanning();
|
|
20
|
+
const exported = planning.generatedAt.replace('T', ' ').slice(0, 16);
|
|
21
|
+
const head = planning.source.head?.slice(0, 7) ?? 'unknown';
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<p class="export-stamp" data-pagefind-ignore>
|
|
25
|
+
Plan exported {exported} from {planning.source.branch ?? 'a detached HEAD'} at <code>{head}</code> ({config.planningLabel}).
|
|
26
|
+
</p>
|
|
27
|
+
<span hidden data-pagefind-filter={`Kind:${kind}`}></span>
|
|
28
|
+
{state && <span hidden data-pagefind-filter={`State:${state}`}></span>}
|
|
29
|
+
{milestone && <span hidden data-pagefind-filter={`Milestone:${milestone}`}></span>}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One item's summary: state, milestone, facts, Done when, related items, brief
|
|
3
|
+
// and risks. The feature page shows it, and so does the item popup on the
|
|
4
|
+
// Board and Roadmap, so the two never drift.
|
|
5
|
+
import { briefOf, dependents, features, loadPlanning, planProgress } from '../lib/planning';
|
|
6
|
+
import LinkedText from './LinkedText.astro';
|
|
7
|
+
import RefLink from './RefLink.astro';
|
|
8
|
+
import StateBadge from './StateBadge.astro';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const planning = loadPlanning();
|
|
15
|
+
const all = features(planning);
|
|
16
|
+
const feature = all.find((candidate) => candidate.id === Astro.props.id)!;
|
|
17
|
+
const byId = new Map(all.map((candidate) => [candidate.id, candidate]));
|
|
18
|
+
const brief = briefOf(planning, feature);
|
|
19
|
+
const blocks = dependents(all, feature.id);
|
|
20
|
+
const revisedBy = all.filter((candidate) => candidate.revisits === feature.id);
|
|
21
|
+
const risks = [...planning.risks.open, ...planning.risks.closed].filter((risk) => risk.affects === feature.id);
|
|
22
|
+
const plan = feature.state === 'now' ? planning.plan : null;
|
|
23
|
+
|
|
24
|
+
const facts: { label: string; value: string }[] = [
|
|
25
|
+
{ label: 'Owner', value: feature.owner ?? '–' },
|
|
26
|
+
{ label: 'Size', value: feature.size ?? '–' },
|
|
27
|
+
...(feature.state === 'next' || feature.state === 'later' ? [{ label: 'Position', value: `${feature.state === 'next' ? 'Next' : 'Later'} ${feature.position}` }] : []),
|
|
28
|
+
...(feature.status
|
|
29
|
+
? [{ label: 'Status', value: [feature.status.value, feature.status.reason, feature.status.since && `since ${feature.status.since}`].filter(Boolean).join(', ') }]
|
|
30
|
+
: []),
|
|
31
|
+
...(feature.stage ? [{ label: 'Stage', value: feature.stage }] : []),
|
|
32
|
+
...(feature.started ? [{ label: 'Started', value: feature.started }] : []),
|
|
33
|
+
...(plan ? [{ label: 'Plan steps', value: `${plan.checked} of ${plan.total} (${planProgress(plan)}%)` }] : []),
|
|
34
|
+
...(feature.date ? [{ label: feature.state === 'done' ? 'Done' : 'Dropped', value: feature.date }] : []),
|
|
35
|
+
];
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<p>
|
|
39
|
+
<StateBadge state={feature.state} />
|
|
40
|
+
{
|
|
41
|
+
(feature.label === 'blocked' || feature.label === 'waiting') && (
|
|
42
|
+
<>
|
|
43
|
+
{' '}
|
|
44
|
+
<StateBadge label={feature.label} />
|
|
45
|
+
</>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
{' '}
|
|
49
|
+
<RefLink ref={feature.milestone ?? 'none'} />
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<dl class="plan-facts">
|
|
53
|
+
{
|
|
54
|
+
facts.map((fact) => (
|
|
55
|
+
<div>
|
|
56
|
+
<dt>{fact.label}</dt>
|
|
57
|
+
<dd>
|
|
58
|
+
<LinkedText text={fact.value} />
|
|
59
|
+
</dd>
|
|
60
|
+
</div>
|
|
61
|
+
))
|
|
62
|
+
}
|
|
63
|
+
</dl>
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
feature.doneWhen.length > 0 && (
|
|
67
|
+
<section>
|
|
68
|
+
<h2>Done when</h2>
|
|
69
|
+
<ul>
|
|
70
|
+
{feature.doneWhen.map((check) => (
|
|
71
|
+
<li>
|
|
72
|
+
<LinkedText text={check} />
|
|
73
|
+
</li>
|
|
74
|
+
))}
|
|
75
|
+
</ul>
|
|
76
|
+
</section>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
{
|
|
81
|
+
(feature.dependsOn.length > 0 || blocks.length > 0 || feature.revisits || revisedBy.length > 0) && (
|
|
82
|
+
<section>
|
|
83
|
+
<h2>Related items</h2>
|
|
84
|
+
<ul>
|
|
85
|
+
{feature.dependsOn.map((dep) => (
|
|
86
|
+
<li>
|
|
87
|
+
Depends on <RefLink ref={dep} /> {byId.get(dep) && <StateBadge state={byId.get(dep)!.state} />}
|
|
88
|
+
</li>
|
|
89
|
+
))}
|
|
90
|
+
{blocks.map((other) => (
|
|
91
|
+
<li>
|
|
92
|
+
Needed by <RefLink ref={other.id} /> <StateBadge state={other.state} />
|
|
93
|
+
</li>
|
|
94
|
+
))}
|
|
95
|
+
{feature.revisits && (
|
|
96
|
+
<li>
|
|
97
|
+
Revisits <RefLink ref={feature.revisits} />
|
|
98
|
+
</li>
|
|
99
|
+
)}
|
|
100
|
+
{revisedBy.map((other) => (
|
|
101
|
+
<li>
|
|
102
|
+
Revised by <RefLink ref={other.id} />
|
|
103
|
+
</li>
|
|
104
|
+
))}
|
|
105
|
+
</ul>
|
|
106
|
+
</section>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
{
|
|
111
|
+
(brief || feature.brief) && (
|
|
112
|
+
<section>
|
|
113
|
+
<h2>Brief</h2>
|
|
114
|
+
{brief ? (
|
|
115
|
+
<>
|
|
116
|
+
<p>
|
|
117
|
+
<strong>{brief.title}</strong> — {brief.status ? <LinkedText text={brief.status} /> : 'no status'}
|
|
118
|
+
{brief.updated && <>, updated {brief.updated}</>}
|
|
119
|
+
</p>
|
|
120
|
+
{brief.problem && (
|
|
121
|
+
<p>
|
|
122
|
+
Problem: <LinkedText text={brief.problem} />
|
|
123
|
+
</p>
|
|
124
|
+
)}
|
|
125
|
+
{brief.decision && (
|
|
126
|
+
<p>
|
|
127
|
+
Decision: <LinkedText text={brief.decision} />
|
|
128
|
+
</p>
|
|
129
|
+
)}
|
|
130
|
+
<p>
|
|
131
|
+
<RefLink ref={brief.path} label="id" />
|
|
132
|
+
</p>
|
|
133
|
+
</>
|
|
134
|
+
) : (
|
|
135
|
+
<p>
|
|
136
|
+
<code>{feature.brief}</code>
|
|
137
|
+
</p>
|
|
138
|
+
)}
|
|
139
|
+
</section>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
{
|
|
144
|
+
risks.length > 0 && (
|
|
145
|
+
<section>
|
|
146
|
+
<h2>Risks</h2>
|
|
147
|
+
<ul>
|
|
148
|
+
{risks.map((risk) => (
|
|
149
|
+
<li>
|
|
150
|
+
<span class={`rag rag--${risk.rag}`}>{risk.rag}</span>{' '}
|
|
151
|
+
<strong>
|
|
152
|
+
<RefLink ref={risk.id} label="id" />
|
|
153
|
+
</strong>{' '}
|
|
154
|
+
<LinkedText text={risk.title} /> — {risk.status}
|
|
155
|
+
</li>
|
|
156
|
+
))}
|
|
157
|
+
</ul>
|
|
158
|
+
</section>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
// A table of roadmap items of one state: each row links to the item's page,
|
|
3
|
+
// with its milestone, owner, size, and what decides it (Done when, Result, or Reason).
|
|
4
|
+
import type { Feature, FeatureState } from '../lib/planning';
|
|
5
|
+
import type { Milestone } from '../lib/planning-types';
|
|
6
|
+
import LinkedText from './LinkedText.astro';
|
|
7
|
+
import RefLink from './RefLink.astro';
|
|
8
|
+
import StateBadge from './StateBadge.astro';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
state: FeatureState;
|
|
12
|
+
items: Feature[];
|
|
13
|
+
milestones: Milestone[];
|
|
14
|
+
/** Leave the Milestone column out (on a milestone's own page). */
|
|
15
|
+
hideMilestone?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { state, items, hideMilestone = false } = Astro.props;
|
|
19
|
+
const decision = (feature: Feature) => (state === 'done' ? feature.result : state === 'dropped' ? feature.reason : feature.doneWhen.join(' ')) || null;
|
|
20
|
+
const decides = state === 'done' ? 'Result' : state === 'dropped' ? 'Reason' : 'Done when';
|
|
21
|
+
const when = (feature: Feature) => (state === 'done' || state === 'dropped' ? feature.date : state === 'now' ? feature.stage : `${state === 'next' ? 'Next' : 'Later'} ${feature.position}`);
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
{items.length === 0 && <p class="plan-empty">Nothing here</p>}
|
|
25
|
+
{
|
|
26
|
+
items.length > 0 && (
|
|
27
|
+
<table class="plan-table">
|
|
28
|
+
<thead>
|
|
29
|
+
<tr>
|
|
30
|
+
<th scope="col">Item</th>
|
|
31
|
+
<th scope="col">{state === 'done' || state === 'dropped' ? 'Date' : state === 'now' ? 'Stage' : 'Position'}</th>
|
|
32
|
+
{!hideMilestone && <th scope="col">Milestone</th>}
|
|
33
|
+
<th scope="col">Owner</th>
|
|
34
|
+
<th scope="col">Size</th>
|
|
35
|
+
<th scope="col">{decides}</th>
|
|
36
|
+
</tr>
|
|
37
|
+
</thead>
|
|
38
|
+
<tbody>
|
|
39
|
+
{items.map((feature) => (
|
|
40
|
+
<tr id={feature.id.toLowerCase()}>
|
|
41
|
+
<td>
|
|
42
|
+
<RefLink ref={feature.id} />
|
|
43
|
+
{(feature.label === 'blocked' || feature.label === 'waiting') && (
|
|
44
|
+
<>
|
|
45
|
+
{' '}
|
|
46
|
+
<StateBadge label={feature.label} />
|
|
47
|
+
</>
|
|
48
|
+
)}
|
|
49
|
+
</td>
|
|
50
|
+
<td class="plan-nowrap">{when(feature) ?? '–'}</td>
|
|
51
|
+
{!hideMilestone && (
|
|
52
|
+
<td>
|
|
53
|
+
<RefLink ref={feature.milestone ?? 'none'} />
|
|
54
|
+
</td>
|
|
55
|
+
)}
|
|
56
|
+
<td>{feature.owner ?? '–'}</td>
|
|
57
|
+
<td>{feature.size ?? '–'}</td>
|
|
58
|
+
<td>{decision(feature) ? <LinkedText text={decision(feature)} /> : '–'}</td>
|
|
59
|
+
</tr>
|
|
60
|
+
))}
|
|
61
|
+
</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The popup content for one item, kept inert in a <template> until a plain
|
|
3
|
+
// click on its card opens the item dialog. Search ignores it: the item's own
|
|
4
|
+
// page holds the same summary.
|
|
5
|
+
import FeatureSummary from './FeatureSummary.astro';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { id } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<template data-item-detail={id} data-pagefind-ignore>
|
|
15
|
+
<FeatureSummary id={id} />
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The one item dialog on the Board and Roadmap. src/scripts/plan.ts fills it
|
|
3
|
+
// from a card's <template> and opens it on a plain click; without JavaScript
|
|
4
|
+
// the card link goes to the item's page instead.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<dialog class="plan-dialog" data-item-dialog aria-labelledby="plan-dialog-title" data-pagefind-ignore>
|
|
8
|
+
<div class="plan-dialog__head">
|
|
9
|
+
<h2 id="plan-dialog-title"></h2>
|
|
10
|
+
<button type="button" class="plan-dialog__close" data-item-dialog-close aria-label="Close">×</button>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="plan-dialog__body" data-item-dialog-body></div>
|
|
13
|
+
<p class="plan-dialog__foot">
|
|
14
|
+
<a data-item-dialog-open href="">Open page</a>
|
|
15
|
+
</p>
|
|
16
|
+
</dialog>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The pages that link to one item, milestone or risk, grouped by how they
|
|
3
|
+
// link. Derived from planning.json (references), so search ignores it.
|
|
4
|
+
import { RELATION_LABELS, siteRefs, type Relation } from '../lib/references';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
ref: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const links = siteRefs().back.get(Astro.props.ref) ?? [];
|
|
11
|
+
const groups = (Object.keys(RELATION_LABELS) as Relation[])
|
|
12
|
+
.map((relation) => ({ relation, links: links.filter((link) => link.relation === relation) }))
|
|
13
|
+
.filter((group) => group.links.length > 0);
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<section class="linked-from" data-linked-from data-pagefind-ignore>
|
|
17
|
+
<h2>Linked from</h2>
|
|
18
|
+
{groups.length === 0 && <p class="plan-empty">Nothing links here yet.</p>}
|
|
19
|
+
{
|
|
20
|
+
groups.map((group) => (
|
|
21
|
+
<>
|
|
22
|
+
<h3>{RELATION_LABELS[group.relation]}</h3>
|
|
23
|
+
<ul>
|
|
24
|
+
{group.links.map((link) => (
|
|
25
|
+
<li>
|
|
26
|
+
<a href={link.href}>{link.label}</a>
|
|
27
|
+
</li>
|
|
28
|
+
))}
|
|
29
|
+
</ul>
|
|
30
|
+
</>
|
|
31
|
+
))
|
|
32
|
+
}
|
|
33
|
+
</section>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Prose with every known ID and brief path linked to its page.
|
|
3
|
+
import { linkify, siteRefs } from '../lib/references';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
text: string | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const runs = linkify(Astro.props.text ?? '', siteRefs().known);
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
{runs.map((run) => (run.target?.href ? <a href={run.target.href} title={run.target.label}>{run.text}</a> : run.text))}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The Board's and Roadmap's client script (src/scripts/plan.ts). The inline
|
|
3
|
+
// part runs as the page is parsed, before the columns paint, so a collapsed
|
|
4
|
+
// column never flashes open; it must stay in step with STORAGE_KEY there.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<script is:inline>
|
|
8
|
+
try {
|
|
9
|
+
const names = JSON.parse(localStorage.getItem('pm-docs-site:board:collapsed') ?? '[]');
|
|
10
|
+
|
|
11
|
+
if (Array.isArray(names)) document.documentElement.dataset.boardCollapsed = names.filter((name) => typeof name === 'string').join(' ');
|
|
12
|
+
} catch {
|
|
13
|
+
// Junk or no storage: every column stays open.
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script>
|
|
17
|
+
import '../scripts/plan.ts';
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One item, milestone, risk or brief as a link to its page, named with its
|
|
3
|
+
// title, or as plain text when that page is not built or the key is unknown.
|
|
4
|
+
import { siteRefs } from '../lib/references';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
/** An ID (`R-012`, `M1`, `RK-002`), `none` for the No-milestone page, or a brief path. */
|
|
8
|
+
ref: string | null | undefined;
|
|
9
|
+
/** `full` shows the target's label (`R-012 Invoice export`); `id` the key only. */
|
|
10
|
+
label?: 'full' | 'id';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { ref, label = 'full' } = Astro.props;
|
|
14
|
+
const target = ref ? siteRefs().known.get(ref) : undefined;
|
|
15
|
+
const text = target && label === 'full' ? target.label : (ref ?? '');
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
{target?.href ? <a href={target.href} title={target.label}>{text}</a> : text}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
// An item's state (In progress, Next, Later, Done, Dropped) or its roadmap
|
|
3
|
+
// label (blocked, waiting) as a badge that always prints the word.
|
|
4
|
+
import { FEATURE_STATES, type FeatureState } from '../lib/planning';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
state?: FeatureState;
|
|
8
|
+
label?: 'blocked' | 'waiting';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { state, label } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{state && <span class={`state state--${state}`}>{FEATURE_STATES[state]}</span>}
|
|
15
|
+
{label && <span class={`state state--${label}`}>{label}</span>}
|