lib/project-facts
lib/project-facts.js
Functions(7)
Read and JSON-parse a file, returning `fallback` on any error.
| Parameter | Type | Optional | Description |
|---|---|---|---|
filePath | string | ||
fallback | * |
Returns:
* Signature
readJsonSafe(filePath: any, fallback: any): any
Node version facts: the package's declared minimum vs. what CI actually
tests against. Surfaced separately and explicitly -- not collapsed into
one answer -- because they may legitimately differ (see story-dev-onboarding-dashboard AC1).
| Parameter | Type | Optional | Description |
|---|---|---|---|
rootDir | string |
Returns:
{declaredMin: (string|null), ciTested: number[], matches: boolean} Signature
getNodeVersions(rootDir: any): any
Which package manager this repo uses, detected from lockfile presence.
| Parameter | Type | Optional | Description |
|---|---|---|---|
rootDir | string |
Returns:
{manager: string, lockfile: (string|null)} Signature
getPackageManager(rootDir: any): any
Global (machine-wide) dependencies required to work on this repo.
Static, but reasoned from the same repo-state signals as the rest of this
module -- zero devDependencies historically meant zero global tooling
beyond Node/npm/git; the new code-multivitals devDependency doesn't
change that (it's invoked via its programmatic API, never a global install
or npx network fetch in CI since `npm ci` already resolves it).
| Parameter | Type | Optional | Description |
|---|---|---|---|
rootDir | string |
Returns:
{required: string[], conditionallyRequired: string[]} Signature
getGlobalDependencies(rootDir: any): any
One-line-per-directory map of the top-level project structure, generated
by walking the actual filesystem (not hand-maintained).
| Parameter | Type | Optional | Description |
|---|---|---|---|
rootDir | string |
Returns:
{name: string, description: string}[] Signature
getProjectStructure(rootDir: any): any
Test-tooling facts: no framework, hand-rolled runner, no HTTP API.
| Parameter | Type | Optional | Description |
|---|---|---|---|
rootDir | string |
Returns:
{framework: (string|null), runner: string, suiteCount: (number|null), hasHttpApi: boolean} Signature
getTestInfo(rootDir: any): any
Variables & Constants(17)
const fs: any
constlib/project-facts.js
----------------------------------------
Onboarding-facts generator for the internal project dashboard (Track A,
see docs/backlog/adr-phase-j-project-dashboard.md). Every fact is derived
by reading the repo's actual current state -- package.json, CI workflow
YAML, the real directory tree -- never hand-typed prose that can drift
out of sync with reality.
Signature
const fs: any
Signature
const KNOWN_DIR_DESCRIPTIONS: Object
Signature
const IGNORE_TOP_LEVEL_DIRS: Set