adr-kit 0.10.0 → 0.12.0
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 -6
- package/README.zh.md +7 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +2 -55
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +3 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/graph.d.ts +2 -0
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/graph.js +37 -7
- package/dist/commands/graph.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/instructions.d.ts.map +1 -1
- package/dist/commands/instructions.js +8 -1
- package/dist/commands/instructions.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +7 -4
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/supersede.d.ts.map +1 -1
- package/dist/commands/supersede.js +12 -7
- package/dist/commands/supersede.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +3 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/core/adr.d.ts +1 -0
- package/dist/core/adr.d.ts.map +1 -1
- package/dist/core/adr.js.map +1 -1
- package/dist/core/canvas-view.d.ts +19 -3
- package/dist/core/canvas-view.d.ts.map +1 -1
- package/dist/core/canvas-view.js +210 -15
- package/dist/core/canvas-view.js.map +1 -1
- package/dist/core/cli-options.d.ts +23 -0
- package/dist/core/cli-options.d.ts.map +1 -0
- package/dist/core/cli-options.js +69 -0
- package/dist/core/cli-options.js.map +1 -0
- package/dist/core/config.d.ts +29 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +69 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/deliberation-html.d.ts.map +1 -1
- package/dist/core/deliberation-html.js +89 -24
- package/dist/core/deliberation-html.js.map +1 -1
- package/dist/core/deliberation-view.d.ts.map +1 -1
- package/dist/core/deliberation-view.js +28 -195
- package/dist/core/deliberation-view.js.map +1 -1
- package/dist/core/deliberation.d.ts +15 -0
- package/dist/core/deliberation.d.ts.map +1 -1
- package/dist/core/deliberation.js +35 -15
- package/dist/core/deliberation.js.map +1 -1
- package/dist/core/graph-html.d.ts +1 -1
- package/dist/core/graph-html.d.ts.map +1 -1
- package/dist/core/graph-html.js +163 -44
- package/dist/core/graph-html.js.map +1 -1
- package/dist/core/graph-view.d.ts +1 -1
- package/dist/core/graph-view.d.ts.map +1 -1
- package/dist/core/graph-view.js +9 -187
- package/dist/core/graph-view.js.map +1 -1
- package/dist/core/relation-focus.d.ts +4 -0
- package/dist/core/relation-focus.d.ts.map +1 -0
- package/dist/core/relation-focus.js +89 -0
- package/dist/core/relation-focus.js.map +1 -0
- package/dist/core/share.d.ts +30 -0
- package/dist/core/share.d.ts.map +1 -0
- package/dist/core/share.js +420 -0
- package/dist/core/share.js.map +1 -0
- package/dist/core/templates.d.ts +4 -1
- package/dist/core/templates.d.ts.map +1 -1
- package/dist/core/templates.js +4 -1
- package/dist/core/templates.js.map +1 -1
- package/dist/core/tool-integrations.d.ts.map +1 -1
- package/dist/core/tool-integrations.js +47 -29
- package/dist/core/tool-integrations.js.map +1 -1
- package/dist/core/validate.d.ts +1 -1
- package/dist/core/validate.d.ts.map +1 -1
- package/dist/core/validate.js +25 -14
- package/dist/core/validate.js.map +1 -1
- package/dist/core/view-text.d.ts +7 -0
- package/dist/core/view-text.d.ts.map +1 -1
- package/dist/core/view-text.js +15 -0
- package/dist/core/view-text.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,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AAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACnD,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9B,IAAI,YAAY,KAAK,SAAS;QAAE,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACnE,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,CAAC,mCAAmC,IAAI,EAAE,CAAC,CAAC;IAC1D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,+BAA+B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/core/adr.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export interface AdrRecord {
|
|
|
84
84
|
commit?: string;
|
|
85
85
|
rejectionReason?: string;
|
|
86
86
|
/** For superseded decisions: the number of the decision that replaced this one. */
|
|
87
|
+
/** Immediate historical successor; validation follows the chain to an accepted record. */
|
|
87
88
|
supersededBy?: number;
|
|
88
89
|
/** Optional kebab-case theme keywords; validate checks the shape. */
|
|
89
90
|
tags?: string[];
|
package/dist/core/adr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adr.d.ts","sourceRoot":"","sources":["../../src/core/adr.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAA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,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3C,IAAI,eAAe,KAAK,SAAS;QAAE,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;IAC5E,IAAI,YAAY,KAAK,SAAS;QAAE,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACnE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC;IACzD,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
/** Shared
|
|
1
|
+
/** Shared compact shell for both offline viewers. */
|
|
2
|
+
export declare const CANVAS_STYLE: string;
|
|
3
|
+
/**
|
|
4
|
+
* The compact toolbar: brand, title, one headline count, and the controls —
|
|
5
|
+
* the Info disclosure and the Save-as-image camera, as one cluster. The canvas
|
|
6
|
+
* dock keeps the gesture controls. A statistic is listed only when its count is
|
|
7
|
+
* non-zero: a zero names something the view does not contain, which sends the
|
|
8
|
+
* reader looking for it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function canvasHeaderHTML(title: string, stats: Array<[string, number]>, description: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* The canvas dock: the legend over the bottom-left corner, the zoom cluster
|
|
13
|
+
* over the bottom-right. Both float above the canvas, so the header can stay
|
|
14
|
+
* compact without hiding what the picture means. A view with nothing to key
|
|
15
|
+
* draws no legend panel rather than an empty one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function canvasDockHTML(legend: string, fitLabel: string): string;
|
|
18
|
+
/** Shared pan/zoom controller for the offline HTML views. */
|
|
2
19
|
export declare const CANVAS_SCRIPT: string;
|
|
3
|
-
export declare const CANVAS_HINT = "Drag
|
|
4
|
-
export declare function canvasControlsHTML(fitLabel: string): string;
|
|
20
|
+
export declare const CANVAS_HINT = "Drag anywhere or scroll to pan \u00B7 Pinch or Ctrl/\u2318 + scroll to zoom at the pointer \u00B7 Arrow keys move \u00B7 + / \u2212 zoom \u00B7 0 fits";
|
|
5
21
|
//# sourceMappingURL=canvas-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-view.d.ts","sourceRoot":"","sources":["../../src/core/canvas-view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"canvas-view.d.ts","sourceRoot":"","sources":["../../src/core/canvas-view.ts"],"names":[],"mappings":"AAcA,qDAAqD;AACrD,eAAO,MAAM,YAAY,QAyExB,CAAC;AAYF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAgB3G;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKvE;AAED,6DAA6D;AAC7D,eAAO,MAAM,aAAa,QA4KzB,CAAC;AACF,eAAO,MAAM,WAAW,2JAA6H,CAAC"}
|
package/dist/core/canvas-view.js
CHANGED
|
@@ -1,4 +1,135 @@
|
|
|
1
|
-
|
|
1
|
+
import { escapeHtml } from './view-text.js';
|
|
2
|
+
import { GITHUB_MARK_PATH, SHARE_BUTTON_HTML, SHARE_WATERMARK } from './share.js';
|
|
3
|
+
/** Derived from the credit line, so the link and the image cannot drift apart. */
|
|
4
|
+
const REPOSITORY_URL = 'https://github.com/' + SHARE_WATERMARK;
|
|
5
|
+
/**
|
|
6
|
+
* The GitHub mark beside the wordmark — the same glyph the shared image
|
|
7
|
+
* credits with, filled rather than stroked because it is a logo here, and it
|
|
8
|
+
* inherits the link's colour so hover reaches it too.
|
|
9
|
+
*/
|
|
10
|
+
const BRAND_MARK = '<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false">'
|
|
11
|
+
+ '<path d="' + GITHUB_MARK_PATH + '" fill="currentColor"/></svg>';
|
|
12
|
+
/** Shared compact shell for both offline viewers. */
|
|
13
|
+
export const CANVAS_STYLE = String.raw `
|
|
14
|
+
:root { font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color: #233c36; background: #f6f8f5; }
|
|
15
|
+
* { box-sizing: border-box; }
|
|
16
|
+
body { margin: 0; }
|
|
17
|
+
main { position: relative; }
|
|
18
|
+
button, summary { font: inherit; color: inherit; cursor: pointer; }
|
|
19
|
+
button:focus-visible, summary:focus-visible, main:focus-visible, a:focus-visible { outline: 2px solid #7750a5; outline-offset: -2px; }
|
|
20
|
+
.viewer-bar { position: relative; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 8px 16px; min-height: 52px; background: #fff; border-bottom: 1px solid #e1e7e1; }
|
|
21
|
+
.viewer-heading { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
|
|
22
|
+
.viewer-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; white-space: nowrap; padding-right: 12px; border-right: 1px solid #dce4dc; color: inherit; text-decoration: none; }
|
|
23
|
+
.viewer-brand svg { display: block; }
|
|
24
|
+
.viewer-brand:hover { color: #294d3e; text-decoration: underline; text-decoration-color: #a6bcae; text-underline-offset: 2px; }
|
|
25
|
+
.viewer-heading h1 { margin: 0; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
26
|
+
.viewer-count { flex: none; font-size: 12px; color: #64756c; }
|
|
27
|
+
.viewer-sep { flex: none; width: 1px; height: 18px; background: #dce4dc; }
|
|
28
|
+
.viewer-actions { display: flex; align-items: center; gap: 10px; flex: none; }
|
|
29
|
+
/* The controls are icon buttons: square, and close enough together to read as
|
|
30
|
+
one cluster while the count and the divider keep their distance. */
|
|
31
|
+
.viewer-tools { display: flex; align-items: center; gap: 4px; }
|
|
32
|
+
.viewer-bar button, .viewer-info > summary { border: 0; border-radius: 7px; background: transparent; padding: 7px; font-size: 12px; line-height: 20px; white-space: nowrap; }
|
|
33
|
+
.viewer-bar button:hover, .viewer-info > summary:hover, .viewer-info[open] > summary { background: #edf3ef; }
|
|
34
|
+
.viewer-info > summary { list-style: none; }
|
|
35
|
+
.viewer-info > summary::-webkit-details-marker { display: none; }
|
|
36
|
+
/* Toolbar icons sit on their own line: an inline SVG adds the font's descender
|
|
37
|
+
space below it, which lifts the icon out of line with its neighbour. This
|
|
38
|
+
belongs to the shared shell, or one view aligns and the other does not. */
|
|
39
|
+
.viewer-bar button svg, .viewer-bar summary svg { display: block; }
|
|
40
|
+
.viewer-panel { position: absolute; right: 12px; top: calc(100% + 8px); width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow: auto; overscroll-behavior: contain; padding: 20px; background: #fff; border: 1px solid #dce4dc; border-radius: 12px; box-shadow: 0 12px 36px #233c3620; font-size: 12px; line-height: 1.6; }
|
|
41
|
+
.viewer-panel h2 { margin: 0 0 10px; font-size: 15px; overflow-wrap: anywhere; }
|
|
42
|
+
.viewer-panel p { margin: 10px 0; color: #64756c; }
|
|
43
|
+
.viewer-stats { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 16px 0 0; }
|
|
44
|
+
.viewer-stats strong { margin-right: 4px; }
|
|
45
|
+
.canvas-dock { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; pointer-events: none; }
|
|
46
|
+
.canvas-dock > * { pointer-events: auto; }
|
|
47
|
+
/* Without the script there is no floating canvas: the dock sits at the end of the content. */
|
|
48
|
+
body:not(.interactive) main { padding-bottom: 84px; }
|
|
49
|
+
.canvas-legend { display: grid; gap: 6px; min-width: 0; max-width: min(620px, 100%); padding: 10px 12px; background: #ffffffe8; border: 1px solid #e1e7e1; border-radius: 10px; box-shadow: 0 4px 20px #294d3e0a; font-size: 11px; color: #55655c; }
|
|
50
|
+
.canvas-legend .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
|
|
51
|
+
.canvas-legend .legend span { display: flex; align-items: center; gap: 8px; }
|
|
52
|
+
.viewer-panel .hint { border-top: 1px solid #e1e7e1; padding-top: 14px; margin: 16px 0 0; }
|
|
53
|
+
.controls { display: none; align-items: center; gap: 2px; padding: 5px; background: #fff; border: 1px solid #dce4dc; border-radius: 11px; box-shadow: 0 4px 20px #294d3e0a; }
|
|
54
|
+
.controls button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 6px 9px; border-radius: 7px; }
|
|
55
|
+
.controls button:hover { background: #edf3ef; }
|
|
56
|
+
.controls output { font: 11px monospace; min-width: 44px; text-align: center; }
|
|
57
|
+
.js-control { display: none; }
|
|
58
|
+
body.interactive { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
|
|
59
|
+
.interactive .viewer-bar { flex: none; }
|
|
60
|
+
.interactive main { flex: 1; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
|
|
61
|
+
.interactive #world { position: absolute; }
|
|
62
|
+
.interactive .js-control { display: block; }
|
|
63
|
+
.interactive .controls { display: flex; }
|
|
64
|
+
.interactive main.dragging { cursor: grabbing; }
|
|
65
|
+
@media (max-width: 760px) {
|
|
66
|
+
.viewer-bar { flex-wrap: wrap; gap: 4px 12px; padding: 6px 10px; }
|
|
67
|
+
.viewer-heading { flex-basis: 100%; min-height: 28px; }
|
|
68
|
+
.viewer-actions { width: 100%; justify-content: flex-end; }
|
|
69
|
+
.viewer-count { margin-right: auto; }
|
|
70
|
+
.viewer-panel { right: 10px; }
|
|
71
|
+
.canvas-legend { max-width: 100%; }
|
|
72
|
+
}
|
|
73
|
+
/* Below the count's breakpoint the row it sat on would hold two icons and
|
|
74
|
+
nothing else, so the bar goes back to one line and keeps its height for the
|
|
75
|
+
canvas. The brand gives up its room to the title, which needs it more. */
|
|
76
|
+
@media (max-width: 480px) {
|
|
77
|
+
.viewer-count, .viewer-sep, .viewer-brand { display: none; }
|
|
78
|
+
/* flex-basis 0, not auto: an auto basis measures the whole title, which no
|
|
79
|
+
row can hold, so the bar would wrap back into two lines. */
|
|
80
|
+
.viewer-heading { flex-basis: 0; }
|
|
81
|
+
.viewer-actions { width: auto; }
|
|
82
|
+
}
|
|
83
|
+
@media (pointer: coarse) {
|
|
84
|
+
.viewer-bar button, .viewer-info > summary { min-height: 44px; min-width: 44px; }
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
/**
|
|
88
|
+
* The Info disclosure is icon-only: the word carried no information of its
|
|
89
|
+
* own, and the glyph is unambiguous. The label keeps it accessible, and the
|
|
90
|
+
* separator sets the read-only count apart from the controls.
|
|
91
|
+
*/
|
|
92
|
+
const INFO_ICON = '<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" focusable="false">'
|
|
93
|
+
+ '<circle cx="8" cy="8" r="6.6" fill="none" stroke="currentColor" stroke-width="1.4"/>'
|
|
94
|
+
+ '<circle cx="8" cy="5.1" r=".95" fill="currentColor"/>'
|
|
95
|
+
+ '<path d="M8 7.4v4.2" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>';
|
|
96
|
+
/**
|
|
97
|
+
* The compact toolbar: brand, title, one headline count, and the controls —
|
|
98
|
+
* the Info disclosure and the Save-as-image camera, as one cluster. The canvas
|
|
99
|
+
* dock keeps the gesture controls. A statistic is listed only when its count is
|
|
100
|
+
* non-zero: a zero names something the view does not contain, which sends the
|
|
101
|
+
* reader looking for it.
|
|
102
|
+
*/
|
|
103
|
+
export function canvasHeaderHTML(title, stats, description) {
|
|
104
|
+
const listed = stats.filter(([, value]) => value !== 0);
|
|
105
|
+
const first = listed[0];
|
|
106
|
+
return '<header class="viewer-bar">'
|
|
107
|
+
+ '<div class="viewer-heading"><a class="viewer-brand" href="' + REPOSITORY_URL + '" target="_blank" rel="noopener noreferrer" title="' + SHARE_WATERMARK + ' on GitHub">' + BRAND_MARK + 'ADR Kit</a><h1>' + escapeHtml(title) + '</h1></div>'
|
|
108
|
+
+ '<div class="viewer-actions"><span class="viewer-count">' + (first ? first[1] + ' ' + escapeHtml(first[0]) : '') + '</span>'
|
|
109
|
+
+ '<span class="viewer-sep" aria-hidden="true"></span>'
|
|
110
|
+
+ '<div class="viewer-tools">'
|
|
111
|
+
+ '<details class="viewer-info"><summary aria-label="View information" title="View information">' + INFO_ICON + '</summary><section class="viewer-panel" aria-label="View information">'
|
|
112
|
+
+ '<h2>' + escapeHtml(title) + '</h2><p>' + escapeHtml(description) + '</p>'
|
|
113
|
+
+ '<div class="viewer-stats">' + listed.map(([label, value]) => '<span><strong>' + value + '</strong>' + escapeHtml(label) + '</span>').join('') + '</div>'
|
|
114
|
+
+ '<p id="instructions" class="hint">' + CANVAS_HINT + '</p>'
|
|
115
|
+
+ '</section></details>'
|
|
116
|
+
+ SHARE_BUTTON_HTML
|
|
117
|
+
+ '</div>'
|
|
118
|
+
+ '</div></header>';
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The canvas dock: the legend over the bottom-left corner, the zoom cluster
|
|
122
|
+
* over the bottom-right. Both float above the canvas, so the header can stay
|
|
123
|
+
* compact without hiding what the picture means. A view with nothing to key
|
|
124
|
+
* draws no legend panel rather than an empty one.
|
|
125
|
+
*/
|
|
126
|
+
export function canvasDockHTML(legend, fitLabel) {
|
|
127
|
+
return '<div class="canvas-dock">'
|
|
128
|
+
+ (legend === '' ? '' : '<section class="canvas-legend" aria-label="Legend"><div class="legend">' + legend + '</div></section>')
|
|
129
|
+
+ canvasControlsHTML(fitLabel)
|
|
130
|
+
+ '</div>';
|
|
131
|
+
}
|
|
132
|
+
/** Shared pan/zoom controller for the offline HTML views. */
|
|
2
133
|
export const CANVAS_SCRIPT = String.raw `
|
|
3
134
|
|
|
4
135
|
(() => {
|
|
@@ -6,6 +137,16 @@ export const CANVAS_SCRIPT = String.raw `
|
|
|
6
137
|
const world = document.getElementById('world');
|
|
7
138
|
if (!viewport || !world) return;
|
|
8
139
|
document.body.classList.add('interactive');
|
|
140
|
+
const info = document.querySelector('.viewer-info');
|
|
141
|
+
document.addEventListener('keydown', event => {
|
|
142
|
+
if (event.key === 'Escape' && info && info.open) {
|
|
143
|
+
info.open = false;
|
|
144
|
+
info.querySelector('summary').focus();
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
document.addEventListener('pointerdown', event => {
|
|
148
|
+
if (info && info.open && !info.contains(event.target)) info.open = false;
|
|
149
|
+
});
|
|
9
150
|
let scale = 1, tx = 0, ty = 0, frame = 0;
|
|
10
151
|
|
|
11
152
|
function paint() {
|
|
@@ -13,12 +154,31 @@ export const CANVAS_SCRIPT = String.raw `
|
|
|
13
154
|
const zoom = document.getElementById('zoom');
|
|
14
155
|
if (zoom) zoom.value = Math.round(scale * 100) + '%';
|
|
15
156
|
}
|
|
157
|
+
/** Overview: the whole diagram inside the viewport, behind the Fit control. */
|
|
16
158
|
function fit() {
|
|
17
159
|
const width = world.offsetWidth, height = world.offsetHeight;
|
|
18
160
|
if (!width || !height) return;
|
|
19
|
-
|
|
161
|
+
// Fit above the dock so no card hides behind the legend panel.
|
|
162
|
+
const dock = viewport.querySelector('.canvas-dock');
|
|
163
|
+
const padY = 48 + (dock ? dock.offsetHeight : 0);
|
|
164
|
+
scale = Math.max(.01, Math.min(1, (viewport.clientWidth - 48) / width, (viewport.clientHeight - padY) / height));
|
|
20
165
|
tx = (viewport.clientWidth - width * scale) / 2;
|
|
21
|
-
ty =
|
|
166
|
+
ty = (viewport.clientHeight - height * scale) / 2;
|
|
167
|
+
paint();
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The view a diagram opens in: readable first. Fit the width and never past
|
|
171
|
+
* 1:1, so a tall tree runs past the fold and pans instead of shrinking to a
|
|
172
|
+
* thumbnail whose text cannot be read. Fit is still the overview.
|
|
173
|
+
*/
|
|
174
|
+
function fitWidth() {
|
|
175
|
+
const width = world.offsetWidth, height = world.offsetHeight;
|
|
176
|
+
if (!width || !height) return;
|
|
177
|
+
scale = Math.max(.01, Math.min(1, (viewport.clientWidth - 48) / width));
|
|
178
|
+
tx = (viewport.clientWidth - width * scale) / 2;
|
|
179
|
+
const dock = viewport.querySelector('.canvas-dock');
|
|
180
|
+
const room = viewport.clientHeight - 48 - (dock ? dock.offsetHeight : 0);
|
|
181
|
+
ty = height * scale <= room ? (viewport.clientHeight - height * scale) / 2 : 24;
|
|
22
182
|
paint();
|
|
23
183
|
}
|
|
24
184
|
function zoomAt(factor, clientX, clientY) {
|
|
@@ -49,23 +209,51 @@ export const CANVAS_SCRIPT = String.raw `
|
|
|
49
209
|
if (reset) reset.addEventListener('click', () => zoom(1 / scale));
|
|
50
210
|
|
|
51
211
|
let drag = null;
|
|
212
|
+
let panned = false;
|
|
213
|
+
// A press that moves pans; a press that stays is a click. The slop
|
|
214
|
+
// threshold is what lets links live inside the canvas: pointer capture
|
|
215
|
+
// would retarget their click, so capture waits until the gesture has
|
|
216
|
+
// committed to being a pan.
|
|
217
|
+
const CLICK_SLOP = 4;
|
|
52
218
|
viewport.addEventListener('pointerdown', event => {
|
|
53
|
-
if (event.button !== 0
|
|
54
|
-
|
|
55
|
-
viewport.
|
|
56
|
-
|
|
219
|
+
if (event.button !== 0) return;
|
|
220
|
+
// Real controls keep their native press behavior: with pointer capture
|
|
221
|
+
// their click would land on the viewport and never reach them.
|
|
222
|
+
if (event.target.closest('button, summary, input, select, textarea, .controls, .canvas-legend')) return;
|
|
223
|
+
panned = false;
|
|
224
|
+
drag = { x: event.clientX, y: event.clientY, id: event.pointerId, moved: false };
|
|
57
225
|
});
|
|
58
226
|
viewport.addEventListener('pointermove', event => {
|
|
59
227
|
if (!drag || drag.id !== event.pointerId) return;
|
|
228
|
+
if (!drag.moved) {
|
|
229
|
+
if (Math.abs(event.clientX - drag.x) + Math.abs(event.clientY - drag.y) < CLICK_SLOP) return;
|
|
230
|
+
drag.moved = true;
|
|
231
|
+
viewport.setPointerCapture(event.pointerId);
|
|
232
|
+
viewport.classList.add('dragging');
|
|
233
|
+
}
|
|
60
234
|
tx += event.clientX - drag.x;
|
|
61
235
|
ty += event.clientY - drag.y;
|
|
62
236
|
drag.x = event.clientX;
|
|
63
237
|
drag.y = event.clientY;
|
|
64
238
|
paint();
|
|
65
239
|
});
|
|
66
|
-
|
|
240
|
+
viewport.addEventListener('pointerup', event => {
|
|
241
|
+
panned = drag !== null && drag.moved && drag.id === event.pointerId;
|
|
242
|
+
drag = null;
|
|
243
|
+
viewport.classList.remove('dragging');
|
|
244
|
+
});
|
|
245
|
+
for (const name of ['pointercancel', 'lostpointercapture']) {
|
|
67
246
|
viewport.addEventListener(name, () => { drag = null; viewport.classList.remove('dragging'); });
|
|
68
247
|
}
|
|
248
|
+
// The pan must not also open the link it started on, and a native link
|
|
249
|
+
// drag would cancel the pointer gesture outright.
|
|
250
|
+
viewport.addEventListener('click', event => {
|
|
251
|
+
if (!panned) return;
|
|
252
|
+
panned = false;
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
event.stopPropagation();
|
|
255
|
+
}, true);
|
|
256
|
+
viewport.addEventListener('dragstart', event => { if (drag) event.preventDefault(); });
|
|
69
257
|
// A trackpad pinch arrives as a ctrlKey wheel event; macOS also reports
|
|
70
258
|
// Command as metaKey. Either one zooms toward the pointer so the point under
|
|
71
259
|
// the cursor stays put (ADR 11), matching the on-screen hint. A plain wheel
|
|
@@ -90,31 +278,38 @@ export const CANVAS_SCRIPT = String.raw `
|
|
|
90
278
|
if (actions[event.key]) { event.preventDefault(); actions[event.key](); paint(); }
|
|
91
279
|
});
|
|
92
280
|
viewport.addEventListener('focusin', event => {
|
|
93
|
-
if (!event.target.closest('.card')) return;
|
|
281
|
+
if (!event.target.closest('.card, #world a')) return;
|
|
94
282
|
const target = event.target.getBoundingClientRect();
|
|
95
283
|
const view = viewport.getBoundingClientRect();
|
|
96
|
-
if (target.left < view.left || target.right > view.right || target.top < view.top || target.bottom > view.bottom
|
|
284
|
+
if (target.left < view.left || target.right > view.right || target.top < view.top || target.bottom > view.bottom) {
|
|
97
285
|
tx += view.left + view.width / 2 - (target.left + target.width / 2);
|
|
98
286
|
ty += view.top + view.height / 2 - (target.top + target.height / 2);
|
|
99
287
|
paint();
|
|
100
288
|
}
|
|
101
289
|
});
|
|
102
|
-
window.addEventListener('resize', () => { relayout();
|
|
290
|
+
window.addEventListener('resize', () => { relayout(); fitWidth(); });
|
|
103
291
|
|
|
104
292
|
window.__adrCanvas = {
|
|
105
293
|
viewport, world,
|
|
106
294
|
get scale() { return scale; },
|
|
107
|
-
paint, fit, zoom, zoomAt, addPan, schedule, relayout
|
|
295
|
+
paint, fit, fitWidth, zoom, zoomAt, addPan, schedule, relayout
|
|
108
296
|
};
|
|
297
|
+
|
|
298
|
+
// Open in the readable view, from the shared controller that owns it: the
|
|
299
|
+
// map has no layout step of its own, so without this it would sit unfitted.
|
|
300
|
+
// The tree's cards are laid out by the script that follows this one, which
|
|
301
|
+
// fits again once they are measured.
|
|
302
|
+
relayout();
|
|
303
|
+
fitWidth();
|
|
109
304
|
})();
|
|
110
305
|
`;
|
|
111
|
-
export const CANVAS_HINT = 'Drag
|
|
112
|
-
|
|
306
|
+
export const CANVAS_HINT = 'Drag anywhere or scroll to pan · Pinch or Ctrl/⌘ + scroll to zoom at the pointer · Arrow keys move · + / − zoom · 0 fits';
|
|
307
|
+
function canvasControlsHTML(fitLabel) {
|
|
113
308
|
return '<div class="controls js-control">'
|
|
114
309
|
+ '<button id="minus" aria-label="Zoom out">−</button>'
|
|
115
310
|
+ '<output id="zoom" aria-label="Zoom level">100%</output>'
|
|
116
311
|
+ '<button id="plus" aria-label="Zoom in">+</button>'
|
|
117
|
-
+ '<button id="fit"
|
|
312
|
+
+ '<button id="fit" aria-label="' + escapeHtml(fitLabel) + '">Fit</button>'
|
|
118
313
|
+ '<button id="reset">1:1</button>'
|
|
119
314
|
+ '</div>';
|
|
120
315
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-view.js","sourceRoot":"","sources":["../../src/core/canvas-view.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"canvas-view.js","sourceRoot":"","sources":["../../src/core/canvas-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElF,kFAAkF;AAClF,MAAM,cAAc,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAE/D;;;;GAIG;AACH,MAAM,UAAU,GAAG,uFAAuF;MACtG,WAAW,GAAG,gBAAgB,GAAG,+BAA+B,CAAC;AAErE,qDAAqD;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyErC,CAAC;AAEF;;;;GAIG;AACH,MAAM,SAAS,GAAG,uFAAuF;MACrG,sFAAsF;MACtF,uDAAuD;MACvD,8FAA8F,CAAC;AAEnG;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,KAA8B,EAAE,WAAmB;IACjG,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACxB,OAAO,6BAA6B;UAChC,4DAA4D,GAAG,cAAc,GAAG,qDAAqD,GAAG,eAAe,GAAG,cAAc,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,aAAa;UAC7O,yDAAyD,GAAG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AM,CAAC,MAAM,WAAW,GAAG,0HAA0H,CAAC;AAEtJ,SAAS,kBAAkB,CAAC,QAAgB;IAC1C,OAAO,mCAAmC;UACtC,qDAAqD;UACrD,yDAAyD;UACzD,mDAAmD;UACnD,+BAA+B,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,gBAAgB;UACzE,iCAAiC;UACjC,QAAQ,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command surface: which commands exist and which options each one takes.
|
|
3
|
+
* `src/cli.ts` uses it to reject an option a command does not take, and
|
|
4
|
+
* `src/commands/completion.ts` uses it to offer the same options, so the two
|
|
5
|
+
* cannot drift apart. Update this table whenever the CLI surface changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const COMMANDS: readonly ['init', 'propose', 'decide', 'accept', 'reject', 'supersede', 'list', 'show', 'status', 'instructions', 'validate', 'update', 'config', 'graph', 'tree', 'completion', 'version', 'help'];
|
|
8
|
+
/**
|
|
9
|
+
* Options each command accepts, spelled with their leading dashes. `--help` is
|
|
10
|
+
* valid everywhere; the global `--version` never reaches a command because the
|
|
11
|
+
* CLI handles it before dispatch.
|
|
12
|
+
*/
|
|
13
|
+
export declare const COMMAND_OPTIONS: Record<string, string[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Options that consume the following word as their value. Declaring them as
|
|
16
|
+
* valueless would make every shell treat them as flags, so completion would
|
|
17
|
+
* repeat the option list where the CLI expects free text.
|
|
18
|
+
*/
|
|
19
|
+
export declare const VALUE_OPTIONS: readonly ['--by', '--reason', '--tag', '--tools', '--workflows', '--out'];
|
|
20
|
+
export declare function takesValue(option: string): boolean;
|
|
21
|
+
/** Options supplied for a `command` that its synopsis does not list. */
|
|
22
|
+
export declare function unsupportedOptions(command: string, supplied: readonly string[]): string[];
|
|
23
|
+
//# sourceMappingURL=cli-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-options.d.ts","sourceRoot":"","sources":["../../src/core/cli-options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,QAAQ,YACnB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,EACN,MAAM,EACN,QAAQ,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,EACZ,SAAS,EACT,MAAM,CACE,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAmBpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,YAAI,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAU,CAAC;AAEvG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAKzF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command surface: which commands exist and which options each one takes.
|
|
3
|
+
* `src/cli.ts` uses it to reject an option a command does not take, and
|
|
4
|
+
* `src/commands/completion.ts` uses it to offer the same options, so the two
|
|
5
|
+
* cannot drift apart. Update this table whenever the CLI surface changes.
|
|
6
|
+
*/
|
|
7
|
+
export const COMMANDS = [
|
|
8
|
+
'init',
|
|
9
|
+
'propose',
|
|
10
|
+
'decide',
|
|
11
|
+
'accept',
|
|
12
|
+
'reject',
|
|
13
|
+
'supersede',
|
|
14
|
+
'list',
|
|
15
|
+
'show',
|
|
16
|
+
'status',
|
|
17
|
+
'instructions',
|
|
18
|
+
'validate',
|
|
19
|
+
'update',
|
|
20
|
+
'config',
|
|
21
|
+
'graph',
|
|
22
|
+
'tree',
|
|
23
|
+
'completion',
|
|
24
|
+
'version',
|
|
25
|
+
'help',
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Options each command accepts, spelled with their leading dashes. `--help` is
|
|
29
|
+
* valid everywhere; the global `--version` never reaches a command because the
|
|
30
|
+
* CLI handles it before dispatch.
|
|
31
|
+
*/
|
|
32
|
+
export const COMMAND_OPTIONS = {
|
|
33
|
+
init: ['--tools', '--workflows', '--help'],
|
|
34
|
+
propose: ['--help'],
|
|
35
|
+
decide: ['--raised-by', '--decided-by', '--help'],
|
|
36
|
+
accept: ['--raised-by', '--decided-by', '--help'],
|
|
37
|
+
reject: ['--reason', '--help'],
|
|
38
|
+
supersede: ['--by', '--help'],
|
|
39
|
+
list: ['--help'],
|
|
40
|
+
show: ['--help'],
|
|
41
|
+
status: ['--help'],
|
|
42
|
+
instructions: ['--help'],
|
|
43
|
+
validate: ['--all', '--help'],
|
|
44
|
+
update: ['--tools', '--workflows', '--help'],
|
|
45
|
+
config: ['--help'],
|
|
46
|
+
graph: ['--mermaid', '--dot', '--text', '--html', '--formal-only', '--tag', '--out', '--help'],
|
|
47
|
+
tree: ['--mermaid', '--text', '--html', '--help'],
|
|
48
|
+
completion: ['--help'],
|
|
49
|
+
version: ['--help'],
|
|
50
|
+
help: ['--help'],
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Options that consume the following word as their value. Declaring them as
|
|
54
|
+
* valueless would make every shell treat them as flags, so completion would
|
|
55
|
+
* repeat the option list where the CLI expects free text.
|
|
56
|
+
*/
|
|
57
|
+
export const VALUE_OPTIONS = ['--by', '--reason', '--tag', '--tools', '--workflows', '--out'];
|
|
58
|
+
export function takesValue(option) {
|
|
59
|
+
return VALUE_OPTIONS.includes(option);
|
|
60
|
+
}
|
|
61
|
+
/** Options supplied for a `command` that its synopsis does not list. */
|
|
62
|
+
export function unsupportedOptions(command, supplied) {
|
|
63
|
+
const allowed = COMMAND_OPTIONS[command];
|
|
64
|
+
if (allowed === undefined)
|
|
65
|
+
return [];
|
|
66
|
+
const set = new Set(allowed);
|
|
67
|
+
return supplied.filter((option) => !set.has(option));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=cli-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../../src/core/cli-options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,MAAM;IACN,MAAM;IACN,QAAQ;IACR,cAAc;IACd,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,YAAY;IACZ,SAAS;IACT,MAAM;CACE,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,IAAI,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,CAAC;IAC1C,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,MAAM,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,QAAQ,CAAC;IACjD,MAAM,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,QAAQ,CAAC;IACjD,MAAM,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC7B,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,YAAY,EAAE,CAAC,QAAQ,CAAC;IACxB,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC7B,MAAM,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,CAAC;IAC5C,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,KAAK,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC9F,IAAI,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC;IACjD,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,IAAI,EAAE,CAAC,QAAQ,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAU,CAAC;AAEvG,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,QAA2B;IAC7E,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export interface AdrKitConfig {
|
|
|
9
9
|
tools?: string[];
|
|
10
10
|
/** Workflow subset for integrations, e.g. `["init", "decide", "validate"]`. */
|
|
11
11
|
workflows?: string[];
|
|
12
|
+
/** Version of the CLI that last wrote the integrations; absent before this stamp existed. */
|
|
13
|
+
installedWith?: string;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Walk from `startDir` upward to find the nearest directory that contains
|
|
@@ -19,8 +21,35 @@ export declare function findRoot(startDir: string): string | undefined;
|
|
|
19
21
|
export declare function requireRoot(startDir: string): string;
|
|
20
22
|
export declare function configPath(root: string): string;
|
|
21
23
|
export declare function readConfig(root: string): AdrKitConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Read the configuration without throwing. The drift notice must never turn a
|
|
26
|
+
* command into a failure: a repository with a malformed `adr/config.yaml`
|
|
27
|
+
* simply has nothing honest to say about its stamp, and `validate` remains the
|
|
28
|
+
* command that reports the broken file.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readConfigSafe(root: string): AdrKitConfig | undefined;
|
|
22
31
|
/** Update the `tools:` key; see {@link writeListConfig} for the semantics. */
|
|
23
32
|
export declare function writeToolsConfig(root: string, tools: string[]): void;
|
|
24
33
|
/** Update the `workflows:` key; see {@link writeListConfig} for the semantics. */
|
|
25
34
|
export declare function writeWorkflowsConfig(root: string, workflows: string[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* Stamp the `installed-with:` scalar with the version that is writing the
|
|
37
|
+
* integrations. The stamp is what lets later commands notice that the
|
|
38
|
+
* installed skills predate (or postdate) the running CLI; see
|
|
39
|
+
* {@link installedWithNotice}.
|
|
40
|
+
*/
|
|
41
|
+
export declare function writeInstalledWithConfig(root: string, version: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* The one-line drift notice for a repository whose integrations were written
|
|
44
|
+
* by a different adr-kit than the one now running. The newer side suggests
|
|
45
|
+
* `adrkit update`; the older side directs to upgrading the package instead,
|
|
46
|
+
* because running `adrkit update` there would rewrite the newer installed
|
|
47
|
+
* skills with this CLI's older templates. Quiet — `undefined` — when
|
|
48
|
+
* there is nothing honest to say: no stamp (repositories configured before it
|
|
49
|
+
* existed), an explicit integrations opt-out, equal versions, or a version
|
|
50
|
+
* either side cannot parse.
|
|
51
|
+
*/
|
|
52
|
+
export declare function installedWithNotice(config: AdrKitConfig, currentVersion: string): string | undefined;
|
|
53
|
+
/** Append the drift notice to a command's output as its own paragraph. */
|
|
54
|
+
export declare function withNotice(output: string, notice: string | undefined): string;
|
|
26
55
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,QAAQ,CAAC;AAC7B,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,QAAQ,CAAC;AAC7B,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAU7D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAmBD,wBAAgB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