@hawkeyexl/manni 2.10.1 → 2.11.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/dist/docmeta.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  buildProgram
4
- } from "./chunk-5GVRMS6B.js";
4
+ } from "./chunk-V5NTFMUD.js";
5
5
  import {
6
6
  runIfMain
7
- } from "./chunk-O2V45AVG.js";
7
+ } from "./chunk-BUXVMARH.js";
8
8
 
9
9
  // src/docmeta.ts
10
10
  runIfMain(import.meta.url, () => buildProgram().name("docmeta"));
package/dist/index.d.ts CHANGED
@@ -1491,6 +1491,14 @@ interface LoadExternalMetadataOptions {
1491
1491
  timeoutMs?: number;
1492
1492
  /** For tests: the environment `tokenEnv` is read from. */
1493
1493
  env?: Record<string, string | undefined>;
1494
+ /**
1495
+ * The run's documents, as absolute paths (proposal 0058). An entry whose
1496
+ * `file` holds `{page}` names one manifest per page, so it is read for
1497
+ * exactly these pages, each that belongs to its collection, and for nothing
1498
+ * else. Absent, such an entry reads no file. An entry without the
1499
+ * placeholder ignores this and loads its one manifest as it always has.
1500
+ */
1501
+ pages?: readonly string[];
1494
1502
  }
1495
1503
  /** A place a merged value lives, for a finding that must name it. */
1496
1504
  interface SourceLocation {
@@ -1594,6 +1602,14 @@ declare function externalMetadataPointer(key: string): string;
1594
1602
  * the run is the config corpus (the same invariant corpus checks use): a
1595
1603
  * positional path means the operator chose to look at part of the corpus,
1596
1604
  * and an entry for the rest is expected, not orphaned.
1605
+ *
1606
+ * A `{page}` entry (proposal 0058) is never orphaned inside a file the run
1607
+ * read, because each file is named after its page. Its orphan is a stray
1608
+ * *file*, left behind by a `git mv` or a deletion, so on a run with no
1609
+ * `collections` narrowing the pattern's glob is walked and every manifest of
1610
+ * a page the run did not load is reported after the entries above. A
1611
+ * `--collection` run skips the walk: another collection's pages, which it
1612
+ * did not load, could share the pattern.
1597
1613
  */
1598
1614
  declare function orphanEntries(index: ExternalMetadataIndex | null, loaded: readonly string[], base: string, collections?: readonly string[]): ExternalMetadataEntry[];
1599
1615
  /**
@@ -3453,7 +3469,18 @@ path: string,
3453
3469
  * of a payload that is not valid UTF-8 — so the pin would be wrong the first
3454
3470
  * time anything checked it.
3455
3471
  */
3456
- contents: string | Uint8Array): Promise<void>;
3472
+ contents: string | Uint8Array,
3473
+ /**
3474
+ * `createParents` makes the target's directory, recursively, before the
3475
+ * temp file that lives in it. A manifest writer asks for it: a mirrored
3476
+ * per-page manifest (proposal 0058), `./meta/{page}.citations.yaml`, may be
3477
+ * the first file in its directory. Every other writer leaves it off, so a
3478
+ * missing directory stays the failure it always was (`--write-baseline`
3479
+ * into a directory that is not there, say).
3480
+ */
3481
+ options?: {
3482
+ createParents?: boolean;
3483
+ }): Promise<void>;
3457
3484
 
3458
3485
  /**
3459
3486
  * Extractor registry. Maps file extensions to extractors and resolves an
@@ -4032,6 +4059,11 @@ interface UpdateOptions extends Omit<CheckOptions, "baseline" | "writeBaseline">
4032
4059
  accept?: boolean;
4033
4060
  only?: string[];
4034
4061
  dryRun?: boolean;
4062
+ /**
4063
+ * Re-record `commit-sha` where the recorded commit does not contain the
4064
+ * pinned lines. Rewrites that one field and nothing else.
4065
+ */
4066
+ recommit?: boolean;
4035
4067
  }
4036
4068
  /**
4037
4069
  * One end `update` rewrote.
@@ -4052,7 +4084,7 @@ interface UpdateRewrite {
4052
4084
  * and the words held while the anchor moved (0053). `status` is what tells
4053
4085
  * those apart. `replaced` is a claim `--accept` refused to re-pin.
4054
4086
  */
4055
- reason: "moved" | "accepted" | "re-anchored" | "shifted" | "replaced";
4087
+ reason: "moved" | "accepted" | "re-anchored" | "shifted" | "replaced" | "recommitted";
4056
4088
  /**
4057
4089
  * The status that was repaired. `replaced` is a claim whose line held
4058
4090
  * wholly other text, accepted because `--only` named it.
@@ -4071,6 +4103,9 @@ interface UpdateRewrite {
4071
4103
  /** An accepted or re-anchored end: its pin, before and after. */
4072
4104
  fromPin?: string;
4073
4105
  toPin?: string;
4106
+ /** A re-committed source: the commit it recorded, and the one it records now. */
4107
+ fromCommit?: string;
4108
+ toCommit?: string;
4074
4109
  /** A re-anchored claim: the span that held, in file lines. */
