@davmash/bygone 0.9.8 → 0.10.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/CHANGELOG.md +26 -1
- package/README.md +74 -1
- package/cli/commandSpec.js +2 -0
- package/cli/completions.js +3 -3
- package/cli/present.js +41 -14
- package/cli/tour.js +22 -1
- package/cli/tourExport.js +147 -0
- package/cli/tourFile.js +109 -4
- package/cli/tourHistory.js +31 -1
- package/completions/_bygone +1 -1
- package/completions/bygone +1 -1
- package/completions/bygone.fish +1 -1
- package/docs/change-tour-format.md +85 -68
- package/docs/explore.md +14 -3
- package/docs/generating-change-tours.md +84 -46
- package/docs/present.md +103 -14
- package/docs/product-surface.md +19 -8
- package/docs/sharing-tours.md +95 -0
- package/docs/visual-walkthrough/README.md +89 -0
- package/docs/visual-walkthrough/build-tour.mjs +54 -0
- package/docs/visual-walkthrough/capture-desktop.cjs +42 -0
- package/docs/visual-walkthrough/capture-desktop.mjs +21 -0
- package/docs/visual-walkthrough/captures.md +49 -0
- package/docs/visual-walkthrough/create-demo.mjs +57 -0
- package/docs/visual-walkthrough/deconstructed-demo.bygone +100 -0
- package/docs/visual-walkthrough/images/01-two-files.png +0 -0
- package/docs/visual-walkthrough/images/02-many-panels.png +0 -0
- package/docs/visual-walkthrough/images/03-directories.png +0 -0
- package/docs/visual-walkthrough/images/04-search.png +0 -0
- package/docs/visual-walkthrough/images/05-repository-history.png +0 -0
- package/docs/visual-walkthrough/images/06-file-history.png +0 -0
- package/docs/visual-walkthrough/images/07-branch-review.png +0 -0
- package/docs/visual-walkthrough/images/08-tour-reader.png +0 -0
- package/docs/visual-walkthrough/images/09-focused-step.png +0 -0
- package/docs/visual-walkthrough/images/10-deconstructed.png +0 -0
- package/docs/visual-walkthrough/images/11-exploration.png +0 -0
- package/docs/visual-walkthrough/images/12-authoring.png +0 -0
- package/docs/visual-walkthrough/images/13-export.png +0 -0
- package/docs/visual-walkthrough/images/14-vscode.png +0 -0
- package/docs/visual-walkthrough/images/15-cli.png +0 -0
- package/docs/visual-walkthrough/narrative.md +134 -0
- package/docs/visual-walkthrough/outline.md +52 -0
- package/docs/visual-walkthrough/walkthrough.bygone +340 -0
- package/docs/walkthrough.md +6 -101
- package/examples/bygone-history.bygone +11 -44
- package/examples/marker-focus.bygone +116 -0
- package/examples/navigation-lab.bygone.yaml +401 -336
- package/examples/tour-orientation.bygone +349 -0
- package/media/diff.worker.js +13 -3
- package/media/webview.css +1 -1
- package/media/webview.js +394 -319
- package/out/changeTour.js +865 -397
- package/out/deepLink.js +167 -0
- package/out/historyDirectory.js +66 -0
- package/out/standalone-main.js +20532 -16832
- package/out/tourCoverage.js +850 -386
- package/out/tourDocument.js +97 -0
- package/package.json +1 -1
- package/schemas/change-tour-source.schema.json +91 -64
- package/skills/pr-tour-guide/SKILL.md +144 -128
- package/skills/pr-tour-guide/references/expectations-and-feedback.md +57 -0
- package/standalone/index.html +10 -25
- package/web/export-bootstrap.js +62 -0
- package/web/export-licenses.txt +78 -0
- package/web/export-runtime.json +12 -0
- package/web/index.html +54 -47
- package/web/presenter.css +332 -178
- package/web/web-host.js +239 -137
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/tourDocument.ts
|
|
31
|
+
var tourDocument_exports = {};
|
|
32
|
+
__export(tourDocument_exports, {
|
|
33
|
+
classifyAuthoredTourPaths: () => classifyAuthoredTourPaths,
|
|
34
|
+
discoverAuthoredTourDocument: () => discoverAuthoredTourDocument,
|
|
35
|
+
isAuthoredTourPath: () => isAuthoredTourPath
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(tourDocument_exports);
|
|
38
|
+
var import_child_process = require("child_process");
|
|
39
|
+
var fs = __toESM(require("fs"));
|
|
40
|
+
var path = __toESM(require("path"));
|
|
41
|
+
function isAuthoredTourPath(candidate, platform = process.platform) {
|
|
42
|
+
const comparable = platform === "win32" || platform === "darwin" ? candidate.toLocaleLowerCase("en-US") : candidate;
|
|
43
|
+
return comparable.endsWith(".bygone") || comparable.endsWith(".bygone.yaml");
|
|
44
|
+
}
|
|
45
|
+
function classifyAuthoredTourPaths(candidates, platform = process.platform) {
|
|
46
|
+
const tourPaths = candidates.filter((candidate) => isAuthoredTourPath(candidate, platform));
|
|
47
|
+
if (tourPaths.length === 0) return { kind: "none", paths: candidates };
|
|
48
|
+
if (tourPaths.length === 1 && candidates.length === 1) return { kind: "single", path: tourPaths[0] };
|
|
49
|
+
if (tourPaths.length === candidates.length) return { kind: "multiple", paths: tourPaths };
|
|
50
|
+
return {
|
|
51
|
+
kind: "mixed",
|
|
52
|
+
tourPaths,
|
|
53
|
+
otherPaths: candidates.filter((candidate) => !isAuthoredTourPath(candidate, platform))
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function discoverAuthoredTourDocument(sourcePath) {
|
|
57
|
+
const requestedPath = path.resolve(sourcePath);
|
|
58
|
+
let documentPath;
|
|
59
|
+
try {
|
|
60
|
+
documentPath = fs.realpathSync(requestedPath);
|
|
61
|
+
if (!fs.statSync(documentPath).isFile()) {
|
|
62
|
+
throw new Error("path is not a regular file");
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
throw errorWithCause(`Could not open Bygone source ${requestedPath}: ${errorMessage(error)}`, error);
|
|
66
|
+
}
|
|
67
|
+
let repoRoot;
|
|
68
|
+
try {
|
|
69
|
+
const discoveredRoot = (0, import_child_process.execFileSync)("git", ["rev-parse", "--show-toplevel"], {
|
|
70
|
+
cwd: path.dirname(documentPath),
|
|
71
|
+
encoding: "utf8",
|
|
72
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
73
|
+
}).trim();
|
|
74
|
+
repoRoot = fs.realpathSync(discoveredRoot);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
throw errorWithCause(
|
|
77
|
+
`Bygone source ${documentPath} needs its Git repository. Place it inside the corresponding worktree or open it with an explicit repository working directory.`,
|
|
78
|
+
error
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return { documentPath, repoRoot };
|
|
82
|
+
}
|
|
83
|
+
function errorMessage(error) {
|
|
84
|
+
return error instanceof Error ? error.message : String(error);
|
|
85
|
+
}
|
|
86
|
+
function errorWithCause(message, cause) {
|
|
87
|
+
const error = new Error(message);
|
|
88
|
+
error.cause = cause;
|
|
89
|
+
return error;
|
|
90
|
+
}
|
|
91
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
92
|
+
0 && (module.exports = {
|
|
93
|
+
classifyAuthoredTourPaths,
|
|
94
|
+
discoverAuthoredTourDocument,
|
|
95
|
+
isAuthoredTourPath
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=tourDocument.js.map
|
package/package.json
CHANGED
|
@@ -7,20 +7,23 @@
|
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["version", "anchors", "connections", "chapters"],
|
|
9
9
|
"properties": {
|
|
10
|
-
"version": { "enum": [1, 2,
|
|
10
|
+
"version": { "enum": [1, 2, 4, 5] },
|
|
11
|
+
"opening": { "$ref": "#/$defs/passage" },
|
|
12
|
+
"conclusion": { "$ref": "#/$defs/passage" },
|
|
11
13
|
"title": { "$ref": "#/$defs/nonEmptyString" },
|
|
12
14
|
"windowTitle": {
|
|
13
15
|
"$ref": "#/$defs/nonEmptyString",
|
|
14
16
|
"description": "Optional native window title for the tour presenter. Use a short label such as a pull request number when multiple tours may be open."
|
|
15
17
|
},
|
|
16
18
|
"sourceUrl": { "type": "string", "minLength": 1 },
|
|
19
|
+
"details": { "$ref": "#/$defs/details" },
|
|
17
20
|
"range": {
|
|
18
21
|
"type": "object",
|
|
19
22
|
"additionalProperties": false,
|
|
20
23
|
"required": ["base", "head"],
|
|
21
24
|
"properties": {
|
|
22
|
-
"base": { "$ref": "#/$defs/
|
|
23
|
-
"head": { "$ref": "#/$defs/
|
|
25
|
+
"base": { "$ref": "#/$defs/prose" },
|
|
26
|
+
"head": { "$ref": "#/$defs/prose" }
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
"coverage": {
|
|
@@ -34,7 +37,6 @@
|
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
|
-
"review": { "$ref": "#/$defs/review" },
|
|
38
40
|
"anchors": {
|
|
39
41
|
"type": "object",
|
|
40
42
|
"propertyNames": { "minLength": 1 },
|
|
@@ -69,10 +71,29 @@
|
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
"allOf": [
|
|
74
|
+
{
|
|
75
|
+
"if": { "properties": { "version": { "const": 5 } } },
|
|
76
|
+
"then": {
|
|
77
|
+
"properties": {
|
|
78
|
+
"chapters": { "$ref": "#/$defs/purposeChapters" },
|
|
79
|
+
"tours": { "additionalProperties": { "properties": {
|
|
80
|
+
"chapters": { "$ref": "#/$defs/purposeChapters" }
|
|
81
|
+
} } }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"else": {
|
|
85
|
+
"properties": {
|
|
86
|
+
"opening": false, "conclusion": false, "details": false, "chapters": { "$ref": "#/$defs/legacyFramingChapters" },
|
|
87
|
+
"tours": { "additionalProperties": { "properties": {
|
|
88
|
+
"opening": false, "conclusion": false, "details": false, "chapters": { "$ref": "#/$defs/legacyFramingChapters" }
|
|
89
|
+
} } }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
72
93
|
{
|
|
73
94
|
"if": { "properties": { "version": { "enum": [1, 2] } }, "required": ["version"] },
|
|
74
95
|
"then": {
|
|
75
|
-
"not": { "
|
|
96
|
+
"not": { "required": ["tours"] },
|
|
76
97
|
"properties": {
|
|
77
98
|
"chapters": {
|
|
78
99
|
"items": {
|
|
@@ -106,7 +127,7 @@
|
|
|
106
127
|
}
|
|
107
128
|
},
|
|
108
129
|
{
|
|
109
|
-
"if": { "properties": { "version": { "enum": [2,
|
|
130
|
+
"if": { "properties": { "version": { "enum": [2, 4, 5] } }, "required": ["version"] },
|
|
110
131
|
"then": {
|
|
111
132
|
"properties": {
|
|
112
133
|
"chapters": {
|
|
@@ -126,8 +147,53 @@
|
|
|
126
147
|
}
|
|
127
148
|
],
|
|
128
149
|
"$defs": {
|
|
150
|
+
"legacyFramingChapters": {
|
|
151
|
+
"items": {
|
|
152
|
+
"allOf": [
|
|
153
|
+
{ "not": { "required": ["summary"] } },
|
|
154
|
+
{ "properties": { "scenes": {
|
|
155
|
+
"items": { "properties": { "overview": { "not": { "required": ["purpose"] } } } }
|
|
156
|
+
} } }
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"purposeChapters": {
|
|
161
|
+
"items": { "properties": { "scenes": {
|
|
162
|
+
"items": { "properties": { "overview": { "required": ["purpose"] } } }
|
|
163
|
+
} } }
|
|
164
|
+
},
|
|
165
|
+
"prose": { "type": "string", "pattern": "\\S" },
|
|
166
|
+
"passage": {
|
|
167
|
+
"type": "object", "additionalProperties": false,
|
|
168
|
+
"required": ["title", "summary"],
|
|
169
|
+
"properties": {
|
|
170
|
+
"title": { "$ref": "#/$defs/prose" },
|
|
171
|
+
"summary": { "$ref": "#/$defs/prose" },
|
|
172
|
+
"bullets": { "type": "array", "items": { "$ref": "#/$defs/prose" } }
|
|
173
|
+
}
|
|
174
|
+
},
|
|
129
175
|
"nonEmptyString": { "type": "string", "minLength": 1 },
|
|
130
|
-
"
|
|
176
|
+
"details": {
|
|
177
|
+
"type": "object",
|
|
178
|
+
"additionalProperties": false,
|
|
179
|
+
"properties": {
|
|
180
|
+
"audience": { "$ref": "#/$defs/audience" }
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"audience": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"required": ["codebase", "language", "readingDemand", "purpose", "scope"],
|
|
187
|
+
"properties": {
|
|
188
|
+
"codebase": { "enum": ["none", "some", "maintainer"] },
|
|
189
|
+
"language": { "enum": ["none", "basic", "fluent", "advanced"] },
|
|
190
|
+
"domain": { "type": "array", "items": { "$ref": "#/$defs/prose" } },
|
|
191
|
+
"readingDemand": { "enum": ["general", "technical", "specialist"] },
|
|
192
|
+
"purpose": { "enum": ["overview", "explanation", "review"] },
|
|
193
|
+
"scope": { "$ref": "#/$defs/prose" },
|
|
194
|
+
"estimatedMinutes": { "type": "number", "exclusiveMinimum": 0 }
|
|
195
|
+
}
|
|
196
|
+
},
|
|
131
197
|
"stringArray": {
|
|
132
198
|
"type": "array",
|
|
133
199
|
"items": { "type": "string" }
|
|
@@ -179,6 +245,7 @@
|
|
|
179
245
|
"additionalProperties": false,
|
|
180
246
|
"required": ["kind"],
|
|
181
247
|
"properties": {
|
|
248
|
+
"purpose": { "$ref": "#/$defs/prose" },
|
|
182
249
|
"kind": { "const": "directory-diff" },
|
|
183
250
|
"comparison": {
|
|
184
251
|
"type": "object",
|
|
@@ -208,63 +275,6 @@
|
|
|
208
275
|
"confidence": { "enum": ["high", "medium", "low"] }
|
|
209
276
|
}
|
|
210
277
|
},
|
|
211
|
-
"review": {
|
|
212
|
-
"type": "object",
|
|
213
|
-
"additionalProperties": false,
|
|
214
|
-
"required": ["baseOid", "headOid", "items"],
|
|
215
|
-
"properties": {
|
|
216
|
-
"baseOid": { "$ref": "#/$defs/fullGitOid" },
|
|
217
|
-
"headOid": { "$ref": "#/$defs/fullGitOid" },
|
|
218
|
-
"items": {
|
|
219
|
-
"type": "array",
|
|
220
|
-
"minItems": 1,
|
|
221
|
-
"items": { "$ref": "#/$defs/reviewItem" }
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
"fullGitOid": {
|
|
226
|
-
"type": "string",
|
|
227
|
-
"pattern": "^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$"
|
|
228
|
-
},
|
|
229
|
-
"reviewItem": {
|
|
230
|
-
"type": "object",
|
|
231
|
-
"additionalProperties": false,
|
|
232
|
-
"required": ["id", "kind", "title", "body", "evidence"],
|
|
233
|
-
"properties": {
|
|
234
|
-
"id": { "$ref": "#/$defs/reviewString" },
|
|
235
|
-
"kind": { "enum": ["concept", "boundary", "tradeoff", "question"] },
|
|
236
|
-
"title": { "$ref": "#/$defs/reviewString" },
|
|
237
|
-
"body": { "$ref": "#/$defs/reviewString" },
|
|
238
|
-
"evidence": {
|
|
239
|
-
"type": "array",
|
|
240
|
-
"items": { "$ref": "#/$defs/reviewEvidence" }
|
|
241
|
-
},
|
|
242
|
-
"nextCheck": { "$ref": "#/$defs/reviewString" }
|
|
243
|
-
},
|
|
244
|
-
"allOf": [
|
|
245
|
-
{
|
|
246
|
-
"if": {
|
|
247
|
-
"properties": { "kind": { "const": "question" } },
|
|
248
|
-
"required": ["kind"]
|
|
249
|
-
},
|
|
250
|
-
"then": { "required": ["nextCheck"] },
|
|
251
|
-
"else": {
|
|
252
|
-
"properties": {
|
|
253
|
-
"evidence": { "minItems": 1 }
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
]
|
|
258
|
-
},
|
|
259
|
-
"reviewEvidence": {
|
|
260
|
-
"type": "object",
|
|
261
|
-
"additionalProperties": false,
|
|
262
|
-
"required": ["sceneId", "stepId"],
|
|
263
|
-
"properties": {
|
|
264
|
-
"sceneId": { "$ref": "#/$defs/reviewString" },
|
|
265
|
-
"stepId": { "$ref": "#/$defs/reviewString" }
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
278
|
"step": {
|
|
269
279
|
"type": "object",
|
|
270
280
|
"additionalProperties": false,
|
|
@@ -274,6 +284,15 @@
|
|
|
274
284
|
"title": { "$ref": "#/$defs/nonEmptyString" },
|
|
275
285
|
"body": { "$ref": "#/$defs/nonEmptyString" },
|
|
276
286
|
"focus": { "$ref": "#/$defs/nonEmptyString" },
|
|
287
|
+
"image": {
|
|
288
|
+
"type": "object", "additionalProperties": false,
|
|
289
|
+
"required": ["file", "revision", "alt"],
|
|
290
|
+
"properties": {
|
|
291
|
+
"file": { "$ref": "#/$defs/nonEmptyString" },
|
|
292
|
+
"revision": { "enum": ["base", "head"] },
|
|
293
|
+
"alt": { "$ref": "#/$defs/nonEmptyString" }
|
|
294
|
+
}
|
|
295
|
+
},
|
|
277
296
|
"connection": { "$ref": "#/$defs/nonEmptyString" },
|
|
278
297
|
"depth": { "enum": ["mentioned", "explained", "contextualized"] },
|
|
279
298
|
"requirement": { "$ref": "#/$defs/requirement" }
|
|
@@ -440,6 +459,7 @@
|
|
|
440
459
|
"properties": {
|
|
441
460
|
"id": { "$ref": "#/$defs/nonEmptyString" },
|
|
442
461
|
"title": { "$ref": "#/$defs/nonEmptyString" },
|
|
462
|
+
"summary": { "$ref": "#/$defs/prose" },
|
|
443
463
|
"scenes": {
|
|
444
464
|
"type": "array",
|
|
445
465
|
"minItems": 1,
|
|
@@ -458,6 +478,9 @@
|
|
|
458
478
|
"additionalProperties": false,
|
|
459
479
|
"required": ["chapters"],
|
|
460
480
|
"properties": {
|
|
481
|
+
"opening": { "$ref": "#/$defs/passage" },
|
|
482
|
+
"conclusion": { "$ref": "#/$defs/passage" },
|
|
483
|
+
"details": { "$ref": "#/$defs/details" },
|
|
461
484
|
"chapters": {
|
|
462
485
|
"type": "array",
|
|
463
486
|
"minItems": 1,
|
|
@@ -472,6 +495,7 @@
|
|
|
472
495
|
"properties": {
|
|
473
496
|
"id": { "$ref": "#/$defs/nonEmptyString" },
|
|
474
497
|
"title": { "$ref": "#/$defs/nonEmptyString" },
|
|
498
|
+
"summary": { "$ref": "#/$defs/prose" },
|
|
475
499
|
"scenes": {
|
|
476
500
|
"type": "array",
|
|
477
501
|
"minItems": 1,
|
|
@@ -489,6 +513,9 @@
|
|
|
489
513
|
"additionalProperties": false,
|
|
490
514
|
"required": ["chapters"],
|
|
491
515
|
"properties": {
|
|
516
|
+
"opening": { "$ref": "#/$defs/passage" },
|
|
517
|
+
"conclusion": { "$ref": "#/$defs/passage" },
|
|
518
|
+
"details": { "$ref": "#/$defs/details" },
|
|
492
519
|
"chapters": {
|
|
493
520
|
"type": "array",
|
|
494
521
|
"minItems": 1,
|