jsdoc-scribe API/lib/site-dataCurrent
Functions(4)
#buildSiteData
line 37
Assembles the full site-data payload from already-computed pieces -- this function does no extraction/analysis of its own, it only shapes data callers already have.
ParameterTypeOptionalDescription
modulesobject[]- extractModule() output, one per file.
quality{result: object, graph?: object, orphans?: string[], snapshots?: object[]}|null- computeQualityEmbedData() output, or null if `--quality` wasn't used.
meta{projectName: string, version: string, sourceUrl?: string}
Returns: object — the full payload, ready for JSON.stringify().
Signature
buildSiteData(modules: any, quality: any, meta: any): any
#historyDirFor
line 73
ParameterTypeOptionalDescription
dataPathstring- path to the canonical site-data.json.
Returns: string — the sibling history directory for that path.
Signature
historyDirFor(dataPath: any): any
#writeSiteData
line 91
Writes `payload` to `dataPath`, NEVER silently overwriting a prior generation (story-file-detail-redesign AC5): if `dataPath` already exists, it is moved (not deleted) into a sibling `<name>-history/` directory under an ISO-timestamped filename -- same timestamp convention `code-multivitals`'s own `saveSnapshot()` already uses in this codebase -- before the new payload is written to the canonical path. Collision-safe: if two writes land in the same millisecond (e.g. rapid successive test runs), a numeric suffix is appended rather than clobbering the preserved copy.
ParameterTypeOptionalDescription
dataPathstring
payloadobject
Returns: {path: string, preserved: string|null} — the canonical path written, and the history path of the preserved prior file (or null if none existed).
Signature
writeSiteData(dataPath: any, payload: any): any
#loadSiteData
line 119
Reads + validates a site-data JSON file. Throws a clear, actionable Error (never a raw parse/ENOENT stack trace) on failure -- same contract as `lib/quality.js`'s `CODE_MULTIVITALS_NOT_INSTALLED`.
ParameterTypeOptionalDescription
dataPathstring
Returns: object — the parsed, validated payload.
Signature
loadSiteData(dataPath: any): any
Variables & Constants(14)
const fs: any
const
lib/site-data.js ---------------------------------------- story-file-detail-redesign / adr-phase-l-file-detail-and-site-data.md A single JSON artifact that captures everything `buildSite()` needs to regenerate the doc site: module data (same shape `--json`/`docs.json` already publishes -- reused, not redefined) plus quality/import-graph/ snapshot data (the exact shape `computeQualityEmbedData()` in bin/gen-docs.js already produces). Two things this module is deliberately NOT: - It does not touch `docs.json` (the existing `--json` flag's output). That's a separate, already-published contract -- see the ADR's Decision 4. - It is not itself a renderer. `loadSiteData()` only reads and validates; turning the result back into HTML is `bin/gen-docs.js`'s job (calling the same `buildSite()` the normal path already uses).
Signature
const fs: any
const path: any
const
Signature
const path: any
#SCHEMA_VERSION
line 26
const SCHEMA_VERSION: number
const
Signature
const SCHEMA_VERSION: number
#preserved
line 92
let preserved: any
var
Signature
let preserved: any
#histDir
line 94
const histDir: any
const
Signature
const histDir: any
const ts: any
const
Signature
const ts: any
const base: any
const
Signature
const base: any
#histPath
line 98
let histPath: any
var
Signature
let histPath: any
let n: number
var
Signature
let n: number
let raw: any
var
Signature
let raw: any
#wrapped
line 124
const wrapped: Error
const
Signature
const wrapped: Error
let data: any
var
Signature
let data: any
#wrapped
line 132
const wrapped: Error
const
Signature
const wrapped: Error
#wrapped
line 137
const wrapped: Error
const
Signature
const wrapped: Error