NPM Build Utilities @ 0.3.0-alpha.9
    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.

    _sassLoggerWarningDuringPackaging: boolean = false
    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;
                  "alpha-function": { preserve: false };
                  "any-link-pseudo-class": false;
                  "blank-pseudo-class": false;
                  "break-properties": true;
                  "cascade-layers": true;
                  "case-insensitive-attributes": true;
                  clamp: { preserve: false };
                  "color-function": { preserve: true };
                  "color-function-display-p3-linear": { preserve: false };
                  "color-functional-notation": false;
                  "color-mix": false;
                  "color-mix-variadic-function-arguments": false;
                  "content-alt-text": { preserve: true };
                  "contrast-color-function": { 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": { preserve: false };
                  "nesting-rules": true;
                  "not-pseudo-class": true;
                  "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;
                  "alpha-function": { preserve: false };
                  "any-link-pseudo-class": false;
                  "blank-pseudo-class": false;
                  "break-properties": true;
                  "cascade-layers": true;
                  "case-insensitive-attributes": true;
                  clamp: { preserve: false };
                  "color-function": { preserve: true };
                  "color-function-display-p3-linear": { preserve: false };
                  "color-functional-notation": false;
                  "color-mix": false;
                  "color-mix-variadic-function-arguments": false;
                  "content-alt-text": { preserve: true };
                  "contrast-color-function": { 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": { preserve: false };
                  "nesting-rules": true;
                  "not-pseudo-class": true;
                  "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: {
              alertAscii: undefined;
              alertColor: undefined;
              benchmarkCompileTime: undefined;
              charset: true;
              cli: undefined;
              compileViaCLI: undefined;
              fatalDeprecations: undefined;
              functions: undefined;
              futureDeprecations: undefined;
              ignoreWarningsInPackaging: undefined;
              importers: undefined;
              isWatchedUpdate: undefined;
              loadPaths: undefined;
              logger: undefined;
              pathToSassLoggingRoot: undefined;
              quietDeps: undefined;
              silenceDeprecations: undefined;
              sourceMap: true;
              sourceMapIncludeSources: true;
              style: "expanded";
              verbose: undefined;
          };
          ts: {};
      }
      Internal

      Default values for the args property.

      Returns {
          postCSS: PostCSS;
          sass: {
              alertAscii: undefined;
              alertColor: undefined;
              benchmarkCompileTime: undefined;
              charset: true;
              cli: undefined;
              compileViaCLI: undefined;
              fatalDeprecations: undefined;
              functions: undefined;
              futureDeprecations: undefined;
              ignoreWarningsInPackaging: undefined;
              importers: undefined;
              isWatchedUpdate: undefined;
              loadPaths: undefined;
              logger: undefined;
              pathToSassLoggingRoot: undefined;
              quietDeps: undefined;
              silenceDeprecations: undefined;
              sourceMap: true;
              sourceMapIncludeSources: true;
              style: "expanded";
              verbose: undefined;
          };
          ts: {};
      }

      • ReadonlypostCSS: PostCSS

        This is actually the value of the Stage_Compiler.postCssConfig static accessor, but not as const for ease and smoother integration.

      • Readonlysass: {
            alertAscii: undefined;
            alertColor: undefined;
            benchmarkCompileTime: undefined;
            charset: true;
            cli: undefined;
            compileViaCLI: undefined;
            fatalDeprecations: undefined;
            functions: undefined;
            futureDeprecations: undefined;
            ignoreWarningsInPackaging: undefined;
            importers: undefined;
            isWatchedUpdate: undefined;
            loadPaths: undefined;
            logger: undefined;
            pathToSassLoggingRoot: undefined;
            quietDeps: undefined;
            silenceDeprecations: undefined;
            sourceMap: true;
            sourceMapIncludeSources: true;
            style: "expanded";
            verbose: undefined;
        }
      • Readonlyts: {}
    • get tsConfig(): {
          compilerOptions: {
              baseUrl: string
              | undefined;
              exactOptionalPropertyTypes: false;
              outDir: string;
          };
          exclude: ["**/node_modules/**/*"];
          extends: "@maddimathon/build-utilities/tsconfig";
      }
      Internal

      Default TS config file.

      Returns {
          compilerOptions: {
              baseUrl: string | undefined;
              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

      Compile multiple scss files at once.

      Parameters

      • paths: { input: string; output: string }[]
      • level: number

        Depth level for this message.

      • OptionalsassOpts: Sass

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

      • maxConcurrent: number = 10

      Returns Promise<string[]>

      0.3.0-alpha.1

    • Internal

      Logs the message for the benchmark end notice.

      Parameters

      • msg: string
      • level: number
      • start: DateTime
      • end: DateTime

      Returns void

      0.3.0-alpha.1

    • Internal

      Logs the message for the benchmark start notice.

      Parameters

      • msg: string
      • level: number
      • start: DateTime

      Returns void

      0.3.0-alpha.1

    • Internal

      Runs the compileAsync from the sass package and returns with an ending timestamp.

      Parameters

      • input: string
      • level: number
      • opts: Sass

      Returns Promise<CompileResult>

      0.3.0-alpha.1

    • Internal

      Returns the logger argument for sass API opts.

      Fires Stage_Compiler._sassLoggerWarningDuringPackaging event if a warning is encountered during packaging.

      Parameters

      Returns {
          debug: (message: string, options: { span: SourceSpan }) => void;
          warn: (message: string, options: LoggerWarnOptions) => void;
      }

      0.3.0-alpha.3

    • Internal

      Compiles scss via API. This skips compiling options and validating values.

      Parameters

      • input: string
      • output: string
      • level: number
      • sassCompleteOpts: Objects.Classify<Sass>
      • OptionalcompileFn: (input: string, level: number, opts: Sass) => Promise<CompileResult>

      Returns Promise<string>

      0.3.0-alpha.1