@hackwaly/task 0.3.0 → 0.3.1
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/package.json +1 -1
- package/src/cli.d.ts +1 -0
- package/src/config.d.ts +21 -0
- package/src/errors.d.ts +3 -0
- package/src/index.d.ts +2 -0
- package/src/run.d.ts +2 -0
- package/src/scheduler.d.ts +5 -0
- package/src/types.d.ts +23 -0
package/package.json
CHANGED
package/src/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cliMain(): Promise<void>;
|
package/src/config.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TaskDef, TaskRunContext } from "./types.js";
|
|
2
|
+
export interface TaskConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
run?: (ctx: TaskRunContext) => Promise<void>;
|
|
6
|
+
command?: string | string[] | {
|
|
7
|
+
program: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
};
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
inputs?: string[];
|
|
13
|
+
outputs?: string[];
|
|
14
|
+
persistent?: boolean;
|
|
15
|
+
interruptible?: boolean;
|
|
16
|
+
dependsOn?: [TaskDef];
|
|
17
|
+
}
|
|
18
|
+
export interface ConfigAPI {
|
|
19
|
+
defineTask(config: TaskConfig): TaskDef;
|
|
20
|
+
}
|
|
21
|
+
export declare function configInit(importMeta: ImportMeta): ConfigAPI;
|
package/src/errors.d.ts
ADDED
package/src/index.d.ts
ADDED
package/src/run.d.ts
ADDED
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface Command {
|
|
2
|
+
program: string;
|
|
3
|
+
args: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface TaskRunContext {
|
|
6
|
+
abort: AbortSignal;
|
|
7
|
+
}
|
|
8
|
+
export interface TaskMeta {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | undefined;
|
|
11
|
+
cwd: string;
|
|
12
|
+
env: Record<string, string>;
|
|
13
|
+
inputs: string[];
|
|
14
|
+
outputs: string[];
|
|
15
|
+
persistent: boolean;
|
|
16
|
+
interruptible: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TaskDef {
|
|
19
|
+
run: (ctx: TaskRunContext) => Promise<void>;
|
|
20
|
+
meta: TaskMeta;
|
|
21
|
+
deps: Set<TaskDef>;
|
|
22
|
+
invDeps: Set<TaskDef>;
|
|
23
|
+
}
|