NPM Build Utilities @ 0.1.3
    Preparing search index...

    Interface Stage<T_Args, T_SubStage>

    Implementation of a single build stage class.

    For a type that matches the class instead of the object, see Stage.Class.

    0.1.0-alpha

    interface Stage<
        T_Args extends Stage.Args = Stage.Args,
        T_SubStage extends string = string,
    > {
        args: T_Args;
        ARGS_DEFAULT: T_Args;
        clr: Colour;
        compiler: Stage.Compiler;
        config: Config.Internal;
        console: Logger;
        fs: FileSystem;
        isDraftVersion: boolean;
        name: string;
        params: Params;
        pkg: PackageJson;
        subStages: T_SubStage[];
        version: SemVer;
        buildArgs(args?: Partial<T_Args>): T_Args;
        getDistDir(subDir?: SourceDirectory, ...subpaths: string[]): string;
        getScriptsPath(subDir?: "logs", ...subpaths: string[]): string;
        getSrcDir(subDir: SourceDirectory, ...subpaths: string[]): string[];
        getSrcDir(subDir?: undefined, ...subpaths: string[]): string;
        getSrcDir(
            subDir?: SourceDirectory,
            ...subpaths: string[],
        ): string | string[];
        isSubStageIncluded(subStage: T_SubStage, level: number): boolean;
        run(): Promise<void>;
        startEndNotice(
            which: null | "start" | "end",
            watcherVersion?: boolean,
            args?: Partial<BulkMsgArgs>,
        ): void | Promise<void>;
    }

    Type Parameters

    Implemented by

    Index

    Config

    args: T_Args

    A completed args object for this instance.

    ARGS_DEFAULT: T_Args

    Default args for this stage.

    clr: Colour

    Colour used for colour-coding this stage.

    Complete project configuration.

    name: string

    Name for this stage used for notices.

    params: Params

    Current CLI params.

    subStages: T_SubStage[]

    All sub-stages to run in this stage (in order).

    Project

    isDraftVersion: boolean

    Wheather the current project version is a draft (e.g., this is not a non-dryrun release).

    Current value of the package.json file for this project.

    version: SemVer

    Current version object for the project.

    Running

    • Prints a message to the console signalling the start or end of this build stage.

      Parameters

      • which: null | "start" | "end"

        Whether we are starting or ending.

      • OptionalwatcherVersion: boolean

        Whether to display the watcher version of the message if applicable. Default false.

      • Optionalargs: Partial<BulkMsgArgs>

        Message argument overrides.

      Returns void | Promise<void>

    Utilities

    compiler: Stage.Compiler

    Instance used to compile files from the src directory.

    console: Logger

    Instance used to send messages to the console.

    Instance used to deal with files and paths.

    • Gets the paths from the config for the given dist sub directory.

      Parameters

      • OptionalsubDir: SourceDirectory

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string

    • Gets an absolute path to the Config.Paths.scripts directories.

      Parameters

      • OptionalsubDir: "logs"

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string

    • If there's a subdir, the return will be an array of strings.

      Parameters

      • subDir: SourceDirectory

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string[]

    • If there's no subdir, the return will be a string.

      Parameters

      • OptionalsubDir: undefined

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string

    • Gets the paths from the config for the given src sub directory.

      Parameters

      • OptionalsubDir: SourceDirectory

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string | string[]