builder-util

  • Version 22.13.1
  • Published
  • 123 kB
  • 15 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: any;

    variable debug7z

    const debug7z: any;

      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?: any,
                  extraOptions?: ExtraSpawnOptions
                  ) => any;

                    function exec

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

                      function executeAppBuilder

                      executeAppBuilder: (
                      args: Array<string>,
                      childProcessConsumer?: (childProcess: any) => void,
                      extraOptions?: any,
                      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 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>,
                                            retriesLeft: number,
                                            interval: number
                                            ) => Promise<T>;

                                              function serializeToYaml

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

                                                function spawn

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

                                                  function spawnAndWrite

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

                                                    function toLinuxArchString

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

                                                      function use

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

                                                        Classes

                                                        class AsyncTaskManager

                                                        class AsyncTaskManager {}

                                                          constructor

                                                          constructor(cancellationToken: any);

                                                            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 (7)

                                                                                                                Dependencies (15)

                                                                                                                Dev Dependencies (4)

                                                                                                                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>