@domandigital/craft 0.16.0 → 0.18.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.
@@ -4,14 +4,16 @@ import {
4
4
  REFLEX_FONTS_1,
5
5
  REFLEX_FONTS_2,
6
6
  SHARED_PART,
7
- TRADE_NOUNS,
8
7
  deltaEOk,
9
8
  isAiViolet,
10
9
  isCream,
11
10
  levenshtein,
12
11
  normaliseFamily,
13
12
  parseColour
14
- } from "./chunk-B2MJLGF6.js";
13
+ } from "./chunk-WFB6F3BN.js";
14
+ import {
15
+ TRADE_NOUNS
16
+ } from "./chunk-4QWEAL4G.js";
15
17
 
16
18
  // src/direction/types.ts
17
19
  var DIRECTION_VERSION = 2;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  snapshotUrl,
3
3
  snapshotUrls
4
- } from "./chunk-YK2FFL6Z.js";
4
+ } from "./chunk-SL5VZJ2J.js";
5
5
  import {
6
6
  describeTypicality,
7
7
  loadNull
8
- } from "./chunk-LWVGIJ5A.js";
8
+ } from "./chunk-ZUYERAFM.js";
9
9
  import {
10
10
  SOURCE_FILE,
11
11
  finish,
@@ -13,9 +13,11 @@ import {
13
13
  loadExceptions,
14
14
  parseFlags,
15
15
  prepareReport,
16
- readPaths,
16
+ readPaths
17
+ } from "./chunk-O5B5ELJH.js";
18
+ import {
17
19
  toJson
18
- } from "./chunk-LXDNIJFG.js";
20
+ } from "./chunk-QIEDBL4J.js";
19
21
  import {
20
22
  readSnapshot
21
23
  } from "./chunk-WUACK2HX.js";
@@ -25,7 +27,7 @@ import {
25
27
  fingerprint,
26
28
  scanSource,
27
29
  typicality
28
- } from "./chunk-B2MJLGF6.js";
30
+ } from "./chunk-WFB6F3BN.js";
29
31
 
30
32
  // src/audit/cli.ts
31
33
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -1,22 +1,27 @@
1
+ import {
2
+ toJson
3
+ } from "./chunk-QIEDBL4J.js";
1
4
  import {
2
5
  CATALOGUE,
3
6
  CATALOGUE_VERSION,
4
7
  HOUSE_LOCKED,
5
8
  applyHouseGate,
6
9
  checkCopy,
10
+ holdHouseBlocks,
11
+ houseRule,
12
+ scanSource
13
+ } from "./chunk-WFB6F3BN.js";
14
+ import {
7
15
  compareCompetitor,
8
16
  compareFacts,
9
17
  extractCopy,
10
18
  fileKind,
11
19
  formatComparison,
12
20
  formatCompetitor,
13
- holdHouseBlocks,
14
- houseRule,
15
21
  pageCopy,
16
22
  protectedFacts,
17
- scanSource,
18
23
  visibleText
19
- } from "./chunk-B2MJLGF6.js";
24
+ } from "./chunk-4QWEAL4G.js";
20
25
 
21
26
  // src/character/config.ts
22
27
  var DEFAULT_IGNORE = [".claude", ".agents", ".cursor"];
@@ -80,12 +85,6 @@ function applySeverity(report, config) {
80
85
  return { ...report, findings, summary: { ...report.summary, blocking: findings.filter((f) => f.severity === "block").length } };
81
86
  }
82
87
 
83
- // src/character/json.ts
84
- var JSON_SCHEMA_VERSION = 1;
85
- function toJson(data) {
86
- return JSON.stringify({ schemaVersion: JSON_SCHEMA_VERSION, ...data }, null, 2);
87
- }
88
-
89
88
  // src/character/cli.ts
90
89
  import { execFileSync } from "child_process";
91
90
  import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "fs";
@@ -389,6 +388,9 @@ Usage
389
388
  craft report <url | snapshot.json> [--repo <dir>] [--null <dir>] [--estate <file>] [--direction <file>] [--json] [--strict]
390
389
  craft retrofit <url | snapshot.json> [the same] [--out RETROFIT.md]
391
390
  craft calibrate <labels.json> [--out <dir>] [--fresh] [--json]
391
+ craft register list [--json]
392
+ craft register brief <plain|persuasive|warm|literary> [--json]
393
+ craft register check <file> --as <register> [--json]
392
394
 
393
395
  scan Markup, component code and stylesheets (source and compiled CSS).
394
396
  --staged reads the git index, for a pre-commit hook.
