@ascribed/review 0.4.4 → 0.4.5-next.34
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/dist/marks/index.js +17 -1
- package/dist/marks/index.js.map +1 -1
- package/dist/names.d.ts +21 -0
- package/dist/names.js +21 -0
- package/dist/names.js.map +1 -1
- package/dist/overlay/overlay.js +34 -13
- package/dist/overlay/overlay.js.map +1 -1
- package/dist/shapes.d.ts +60 -7
- package/dist/shapes.js.map +1 -1
- package/package.json +3 -2
package/dist/shapes.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export interface DiffReport {
|
|
|
116
116
|
/**
|
|
117
117
|
* A piece of a formatted value, as the JSON output writes it:
|
|
118
118
|
* `{ "type": "text" | "code", "value": … }`. Other JSON that shows a
|
|
119
|
-
* formatted title, such as the
|
|
119
|
+
* formatted title, such as the HTML preview's, writes it the same way.
|
|
120
120
|
*/
|
|
121
121
|
export interface FormattedPiece {
|
|
122
122
|
/** What the piece is. */
|
|
@@ -149,6 +149,13 @@ export interface LineData {
|
|
|
149
149
|
/** Whether it's the current line. */
|
|
150
150
|
current: boolean;
|
|
151
151
|
}
|
|
152
|
+
/** A page that moved: where it was, and where it is, by content path. */
|
|
153
|
+
export interface MovedPage {
|
|
154
|
+
/** Where it was, in the base. */
|
|
155
|
+
from: string;
|
|
156
|
+
/** Where it is now. */
|
|
157
|
+
to: string;
|
|
158
|
+
}
|
|
152
159
|
/** One changed page: `ascribe diff --format json`'s, and its renderings. */
|
|
153
160
|
export interface PageData {
|
|
154
161
|
/** The page's content path. */
|
|
@@ -166,14 +173,22 @@ export interface PageData {
|
|
|
166
173
|
* The other changed files the page's change can come from: fragments it
|
|
167
174
|
* includes and pages its links take a title or a heading from, in path
|
|
168
175
|
* order; then the snippets whose code changed, by address
|
|
169
|
-
* (`code:app.py#main`);
|
|
170
|
-
*
|
|
176
|
+
* (`code:app.py#main`); then the operations of a declared API whose spec
|
|
177
|
+
* changed what the page writes for them, an `@operation`'s method, path,
|
|
178
|
+
* summary, or deprecation, or a link's address, each by its spec's path
|
|
179
|
+
* from the project root, `#`, and the fragment the page names it by
|
|
180
|
+
* (`api/openapi.yaml#createWidget`); and `ascribe.toml` (last) when the
|
|
181
|
+
* content model is a cause. The kinds are told apart by their form: a
|
|
182
|
+
* content file's path ends in `.md`, a snippet's address has its
|
|
183
|
+
* source's name and `:` before its path, and an operation's has a `#`
|
|
184
|
+
* and neither.
|
|
171
185
|
*/
|
|
172
186
|
because: string[];
|
|
173
187
|
/**
|
|
174
188
|
* What changed about the page itself besides its blocks, in this
|
|
175
189
|
* order: `title`, `frontmatter`, `availability` (the page-level one),
|
|
176
|
-
* and `route`. Empty for an added or removed page.
|
|
190
|
+
* and `route`. Empty for an added or removed page. A moved page's
|
|
191
|
+
* route moves with it, so it isn't listed for one.
|
|
177
192
|
*/
|
|
178
193
|
page_changed: string[];
|
|
179
194
|
/** How many changes of each kind. */
|
|
@@ -197,6 +212,21 @@ export interface PageData {
|
|
|
197
212
|
was: string | null;
|
|
198
213
|
/** Whether it's beyond the limit, so not rendered. */
|
|
199
214
|
omitted: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* For a page that moved, the content path it was at: git sees its
|
|
217
|
+
* file renamed, or `ascribe.addresses` records the move. The page is
|
|
218
|
+
* listed once, at `path`, compared with the page as it was at
|
|
219
|
+
* `moved_from`; `status` is `changed`, and its `counts` and `changes`
|
|
220
|
+
* are what differs besides the move, none for a page that only moved.
|
|
221
|
+
* Absent for a page that didn't move.
|
|
222
|
+
*/
|
|
223
|
+
moved_from?: string;
|
|
224
|
+
/**
|
|
225
|
+
* The pages among `because` whose only change is that they moved, each
|
|
226
|
+
* by where it was and where it is: a link on this page leads to its new
|
|
227
|
+
* address. Absent when there's none.
|
|
228
|
+
*/
|
|
229
|
+
moved_links?: MovedPage[];
|
|
200
230
|
/**
|
|
201
231
|
* The agent prompt about the page, which its Copy prompt button copies:
|
|
202
232
|
* what `ascribe diff --format prompt` writes for it. Absent when the
|
|
@@ -221,14 +251,22 @@ export interface PageDiff {
|
|
|
221
251
|
* The other changed files the page's change can come from: fragments it
|
|
222
252
|
* includes and pages its links take a title or a heading from, in path
|
|
223
253
|
* order; then the snippets whose code changed, by address
|
|
224
|
-
* (`code:app.py#main`);
|
|
225
|
-
*
|
|
254
|
+
* (`code:app.py#main`); then the operations of a declared API whose spec
|
|
255
|
+
* changed what the page writes for them, an `@operation`'s method, path,
|
|
256
|
+
* summary, or deprecation, or a link's address, each by its spec's path
|
|
257
|
+
* from the project root, `#`, and the fragment the page names it by
|
|
258
|
+
* (`api/openapi.yaml#createWidget`); and `ascribe.toml` (last) when the
|
|
259
|
+
* content model is a cause. The kinds are told apart by their form: a
|
|
260
|
+
* content file's path ends in `.md`, a snippet's address has its
|
|
261
|
+
* source's name and `:` before its path, and an operation's has a `#`
|
|
262
|
+
* and neither.
|
|
226
263
|
*/
|
|
227
264
|
because: string[];
|
|
228
265
|
/**
|
|
229
266
|
* What changed about the page itself besides its blocks, in this
|
|
230
267
|
* order: `title`, `frontmatter`, `availability` (the page-level one),
|
|
231
|
-
* and `route`. Empty for an added or removed page.
|
|
268
|
+
* and `route`. Empty for an added or removed page. A moved page's
|
|
269
|
+
* route moves with it, so it isn't listed for one.
|
|
232
270
|
*/
|
|
233
271
|
page_changed: string[];
|
|
234
272
|
/** How many changes of each kind. */
|
|
@@ -239,6 +277,21 @@ export interface PageDiff {
|
|
|
239
277
|
* the report's `blocks_omitted` is `true`.
|
|
240
278
|
*/
|
|
241
279
|
changes: Change[];
|
|
280
|
+
/**
|
|
281
|
+
* For a page that moved, the content path it was at: git sees its
|
|
282
|
+
* file renamed, or `ascribe.addresses` records the move. The page is
|
|
283
|
+
* listed once, at `path`, compared with the page as it was at
|
|
284
|
+
* `moved_from`; `status` is `changed`, and its `counts` and `changes`
|
|
285
|
+
* are what differs besides the move, none for a page that only moved.
|
|
286
|
+
* Absent for a page that didn't move.
|
|
287
|
+
*/
|
|
288
|
+
moved_from?: string;
|
|
289
|
+
/**
|
|
290
|
+
* The pages among `because` whose only change is that they moved, each
|
|
291
|
+
* by where it was and where it is: a link on this page leads to its new
|
|
292
|
+
* address. Absent when there's none.
|
|
293
|
+
*/
|
|
294
|
+
moved_links?: MovedPage[];
|
|
242
295
|
}
|
|
243
296
|
/** Whether a page is new, gone, or different. */
|
|
244
297
|
export type PageStatus = "added" | "removed" | "changed";
|
package/dist/shapes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapes.js","sourceRoot":"","sources":["../src/shapes.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,EAAE;AACF,8CAA8C;AAC9C,uEAAuE","sourcesContent":["// The JSON Ascribe writes that this package reads, as TypeScript types.\n// Generated from the Rust types that write it, through the JSON Schemas in\n// schemas/, by crates/ascribe-cli/src/shapes.rs. Change the Rust types, then\n// run `ASCRIBE_BLESS=1 cargo test -p ascribe-cli shapes`. Don't edit it.\n//\n// - DiffReport (`ascribe diff --format json`)\n// - ReportData (`ascribe diff --format html`, for the report's script)\n\n/**\n * Where a block's text is written: the README's anchor grammar, the same\n * string the rendered page carries in `data-ascribe-source` and\n * `data-ascribe-via`.\n */\nexport interface Anchor {\n /**\n * `<path>:<first>-<last>`: the file's content path, percent-encoded by\n * segment, and the block's first and last lines, from 1.\n */\n source: string;\n /**\n * The includes the block came through, outermost first, each\n * `<path>:<line>`. Empty for a block written in the page itself.\n */\n via: string[];\n}\n\n/** The base of a comparison, in the report. */\nexport interface BaseInfo {\n /** The revision asked for, or the default branch used. */\n requested: string;\n /** The commit it names. */\n commit: string;\n /**\n * The merge base of that commit and `HEAD`, which the comparison reads;\n * `null` with `--base-exact`, which reads `commit`.\n */\n merge_base: string | null;\n}\n\n/** One build's changed pages. */\nexport interface BuildData {\n /** The build's name. */\n build: string;\n /** Its changed pages, in path order. */\n pages: PageData[];\n /**\n * For a line of a versioned build, which: the report lists the lines\n * of one build together, each changed page once. Absent for a build\n * that isn't versioned.\n */\n line?: LineData;\n}\n\n/** What changed in one build. */\nexport interface BuildDiff {\n /** The build's name. */\n build: string;\n /** The pages that changed, in path order. */\n pages: PageDiff[];\n}\n\n/** One block's change. */\nexport interface Change {\n /** What happened to it. */\n kind: ChangeKind;\n /**\n * For a removed block, and a moved block's old place: the block of the\n * new version it came after, among its siblings. Absent when it was\n * first.\n */\n after?: Anchor;\n /** Where it's written now: every kind but `removed`. */\n now?: Anchor;\n /**\n * For a removed block, and a moved block's old place: the block of the\n * new version it was inside. Absent at the top of the page.\n */\n parent?: Anchor;\n /**\n * For a removed block, its text, whitespace collapsed, so it can be\n * shown where it was.\n */\n text?: string;\n /** Where it was written: every kind but `added`. */\n was?: Anchor;\n /** For changed prose, the words that differ. */\n words?: Words;\n}\n\n/** The kinds of block change. */\nexport type ChangeKind = \"changed\" | \"added\" | \"removed\" | \"moved\";\n\n/** How many changes of each kind a page has. */\nexport interface Counts {\n /** Blocks whose content changed. */\n changed: number;\n /** Blocks only in the new version. */\n added: number;\n /** Blocks only in the old version. */\n removed: number;\n /** Blocks in both, somewhere else. */\n moved: number;\n}\n\n/** The whole report, as `ascribe diff --format json` writes it. */\nexport interface DiffReport {\n /** `SCHEMA_VERSION`. */\n schema_version: number;\n /** The version of Ascribe that wrote it. */\n ascribe_version: string;\n /** What was compared with. */\n base: BaseInfo;\n /** Where the project is. */\n repository: RepositoryInfo;\n /**\n * How many errors `ascribe check` finds in the working tree, for the\n * builds compared. The comparison runs regardless, but a page with an\n * error may not render as it will once it's fixed, so a reviewer should\n * know. `diff_project` sets it; `Report::new` leaves it zero.\n */\n working_tree_errors: number;\n /** What changed, per build, in the order asked for. */\n builds: BuildDiff[];\n /**\n * Whether every page's `changes` was left empty, as `ascribe diff\n * --pages-only` leaves them: its `counts` still count them. Only there\n * when it's `true`.\n */\n blocks_omitted?: boolean;\n}\n\n/**\n * A piece of a formatted value, as the JSON output writes it:\n * `{ \"type\": \"text\" | \"code\", \"value\": … }`. Other JSON that shows a\n * formatted title, such as the review report's, writes it the same way.\n */\nexport interface FormattedPiece {\n /** What the piece is. */\n type: PieceKind;\n /** Its text: a code span's content without its backticks. */\n value: string;\n}\n\n/** An image a page refers to. */\nexport interface ImageRef {\n /** The image's source file. */\n path: string;\n /** Its size, when it's too large to include. */\n bytes?: number;\n /** Its key in `images`, when it's included. */\n image?: string;\n}\n\n/** How many changed pages a report renders, and how many it left out. */\nexport interface Limit {\n /** The most it renders. */\n pages: number;\n /** How many it left out. */\n omitted: number;\n}\n\n/** The line of a versioned build a build is. */\nexport interface LineData {\n /** The versioned build's name, which its current line has. */\n build: string;\n /** The line, as `[releases.<target>]` writes it. */\n line: string;\n /** Whether it's the current line. */\n current: boolean;\n}\n\n/** One changed page: `ascribe diff --format json`'s, and its renderings. */\nexport interface PageData {\n /** The page's content path. */\n path: string;\n /** Its route: the new one, or for a removed page the old one. */\n route: string;\n /**\n * Whether the build publishes it only now, only before, or in both\n * with a difference.\n */\n status: PageStatus;\n /** Whether the page's own file changed (or exists on one side only). */\n own_file_changed: boolean;\n /**\n * The other changed files the page's change can come from: fragments it\n * includes and pages its links take a title or a heading from, in path\n * order; then the snippets whose code changed, by address\n * (`code:app.py#main`); and `ascribe.toml` (last) when the content model\n * is a cause.\n */\n because: string[];\n /**\n * What changed about the page itself besides its blocks, in this\n * order: `title`, `frontmatter`, `availability` (the page-level one),\n * and `route`. Empty for an added or removed page.\n */\n page_changed: string[];\n /** How many changes of each kind. */\n counts: Counts;\n /**\n * The block-level changes, in the page's order, a removed block where\n * it was. Empty for an added or removed page, and for every page when\n * the report's `blocks_omitted` is `true`.\n */\n changes: Change[];\n /** Its title, when the build has one. */\n title: string | null;\n /**\n * Its title formatted, when its field sets `inline = \"code\"`: for the\n * page list and the page's heading. `title` stays the plain text.\n */\n formatted_title: FormattedPiece[] | null;\n /** The page now, as a key of `pages`; `null` when there's none. */\n now: string | null;\n /** The page before, as a key of `pages`; `null` when there's none. */\n was: string | null;\n /** Whether it's beyond the limit, so not rendered. */\n omitted: boolean;\n /**\n * The agent prompt about the page, which its Copy prompt button copies:\n * what `ascribe diff --format prompt` writes for it. Absent when the\n * report was written without prompts.\n */\n prompt?: string;\n}\n\n/** What changed on one page of a build. */\nexport interface PageDiff {\n /** The page's content path. */\n path: string;\n /** Its route: the new one, or for a removed page the old one. */\n route: string;\n /**\n * Whether the build publishes it only now, only before, or in both\n * with a difference.\n */\n status: PageStatus;\n /** Whether the page's own file changed (or exists on one side only). */\n own_file_changed: boolean;\n /**\n * The other changed files the page's change can come from: fragments it\n * includes and pages its links take a title or a heading from, in path\n * order; then the snippets whose code changed, by address\n * (`code:app.py#main`); and `ascribe.toml` (last) when the content model\n * is a cause.\n */\n because: string[];\n /**\n * What changed about the page itself besides its blocks, in this\n * order: `title`, `frontmatter`, `availability` (the page-level one),\n * and `route`. Empty for an added or removed page.\n */\n page_changed: string[];\n /** How many changes of each kind. */\n counts: Counts;\n /**\n * The block-level changes, in the page's order, a removed block where\n * it was. Empty for an added or removed page, and for every page when\n * the report's `blocks_omitted` is `true`.\n */\n changes: Change[];\n}\n\n/** Whether a page is new, gone, or different. */\nexport type PageStatus = \"added\" | \"removed\" | \"changed\";\n\n/** What a piece of a formatted value is. */\nexport type PieceKind = \"text\" | \"code\";\n\n/** A page rendered: its HTML, and what each image reference in it is. */\nexport interface RenderedPage {\n /** The page's content, rendered with source anchors. */\n html: string;\n /** Each image reference the HTML writes, and what it is. */\n images: Record<string, ImageRef>;\n}\n\n/**\n * The data the report's script draws from. Its keys, like the JSON\n * report's, are snake_case.\n */\nexport interface ReportData {\n /** The version of Ascribe that wrote it. */\n ascribe_version: string;\n /** What was compared with. */\n base: BaseInfo;\n /** How many errors `ascribe check` finds in the working tree. */\n working_tree_errors: number;\n /** What changed, per build. */\n builds: BuildData[];\n /** Each rendered page, once however many builds render it alike. */\n pages: Record<string, RenderedPage>;\n /** Each image, as a `data:` URL, once however many pages use it. */\n images: Record<string, string>;\n /** How many changed pages the report renders, and how many it left out. */\n limit: Limit;\n /** The size, in bytes, above which an image isn't included. */\n image_limit: number;\n}\n\n/** The repository, in the report. */\nexport interface RepositoryInfo {\n /** The repository's top-level directory, as git prints it. */\n root: string;\n /**\n * The project's folder inside it, with a trailing `/`, or empty when\n * the project is at the repository's root.\n */\n project_prefix: string;\n}\n\n/**\n * The words that differ inside a changed block of prose. Ranges are\n * `[start, end)` in characters (Unicode scalar values) of each side's\n * `text`, which is the block's text with whitespace collapsed.\n */\nexport interface Words {\n /** Ranges in `now_text`: words added or replacing others. */\n now: [number, number][];\n /** Ranges in `was_text`: words removed or replaced. */\n was: [number, number][];\n /** The block's text now. */\n now_text: string;\n /** The block's text before. */\n was_text: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shapes.js","sourceRoot":"","sources":["../src/shapes.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,EAAE;AACF,8CAA8C;AAC9C,uEAAuE","sourcesContent":["// The JSON Ascribe writes that this package reads, as TypeScript types.\n// Generated from the Rust types that write it, through the JSON Schemas in\n// schemas/, by crates/ascribe-cli/src/shapes.rs. Change the Rust types, then\n// run `ASCRIBE_BLESS=1 cargo test -p ascribe-cli shapes`. Don't edit it.\n//\n// - DiffReport (`ascribe diff --format json`)\n// - ReportData (`ascribe diff --format html`, for the report's script)\n\n/**\n * Where a block's text is written: the README's anchor grammar, the same\n * string the rendered page carries in `data-ascribe-source` and\n * `data-ascribe-via`.\n */\nexport interface Anchor {\n /**\n * `<path>:<first>-<last>`: the file's content path, percent-encoded by\n * segment, and the block's first and last lines, from 1.\n */\n source: string;\n /**\n * The includes the block came through, outermost first, each\n * `<path>:<line>`. Empty for a block written in the page itself.\n */\n via: string[];\n}\n\n/** The base of a comparison, in the report. */\nexport interface BaseInfo {\n /** The revision asked for, or the default branch used. */\n requested: string;\n /** The commit it names. */\n commit: string;\n /**\n * The merge base of that commit and `HEAD`, which the comparison reads;\n * `null` with `--base-exact`, which reads `commit`.\n */\n merge_base: string | null;\n}\n\n/** One build's changed pages. */\nexport interface BuildData {\n /** The build's name. */\n build: string;\n /** Its changed pages, in path order. */\n pages: PageData[];\n /**\n * For a line of a versioned build, which: the report lists the lines\n * of one build together, each changed page once. Absent for a build\n * that isn't versioned.\n */\n line?: LineData;\n}\n\n/** What changed in one build. */\nexport interface BuildDiff {\n /** The build's name. */\n build: string;\n /** The pages that changed, in path order. */\n pages: PageDiff[];\n}\n\n/** One block's change. */\nexport interface Change {\n /** What happened to it. */\n kind: ChangeKind;\n /**\n * For a removed block, and a moved block's old place: the block of the\n * new version it came after, among its siblings. Absent when it was\n * first.\n */\n after?: Anchor;\n /** Where it's written now: every kind but `removed`. */\n now?: Anchor;\n /**\n * For a removed block, and a moved block's old place: the block of the\n * new version it was inside. Absent at the top of the page.\n */\n parent?: Anchor;\n /**\n * For a removed block, its text, whitespace collapsed, so it can be\n * shown where it was.\n */\n text?: string;\n /** Where it was written: every kind but `added`. */\n was?: Anchor;\n /** For changed prose, the words that differ. */\n words?: Words;\n}\n\n/** The kinds of block change. */\nexport type ChangeKind = \"changed\" | \"added\" | \"removed\" | \"moved\";\n\n/** How many changes of each kind a page has. */\nexport interface Counts {\n /** Blocks whose content changed. */\n changed: number;\n /** Blocks only in the new version. */\n added: number;\n /** Blocks only in the old version. */\n removed: number;\n /** Blocks in both, somewhere else. */\n moved: number;\n}\n\n/** The whole report, as `ascribe diff --format json` writes it. */\nexport interface DiffReport {\n /** `SCHEMA_VERSION`. */\n schema_version: number;\n /** The version of Ascribe that wrote it. */\n ascribe_version: string;\n /** What was compared with. */\n base: BaseInfo;\n /** Where the project is. */\n repository: RepositoryInfo;\n /**\n * How many errors `ascribe check` finds in the working tree, for the\n * builds compared. The comparison runs regardless, but a page with an\n * error may not render as it will once it's fixed, so a reviewer should\n * know. `diff_project` sets it; `Report::new` leaves it zero.\n */\n working_tree_errors: number;\n /** What changed, per build, in the order asked for. */\n builds: BuildDiff[];\n /**\n * Whether every page's `changes` was left empty, as `ascribe diff\n * --pages-only` leaves them: its `counts` still count them. Only there\n * when it's `true`.\n */\n blocks_omitted?: boolean;\n}\n\n/**\n * A piece of a formatted value, as the JSON output writes it:\n * `{ \"type\": \"text\" | \"code\", \"value\": … }`. Other JSON that shows a\n * formatted title, such as the HTML preview's, writes it the same way.\n */\nexport interface FormattedPiece {\n /** What the piece is. */\n type: PieceKind;\n /** Its text: a code span's content without its backticks. */\n value: string;\n}\n\n/** An image a page refers to. */\nexport interface ImageRef {\n /** The image's source file. */\n path: string;\n /** Its size, when it's too large to include. */\n bytes?: number;\n /** Its key in `images`, when it's included. */\n image?: string;\n}\n\n/** How many changed pages a report renders, and how many it left out. */\nexport interface Limit {\n /** The most it renders. */\n pages: number;\n /** How many it left out. */\n omitted: number;\n}\n\n/** The line of a versioned build a build is. */\nexport interface LineData {\n /** The versioned build's name, which its current line has. */\n build: string;\n /** The line, as `[releases.<target>]` writes it. */\n line: string;\n /** Whether it's the current line. */\n current: boolean;\n}\n\n/** A page that moved: where it was, and where it is, by content path. */\nexport interface MovedPage {\n /** Where it was, in the base. */\n from: string;\n /** Where it is now. */\n to: string;\n}\n\n/** One changed page: `ascribe diff --format json`'s, and its renderings. */\nexport interface PageData {\n /** The page's content path. */\n path: string;\n /** Its route: the new one, or for a removed page the old one. */\n route: string;\n /**\n * Whether the build publishes it only now, only before, or in both\n * with a difference.\n */\n status: PageStatus;\n /** Whether the page's own file changed (or exists on one side only). */\n own_file_changed: boolean;\n /**\n * The other changed files the page's change can come from: fragments it\n * includes and pages its links take a title or a heading from, in path\n * order; then the snippets whose code changed, by address\n * (`code:app.py#main`); then the operations of a declared API whose spec\n * changed what the page writes for them, an `@operation`'s method, path,\n * summary, or deprecation, or a link's address, each by its spec's path\n * from the project root, `#`, and the fragment the page names it by\n * (`api/openapi.yaml#createWidget`); and `ascribe.toml` (last) when the\n * content model is a cause. The kinds are told apart by their form: a\n * content file's path ends in `.md`, a snippet's address has its\n * source's name and `:` before its path, and an operation's has a `#`\n * and neither.\n */\n because: string[];\n /**\n * What changed about the page itself besides its blocks, in this\n * order: `title`, `frontmatter`, `availability` (the page-level one),\n * and `route`. Empty for an added or removed page. A moved page's\n * route moves with it, so it isn't listed for one.\n */\n page_changed: string[];\n /** How many changes of each kind. */\n counts: Counts;\n /**\n * The block-level changes, in the page's order, a removed block where\n * it was. Empty for an added or removed page, and for every page when\n * the report's `blocks_omitted` is `true`.\n */\n changes: Change[];\n /** Its title, when the build has one. */\n title: string | null;\n /**\n * Its title formatted, when its field sets `inline = \"code\"`: for the\n * page list and the page's heading. `title` stays the plain text.\n */\n formatted_title: FormattedPiece[] | null;\n /** The page now, as a key of `pages`; `null` when there's none. */\n now: string | null;\n /** The page before, as a key of `pages`; `null` when there's none. */\n was: string | null;\n /** Whether it's beyond the limit, so not rendered. */\n omitted: boolean;\n /**\n * For a page that moved, the content path it was at: git sees its\n * file renamed, or `ascribe.addresses` records the move. The page is\n * listed once, at `path`, compared with the page as it was at\n * `moved_from`; `status` is `changed`, and its `counts` and `changes`\n * are what differs besides the move, none for a page that only moved.\n * Absent for a page that didn't move.\n */\n moved_from?: string;\n /**\n * The pages among `because` whose only change is that they moved, each\n * by where it was and where it is: a link on this page leads to its new\n * address. Absent when there's none.\n */\n moved_links?: MovedPage[];\n /**\n * The agent prompt about the page, which its Copy prompt button copies:\n * what `ascribe diff --format prompt` writes for it. Absent when the\n * report was written without prompts.\n */\n prompt?: string;\n}\n\n/** What changed on one page of a build. */\nexport interface PageDiff {\n /** The page's content path. */\n path: string;\n /** Its route: the new one, or for a removed page the old one. */\n route: string;\n /**\n * Whether the build publishes it only now, only before, or in both\n * with a difference.\n */\n status: PageStatus;\n /** Whether the page's own file changed (or exists on one side only). */\n own_file_changed: boolean;\n /**\n * The other changed files the page's change can come from: fragments it\n * includes and pages its links take a title or a heading from, in path\n * order; then the snippets whose code changed, by address\n * (`code:app.py#main`); then the operations of a declared API whose spec\n * changed what the page writes for them, an `@operation`'s method, path,\n * summary, or deprecation, or a link's address, each by its spec's path\n * from the project root, `#`, and the fragment the page names it by\n * (`api/openapi.yaml#createWidget`); and `ascribe.toml` (last) when the\n * content model is a cause. The kinds are told apart by their form: a\n * content file's path ends in `.md`, a snippet's address has its\n * source's name and `:` before its path, and an operation's has a `#`\n * and neither.\n */\n because: string[];\n /**\n * What changed about the page itself besides its blocks, in this\n * order: `title`, `frontmatter`, `availability` (the page-level one),\n * and `route`. Empty for an added or removed page. A moved page's\n * route moves with it, so it isn't listed for one.\n */\n page_changed: string[];\n /** How many changes of each kind. */\n counts: Counts;\n /**\n * The block-level changes, in the page's order, a removed block where\n * it was. Empty for an added or removed page, and for every page when\n * the report's `blocks_omitted` is `true`.\n */\n changes: Change[];\n /**\n * For a page that moved, the content path it was at: git sees its\n * file renamed, or `ascribe.addresses` records the move. The page is\n * listed once, at `path`, compared with the page as it was at\n * `moved_from`; `status` is `changed`, and its `counts` and `changes`\n * are what differs besides the move, none for a page that only moved.\n * Absent for a page that didn't move.\n */\n moved_from?: string;\n /**\n * The pages among `because` whose only change is that they moved, each\n * by where it was and where it is: a link on this page leads to its new\n * address. Absent when there's none.\n */\n moved_links?: MovedPage[];\n}\n\n/** Whether a page is new, gone, or different. */\nexport type PageStatus = \"added\" | \"removed\" | \"changed\";\n\n/** What a piece of a formatted value is. */\nexport type PieceKind = \"text\" | \"code\";\n\n/** A page rendered: its HTML, and what each image reference in it is. */\nexport interface RenderedPage {\n /** The page's content, rendered with source anchors. */\n html: string;\n /** Each image reference the HTML writes, and what it is. */\n images: Record<string, ImageRef>;\n}\n\n/**\n * The data the report's script draws from. Its keys, like the JSON\n * report's, are snake_case.\n */\nexport interface ReportData {\n /** The version of Ascribe that wrote it. */\n ascribe_version: string;\n /** What was compared with. */\n base: BaseInfo;\n /** How many errors `ascribe check` finds in the working tree. */\n working_tree_errors: number;\n /** What changed, per build. */\n builds: BuildData[];\n /** Each rendered page, once however many builds render it alike. */\n pages: Record<string, RenderedPage>;\n /** Each image, as a `data:` URL, once however many pages use it. */\n images: Record<string, string>;\n /** How many changed pages the report renders, and how many it left out. */\n limit: Limit;\n /** The size, in bytes, above which an image isn't included. */\n image_limit: number;\n}\n\n/** The repository, in the report. */\nexport interface RepositoryInfo {\n /** The repository's top-level directory, as git prints it. */\n root: string;\n /**\n * The project's folder inside it, with a trailing `/`, or empty when\n * the project is at the repository's root.\n */\n project_prefix: string;\n}\n\n/**\n * The words that differ inside a changed block of prose. Ranges are\n * `[start, end)` in characters (Unicode scalar values) of each side's\n * `text`, which is the block's text with whitespace collapsed.\n */\nexport interface Words {\n /** Ranges in `now_text`: words added or replacing others. */\n now: [number, number][];\n /** Ranges in `was_text`: words removed or replaced. */\n was: [number, number][];\n /** The block's text now. */\n now_text: string;\n /** The block's text before. */\n was_text: string;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ascribed/review",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5-next.34",
|
|
4
4
|
"description": "A toolchain for documentation written as code. This package reviews pages as readers see them: changed blocks marked on the rendered page, and a pull request's review threads beside them.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"node": ">=24"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@ascribed/elements": "0.4.
|
|
56
|
+
"@ascribed/elements": "0.4.5-next.34",
|
|
57
57
|
"@types/node": "^24.19.2",
|
|
58
58
|
"esbuild": "^0.28.2",
|
|
59
59
|
"jsdom": "^30.1.3"
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"smol-toml": "^1.9.1"
|
|
66
66
|
},
|
|
67
|
+
"gitHead": "570d8f155ffbc71857ce05a47a70840f1bbab67e",
|
|
67
68
|
"scripts": {
|
|
68
69
|
"build": "tsc -p tsconfig.build.json",
|
|
69
70
|
"typecheck": "tsc --noEmit",
|