@milkio/cookbook-command 1.0.0-alpha.104 → 1.0.0-alpha.107
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/index.d.ts +75 -0
- package/package.json +1 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { consola } from "consola";
|
|
2
|
+
export declare function defineCookbookCommand<Handler extends CookbookCommandHandler>(handler: Handler): Promise<Handler>;
|
|
3
|
+
export type CookbookCommandHandler = (utils: {
|
|
4
|
+
log: (typeof consola)["log"];
|
|
5
|
+
info: (typeof consola)["info"];
|
|
6
|
+
warn: (typeof consola)["warn"];
|
|
7
|
+
error: (typeof consola)["error"];
|
|
8
|
+
success: (typeof consola)["success"];
|
|
9
|
+
debug: (typeof consola)["debug"];
|
|
10
|
+
fatal: (typeof consola)["fatal"];
|
|
11
|
+
trace: (typeof consola)["trace"];
|
|
12
|
+
start: (typeof consola)["start"];
|
|
13
|
+
box: (typeof consola)["box"];
|
|
14
|
+
prompt: (typeof consola)["prompt"];
|
|
15
|
+
getScriptPath: () => string;
|
|
16
|
+
getWorkspacePath: () => string;
|
|
17
|
+
getParams: () => {
|
|
18
|
+
command: string;
|
|
19
|
+
commands: Array<string>;
|
|
20
|
+
options: Record<string, string | true>;
|
|
21
|
+
raw: Array<string>;
|
|
22
|
+
};
|
|
23
|
+
inputBoolean: (options: {
|
|
24
|
+
env: string;
|
|
25
|
+
message: string;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
}) => Promise<boolean>;
|
|
28
|
+
inputString: (options: {
|
|
29
|
+
env: string;
|
|
30
|
+
message: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
}) => Promise<string>;
|
|
33
|
+
canUseAI: () => Promise<false | {
|
|
34
|
+
aiBaseUrl: string;
|
|
35
|
+
aiApiKey: string;
|
|
36
|
+
aiModel: string;
|
|
37
|
+
}>;
|
|
38
|
+
fetchEventSource: (input: string | URL | globalThis.Request, init?: RequestInit) => AsyncIterableIterator<{
|
|
39
|
+
data: any;
|
|
40
|
+
event?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
}>;
|
|
43
|
+
openProgress: (message: string) => Promise<void>;
|
|
44
|
+
closeProgress: (message: string) => Promise<void>;
|
|
45
|
+
getCookbookToml: () => Promise<CookbookToml>;
|
|
46
|
+
}) => Promise<void>;
|
|
47
|
+
export interface CookbookToml {
|
|
48
|
+
projects: Record<string, {
|
|
49
|
+
type: "milkio" | "custom";
|
|
50
|
+
port: number;
|
|
51
|
+
start: string;
|
|
52
|
+
build: string;
|
|
53
|
+
meta: Partial<{
|
|
54
|
+
inspect: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
name?: string;
|
|
57
|
+
watch?: boolean;
|
|
58
|
+
lazyRoutes?: boolean;
|
|
59
|
+
typiaMode?: "generation" | "bundler";
|
|
60
|
+
significant?: Array<string>;
|
|
61
|
+
insignificant?: Array<string>;
|
|
62
|
+
autoStart?: boolean;
|
|
63
|
+
autoStartDelay?: number;
|
|
64
|
+
connectTestUrl?: string;
|
|
65
|
+
prismaMigrateMode?: "migrate-dev" | "push";
|
|
66
|
+
}>;
|
|
67
|
+
general: {
|
|
68
|
+
start: string;
|
|
69
|
+
packageManager: string;
|
|
70
|
+
cookbookPort: number;
|
|
71
|
+
};
|
|
72
|
+
config: {
|
|
73
|
+
[key: string]: string | number | boolean;
|
|
74
|
+
};
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@milkio/cookbook-command","version":"1.0.0-alpha.
|
|
1
|
+
{"name":"@milkio/cookbook-command","version":"1.0.0-alpha.107","type":"module","module":"./index.js","types":"./index.d.ts","dependencies":{}}
|