rvlib-shipkit 0.30.0 → 0.32.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +3 -0
  3. package/package.json +1 -1
  4. package/src/cli/cmd_Bump.ts +2 -0
  5. package/src/cli/cmd_Ci.ts +3 -1
  6. package/src/cli/cmd_Pb.ts +27 -0
  7. package/src/cli/cmd_Release.ts +1 -1
  8. package/src/cli/cmd_Wiki.ts +2 -2
  9. package/src/cli.ts +49 -39
  10. package/src/collections/graphs.ts +17 -19
  11. package/src/collections/providers.ts +7 -2
  12. package/src/contracts/contracts-once.ts +43 -0
  13. package/src/core/canonical-scripts.ts +33 -0
  14. package/src/core/check-ctx.ts +13 -0
  15. package/src/core/check-suite.ts +121 -53
  16. package/src/core/floor.ts +82 -0
  17. package/src/core/motherhome.ts +14 -1
  18. package/src/core/run-check.ts +34 -0
  19. package/src/core/run-ci.ts +63 -2
  20. package/src/core/run-fixers.ts +6 -1
  21. package/src/ledger/toolchain-identity.ts +134 -0
  22. package/src/pb/collection-scaffold.ts +299 -0
  23. package/src/pb/pb-types.ts +233 -0
  24. package/src/pb/run-pb.ts +157 -0
  25. package/src/release/git-facts.ts +3 -2
  26. package/src/release/release-scope.ts +52 -0
  27. package/src/release/releases-share.ts +85 -0
  28. package/src/release/run-bump.ts +31 -8
  29. package/src/release/run-release.ts +8 -1
  30. package/src/release/run-releases.ts +20 -6
  31. package/src/repo-config.ts +22 -65
  32. package/src/rules/SK001-package-json-shape.ts +65 -2
  33. package/src/rules/SK002-contracts-fulfillness.ts +2 -2
  34. package/src/rules/SK004-gitignore-policy.ts +27 -3
  35. package/src/rules/SK012-config-barrel-import.ts +60 -0
  36. package/src/rules/rule-registry.ts +2 -0
  37. package/src/rules/untrack-generated.ts +117 -0
  38. package/src/scaffold/project-scaffold.ts +1 -1
  39. package/src/serve/hub-port.ts +17 -0
  40. package/src/serve/run-serve.ts +54 -20
  41. package/src/serve/serve-hub.ts +13 -15
  42. package/src/shipkit.ts +3 -2
  43. package/src/wiki/graph-mount.ts +21 -0
  44. package/src/wiki/run-wiki.ts +18 -8
@@ -6,7 +6,15 @@ import { lintMd } from './lint-md.ts'
6
6
  import { scanMdGraph } from './scan-md.ts'
7
7
  import { serveMdGraph } from './serve-graph.ts'
8
8
 
9
- export type WikiScanOpts = { root: string; index?: string; skip?: string }
9
+ export type WikiScanOpts = {
10
+ root: string
11
+ index?: string
12
+ skip?: string
13
+ /** where the verdict goes. The command passes its own stream, so the
14
+ * output is capturable: a console.log inside a command bypasses the
15
+ * stream clipanion hands it, and nothing downstream can read it */
16
+ print?: (line: string) => void
17
+ }
10
18
 
11
19
  const scanConfig = (o: WikiScanOpts): { root: string; index?: string; skipDirs?: string[] } => ({
12
20
  root: resolve(process.cwd(), o.root),
@@ -15,18 +23,19 @@ const scanConfig = (o: WikiScanOpts): { root: string; index?: string; skipDirs?:
15
23
  })
16
24
 
17
25
  export async function runWikiServe(o: WikiScanOpts & { port: number; title?: string }): Promise<number> {
26
+ const say = o.print ?? console.log
18
27
  const cfg = scanConfig(o)
19
28
  const rel = relative(process.cwd(), cfg.root)
20
29
  const title = o.title ?? (rel === '' ? basename(cfg.root) : `${basename(process.cwd())} ${rel}`)
21
30
  try {
22
31
  serveMdGraph({ port: o.port, title, load: () => scanMdGraph(cfg) })
23
- console.log(`wiki graph → http://localhost:${o.port} (open in browser, or VSCode "Simple Browser: Show")`)
32
+ say(`wiki graph → http://localhost:${o.port} (open in browser, or VSCode "Simple Browser: Show")`)
24
33
  // keep the server alive — the command must not resolve
25
34
  await new Promise(() => {})
26
35
  return 0
27
36
  } catch (e) {
28
37
  if (e instanceof Error && e.message.includes('in use')) {
29
- console.log(`wiki graph already served → http://localhost:${o.port} (another window owns it)`)
38
+ say(`wiki graph already served → http://localhost:${o.port} (another window owns it)`)
30
39
  return 0
31
40
  }
32
41
  throw e
@@ -34,17 +43,18 @@ export async function runWikiServe(o: WikiScanOpts & { port: number; title?: str
34
43
  }
35
44
 
36
45
  export function runWikiLint(o: WikiScanOpts): number {
46
+ const say = o.print ?? console.log
37
47
  const cfg = scanConfig(o)
38
48
  const r = lintMd(cfg)
39
49
  if (r.index == null) {
40
- console.log(o.index != null
50
+ say(o.index != null
41
51
  ? `FAIL entrypoint '${o.index}' not found in ${cfg.root}`
42
52
  : `FAIL no entrypoint: neither index.md nor README.md in ${cfg.root} — pass --index <entry.md>`)
43
53
  return 1
44
54
  }
45
- for (const f of r.orphans) console.log(`FAIL orphan: ${f} — unreachable from ${r.index}; link it or delete it`)
46
- for (const d of r.dangling) console.log(`FAIL dangling: ${d.from} → ${d.token} — target not found`)
47
- if (!r.ok) { console.log(`FAIL mdwiki lint: ${r.orphans.length} orphan(s), ${r.dangling.length} dangling ref(s) in ${cfg.root}`); return 1 }
48
- console.log(`ok mdwiki lint: ${r.files} files, all reachable from ${r.index}, no dangling refs`)
55
+ for (const f of r.orphans) say(`FAIL orphan: ${f} — unreachable from ${r.index}; link it or delete it`)
56
+ for (const d of r.dangling) say(`FAIL dangling: ${d.from} → ${d.token} — target not found`)
57
+ if (!r.ok) { say(`FAIL mdwiki lint: ${r.orphans.length} orphan(s), ${r.dangling.length} dangling ref(s) in ${cfg.root}`); return 1 }
58
+ say(`ok mdwiki lint: ${r.files} files, all reachable from ${r.index}, no dangling refs`)
49
59
  return 0
50
60
  }