Nog CLI Developer Guide - v0.10.5
    Preparing search index...

    Generates barrel export files (index.ts) for simplified SDK imports.

    Barrels reduce import path complexity for SDK consumers by re-exporting all models and services from a single entry point per layer (DTOs, Services, root).

    Emitted files:

    • ${outputDir}/dto/index.ts – Re-exports all DTO and Enum definitions.
    • ${outputDir}/services/index.ts – Re-exports all Service classes.
    • ${outputDir}/index.ts – Re-exports DTO and Service barrels.

    Each barrel includes the standard generated file header with metadata.

    Index

    Constructors

    Methods

    Constructors

    • Instantiates the index writer.

      Parameters

      • project: Project

        The ts-morph Project instance for AST manipulation.

      • outputDir: string

        The target directory structure where barrels will be written.

      • specTitle: string = 'Unknown Spec'

        The OpenAPI specification title for file header metadata.

      • specVersion: string = 'Unknown Version'

        The OpenAPI specification version for file header metadata.

      Returns IndexWriter

    Methods

    • Generates all necessary index.ts files for DTOs, services, and the root entrypoint.

      Parameters

      • ir: IrDefinition

        The Internal Representation containing models and services.

      Returns Promise<void>

      Promise resolving when all barrel files are written.