library_output.ts

Library output generation.

Generates the library.json and library.ts files from analyzed metadata.

@see library_generate.ts for the main generation entry point @see library_pipeline.ts for pipeline orchestration functions @see library_gen.ts for Gro-specific integration

Declarations
#

2 declarations

view source

library_generate_output
#

library_output.ts view source

(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; logo?: string | undefined; ... 23 more ...; exports?: string | ... 2 more ... | undefined; }, source_json: { ...; }): LibraryOutputResult

Generate the library.json and library.ts file contents. Parses at generation time so runtime only needs the pre-computed result.

Returns JSON + .ts wrapper because: - JSON is natively importable by Node.js and Vite without TypeScript loaders - Works in CI environments that don't have TS compilation - The .ts wrapper validates with zod and exports with proper types (JSON imports get widened types like string instead of literal unions)

package_json

type { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; logo?: string | undefined; ... 23 more ...; exports?: string | ... 2 more ... | undefined; }

source_json

type { [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefine...

returns

LibraryOutputResult

LibraryOutputResult
#

library_output.ts view source

LibraryOutputResult

Result of generating library output files. Contains both the JSON data and the TypeScript wrapper file.

json_content

JSON content for library.json

type string

ts_content

TypeScript wrapper content for library.ts

type string

Imported by
#