@types/jake

  • Version 0.0.36
  • Published
  • 21.4 kB
  • 1 dependency
  • MIT license

Install

npm i @types/jake
yarn add @types/jake
pnpm add @types/jake

Overview

TypeScript definitions for jake

Index

Namespaces

namespace global

namespace global {}

    function complete

    complete: (value?: any) => void;
    • Complets an asynchronous task, allowing Jake's execution to proceed to the next task

      Parameter value

      A value to return from the task.

    function desc

    desc: (description: string) => void;
    • Creates a description for a Jake Task (or FileTask, DirectoryTask). When invoked, the description that iscreated will be associated with whatever Task is created next.

      Parameter description

      The description for the Task

    function directory

    directory: (name: string) => jake.DirectoryTask;
    • Creates a Jake DirectoryTask. Can be used as a prerequisite for FileTasks, or for simply ensuring a directory exists for use with a Task's action.

      Parameter name

      The name of the DiretoryTask

    function fail

    fail: {
    (...err: string[]): void;
    (...err: Error[]): void;
    (...err: any[]): void;
    };
    • Causes Jake execution to abort with an error. Allows passing an optional error code, which will be used to set the exit-code of exiting process.

      Parameter err

      The error to thow when aborting execution. If this argument is an Error object, it will simply be thrown. If a String, it will be used as the error-message. (If it is a multi-line String, the first line will be used as the Error message, and the remaining lines will be used as the error-stack.)

    function file

    file: (
    name: string,
    prereqs?: string[],
    action?: (this: jake.FileTask) => void,
    opts?: jake.FileTaskOptions
    ) => jake.FileTask;
    • Creates a Jake FileTask. name The name of the Task

      Parameter prereqs

      Prerequisites to be run before this task

      Parameter action

      The action to perform for this task

      Parameter opts

      Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task.

    function namespace

    namespace: (name: string, scope: () => void) => void;
    • Creates a namespace which allows logical grouping of tasks, and prevents name-collisions with task-names. Namespaces can be nested inside of other namespaces.

      Parameter name

      The name of the namespace

      Parameter scope

      The enclosing scope for the namespaced tasks

    function npmPublishTask

    npmPublishTask: {
    (name: string, packageFiles: string[]): jake.NpmPublishTask;
    (name: string, definition?: () => void): jake.NpmPublishTask;
    };
    • Parameter name

      The name of the NpmPublishTask

      Parameter packageFiles

      The files to include in the package

      Parameter definition

      A function that creates the package definition

    function rule

    rule: (
    pattern: RegExp,
    source: string | ((name: string) => string),
    prereqs?: string[],
    action?: () => void,
    opts?: jake.TaskOptions
    ) => void;
    • Creates Jake FileTask from regex patterns name/pattern of the Task

      Parameter source

      calculated from the name pattern

      Parameter prereqs

      Prerequisites to be run before this task

      Parameter action

      The action to perform for this task

      Parameter opts

      Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task.

    function task

    task: {
    (
    name: string,
    prereqs?: string[],
    action?: (this: jake.Task, ...params: any[]) => any,
    opts?: jake.TaskOptions
    ): jake.Task;
    (
    name: string,
    action?: (this: jake.Task, ...params: any[]) => any,
    opts?: jake.TaskOptions
    ): jake.Task;
    (
    name: string,
    opts?: jake.TaskOptions,
    action?: (this: jake.Task, ...params: any[]) => any
    ): jake.Task;
    };
    • Parameter name

      The name of the Task

      Parameter prereqs

      Prerequisites to be run before this task

      Parameter action

      The action to perform for this task

      Parameter opts

    namespace global.jake

    namespace global.jake {}

      variable logger

      var logger: Logger;

        variable program

        var program: {
        opts: { [name: string]: any; quiet: boolean };
        taskNames: string[];
        taskArgs: string[];
        envVars: { [key: string]: string };
        };

          function addListener

          addListener: (event: string, listener: Function) => NodeJS.EventEmitter;

            function cpR

            cpR: {
            (
            path: string,
            destination: string,
            opts?: UtilOptions,
            callback?: () => void
            ): void;
            (path: string, destination: string, callback?: (err: Error) => void): void;
            };
            • The jake.cpR utility does a recursive copy of a file or directory. Note that this command can only copy files and directories; it does not perform globbing (so arguments like '*.txt' are not possible).

              Parameter path

              the file/directory to copy,

              Parameter destination

              the destination.

            function createExec

            createExec: {
            (cmds: string[], callback?: () => void, opts?: ExecOptions): Exec;
            (cmds: string[], opts?: ExecOptions, callback?: () => void): Exec;
            (cmds: string, callback?: () => void, opts?: ExecOptions): Exec;
            (cmds: string, opts?: ExecOptions, callback?: () => void): Exec;
            };

              function emit

              emit: (event: string, ...args: any[]) => boolean;

                function exec

                exec: (cmds: string[], callback?: () => void, opts?: ExecOptions) => void;

                  function listeners

                  listeners: (event: string) => Function[];

                    function mkdirP

                    mkdirP: {
                    (name: string, mode?: string, f?: (er: Error, made: any) => void): void;
                    (name: string, f?: (er: Error, made: any) => void): void;
                    };
                    • The jake.mkdirP utility recursively creates a set of nested directories. It will not throw an error if any of the directories already exists. https://github.com/substack/node-mkdirp

                    function on

                    on: (event: string, listener: Function) => NodeJS.EventEmitter;

                      function once

                      once: (event: string, listener: Function) => NodeJS.EventEmitter;

                        function readdirR

                        readdirR: (name: string, opts?: UtilOptions) => string[];
                        • The jake.readdirR utility gives you a recursive directory listing, giving you output somewhat similar to the Unix find command. It only works with a directory name, and does not perform filtering or globbing. an array of filepaths for all files in the 'pkg' directory, and all its subdirectories.

                        function removeAllListener

                        removeAllListener: (event: string) => NodeJS.EventEmitter;

                          function removeListener

                          removeListener: (event: string, listener: Function) => NodeJS.EventEmitter;

                            function rmRf

                            rmRf: (name: string, opts?: UtilOptions) => void;
                            • The jake.rmRf utility recursively removes a directory and all its contents.

                            function setMaxListeners

                            setMaxListeners: (n: number) => void;

                              class DirectoryTask

                              class DirectoryTask extends FileTask {}

                                constructor

                                constructor(name: string);
                                • Parameter name

                                  The name of the directory to create.

                                class FileList

                                class FileList {}

                                  constructor

                                  constructor();

                                    method clearExclude

                                    clearExclude: () => void;
                                    • Get rid of any current exclusion rules

                                    method exclude

                                    exclude: {
                                    (file: string[]): void;
                                    (...file: string[]): void;
                                    (file: RegExp[]): void;
                                    (...file: RegExp[]): void;
                                    (file: FileFilter[]): void;
                                    (...file: FileFilter[]): void;
                                    };
                                    • Excludes file-patterns from the FileList. Should be called with one or more pattern for finding file to include in the list. Arguments can be: 1. Strings for either a glob-pattern or a specific file-name 2. Regular expression literals 3. Functions to be run on the filename that return a true/false

                                    method include

                                    include: { (files: string[]): void; (...files: string[]): void };
                                    • Includes file-patterns in the FileList. Should be called with one or more pattern for finding file to include in the list. Arguments should be strings for either a glob-pattern or a specific file-name, or an array of them

                                    method resolve

                                    resolve: () => void;
                                    • Populates the FileList from the include/exclude rules with a list of actual files

                                    method shouldExclude

                                    shouldExclude: (name: string) => boolean;
                                    • Indicates whether a particular file would be filtered out by the current exclusion rules for this FileList.

                                      Parameter name

                                      The filename to check Whether or not the file should be excluded

                                    method toArray

                                    toArray: () => string[];
                                    • Convert to a plain-jane array

                                    class FileTask

                                    class FileTask extends Task {}

                                      constructor

                                      constructor(
                                      name: string,
                                      prereqs?: string[],
                                      action?: (this: FileTask) => void,
                                      opts?: FileTaskOptions
                                      );
                                      • Parameter name

                                        The name of the Task

                                        Parameter prereqs

                                        Prerequisites to be run before this task

                                        Parameter action

                                        The action to perform to create this file

                                        Parameter opts

                                        Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task.

                                      class NpmPublishTask

                                      class NpmPublishTask {}

                                        constructor

                                        constructor(name: string, packageFiles: string[]);

                                          constructor

                                          constructor(name: string, definition?: () => void);

                                            class PackageTask

                                            class PackageTask {}

                                              constructor

                                              constructor(name: string, version: string, definition: () => void);
                                              • Instantiating a PackageTask creates a number of Jake Tasks that make packaging and distributing your software easy.

                                                Parameter name

                                                The name of the project

                                                Parameter version

                                                The current project version (will be appended to the project-name in the package-archive

                                                Parameter definition

                                                Defines the contents of the package, and format of the package-archive. Will be executed on the instantiated PackageTask (i.e., 'this', will be the PackageTask instance), to set the various instance-propertiess.

                                              property archiveChangeDir

                                              archiveChangeDir: string;
                                              • Equivalent to the '-C' command for the tar and jar commands. ("Change to this directory before adding files.")

                                              property archiveContentDir

                                              archiveContentDir: string;
                                              • Specifies the files and directories to include in the package-archive. If unset, this will default to the main package directory -- i.e., name + version.

                                              property jarCommand

                                              jarCommand: string;
                                              • The shell-command to use for creating jar archives.

                                              property manifestFile

                                              manifestFile: string;
                                              • Can be set to point the jar utility at a manifest file to use in a .jar archive. If unset, one will be automatically created by the jar utility. This path should be relative to the root of the package directory (this.packageDir above, likely 'pkg')

                                              property name

                                              name: string;
                                              • The name of the project

                                              property needJar

                                              needJar: boolean;
                                              • If set to true, uses the jar utility to create a .jar archive of the pagckage

                                              property needTar

                                              needTar: boolean;
                                              • If set to true, uses the tar utility to create a gzip .tgz archive of the pagckage

                                              property needTarBz2

                                              needTarBz2: boolean;
                                              • If set to true, uses the tar utility to create a bzip2 .bz2 archive of the pagckage

                                              property needZip

                                              needZip: boolean;
                                              • If set to true, uses the zip utility to create a .zip archive of the pagckage

                                              property packageFiles

                                              packageFiles: FileList;
                                              • The list of files and directories to include in the package-archive

                                              property tarCommand

                                              tarCommand: string;
                                              • The shell-command to use for creating tar archives.

                                              property version

                                              version: string;
                                              • The project version-string

                                              property zipCommand

                                              zipCommand: string;
                                              • The shell-command to use for creating zip archives.

                                              class Task

                                              class Task extends EventEmitter {}
                                              • A Jake Task

                                                complete

                                              constructor

                                              constructor(
                                              name: string,
                                              prereqs?: string[],
                                              action?: (this: Task) => void,
                                              opts?: TaskOptions
                                              );
                                              • name The name of the Task

                                                Parameter prereqs

                                                Prerequisites to be run before this task

                                                Parameter action

                                                The action to perform for this task

                                                Parameter opts

                                                Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task.

                                              property action

                                              action?: (...params: any[]) => any;

                                                property async

                                                async?: boolean;

                                                  property description

                                                  description?: string;

                                                    property fullName

                                                    fullName: string;

                                                      property name

                                                      name?: string;

                                                        property prereqs

                                                        prereqs?: string[];

                                                          property taskStatus

                                                          taskStatus?: string;

                                                            property value

                                                            value: any;

                                                              method addListener

                                                              addListener: (event: string, listener: Function) => this;

                                                                method complete

                                                                complete: (value?: any) => void;

                                                                  method emit

                                                                  emit: (event: string, ...args: any[]) => boolean;

                                                                    method getMaxListeners

                                                                    getMaxListeners: () => number;

                                                                      method invoke

                                                                      invoke: () => void;
                                                                      • Runs prerequisites, then this task. If the task has already been run, will not run the task again.

                                                                      method listenerCount

                                                                      listenerCount: (type: string) => number;

                                                                        method listeners

                                                                        listeners: (event: string) => Function[];

                                                                          method on

                                                                          on: (event: string, listener: Function) => this;

                                                                            method once

                                                                            once: (event: string, listener: Function) => this;

                                                                              method reenable

                                                                              reenable: () => void;
                                                                              • Runs this task, without running any prerequisites. If the task has already been run, it will still run it again.

                                                                              method removeAllListeners

                                                                              removeAllListeners: (event?: string) => this;

                                                                                method removeListener

                                                                                removeListener: (event: string, listener: Function) => this;

                                                                                  method setMaxListeners

                                                                                  setMaxListeners: (n: number) => this;

                                                                                    class TestTask

                                                                                    class TestTask {}

                                                                                      constructor

                                                                                      constructor(name: string, definition?: () => void);

                                                                                        interface Exec

                                                                                        interface Exec extends NodeJS.EventEmitter {}
                                                                                        • cmdStart When a new command begins to run. Passes one arg, the command being run. cmdEnd When a command finishes. Passes one arg, the command being run. stdout When the stdout for the child-process recieves data. This streams the stdout data. Passes one arg, the chunk of data. stderr When the stderr for the child-process recieves data. This streams the stderr data. Passes one arg, the chunk of data. error When a shell-command

                                                                                        method append

                                                                                        append: (cmd: string) => void;

                                                                                          method run

                                                                                          run: () => void;

                                                                                            interface ExecOptions

                                                                                            interface ExecOptions {}

                                                                                              property breakOnError

                                                                                              breakOnError?: boolean | undefined;
                                                                                              • stop execution on error, default true

                                                                                              property printStderr

                                                                                              printStderr?: boolean | undefined;
                                                                                              • print to stderr, default false

                                                                                              property printStdout

                                                                                              printStdout?: boolean | undefined;
                                                                                              • print to stdout, default false

                                                                                              property windowsVerbatimArguments

                                                                                              windowsVerbatimArguments?: boolean | undefined;

                                                                                              interface FileFilter

                                                                                              interface FileFilter {}

                                                                                                call signature

                                                                                                (filename: string): boolean;

                                                                                                  interface FileTaskOptions

                                                                                                  interface FileTaskOptions {}

                                                                                                    property async

                                                                                                    async?: boolean | undefined;
                                                                                                    • Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task. false

                                                                                                    interface Logger

                                                                                                    interface Logger {}

                                                                                                      method error

                                                                                                      error: (value: any) => void;

                                                                                                        method log

                                                                                                        log: (value: any) => void;

                                                                                                          interface TaskOptions

                                                                                                          interface TaskOptions {}

                                                                                                            property async

                                                                                                            async?: boolean | undefined;
                                                                                                            • Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task. false

                                                                                                            property parallelLimit

                                                                                                            parallelLimit?: number | undefined;
                                                                                                            • number of parllel async tasks

                                                                                                            interface UtilOptions

                                                                                                            interface UtilOptions {}

                                                                                                              property silent

                                                                                                              silent?: boolean | undefined;

                                                                                                                Package Files (1)

                                                                                                                Dependencies (1)

                                                                                                                Dev Dependencies (0)

                                                                                                                No dev dependencies.

                                                                                                                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/@types/jake.

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