@plugjs/plug 0.0.2 → 0.0.3
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/dist/async.cjs +4 -2
- package/dist/async.cjs.map +1 -1
- package/dist/async.mjs +4 -2
- package/dist/async.mjs.map +1 -1
- package/dist/files.cjs +16 -2
- package/dist/files.cjs.map +1 -1
- package/dist/files.mjs +17 -3
- package/dist/files.mjs.map +1 -1
- package/dist/fork.cjs +2 -2
- package/dist/fork.cjs.map +1 -1
- package/dist/fork.mjs +2 -2
- package/dist/fork.mjs.map +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.mjs +1 -1
- package/dist/helpers.mjs.map +1 -1
- package/dist/log/report.cjs +2 -1
- package/dist/log/report.cjs.map +1 -1
- package/dist/log/report.mjs +2 -1
- package/dist/log/report.mjs.map +1 -1
- package/dist/log.cjs +4 -1
- package/dist/log.cjs.map +1 -1
- package/dist/log.mjs +4 -1
- package/dist/log.mjs.map +1 -1
- package/dist/paths.cjs.map +1 -1
- package/dist/paths.mjs.map +1 -1
- package/dist/plugs/copy.cjs +1 -1
- package/dist/plugs/copy.cjs.map +1 -1
- package/dist/plugs/copy.mjs +1 -1
- package/dist/plugs/copy.mjs.map +1 -1
- package/dist/plugs/coverage/analysis.cjs +8 -3
- package/dist/plugs/coverage/analysis.cjs.map +2 -2
- package/dist/plugs/coverage/analysis.mjs +8 -3
- package/dist/plugs/coverage/analysis.mjs.map +2 -2
- package/dist/plugs/coverage/report.cjs +2 -1
- package/dist/plugs/coverage/report.cjs.map +1 -1
- package/dist/plugs/coverage/report.mjs +2 -1
- package/dist/plugs/coverage/report.mjs.map +1 -1
- package/dist/plugs/debug.cjs +6 -6
- package/dist/plugs/debug.cjs.map +1 -1
- package/dist/plugs/debug.mjs +7 -7
- package/dist/plugs/debug.mjs.map +1 -1
- package/dist/plugs/esbuild/fix-extensions.cjs +4 -3
- package/dist/plugs/esbuild/fix-extensions.cjs.map +1 -1
- package/dist/plugs/esbuild/fix-extensions.mjs +4 -3
- package/dist/plugs/esbuild/fix-extensions.mjs.map +1 -1
- package/dist/plugs/esbuild.cjs +34 -4
- package/dist/plugs/esbuild.cjs.map +2 -2
- package/dist/plugs/esbuild.mjs +35 -5
- package/dist/plugs/esbuild.mjs.map +2 -2
- package/dist/plugs/filter.cjs +2 -3
- package/dist/plugs/filter.cjs.map +1 -1
- package/dist/plugs/filter.mjs +2 -3
- package/dist/plugs/filter.mjs.map +1 -1
- package/dist/plugs/mocha/reporter.cjs +1 -1
- package/dist/plugs/mocha/reporter.cjs.map +1 -1
- package/dist/plugs/mocha/reporter.mjs +1 -1
- package/dist/plugs/mocha/reporter.mjs.map +1 -1
- package/dist/plugs/rmf.cjs +53 -0
- package/dist/plugs/rmf.cjs.map +6 -0
- package/dist/plugs/rmf.mjs +28 -0
- package/dist/plugs/rmf.mjs.map +6 -0
- package/dist/plugs.cjs +1 -0
- package/dist/plugs.cjs.map +1 -1
- package/dist/plugs.mjs +1 -0
- package/dist/plugs.mjs.map +1 -1
- package/dist/run.cjs +3 -3
- package/dist/run.cjs.map +1 -1
- package/dist/run.mjs +3 -3
- package/dist/run.mjs.map +1 -1
- package/package.json +2 -2
- package/src/files.ts +36 -4
- package/src/fork.ts +2 -2
- package/src/helpers.ts +4 -4
- package/src/paths.ts +1 -0
- package/src/plugs/copy.ts +1 -1
- package/src/plugs/debug.ts +7 -7
- package/src/plugs/esbuild.ts +69 -10
- package/src/plugs/filter.ts +2 -3
- package/src/plugs/rmf.ts +42 -0
- package/src/plugs.ts +1 -0
- package/src/run.ts +5 -5
- package/types/files.d.ts +12 -1
- package/types/helpers.d.ts +3 -3
- package/types/plugs/rmf.d.ts +15 -0
- package/types/plugs.d.ts +1 -0
- package/types/run.d.ts +2 -2
package/types/files.d.ts
CHANGED
|
@@ -6,8 +6,19 @@ import { AbsolutePath } from './paths.js';
|
|
|
6
6
|
export interface FilesBuilder {
|
|
7
7
|
/** The (resolved) directory the {@link Files} will be associated with */
|
|
8
8
|
readonly directory: AbsolutePath;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Push files into the {@link Files} instance being built **checking for
|
|
11
|
+
* their existance on disk**.
|
|
12
|
+
*
|
|
13
|
+
* This _will_ be slow, use {@link FilesBuilder.unchecked} when absolutely
|
|
14
|
+
* sure the file already exist.
|
|
15
|
+
*/
|
|
10
16
|
add(...files: string[]): this;
|
|
17
|
+
/**
|
|
18
|
+
* Push files into the {@link Files} instance being built without checking
|
|
19
|
+
* they exist on disk _(use with care!)_.
|
|
20
|
+
*/
|
|
21
|
+
unchecked(...files: string[]): this;
|
|
11
22
|
/** Merge orther {@link Files} instance to the {@link Files} being built */
|
|
12
23
|
merge(...files: Files[]): this;
|
|
13
24
|
/** Write a file and add it to the {@link Files} instance being built */
|
package/types/helpers.d.ts
CHANGED
|
@@ -18,15 +18,15 @@ export declare function setLogLevel(level: LogLevelString): void;
|
|
|
18
18
|
* Resolve a path into an {@link AbsolutePath}.
|
|
19
19
|
*
|
|
20
20
|
* If the path starts with `@...` it is considered to be relative to the
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* _directory containing the build file where the task was defined_, otherwise
|
|
22
|
+
* it will be relative to the {@link process.cwd | current working directory}.
|
|
23
23
|
*/
|
|
24
24
|
export declare function resolve(...paths: string[]): AbsolutePath;
|
|
25
25
|
/**
|
|
26
26
|
* Create a new {@link Files} instance.
|
|
27
27
|
*/
|
|
28
28
|
export declare function files(files: Files): FilesBuilder;
|
|
29
|
-
export declare function files(...paths: string[]): FilesBuilder;
|
|
29
|
+
export declare function files(directory: string, ...paths: string[]): FilesBuilder;
|
|
30
30
|
/**
|
|
31
31
|
* Merge multiple {@link Files} instance.
|
|
32
32
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
package/types/plugs.d.ts
CHANGED
package/types/run.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ export interface Run {
|
|
|
43
43
|
* Resolve a path in the context of this {@link Run}.
|
|
44
44
|
*
|
|
45
45
|
* If the path starts with `@...` it is considered to be relative to the
|
|
46
|
-
*
|
|
47
|
-
*
|
|
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
48
|
*/
|
|
49
49
|
resolve(...paths: string[]): AbsolutePath;
|
|
50
50
|
/** Create a {@link FilesBuilder} cloning an existing {@link Files}. */
|