@freetesh/canon 0.18.0 → 0.18.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.
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "name": "canon",
9
9
  "source": "./",
10
- "version": "0.18.0",
10
+ "version": "0.18.1",
11
11
  "description": "Keeps your domain knowledge and AI rules in your repos and enforces them, so Claude hallucinates less."
12
12
  }
13
13
  ],
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "canon",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Keeps your domain knowledge and AI rules in your repos and enforces them, so Claude hallucinates less."
5
5
  }
@@ -11,7 +11,7 @@ export interface Pair {
11
11
  export declare function usedCopies(config: Config): Pair[];
12
12
  export interface CopyState {
13
13
  pair: Pair;
14
- state: "same" | "drift" | "missing" | "unknown-set" | "no-source" | "unnamed";
14
+ state: "same" | "drift" | "missing" | "unknown-set" | "no-source" | "unnamed" | "no-checkout";
15
15
  /** What the product file should hold; set for a drift --sync can repair. */
16
16
  want?: string;
17
17
  }
@@ -24,6 +24,9 @@ export function compareCopies(repo, config) {
24
24
  const { source, sets, use } = config.copies;
25
25
  if (use.length === 0 || !source || resolve(source) === resolve(repo))
26
26
  return [];
27
+ // A clone of one repo (CI) has no source beside it: nothing can be compared, so say that once.
28
+ if (!existsSync(source))
29
+ return [{ pair: { set: use.join(", "), from: "", to: source, named: false }, state: "no-checkout" }];
27
30
  const unknown = use.filter((set) => !sets[set]).map((set) => ({ pair: { set, from: "", to: "", named: false }, state: "unknown-set" }));
28
31
  const productName = nameOf(repo, config);
29
32
  const sourceName = nameOf(source, loadConfig(source).config);
@@ -68,6 +71,8 @@ export const sharedFiles = {
68
71
  const source = config.copies.source ? basename(config.copies.source) : "copies.source";
69
72
  return compareCopies(repo, config).flatMap(({ pair, state }) => {
70
73
  const finding = (file, message) => [{ check: "shared-files", level: "error", file, message }];
74
+ if (state === "no-checkout")
75
+ return [{ check: "shared-files", level: "warn", file: ".claude/canon.yaml", message: `${source} is not checked out at ${pair.to}; sets ${pair.set} were not compared` }];
71
76
  if (state === "unknown-set")
72
77
  return finding(".claude/canon.yaml", `copies.use names ${pair.set}, which no copies.sets defines`);
73
78
  if (state === "no-source")
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@freetesh/canon",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "canon CLI: keep your domain knowledge and AI rules in your repo, and enforce them.",
5
5
  "license": "MIT",
6
6
  "author": "Ritesh Firodiya",
7
+ "homepage": "https://ritesh-firodiya.github.io/products/canon/",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/ritesh-firodiya/canon-cli.git"
@@ -251,7 +251,7 @@ head('architecture — the overview is declared and every framed diagram has its
251
251
  arch_page = R.get('architecture')
252
252
  arch_flow = next((fl for fl in R['flows'] if fl.get('flow') == 'architecture'), None)
253
253
  if not arch_page:
254
- bad('routes.js names no `architecture` page — run bin/arch-set with this set\'s spec')
254
+ bad('routes.js names no `architecture` page — run `canon arch-set` with this set\'s spec')
255
255
  elif arch_page not in declared_files:
256
256
  bad('`architecture: "%s"` is not a declared screen' % arch_page)
257
257
  if arch_flow is None: