NPM Build Utilities @ 0.2.0-alpha.1
    Preparing search index...

    Class ProjectConfig

    A super-simple class just for the configuration of the project.

    0.1.0-alpha

    0.1.0-alpha.1 — Now implements Config.Class instead of Config.Internal.

    Implements

    Index

    Constructors

    Properties

    clr: Colour

    Default output colour to the terminal.

    compiler: undefined | Partial<Stage.Compiler.Args>

    Optional arguments to use when constructing Stage.Compiler.

    console: undefined | Partial<Logger.Args>

    Optional arguments to use when constructing Logger.

    Optional arguments to use when constructing FileSystem.

    launchYear: string

    A four-digit year string representing the launch date of the project.

    Paths to files or directories.

    Absolute or relative to node’s cwd.

    replace: Replace | ((stage: Stage) => Replace)

    Placeholders to be replaced during the build processes.

    All build stages and whether or not they run, including custom implementations.

    If true, the default class is run. If false, it is not run at all.

    title: string

    Project’s human-friendly name in title case.

    Accessors

    Methods

    • Used to export the default config to write a config file when one did not exist.

      Returns Default

      0.1.0-alpha.1

    • Gets a path to the Config.Paths.dist directories.

      Parameters

      • fs: FileSystem

        Instance used to work with paths and files.

      • OptionalsubDir: DistDirectory

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string

      Relative path.

      0.1.0-alpha — Previously defined in ProjectConfig class.

    • Gets a path to the Config.Paths.scripts directories.

      Parameters

      • fs: FileSystem

        Instance used to work with paths and files.

      • OptionalsubDir: "logs"

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string

      Relative path.

      0.1.0-alpha — Previously defined in ProjectConfig class.

    • Gets a path to the Config.Paths.src directories.

      Overloaded for more accurate typing:

      • If a subdirectory is defined, the results will be an array.
      • If no subdirectory is defined, then the return will always be a string.

      Parameters

      • fs: FileSystem

        Instance used to work with paths and files.

      • subDir: SourceDirectory

        Sub-path to get.

      • ...subpaths: string[]

        Optional additional subpaths.

      Returns string[]

      Relative path.

      0.1.0-alpha — Previously defined in ProjectConfig class.

    • Internal

      Parameters

      • fs: FileSystem
      • OptionalsubDir: undefined
      • ...subpaths: string[]

      Returns string

    • Internal

      Parameters

      Returns string | string[]

    • Gets the instance for the given stage.

      Parameters

      • stage: Name

        Stage to get.

        • "snapshot"
        • "compile"
        • "test"
        • "document"
        • "build"
        • "package"
        • "release"
      • console: Logger

      Returns Promise<undefined | [Stage.Class, Partial<Stage.Args>]>

      An array with first the stage’s class and then the configured arguments for that class, or undefined if that class is disabled by the config.

      0.1.0-alpha — Previously defined in ProjectConfig class.

    • Returns the minimum required properties of this config.

      Useful for creating stripped-down or default configuration objects.

      Returns Config

      The minimum required properties for this config.

      0.1.0-alpha — Previously defined in ProjectConfig class.

    • Overrides the default function to return a string representation of this object.

      Returns string

      0.1.0-alpha — Previously defined in ProjectConfig class.