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.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -0
- package/package.json +1 -1
- package/src/cli/cmd_Bump.ts +2 -0
- package/src/cli/cmd_Ci.ts +3 -1
- package/src/cli/cmd_Pb.ts +27 -0
- package/src/cli/cmd_Release.ts +1 -1
- package/src/cli/cmd_Wiki.ts +2 -2
- package/src/cli.ts +49 -39
- package/src/collections/graphs.ts +17 -19
- package/src/collections/providers.ts +7 -2
- package/src/contracts/contracts-once.ts +43 -0
- package/src/core/canonical-scripts.ts +33 -0
- package/src/core/check-ctx.ts +13 -0
- package/src/core/check-suite.ts +121 -53
- package/src/core/floor.ts +82 -0
- package/src/core/motherhome.ts +14 -1
- package/src/core/run-check.ts +34 -0
- package/src/core/run-ci.ts +63 -2
- package/src/core/run-fixers.ts +6 -1
- package/src/ledger/toolchain-identity.ts +134 -0
- package/src/pb/collection-scaffold.ts +299 -0
- package/src/pb/pb-types.ts +233 -0
- package/src/pb/run-pb.ts +157 -0
- package/src/release/git-facts.ts +3 -2
- package/src/release/release-scope.ts +52 -0
- package/src/release/releases-share.ts +85 -0
- package/src/release/run-bump.ts +31 -8
- package/src/release/run-release.ts +8 -1
- package/src/release/run-releases.ts +20 -6
- package/src/repo-config.ts +22 -65
- package/src/rules/SK001-package-json-shape.ts +65 -2
- package/src/rules/SK002-contracts-fulfillness.ts +2 -2
- package/src/rules/SK004-gitignore-policy.ts +27 -3
- package/src/rules/SK012-config-barrel-import.ts +60 -0
- package/src/rules/rule-registry.ts +2 -0
- package/src/rules/untrack-generated.ts +117 -0
- package/src/scaffold/project-scaffold.ts +1 -1
- package/src/serve/hub-port.ts +17 -0
- package/src/serve/run-serve.ts +54 -20
- package/src/serve/serve-hub.ts +13 -15
- package/src/shipkit.ts +3 -2
- package/src/wiki/graph-mount.ts +21 -0
- package/src/wiki/run-wiki.ts +18 -8
package/src/wiki/run-wiki.ts
CHANGED
|
@@ -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 = {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
46
|
-
for (const d of r.dangling)
|
|
47
|
-
if (!r.ok) {
|
|
48
|
-
|
|
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
|
}
|