4075
4110
  lines?: string;
4076
4111
  /** A re-anchored claim: the span now pinned, in file lines. */
@@ -4950,6 +4985,13 @@ interface CitationManifest {
4950
4985
  file: string;
4951
4986
  /** `path`, or the page field the manifest joins on. */
4952
4987
  join: string;
4988
+ /**
4989
+ * The `{page}` pattern as the config writes it (proposal 0058), present
4990
+ * only when each page has a manifest of its own. The page's file is
4991
+ * resolved from it, and one that does not exist yet reads as empty and is
4992
+ * created by the first write.
4993
+ */
4994
+ pattern?: string;
4953
4995
  }
4954
4996
  /** Where one page's citations are kept, and what the manifest already holds. */
4955
4997
  interface PageSidecar {
@@ -4983,6 +5025,12 @@ interface CitationSidecars {
4983
5025
  orphans(loaded: readonly string[], covered?: readonly string[]): ExternalMetadataEntry[];
4984
5026
  /** Field entries no loaded page matched, same invariant. */
4985
5027
  orphanJoins(matched: ReadonlyMap<string, ReadonlySet<string>>, covered?: readonly string[]): ExternalMetadataEntry[];
5028
+ /**
5029
+ * The `{page}` manifests (proposal 0058) of the loaded pages that exist and
5030
+ * that `.gitignore` covers, as the run reports them. A checkout would have
5031
+ * none of them, so CI would read those pages as citing nothing.
5032
+ */
5033
+ ignoredManifests(loaded: readonly string[]): Promise<string[]>;
4986
5034
  }
4987
5035
  interface LoadSidecarOptions {
4988
5036
  /** Every collection the config declares, not only the ones the run selected. */
@@ -4993,6 +5041,11 @@ interface LoadSidecarOptions {
4993
5041
  base: string;
4994
5042
  /** The config file as the user would name it, for the URL refusal. */
4995
5043
  configSource: string;
5044
+ /**
5045
+ * The run's pages, as absolute paths. A `{page}` manifest (proposal 0058)
5046
+ * is read for exactly these; without them it reads nothing.
5047
+ */
5048
+ pages?: readonly string[];
4996
5049
  /** The family encryption key, for a join field a page holds encrypted. */
4997
5050
  key?: string;
4998
5051
  /** The tool's error class; `CiteError` unless a sibling command says otherwise. */
@@ -5025,10 +5078,13 @@ declare function duplicateJoinRefusal(field: string, value: string, file: string
5025
5078
  * citations manifest. `base` overrides the run's when a command labels its
5026
5079
  * pages from somewhere else — `add` takes one page from the command line and
5027
5080
  * labels it from the working directory, whatever the collections would.
5081
+ * `pages` are the run's pages as absolute paths, which a `{page}` manifest
5082
+ * (proposal 0058) is read for.
5028
5083
  */
5029
5084
  declare function sidecarsFor(run: CiteRun, over?: {
5030
5085
  base?: string;
5031
5086
  toError?: (message: string) => Error;
5087
+ pages?: readonly string[];
5032
5088
  }): Promise<CitationSidecars | null>;
5033
5089
 
5034
5090
  interface SpliceManifestOptions {
@@ -5103,6 +5159,14 @@ interface HeldManifest$1<Op extends ManifestOp$1> {
5103
5159
  ops: Op[];
5104
5160
  /** Each entry key this run rewrote, and what it held first. */
5105
5161
  bases: Map<string, KeyBase>;
5162
+ /**
5163
+ * The file did not exist when it was held, so `before` is empty text
5164
+ * standing in for no file (proposal 0058). A distinct state from a file
5165
+ * that exists and is empty: a commit that still finds nothing creates the
5166
+ * file, and one that finds any bytes, empty ones included, rebases onto
5167
+ * them, since another writer created it in between.
5168
+ */
5169
+ absent: boolean;
5106
5170
  }
5107
5171
  /** What a caller may substitute when it writes the manifests it held. */
5108
5172
  interface CommitIo$1<Change> {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  reencryptMetadata,
6
6
  runKeyRotate,
7
7
  runKeySet
8
- } from "./chunk-HA4CK35M.js";
8
+ } from "./chunk-VYFRHPCL.js";
9
9
  import {
10
10
  BinMissing,
11
11
  COMMON_FORMATS,
@@ -127,7 +127,7 @@ import {
127
127
  valueOf,
128
128
  vendorFileName,
129
129
  writeFileAtomic
130
- } from "./chunk-O2V45AVG.js";
130
+ } from "./chunk-BUXVMARH.js";
131
131
 
132
132
  // src/key/index.ts
133
133
  var key_exports = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawkeyexl/manni",
3
- "version": "2.10.1",
3
+ "version": "2.11.0",
4
4
  "description": "One command line for documentation that is meant to be checked. `manni meta` validates the presence and format of document metadata (Markdown frontmatter and more) against JSON Schema, built for CI. Formerly docmeta.",
5
5
  "type": "module",
6
6
  "bin": {