builder-util

  • Version 25.0.0-alpha.4
  • Published
  • 131 kB
  • 16 dependencies
  • MIT license

Install

npm i builder-util
yarn add builder-util
pnpm add builder-util

Overview

Various utilities. Used by [electron-builder](https://github.com/electron-userland/electron-builder).

Index

Variables

variable debug

const debug: _debug.Debugger;

    variable debug7z

    const debug7z: _debug.Debugger;

      variable log

      const log: Logger;

        Functions

        function addValue

        addValue: <K, T>(map: Map<K, Array<T>>, key: K, value: T) => void;

          function archFromString

          archFromString: (name: string) => Arch;

            function copyFile

            copyFile: (src: string, dest: string, isEnsureDir?: boolean) => Promise<any>;

              function deepAssign

              deepAssign: <T>(target: T, ...objects: Array<any>) => T;

                function defaultArchFromString

                defaultArchFromString: (name?: string) => Arch;

                  function doSpawn

                  doSpawn: (
                  command: string,
                  args: Array<string>,
                  options?: SpawnOptions,
                  extraOptions?: ExtraSpawnOptions
                  ) => ChildProcess;

                    function exec

                    exec: (
                    file: string,
                    args?: Array<string> | null,
                    options?: ExecFileOptions,
                    isLogOutIfDebug?: boolean
                    ) => Promise<string>;

                      function executeAppBuilder

                      executeAppBuilder: (
                      args: Array<string>,
                      childProcessConsumer?: (childProcess: ChildProcess) => void,
                      extraOptions?: SpawnOptions,
                      maxRetries?: number
                      ) => Promise<string>;

                        function exists

                        exists: (file: string) => Promise<boolean>;

                          function getArchCliNames

                          getArchCliNames: () => Array<string>;

                            function getArchSuffix

                            getArchSuffix: (arch: Arch, defaultArch?: string) => string;

                              function getPath7x

                              getPath7x: () => Promise<string>;

                                function getPath7za

                                getPath7za: () => Promise<string>;

                                  function getPlatformIconFileName

                                  getPlatformIconFileName: (
                                  value: string | null | undefined,
                                  isMac: boolean
                                  ) => string | null | undefined;

                                    function isEmptyOrSpaces

                                    isEmptyOrSpaces: (s: string | null | undefined) => s is '';

                                      function isEnvTrue

                                      isEnvTrue: (value: string | null | undefined) => boolean;

                                        function isPullRequest

                                        isPullRequest: () => boolean | '' | undefined;

                                          function isTokenCharValid

                                          isTokenCharValid: (token: string) => boolean;

                                            function removePassword

                                            removePassword: (input: string) => string;

                                              function replaceDefault

                                              replaceDefault: (
                                              inList: Array<string> | null | undefined,
                                              defaultList: Array<string>
                                              ) => Array<string>;

                                                function retry

                                                retry: <T>(
                                                task: () => Promise<T>,
                                                retryCount: number,
                                                interval: number,
                                                backoff?: number,
                                                attempt?: number,
                                                shouldRetry?: (e: any) => boolean
                                                ) => Promise<T>;

                                                  function serializeToYaml

                                                  serializeToYaml: (
                                                  object: any,
                                                  skipInvalid?: boolean,
                                                  noRefs?: boolean
                                                  ) => string;

                                                    function spawn

                                                    spawn: (
                                                    command: string,
                                                    args?: Array<string> | null,
                                                    options?: SpawnOptions,
                                                    extraOptions?: ExtraSpawnOptions
                                                    ) => Promise<any>;

                                                      function spawnAndWrite

                                                      spawnAndWrite: (
                                                      command: string,
                                                      args: Array<string>,
                                                      data: string,
                                                      options?: SpawnOptions
                                                      ) => Promise<any>;

                                                        function toLinuxArchString

                                                        toLinuxArchString: (arch: Arch, targetName: string) => string;

                                                          function use

                                                          use: <T, R>(value: T | Nullish, task: (value: T) => R) => R | null;

                                                            Classes

                                                            class AsyncTaskManager

                                                            class AsyncTaskManager {}

                                                              constructor

                                                              constructor(cancellationToken: CancellationToken);

                                                                property tasks

                                                                readonly tasks: Promise<any>[];

                                                                  method add

                                                                  add: (task: () => Promise<any>) => void;

                                                                    method addTask

                                                                    addTask: (promise: Promise<any>) => void;

                                                                      method awaitTasks

                                                                      awaitTasks: () => Promise<Array<any>>;

                                                                        method cancelTasks

                                                                        cancelTasks: () => void;

                                                                          class DebugLogger

                                                                          class DebugLogger {}

                                                                            constructor

                                                                            constructor(isEnabled?: boolean);

                                                                              property data

                                                                              readonly data: any;

                                                                                property isEnabled

                                                                                readonly isEnabled: boolean;

                                                                                  method add

                                                                                  add: (key: string, value: any) => void;

                                                                                    method save

                                                                                    save: (file: string) => Promise<void>;

                                                                                      class ExecError

                                                                                      class ExecError extends Error {}

                                                                                        constructor

                                                                                        constructor(
                                                                                        command: string,
                                                                                        exitCode: number,
                                                                                        out: string,
                                                                                        errorOut: string,
                                                                                        code?: string
                                                                                        );

                                                                                          property alreadyLogged

                                                                                          alreadyLogged: boolean;

                                                                                            property exitCode

                                                                                            readonly exitCode: number;

                                                                                              class InvalidConfigurationError

                                                                                              class InvalidConfigurationError extends Error {}

                                                                                                constructor

                                                                                                constructor(message: string, code?: string);

                                                                                                  Interfaces

                                                                                                  interface ExtraSpawnOptions

                                                                                                  interface ExtraSpawnOptions {}

                                                                                                    property isPipeInput

                                                                                                    isPipeInput?: boolean;

                                                                                                      Enums

                                                                                                      enum Arch

                                                                                                      enum Arch {
                                                                                                      ia32 = 0,
                                                                                                      x64 = 1,
                                                                                                      armv7l = 2,
                                                                                                      arm64 = 3,
                                                                                                      universal = 4,
                                                                                                      }

                                                                                                        member arm64

                                                                                                        arm64 = 3

                                                                                                          member armv7l

                                                                                                          armv7l = 2

                                                                                                            member ia32

                                                                                                            ia32 = 0

                                                                                                              member universal

                                                                                                              universal = 4

                                                                                                                member x64

                                                                                                                x64 = 1

                                                                                                                  Type Aliases

                                                                                                                  type ArchType

                                                                                                                  type ArchType = 'x64' | 'ia32' | 'armv7l' | 'arm64' | 'universal';

                                                                                                                    Package Files (8)

                                                                                                                    Dependencies (16)

                                                                                                                    Dev Dependencies (5)

                                                                                                                    Peer Dependencies (0)

                                                                                                                    No peer dependencies.

                                                                                                                    Badge

                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/builder-util.

                                                                                                                    • Markdown
                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/builder-util)
                                                                                                                    • HTML
                                                                                                                      <a href="https://www.jsdocs.io/package/builder-util"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>