Files
bare-operating-system/scripts/report-holepunch-runtime-compat.mjs
T
Raven Scott e59c57e538 Align Bare OS with Holepunch stack across runtime, P2P, storage, trust, and ops surfaces
Implement the 50-point Holepunch alignment roadmap with a first-pass delivery across coreutils commands, policy examples, audit tooling, and docs. This adds new operator CLIs (appctl/corestorectl/ctxbaredoctor/dhtctl/trustctl), tiered catalog and runtime-compat reports, release-checklist integration, contributor guidance, and kernel/seeder mirrored artifacts for app registry, trust, network services, corestore namespaces, and update manifest workflows.
2026-04-26 08:57:34 -04:00

75 lines
2.0 KiB
JavaScript

#!/usr/bin/env node
import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
const booterPkgPath = path.join(root, 'packages/bare-os-booter/package.json')
const outPath = path.join(root, 'docs/audit/holepunch-runtime-compat.json')
const mirrorRoot = String(
process.env.BARE_OS_HOLEPUNCH_CLONES_ROOT ||
path.join(process.env.HOME || '', 'dev/pearcli/holepunch-repos/holepunchto_repos')
).trim()
const CORE_REPOS = [
'bare-runtime',
'bare-module',
'bare-fs',
'bare-net',
'hypercore',
'corestore',
'hyperdrive',
'hyperdht',
'hyperswarm',
'pear',
'pear-runtime'
]
function readJson(p, fallback = null) {
try {
return JSON.parse(fs.readFileSync(p, 'utf8'))
} catch {
return fallback
}
}
function main() {
const booterPkg = readJson(booterPkgPath, {})
const deps = {
...(booterPkg.dependencies || {}),
...(booterPkg.optionalDependencies || {})
}
const rows = CORE_REPOS.map((repo) => {
const clonePkgPath = path.join(mirrorRoot, repo, 'package.json')
const clonePkg = readJson(clonePkgPath, {})
const cloneVersion = String(clonePkg?.version || '').trim()
const depRange = String(deps[repo] || '').trim()
return {
repo,
booterRange: depRange || null,
cloneVersion: cloneVersion || null,
clonePath: path.join(mirrorRoot, repo),
rangeMentionsLocalFile: depRange.startsWith('file:'),
semverDrift: Boolean(depRange && cloneVersion && !depRange.includes(cloneVersion))
}
})
const out = {
schema: 1,
generatedAt: new Date().toISOString(),
mirrorRoot,
booterPackage: path.relative(root, booterPkgPath),
rows
}
fs.mkdirSync(path.dirname(outPath), { recursive: true })
fs.writeFileSync(outPath, JSON.stringify(out, null, 2) + '\n', 'utf8')
console.log(
'report-holepunch-runtime-compat: wrote',
path.relative(root, outPath),
'rows=',
rows.length
)
}
main()