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

    Class Stage_CompilerInternal

    To be used by AbstractStage and those that inherit from it.

    Includes a variety of utilities for compiling files (like scss and typescript).

    0.1.0-alpha

    Implements

    Index

    Constructors

    Properties

    A completed args object.

    config: Config.Class

    Current project config.

    console: Stage_Console

    Instance used to log messages and debugging info.

    Instance used to work with paths and files.

    params: Params

    Current CLI params.

    Accessors

    • get postCssConfig(): {
          presetEnv: {
              features: {
                  "all-property": false;
                  "any-link-pseudo-class": false;
                  "blank-pseudo-class": false;
                  "break-properties": true;
                  "cascade-layers": true;
                  "case-insensitive-attributes": true;
                  clamp: { preserve: true };
                  "color-function": { preserve: true };
                  "color-functional-notation": false;
                  "color-mix": false;
                  "color-mix-variadic-function-arguments": false;
                  "content-alt-text": { preserve: true };
                  "custom-media-queries": false;
                  "custom-properties": { preserve: true };
                  "custom-selectors": false;
                  "dir-pseudo-class": false;
                  "display-two-values": false;
                  "double-position-gradients": true;
                  "exponential-functions": true;
                  "float-clear-logical-values": true;
                  "focus-visible-pseudo-class": false;
                  "focus-within-pseudo-class": false;
                  "font-format-keywords": false;
                  "font-variant-property": false;
                  "gamut-mapping": false;
                  "gap-properties": true;
                  "gradients-interpolation-method": false;
                  "has-pseudo-class": false;
                  "hexadecimal-alpha-notation": true;
                  "hwb-function": true;
                  "ic-unit": false;
                  "image-set-function": false;
                  "is-pseudo-class": false;
                  "lab-function": { preserve: true };
                  "light-dark-function": false;
                  "logical-overflow": true;
                  "logical-overscroll-behavior": true;
                  "logical-properties-and-values": true;
                  "logical-resize": true;
                  "logical-viewport-units": true;
                  "media-queries-aspect-ratio-number-values": false;
                  "media-query-ranges": true;
                  "nested-calc": true;
                  "nesting-rules": true;
                  "not-pseudo-class": false;
                  "oklab-function": { preserve: true };
                  "opacity-percentage": true;
                  "overflow-property": true;
                  "overflow-wrap-property": false;
                  "place-properties": true;
                  "prefers-color-scheme-query": false;
                  "random-function": false;
                  "rebeccapurple-color": true;
                  "relative-color-syntax": false;
                  "scope-pseudo-class": false;
                  "sign-functions": false;
                  "stepped-value-functions": false;
                  "system-ui-font-family": false;
                  "text-decoration-shorthand": false;
                  "trigonometric-functions": false;
                  "unset-value": { preserve: true };
              };
              logical: { blockDirection: TopToBottom; inlineDirection: LeftToRight };
              stage: false;
          };
          processor: { map: false };
      }
      Internal

      Default configuration for working with PostCSS.

      Returns {
          presetEnv: {
              features: {
                  "all-property": false;
                  "any-link-pseudo-class": false;
                  "blank-pseudo-class": false;
                  "break-properties": true;
                  "cascade-layers": true;
                  "case-insensitive-attributes": true;
                  clamp: { preserve: true };
                  "color-function": { preserve: true };
                  "color-functional-notation": false;
                  "color-mix": false;
                  "color-mix-variadic-function-arguments": false;
                  "content-alt-text": { preserve: true };
                  "custom-media-queries": false;
                  "custom-properties": { preserve: true };
                  "custom-selectors": false;
                  "dir-pseudo-class": false;
                  "display-two-values": false;
                  "double-position-gradients": true;
                  "exponential-functions": true;
                  "float-clear-logical-values": true;
                  "focus-visible-pseudo-class": false;
                  "focus-within-pseudo-class": false;
                  "font-format-keywords": false;
                  "font-variant-property": false;
                  "gamut-mapping": false;
                  "gap-properties": true;
                  "gradients-interpolation-method": false;
                  "has-pseudo-class": false;
                  "hexadecimal-alpha-notation": true;
                  "hwb-function": true;
                  "ic-unit": false;
                  "image-set-function": false;
                  "is-pseudo-class": false;
                  "lab-function": { preserve: true };
                  "light-dark-function": false;
                  "logical-overflow": true;
                  "logical-overscroll-behavior": true;
                  "logical-properties-and-values": true;
                  "logical-resize": true;
                  "logical-viewport-units": true;
                  "media-queries-aspect-ratio-number-values": false;
                  "media-query-ranges": true;
                  "nested-calc": true;
                  "nesting-rules": true;
                  "not-pseudo-class": false;
                  "oklab-function": { preserve: true };
                  "opacity-percentage": true;
                  "overflow-property": true;
                  "overflow-wrap-property": false;
                  "place-properties": true;
                  "prefers-color-scheme-query": false;
                  "random-function": false;
                  "rebeccapurple-color": true;
                  "relative-color-syntax": false;
                  "scope-pseudo-class": false;
                  "sign-functions": false;
                  "stepped-value-functions": false;
                  "system-ui-font-family": false;
                  "text-decoration-shorthand": false;
                  "trigonometric-functions": false;
                  "unset-value": { preserve: true };
              };
              logical: { blockDirection: TopToBottom; inlineDirection: LeftToRight };
              stage: false;
          };
          processor: { map: false };
      }

      0.2.0-alpha

    • get ARGS_DEFAULT(): {
          postCSS: PostCSS;
          sass: {
              charset: true;
              sourceMap: true;
              sourceMapIncludeSources: true;
              style: "expanded";
          };
          ts: {};
      }
      Internal

      Default values for the args property.

      Returns {
          postCSS: PostCSS;
          sass: {
              charset: true;
              sourceMap: true;
              sourceMapIncludeSources: true;
              style: "expanded";
          };
          ts: {};
      }

      • ReadonlypostCSS: PostCSS

        This is the value of the Stage_Compiler.postCssConfig static accessor.

      • Readonlysass: {
            charset: true;
            sourceMap: true;
            sourceMapIncludeSources: true;
            style: "expanded";
        }
      • Readonlyts: {}
    • get tsConfig(): {
          compilerOptions: {
              baseUrl: string;
              exactOptionalPropertyTypes: false;
              outDir: string;
          };
          exclude: ["**/node_modules/**/*"];
          extends: "@maddimathon/build-utilities/tsconfig";
      }
      Internal

      Default TS config file.

      Returns {
          compilerOptions: {
              baseUrl: string;
              exactOptionalPropertyTypes: false;
              outDir: string;
          };
          exclude: ["**/node_modules/**/*"];
          extends: "@maddimathon/build-utilities/tsconfig";
      }

    Methods

    • Internal

      Gets paths to tsconfig files according to the project configuration.

      If none is found, a console prompt asks to write a default file.

      Parameters

      • stage: Stage

        Current stage being run.

      • level: number

        Depth level for output to the console.

      • writeIfNotFound: boolean = true

        Whether to prompt (via console) to write a new tsconfig file if none are found.

      Returns Promise<string[]>

      0.2.0-alpha

    • Internal

      Gets the value of the given tsconfig file.

      Parameters

      • tsconfig: string

        Path to TS config json used to compile the project.

      • level: number

        Depth level for this message.

      • errorIfNotFound: boolean = true

        Whether to throw an error if tsconfig is not found.

      Returns Partial<Json.TsConfig>

      StageError If the tsconfig file doesn’t exist and errorIfNotFound is truthy.

      0.2.0-alpha

    • Internal

      Gets the value of the given tsconfig file.

      Parameters

      • tsconfig: string | Partial<TsConfig> & { path: string }

        Path to TS config json.

      • level: number

        Depth level for this message.

      • errorIfNotFound: boolean = true

        Whether to throw an error if tsconfig is not found.

      Returns string | false

      StageError If the tsconfig file doesn’t exist and errorIfNotFound is truthy.

      0.2.0-alpha

    • Internal

      Process css with the PostCSS npm package.

      Parameters

      • paths: { from: string; to?: string }[]

        Css paths to process (from), and optionally where to output them (to).

      • level: number

        Depth level for this message.

      • _postCssOpts: PostCSS = {}

      Returns Promise<void>

      0.2.0-alpha

    • Internal

      Compile scss using the sass npm package.

      Parameters

      • input: string

        Scss input path.

      • output: string

        Scss output path.

      • level: number

        Depth level for this message.

      • OptionalsassOpts: Sass

        Overrides for the configured sass options in Stage.Compiler.args.

      Returns Promise<void>

    • Internal

      Compile typescript using the typescript npm package.

      Parameters

      • tsconfig: string

        Path to TS config json used to compile the project.

      • level: number

        Depth level for this message.

      • OptionalerrorIfNotFound: boolean

        Whether to throw error if the tsconfig file is not found.

      Returns Promise<void>

      0.2.0-alpha — Now has errorIfNotFound param for use with new Stage_Compiler.getTsConfig method.