@plugjs/plug 0.0.12 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{types → dist}/assert.d.ts +0 -0
- package/dist/async.cjs +20 -19
- package/dist/async.cjs.map +1 -1
- package/dist/async.d.ts +20 -0
- package/dist/async.mjs +18 -17
- package/dist/async.mjs.map +1 -1
- package/dist/build.cjs +144 -110
- package/dist/build.cjs.map +2 -2
- package/dist/build.d.ts +12 -0
- package/dist/build.mjs +146 -112
- package/dist/build.mjs.map +2 -2
- package/dist/files.cjs +2 -16
- package/dist/files.cjs.map +1 -1
- package/{types → dist}/files.d.ts +3 -10
- package/dist/files.mjs +3 -17
- package/dist/files.mjs.map +1 -1
- package/dist/fork.cjs +28 -40
- package/dist/fork.cjs.map +1 -1
- package/dist/fork.d.ts +36 -0
- package/dist/fork.mjs +29 -40
- package/dist/fork.mjs.map +1 -1
- package/dist/helpers.cjs +61 -63
- package/dist/helpers.cjs.map +2 -2
- package/dist/helpers.d.ts +21 -0
- package/dist/helpers.mjs +61 -64
- package/dist/helpers.mjs.map +2 -2
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/log/colors.cjs +3 -1
- package/dist/log/colors.cjs.map +1 -1
- package/{types → dist}/log/colors.d.ts +2 -2
- package/dist/log/colors.mjs +3 -1
- package/dist/log/colors.mjs.map +1 -1
- package/{types → dist}/log/emit.d.ts +1 -1
- package/{types → dist}/log/levels.d.ts +0 -0
- package/dist/log/logger.cjs +4 -0
- package/dist/log/logger.cjs.map +1 -1
- package/{types → dist}/log/logger.d.ts +4 -1
- package/dist/log/logger.mjs +4 -0
- package/dist/log/logger.mjs.map +1 -1
- package/{types → dist}/log/options.d.ts +1 -1
- package/dist/log/report.cjs +4 -13
- package/dist/log/report.cjs.map +1 -1
- package/{types → dist}/log/report.d.ts +36 -4
- package/dist/log/report.mjs +3 -12
- package/dist/log/report.mjs.map +1 -1
- package/{types → dist}/log/spinner.d.ts +0 -0
- package/dist/log.cjs +1 -1
- package/dist/log.cjs.map +1 -1
- package/{types → dist}/log.d.ts +6 -6
- package/dist/log.mjs +2 -2
- package/dist/log.mjs.map +1 -1
- package/{types → dist}/paths.d.ts +0 -0
- package/dist/pipe.cjs +41 -34
- package/dist/pipe.cjs.map +1 -1
- package/dist/pipe.d.ts +182 -0
- package/dist/pipe.mjs +38 -32
- package/dist/pipe.mjs.map +1 -1
- package/dist/plugs/copy.cjs +15 -25
- package/dist/plugs/copy.cjs.map +2 -2
- package/dist/plugs/copy.d.ts +28 -0
- package/dist/plugs/copy.mjs +15 -17
- package/dist/plugs/copy.mjs.map +2 -2
- package/{types → dist}/plugs/coverage/analysis.d.ts +2 -2
- package/dist/plugs/coverage/report.cjs +4 -2
- package/dist/plugs/coverage/report.cjs.map +1 -1
- package/{types → dist}/plugs/coverage/report.d.ts +3 -3
- package/dist/plugs/coverage/report.mjs +4 -2
- package/dist/plugs/coverage/report.mjs.map +1 -1
- package/dist/plugs/coverage.cjs +23 -27
- package/dist/plugs/coverage.cjs.map +1 -1
- package/dist/plugs/coverage.d.ts +49 -0
- package/dist/plugs/coverage.mjs +24 -20
- package/dist/plugs/coverage.mjs.map +1 -1
- package/dist/plugs/debug.cjs +8 -37
- package/dist/plugs/debug.cjs.map +1 -1
- package/dist/plugs/debug.d.ts +7 -0
- package/dist/plugs/debug.mjs +24 -20
- package/dist/plugs/debug.mjs.map +1 -1
- package/{types → dist}/plugs/esbuild/bundle-locals.d.ts +0 -0
- package/{types → dist}/plugs/esbuild/fix-extensions.d.ts +0 -0
- package/dist/plugs/esbuild/fix-extensions.mjs +1 -1
- package/dist/plugs/esbuild/fix-extensions.mjs.map +1 -1
- package/dist/plugs/esbuild.cjs +14 -25
- package/dist/plugs/esbuild.cjs.map +1 -1
- package/dist/plugs/esbuild.d.ts +18 -0
- package/dist/plugs/esbuild.mjs +14 -17
- package/dist/plugs/esbuild.mjs.map +1 -1
- package/dist/plugs/eslint/runner.cjs +5 -6
- package/dist/plugs/eslint/runner.cjs.map +1 -1
- package/dist/plugs/eslint/runner.d.ts +8 -0
- package/dist/plugs/eslint/runner.mjs +6 -7
- package/dist/plugs/eslint/runner.mjs.map +1 -1
- package/dist/{task.cjs → plugs/eslint.cjs} +7 -24
- package/dist/plugs/eslint.cjs.map +6 -0
- package/dist/plugs/eslint.d.ts +34 -0
- package/dist/plugs/eslint.mjs +5 -0
- package/dist/plugs/eslint.mjs.map +6 -0
- package/dist/plugs/exec.cjs +20 -24
- package/dist/plugs/exec.cjs.map +1 -1
- package/dist/plugs/exec.d.ts +90 -0
- package/dist/plugs/exec.mjs +20 -23
- package/dist/plugs/exec.mjs.map +1 -1
- package/dist/plugs/filter.cjs +9 -19
- package/dist/plugs/filter.cjs.map +1 -1
- package/dist/plugs/filter.d.ts +29 -0
- package/dist/plugs/filter.mjs +10 -12
- package/dist/plugs/filter.mjs.map +1 -1
- package/dist/plugs/mocha/reporter.cjs +19 -6
- package/dist/plugs/mocha/reporter.cjs.map +1 -1
- package/{types → dist}/plugs/mocha/reporter.d.ts +0 -2
- package/dist/plugs/mocha/reporter.mjs +18 -4
- package/dist/plugs/mocha/reporter.mjs.map +1 -1
- package/dist/plugs/mocha/runner.cjs +4 -5
- package/dist/plugs/mocha/runner.cjs.map +1 -1
- package/dist/plugs/mocha/runner.d.ts +8 -0
- package/dist/plugs/mocha/runner.mjs +5 -6
- package/dist/plugs/mocha/runner.mjs.map +1 -1
- package/dist/plugs/mocha.cjs +22 -0
- package/dist/plugs/mocha.cjs.map +6 -0
- package/{types/plugs/mocha/runner.d.ts → dist/plugs/mocha.d.ts} +9 -8
- package/dist/plugs/mocha.mjs +5 -0
- package/dist/plugs/mocha.mjs.map +6 -0
- package/dist/plugs/rmf.cjs +4 -32
- package/dist/plugs/rmf.cjs.map +1 -1
- package/dist/plugs/rmf.d.ts +11 -0
- package/dist/plugs/rmf.mjs +25 -20
- package/dist/plugs/rmf.mjs.map +1 -1
- package/{types → dist}/plugs/tsc/compiler.d.ts +1 -1
- package/{types → dist}/plugs/tsc/options.d.ts +1 -1
- package/{types → dist}/plugs/tsc/report.d.ts +2 -2
- package/dist/plugs/tsc/runner.cjs +12 -11
- package/dist/plugs/tsc/runner.cjs.map +1 -1
- package/dist/plugs/tsc/runner.d.ts +8 -0
- package/dist/plugs/tsc/runner.mjs +12 -11
- package/dist/plugs/tsc/runner.mjs.map +1 -1
- package/dist/plugs/tsc.cjs +7 -0
- package/dist/plugs/tsc.cjs.map +6 -0
- package/dist/plugs/tsc.d.ts +36 -0
- package/dist/plugs/tsc.mjs +15 -0
- package/dist/plugs/tsc.mjs.map +6 -0
- package/dist/plugs.cjs +3 -5
- package/dist/plugs.cjs.map +1 -1
- package/dist/plugs.d.ts +10 -0
- package/dist/plugs.mjs +3 -5
- package/dist/plugs.mjs.map +1 -1
- package/dist/types.cjs +19 -0
- package/dist/types.cjs.map +6 -0
- package/dist/types.d.ts +72 -0
- package/dist/types.mjs +1 -0
- package/dist/types.mjs.map +6 -0
- package/{types → dist}/utils/asyncfs.d.ts +0 -0
- package/dist/utils/caller.cjs +8 -11
- package/dist/utils/caller.cjs.map +2 -2
- package/dist/utils/caller.d.ts +2 -0
- package/dist/utils/caller.mjs +8 -11
- package/dist/utils/caller.mjs.map +2 -2
- package/{types → dist}/utils/match.d.ts +0 -0
- package/dist/utils/options.cjs +4 -6
- package/dist/utils/options.cjs.map +1 -1
- package/dist/utils/options.d.ts +16 -0
- package/dist/utils/options.mjs +4 -6
- package/dist/utils/options.mjs.map +1 -1
- package/{types → dist}/utils/walk.d.ts +2 -2
- package/extra/cli.mjs +31 -20
- package/extra/ts-loader.mjs +6 -5
- package/package.json +10 -10
- package/src/async.ts +27 -19
- package/src/files.ts +6 -30
- package/src/fork.ts +35 -76
- package/src/helpers.ts +89 -101
- package/src/index.ts +10 -15
- package/src/log/colors.ts +4 -3
- package/src/log/emit.ts +4 -4
- package/src/log/logger.ts +12 -4
- package/src/log/options.ts +1 -1
- package/src/log/report.ts +10 -24
- package/src/log/spinner.ts +3 -3
- package/src/log.ts +9 -9
- package/src/paths.ts +1 -1
- package/src/pipe.ts +191 -178
- package/src/plugs/copy.ts +40 -31
- package/src/plugs/coverage/analysis.ts +4 -4
- package/src/plugs/coverage/report.ts +9 -6
- package/src/plugs/coverage.ts +68 -55
- package/src/plugs/debug.ts +22 -27
- package/src/plugs/esbuild/fix-extensions.ts +2 -2
- package/src/plugs/esbuild.ts +42 -46
- package/src/plugs/eslint/runner.ts +16 -31
- package/src/plugs/eslint.ts +42 -0
- package/src/plugs/exec.ts +93 -82
- package/src/plugs/filter.ts +42 -27
- package/src/plugs/mocha/reporter.ts +19 -5
- package/src/plugs/mocha/runner.ts +12 -38
- package/src/plugs/mocha.ts +41 -0
- package/src/plugs/rmf.ts +21 -25
- package/src/plugs/tsc/compiler.ts +1 -1
- package/src/plugs/tsc/options.ts +2 -2
- package/src/plugs/tsc/report.ts +2 -2
- package/src/plugs/tsc/runner.ts +24 -30
- package/src/plugs/tsc.ts +45 -0
- package/src/plugs.ts +10 -25
- package/src/types.ts +123 -0
- package/src/utils/caller.ts +11 -22
- package/src/utils/options.ts +49 -17
- package/src/utils/walk.ts +4 -4
- package/dist/run.cjs +0 -90
- package/dist/run.cjs.map +0 -6
- package/dist/run.mjs +0 -65
- package/dist/run.mjs.map +0 -6
- package/dist/task.cjs.map +0 -6
- package/dist/task.mjs +0 -14
- package/dist/task.mjs.map +0 -6
- package/src/run.ts +0 -159
- package/src/task.ts +0 -26
- package/types/async.d.ts +0 -20
- package/types/build.d.ts +0 -56
- package/types/fork.d.ts +0 -57
- package/types/helpers.d.ts +0 -43
- package/types/index.d.ts +0 -14
- package/types/pipe.d.ts +0 -152
- package/types/plugs/copy.d.ts +0 -27
- package/types/plugs/coverage.d.ts +0 -46
- package/types/plugs/debug.d.ts +0 -14
- package/types/plugs/esbuild.d.ts +0 -23
- package/types/plugs/eslint/runner.d.ts +0 -22
- package/types/plugs/exec.d.ts +0 -90
- package/types/plugs/filter.d.ts +0 -23
- package/types/plugs/rmf.d.ts +0 -15
- package/types/plugs/tsc/runner.d.ts +0 -13
- package/types/plugs.d.ts +0 -17
- package/types/run.d.ts +0 -89
- package/types/task.d.ts +0 -15
- package/types/utils/caller.d.ts +0 -7
- package/types/utils/options.d.ts +0 -15
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Files } from '../../files.js';
|
|
2
|
-
import { Plug } from '../../pipe.js';
|
|
3
|
-
import { Run } from '../../run.js';
|
|
4
|
-
export interface ESLintOptions {
|
|
5
|
-
/** ESLint's own _current working directory_, where config files are. */
|
|
6
|
-
directory?: string;
|
|
7
|
-
/** Show sources in report? */
|
|
8
|
-
showSources?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* ESLint's _override_ configuration file: configurations specified in this
|
|
11
|
-
* file will override any other configuration specified elsewhere.
|
|
12
|
-
*/
|
|
13
|
-
configFile?: string;
|
|
14
|
-
}
|
|
15
|
-
/** Writes some info about the current {@link Files} being passed around. */
|
|
16
|
-
export default class ESLint implements Plug<undefined> {
|
|
17
|
-
private readonly _options;
|
|
18
|
-
constructor();
|
|
19
|
-
constructor(configFile: string);
|
|
20
|
-
constructor(options: ESLintOptions);
|
|
21
|
-
pipe(files: Files, run: Run): Promise<undefined>;
|
|
22
|
-
}
|
package/types/plugs/exec.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Files } from '../files.js';
|
|
2
|
-
import { Plug } from '../pipe.js';
|
|
3
|
-
import { Run } from '../run.js';
|
|
4
|
-
import { ParseOptions } from '../utils/options.js';
|
|
5
|
-
/** Options for executing scripts */
|
|
6
|
-
export interface ExecOptions {
|
|
7
|
-
/** Extra environment variables, or overrides for existing ones */
|
|
8
|
-
env?: Record<string, any>;
|
|
9
|
-
/** Whether to run in the context of a _shell_ or not */
|
|
10
|
-
shell?: string | boolean;
|
|
11
|
-
/**
|
|
12
|
-
* The current working directory of the process to execute.
|
|
13
|
-
*
|
|
14
|
-
* Defaults to the current {@link Files.directory | Files' directory} when
|
|
15
|
-
* used as a {@link Plug} or `process.cwd()` when used from {@link exec}.
|
|
16
|
-
*/
|
|
17
|
-
cwd?: string;
|
|
18
|
-
/**
|
|
19
|
-
* When used as a {@link Plug}, the {@link Files} will be appended to the
|
|
20
|
-
* current arguments as _relative_ files (default) or _absolute_ (if false).
|
|
21
|
-
*/
|
|
22
|
-
relativePaths?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Execute a shell command, adding to its _arguments_ the list of files from
|
|
26
|
-
* the current pipe (much like `xargs` does on Unix systems).
|
|
27
|
-
*
|
|
28
|
-
* This {@link Plug} returns the same {@link Files} it was given, so that
|
|
29
|
-
* executing a shell command doesn't interrupt a {@link Pipe}.
|
|
30
|
-
*
|
|
31
|
-
* For example:
|
|
32
|
-
*
|
|
33
|
-
* ```
|
|
34
|
-
* import { find, exec } from '@plugjs/plugjs'
|
|
35
|
-
*
|
|
36
|
-
* export default build({
|
|
37
|
-
* async runme() {
|
|
38
|
-
* find('*.ts', { directory: 'src' })
|
|
39
|
-
* .plug(new Exec('chmod', '755' }))
|
|
40
|
-
* .plug(new Exec('chown root:root', { shell: true }))
|
|
41
|
-
* },
|
|
42
|
-
* })
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare class Exec implements Plug<Files> {
|
|
46
|
-
private readonly _cmd;
|
|
47
|
-
private readonly _args;
|
|
48
|
-
private readonly _options;
|
|
49
|
-
constructor(cmd: string, ...args: ParseOptions<ExecOptions>);
|
|
50
|
-
pipe(files: Files, run: Run): Promise<Files>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Execute a command and await for its result from within a task.
|
|
54
|
-
*
|
|
55
|
-
* For example:
|
|
56
|
-
*
|
|
57
|
-
* ```
|
|
58
|
-
* import { exec } from '@plugjs/plugjs'
|
|
59
|
-
*
|
|
60
|
-
* export default build({
|
|
61
|
-
* async runme() {
|
|
62
|
-
* await exec('ls', '-la', '/')
|
|
63
|
-
* },
|
|
64
|
-
* })
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export declare function exec(cmd: string, ...args: ParseOptions<ExecOptions>): Promise<void>;
|
|
68
|
-
declare module '../pipe.js' {
|
|
69
|
-
interface Pipe {
|
|
70
|
-
/**
|
|
71
|
-
* Execute a shell command, adding to its _arguments_ the list of files
|
|
72
|
-
* from the current pipe (much like `xargs` does on Unix systems).
|
|
73
|
-
*
|
|
74
|
-
* For example:
|
|
75
|
-
*
|
|
76
|
-
* ```
|
|
77
|
-
* import { find, exec } from '@plugjs/plugjs'
|
|
78
|
-
*
|
|
79
|
-
* export default build({
|
|
80
|
-
* async runme() {
|
|
81
|
-
* find('*.ts', { directory: 'src' })
|
|
82
|
-
* .exec('chmod', '755' })
|
|
83
|
-
* .exec('chown root:root', { shell: true })
|
|
84
|
-
* },
|
|
85
|
-
* })
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
exec: PipeExtension<typeof Exec>;
|
|
89
|
-
}
|
|
90
|
-
}
|
package/types/plugs/filter.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Files } from '../files.js';
|
|
2
|
-
import { Plug } from '../pipe.js';
|
|
3
|
-
import { Run } from '../run.js';
|
|
4
|
-
import { MatchOptions } from '../utils/match.js';
|
|
5
|
-
import { ParseOptions } from '../utils/options.js';
|
|
6
|
-
/** Options for filtering {@link Files}. */
|
|
7
|
-
export interface FilterOptions extends MatchOptions {
|
|
8
|
-
/** The base directory for filtering, and relativising the resulting files. */
|
|
9
|
-
directory?: string;
|
|
10
|
-
}
|
|
11
|
-
/** Filter the current {@link Files} using globs. */
|
|
12
|
-
export declare class Filter implements Plug<Files> {
|
|
13
|
-
private readonly _globs;
|
|
14
|
-
private readonly _options;
|
|
15
|
-
constructor(glob: string, ...args: ParseOptions<FilterOptions>);
|
|
16
|
-
pipe(files: Files, run: Run): Files;
|
|
17
|
-
}
|
|
18
|
-
declare module '../pipe.js' {
|
|
19
|
-
interface Pipe {
|
|
20
|
-
/** Filter the current {@link Files} using globs. */
|
|
21
|
-
filter: PipeExtension<typeof Filter>;
|
|
22
|
-
}
|
|
23
|
-
}
|
package/types/plugs/rmf.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Files } from '../files.js';
|
|
2
|
-
import { Plug } from '../pipe.js';
|
|
3
|
-
import { Run } from '../run.js';
|
|
4
|
-
/** Remove some files using globs. */
|
|
5
|
-
export declare class Rmf implements Plug<undefined> {
|
|
6
|
-
private readonly _dryRun;
|
|
7
|
-
constructor(dryRun?: boolean);
|
|
8
|
-
pipe(files: Files, run: Run): Promise<undefined>;
|
|
9
|
-
}
|
|
10
|
-
declare module '../pipe.js' {
|
|
11
|
-
interface Pipe {
|
|
12
|
-
/** Remove all {@link Files} piped in. */
|
|
13
|
-
rmf: PipeExtension<typeof Rmf>;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
2
|
-
import { Files } from '../../files.js';
|
|
3
|
-
import { Plug } from '../../pipe.js';
|
|
4
|
-
import { Run } from '../../run.js';
|
|
5
|
-
export default class Tsc implements Plug<Files> {
|
|
6
|
-
private readonly _tsconfig?;
|
|
7
|
-
private readonly _options;
|
|
8
|
-
constructor();
|
|
9
|
-
constructor(config: string);
|
|
10
|
-
constructor(options: ts.CompilerOptions);
|
|
11
|
-
constructor(config: string, options: ts.CompilerOptions);
|
|
12
|
-
pipe(files: Files, run: Run): Promise<Files>;
|
|
13
|
-
}
|
package/types/plugs.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type ESLint from './plugs/eslint/runner.js';
|
|
2
|
-
import type Mocha from './plugs/mocha/runner.js';
|
|
3
|
-
import type Tsc from './plugs/tsc/runner.js';
|
|
4
|
-
declare module './pipe.js' {
|
|
5
|
-
interface Pipe {
|
|
6
|
-
eslint: PipeExtension<typeof ESLint>;
|
|
7
|
-
mocha: PipeExtension<typeof Mocha>;
|
|
8
|
-
tsc: PipeExtension<typeof Tsc>;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export * from './plugs/copy.js';
|
|
12
|
-
export * from './plugs/coverage.js';
|
|
13
|
-
export * from './plugs/debug.js';
|
|
14
|
-
export * from './plugs/esbuild.js';
|
|
15
|
-
export * from './plugs/exec.js';
|
|
16
|
-
export * from './plugs/filter.js';
|
|
17
|
-
export * from './plugs/rmf.js';
|
package/types/run.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Files, FilesBuilder } from './files.js';
|
|
2
|
-
import { Logger, LogLevelString, Report } from './log.js';
|
|
3
|
-
import { AbsolutePath } from './paths.js';
|
|
4
|
-
import { Pipe } from './pipe.js';
|
|
5
|
-
import { ParseOptions } from './utils/options.js';
|
|
6
|
-
import { WalkOptions } from './utils/walk.js';
|
|
7
|
-
/** The {@link FindOptions} interface defines the options for finding files. */
|
|
8
|
-
export interface FindOptions extends WalkOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The directory where to start looking for files according to the rules
|
|
11
|
-
* specified in {@link Run.resolve}.
|
|
12
|
-
*/
|
|
13
|
-
directory?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The {@link Run} interface defines the context in which a {@link Task} is
|
|
17
|
-
* invoked.
|
|
18
|
-
*
|
|
19
|
-
* Runs keep track of the invocation stack (to avoid circular dependencies) and
|
|
20
|
-
* of the cached results for {@link Task} invocations.
|
|
21
|
-
*/
|
|
22
|
-
export interface Run {
|
|
23
|
-
/**
|
|
24
|
-
* The _name_ of the task associated with this {@link Run} (if one is).
|
|
25
|
-
*
|
|
26
|
-
* Tasks can have different names in different builds, this refers to the
|
|
27
|
-
* _task name_ in the build being executed.
|
|
28
|
-
*/
|
|
29
|
-
readonly taskName: string;
|
|
30
|
-
/** The absolute file name of the build */
|
|
31
|
-
readonly buildFile: AbsolutePath;
|
|
32
|
-
/** For convenience, the directory of the build file */
|
|
33
|
-
readonly buildDir: AbsolutePath;
|
|
34
|
-
/** The {@link Logger} associated with this instance. */
|
|
35
|
-
readonly log: Logger;
|
|
36
|
-
/** Set the logging level within this {@link Run} */
|
|
37
|
-
setLogLevel(level: LogLevelString): void;
|
|
38
|
-
/** Call another {@link Task} from this one. */
|
|
39
|
-
call(name: string): Promise<Files | undefined>;
|
|
40
|
-
/** Create a new {@link Report} with the given _title_ */
|
|
41
|
-
report(title: string): Report;
|
|
42
|
-
/**
|
|
43
|
-
* Resolve a path in the context of this {@link Run}.
|
|
44
|
-
*
|
|
45
|
-
* If the path starts with `@...` it is considered to be relative to the
|
|
46
|
-
* _directory containing the build file where the task was defined_, otherwise
|
|
47
|
-
* it will be relative to the {@link process.cwd | current working directory}.
|
|
48
|
-
*/
|
|
49
|
-
resolve(...paths: string[]): AbsolutePath;
|
|
50
|
-
/** Create a {@link FilesBuilder} cloning an existing {@link Files}. */
|
|
51
|
-
files(files: Files): FilesBuilder;
|
|
52
|
-
/**
|
|
53
|
-
* Create a {@link FilesBuilder} instance resolving the directory specified
|
|
54
|
-
* according to the rules specified in {@link Run.resolve}.
|
|
55
|
-
*/
|
|
56
|
-
files(...paths: string[]): FilesBuilder;
|
|
57
|
-
/**
|
|
58
|
-
* Find files according to the globs and {@link FindOptions} specified.
|
|
59
|
-
*/
|
|
60
|
-
find(glob: string, ...args: ParseOptions<FindOptions>): Pipe & Promise<Files>;
|
|
61
|
-
/**
|
|
62
|
-
* Create a new {@link Pipe} wrapping the specified {@link Files}.
|
|
63
|
-
*/
|
|
64
|
-
pipe(files: Files | Promise<Files>): Pipe & Promise<Files>;
|
|
65
|
-
}
|
|
66
|
-
/** Constructor options for our default {@link Run} implementation */
|
|
67
|
-
export interface RunConstructionOptions {
|
|
68
|
-
readonly taskName: string;
|
|
69
|
-
readonly buildDir: AbsolutePath;
|
|
70
|
-
readonly buildFile: AbsolutePath;
|
|
71
|
-
readonly log?: Logger;
|
|
72
|
-
}
|
|
73
|
-
/** Our default {@link Run} implementation */
|
|
74
|
-
export declare class RunImpl implements Run {
|
|
75
|
-
readonly taskName: string;
|
|
76
|
-
readonly buildFile: AbsolutePath;
|
|
77
|
-
readonly buildDir: AbsolutePath;
|
|
78
|
-
readonly log: Logger;
|
|
79
|
-
constructor(options: RunConstructionOptions);
|
|
80
|
-
/** Set the logging level within this {@link Run} */
|
|
81
|
-
setLogLevel(level: LogLevelString): void;
|
|
82
|
-
report(title: string): Report;
|
|
83
|
-
resolve(path?: string, ...paths: string[]): AbsolutePath;
|
|
84
|
-
files(files: Files): FilesBuilder;
|
|
85
|
-
files(...paths: string[]): FilesBuilder;
|
|
86
|
-
find(glob: string, ...args: ParseOptions<FindOptions>): Pipe & Promise<Files>;
|
|
87
|
-
pipe(files: Files | Promise<Files>): Pipe & Promise<Files>;
|
|
88
|
-
call(name: string): Promise<Files | undefined>;
|
|
89
|
-
}
|
package/types/task.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BuildContext, TaskDefinition, ThisBuild } from './build.js';
|
|
2
|
-
import type { Files } from './files.js';
|
|
3
|
-
import type { Run } from './run.js';
|
|
4
|
-
export interface Task<T extends Files | undefined = Files | undefined> {
|
|
5
|
-
/** The {@link BuildContext} of where this task was originally defined */
|
|
6
|
-
readonly context: BuildContext;
|
|
7
|
-
/** Invoked by the {@link Run} when actually executing this {@link Task} */
|
|
8
|
-
call(thisBuild: ThisBuild<any>, run: Run): Promise<T>;
|
|
9
|
-
}
|
|
10
|
-
export declare class TaskImpl implements Task<Files | undefined> {
|
|
11
|
-
readonly context: BuildContext;
|
|
12
|
-
private readonly _definition;
|
|
13
|
-
constructor(context: BuildContext, _definition: TaskDefinition<any>);
|
|
14
|
-
call(self: ThisBuild<any>, run: Run): Promise<Files | undefined>;
|
|
15
|
-
}
|
package/types/utils/caller.d.ts
DELETED
package/types/utils/options.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type ParsedOptions<Options> = {
|
|
2
|
-
params: string[];
|
|
3
|
-
options: Options;
|
|
4
|
-
};
|
|
5
|
-
export declare type ParsedOptionalOptions<Options> = {
|
|
6
|
-
params: string[];
|
|
7
|
-
options?: Options | undefined;
|
|
8
|
-
};
|
|
9
|
-
export declare type ParseOptions<Options> = string[] | [...string[], Options] | [Options];
|
|
10
|
-
/** Parse an array of at least one string, followed by an optional `Options` argument. */
|
|
11
|
-
export declare function parseOptions<Options>(args: ParseOptions<Options>): ParsedOptionalOptions<Options>;
|
|
12
|
-
/** Parse an array of at least one string, followed by an optional `Options` argument. */
|
|
13
|
-
export declare function parseOptions<Options>(args: ParseOptions<Options>, defaults?: undefined): ParsedOptionalOptions<Options>;
|
|
14
|
-
/** Parse an array of at least one string, followed by an optional `Options` argument, ensuring some defaults are present. */
|
|
15
|
-
export declare function parseOptions<Options, Defaults extends Options>(args: ParseOptions<Options>, defaults: Defaults): ParsedOptions<Options & Defaults>;
|