@@ -439,6 +441,10 @@ calibrate How well the catalogue separates a labelled set (ai, human,
439
441
  first three targets. --out keeps results.json and any snapshots it
440
442
  took; --fresh takes every snapshot again. A page not measured is
441
443
  listed, and never counts as a pass. A measure: always exit 0.
444
+ register Writing in a chosen register (REGISTERS.md). brief prints what to
445
+ do before drafting; check places a draft of five or more
446
+ paragraphs against the human baselines for that register. Never
447
+ fails: exit 0, or 2 on bad usage.
442
448
 
443
449
  ci options (scan, copy, audit)
444
450
  --baseline <file> Report only findings the baseline does not already
@@ -594,7 +600,7 @@ async function pageSnapshot(target, cwd) {
594
600
  return readSnapshot(JSON.parse(readFileSync(local, "utf8")), target);
595
601
  }
596
602
  if (!/^https?:\/\//.test(target)) throw new Error(`${target} is neither a URL nor a snapshot file`);
597
- const { snapshotUrl } = await import("./audit-UJCUWORL.js");
603
+ const { snapshotUrl } = await import("./audit-4SFSLCKY.js");
598
604
  return snapshotUrl(target);
599
605
  }
600
606
  async function briefFor(flags, cwd) {
@@ -605,7 +611,7 @@ async function briefFor(flags, cwd) {
605
611
  if (typeof brief === "string" && brief.trim()) return brief;
606
612
  } else if (flags.direction) throw new Error(`no such file: ${flags.direction}`);
607
613
  if (flags.null) {
608
- const { loadNull } = await import("./cli-AVYNHBFJ.js");
614
+ const { loadNull } = await import("./cli-BN4IT6N2.js");
609
615
  return loadNull(flags.null, cwd).brief;
610
616
  }
611
617
  return void 0;
@@ -631,28 +637,31 @@ async function compareWithCompetitor(flags, io) {
631
637
  function run(argv, io) {
632
638
  const [command, ...rest] = argv;
633
639
  if (command === "direction") {
634
- return import("./cli-K4LSRYBE.js").then((m) => m.runDirection(rest, io));
640
+ return import("./cli-Y7Y5IROK.js").then((m) => m.runDirection(rest, io));
635
641
  }
636
642
  if (command === "report" || command === "retrofit") {
637
- return import("./cli-CWORJYOU.js").then((m) => m.runReport(command, rest, io));
643
+ return import("./cli-V44QEVS6.js").then((m) => m.runReport(command, rest, io));
644
+ }
645
+ if (command === "register") {
646
+ return import("./cli-JB4X5LAG.js").then((m) => m.runRegister(rest, io));
638
647
  }
639
648
  if (command === "estate") {
640
- return import("./cli-PEATEW57.js").then((m) => m.runEstate(rest, io));
649
+ return import("./cli-GXIW7F3E.js").then((m) => m.runEstate(rest, io));
641
650
  }
642
651
  if (command === "null") {
643
- return import("./cli-AVYNHBFJ.js").then((m) => m.runNull(rest, io));
652
+ return import("./cli-BN4IT6N2.js").then((m) => m.runNull(rest, io));
644
653
  }
645
654
  if (command === "calibrate") {
646
- return import("./cli-3GQROFCB.js").then((m) => m.runCalibrate(rest, io));
655
+ return import("./cli-MDW7JTEF.js").then((m) => m.runCalibrate(rest, io));
647
656
  }
648
657
  if (command === "tells" && rest[0] === "harvest") {
649
- return import("./cli-AVYNHBFJ.js").then((m) => m.runHarvest(rest, io)).catch((error) => {
658
+ return import("./cli-BN4IT6N2.js").then((m) => m.runHarvest(rest, io)).catch((error) => {
650
659
  io.err(`craft: ${error.message}`);
651
660
  return 2;
652
661
  });
653
662
  }
654
663
  if (command === "snapshot" || command === "audit") {
655
- return import("./cli-52M62QBN.js").then((m) => m.runAudit(command, rest, io));
664
+ return import("./cli-JZRQBCD4.js").then((m) => m.runAudit(command, rest, io));
656
665
  }
657
666
  if (!command || command === "help" || command === "--help" || command === "-h") {
658
667
  io.out(HELP);
@@ -739,7 +748,6 @@ function run(argv, io) {
739
748
 
740
749
  export {
741
750
  applySeverity,
742
- toJson,
743
751
  parseFlags,
744
752
  readPaths,
745
753
  loadConfig,
@@ -0,0 +1,9 @@
1
+ // src/character/json.ts
2
+ var JSON_SCHEMA_VERSION = 1;
3
+ function toJson(data) {
4
+ return JSON.stringify({ schemaVersion: JSON_SCHEMA_VERSION, ...data }, null, 2);
5
+ }
6
+
7
+ export {
8
+ toJson
9
+ };
@@ -4,14 +4,16 @@ import {
4
4
  formatDirectionMatches,
5
5
  summariseDirection,
6
6
  validateDirection
7
- } from "./chunk-WAV6AKR4.js";
7
+ } from "./chunk-6TSDYETQ.js";
8
8
  import {
9
9
  loadNull
10
- } from "./chunk-LWVGIJ5A.js";
10
+ } from "./chunk-ZUYERAFM.js";
11
+ import {
12
+ parseFlags
13
+ } from "./chunk-O5B5ELJH.js";
11
14
  import {
12
- parseFlags,
13
15
  toJson
14
- } from "./chunk-LXDNIJFG.js";
16
+ } from "./chunk-QIEDBL4J.js";
15
17
  import {
16
18
  readSnapshot
17
19
  } from "./chunk-WUACK2HX.js";
@@ -26,7 +28,7 @@ import {
26
28
  groundName,
27
29
  hueName,
28
30
  shapeName
29
- } from "./chunk-B2MJLGF6.js";
31
+ } from "./chunk-WFB6F3BN.js";
30
32
 
31
33
  // src/estate/cli.ts
32
34
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -103,7 +105,7 @@ async function snapshotOf(target, cwd) {
103
105
  return snap;
104
106
  }
105
107
  if (!/^https?:\/\//.test(target)) throw new Error(`${target} is neither a URL, a snapshot file, nor a site in the register`);
106
- const { snapshotUrl } = await import("./audit-UJCUWORL.js");
108
+ const { snapshotUrl } = await import("./audit-4SFSLCKY.js");
107
109
  return snapshotUrl(target);
108
110
  }
109
111
  var line = (distance, sibling, shared) => `${distance.toFixed(2)}${sibling ? " SIBLING" : ""}${shared.length ? ` shares ${shared.join(", ")}` : ""}`;
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  auditSnapshot,
6
6
  fingerprint
7
- } from "./chunk-B2MJLGF6.js";
7
+ } from "./chunk-WFB6F3BN.js";
8
8
  import {
9
9
  SNAPSHOT_VERSION
10
10
  } from "./chunk-QYBAVU3P.js";