@milkio/cookbook-command 1.0.0-alpha.103 → 1.0.0-alpha.105
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/index.js +4 -0
- package/package.json +1 -10
- package/README.md +0 -15
- package/index.ts +0 -81
- package/tsconfig.json +0 -27
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/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
async function e(o){return o}export{e as defineCookbookCommand};
|
|
2
|
+
|
|
3
|
+
//# debugId=43D694535E62EBED64756E2164756E21
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi5cXGluZGV4LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWwog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21sOiAoKSA9PiBQcm9taXNlPENvb2tib29rVG9tbD47XHJcbn0pID0+IFByb21pc2U8dm9pZD47XHJcblxyXG5leHBvcnQgaW50ZXJmYWNlIENvb2tib29rVG9tbCB7XHJcbiAgcHJvamVjdHM6IFJlY29yZDxcclxuICAgIHN0cmluZyxcclxuICAgIHtcclxuICAgICAgdHlwZTogXCJtaWxraW9cIiB8IFwiY3VzdG9tXCI7XHJcbiAgICAgIHBvcnQ6IG51bWJlcjtcclxuICAgICAgc3RhcnQ6IHN0cmluZztcclxuICAgICAgYnVpbGQ6IHN0cmluZztcclxuICAgICAgbWV0YTogUGFydGlhbDx7XHJcbiAgICAgICAgaW5zcGVjdDogYm9vbGVhbjtcclxuICAgICAgfT47XHJcbiAgICAgIG5hbWU/OiBzdHJpbmc7XHJcbiAgICAgIHdhdGNoPzogYm9vbGVhbjtcclxuICAgICAgbGF6eVJvdXRlcz86IGJvb2xlYW47XHJcbiAgICAgIHR5cGlhTW9kZT86IFwiZ2VuZXJhdGlvblwiIHwgXCJidW5kbGVyXCI7XHJcbiAgICAgIHNpZ25pZmljYW50PzogQXJyYXk8c3RyaW5nPjtcclxuICAgICAgaW5zaWduaWZpY2FudD86IEFycmF5PHN0cmluZz47XHJcbiAgICAgIGF1dG9TdGFydD86IGJvb2xlYW47XHJcbiAgICAgIGF1dG9TdGFydERlbGF5PzogbnVtYmVyO1xyXG4gICAgICBjb25uZWN0VGVzdFVybD86IHN0cmluZztcclxuICAgICAgcHJpc21hTWlncmF0ZU1vZGU/OiBcIm1pZ3JhdGUtZGV2XCIgfCBcInB1c2hcIjtcclxuICAgIH1cclxuICA+O1xyXG4gIGdlbmVyYWw6IHtcclxuICAgIHN0YXJ0OiBzdHJpbmc7XHJcbiAgICBwYWNrYWdlTWFuYWdlcjogc3RyaW5nO1xyXG4gICAgY29va2Jvb2tQb3J0OiBudW1iZXI7XHJcbiAgfTtcclxuICBjb25maWc6IHtcclxuICAgIFtrZXk6IHN0cmluZ106IHN0cmluZyB8IG51bWJlciB8IGJvb2xlYW47XHJcbiAgfTtcclxufVxyXG4iCiAgXSwKICAibWFwcGluZ3MiOiAiQUFFQSxlQUFzQixDQUE2RCxDQUFDLEVBQW9DLENBQ3RILE9BQU8iLAogICJkZWJ1Z0lkIjogIjQzRDY5NDUzNUU2MkVCRUQ2NDc1NkUyMTY0NzU2RTIxIiwKICAibmFtZXMiOiBbXQp9
|
package/package.json
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@milkio/cookbook-command",
|
|
3
|
-
"module": "index.ts",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"consola": "^3.4.0",
|
|
7
|
-
"openai": "^4.87.3"
|
|
8
|
-
},
|
|
9
|
-
"version": "1.0.0-alpha.103"
|
|
10
|
-
}
|
|
1
|
+
{"name":"@milkio/cookbook-command","version":"1.0.0-alpha.105","type":"module","main":"./index.js","module":"./index.js","types":"./index.d.ts"}
|
package/README.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# @milkio/cookbook-command
|
|
2
|
-
|
|
3
|
-
To install dependencies:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
bun install
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
To run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
bun run index.ts
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This project was created using `bun init` in bun v1.2.4. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
package/index.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { consola } from "consola";
|
|
2
|
-
|
|
3
|
-
export async function defineCookbookCommand<Handler extends CookbookCommandHandler>(handler: Handler): Promise<Handler> {
|
|
4
|
-
return handler;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type CookbookCommandHandler = (utils: {
|
|
8
|
-
log: (typeof consola)["log"];
|
|
9
|
-
info: (typeof consola)["info"];
|
|
10
|
-
warn: (typeof consola)["warn"];
|
|
11
|
-
error: (typeof consola)["error"];
|
|
12
|
-
success: (typeof consola)["success"];
|
|
13
|
-
debug: (typeof consola)["debug"];
|
|
14
|
-
fatal: (typeof consola)["fatal"];
|
|
15
|
-
trace: (typeof consola)["trace"];
|
|
16
|
-
start: (typeof consola)["start"];
|
|
17
|
-
box: (typeof consola)["box"];
|
|
18
|
-
prompt: (typeof consola)["prompt"];
|
|
19
|
-
getScriptPath: () => string;
|
|
20
|
-
getWorkspacePath: () => string;
|
|
21
|
-
getParams: () => {
|
|
22
|
-
command: string;
|
|
23
|
-
commands: Array<string>;
|
|
24
|
-
options: Record<string, string | true>;
|
|
25
|
-
raw: Array<string>;
|
|
26
|
-
};
|
|
27
|
-
inputBoolean: (options: { env: string; message: string; placeholder?: string }) => Promise<boolean>;
|
|
28
|
-
inputString: (options: { env: string; message: string; placeholder?: string }) => Promise<string>;
|
|
29
|
-
canUseAI: () => Promise<
|
|
30
|
-
| false
|
|
31
|
-
| {
|
|
32
|
-
aiBaseUrl: string;
|
|
33
|
-
aiApiKey: string;
|
|
34
|
-
aiModel: string;
|
|
35
|
-
}
|
|
36
|
-
>;
|
|
37
|
-
fetchEventSource: (
|
|
38
|
-
input: string | URL | globalThis.Request,
|
|
39
|
-
init?: RequestInit,
|
|
40
|
-
) => AsyncIterableIterator<{
|
|
41
|
-
data: any;
|
|
42
|
-
event?: string;
|
|
43
|
-
id?: string;
|
|
44
|
-
}>;
|
|
45
|
-
openProgress: (message: string) => Promise<void>;
|
|
46
|
-
closeProgress: (message: string) => Promise<void>;
|
|
47
|
-
getCookbookToml: () => Promise<CookbookToml>;
|
|
48
|
-
}) => Promise<void>;
|
|
49
|
-
|
|
50
|
-
export interface CookbookToml {
|
|
51
|
-
projects: Record<
|
|
52
|
-
string,
|
|
53
|
-
{
|
|
54
|
-
type: "milkio" | "custom";
|
|
55
|
-
port: number;
|
|
56
|
-
start: string;
|
|
57
|
-
build: string;
|
|
58
|
-
meta: Partial<{
|
|
59
|
-
inspect: boolean;
|
|
60
|
-
}>;
|
|
61
|
-
name?: string;
|
|
62
|
-
watch?: boolean;
|
|
63
|
-
lazyRoutes?: boolean;
|
|
64
|
-
typiaMode?: "generation" | "bundler";
|
|
65
|
-
significant?: Array<string>;
|
|
66
|
-
insignificant?: Array<string>;
|
|
67
|
-
autoStart?: boolean;
|
|
68
|
-
autoStartDelay?: number;
|
|
69
|
-
connectTestUrl?: string;
|
|
70
|
-
prismaMigrateMode?: "migrate-dev" | "push";
|
|
71
|
-
}
|
|
72
|
-
>;
|
|
73
|
-
general: {
|
|
74
|
-
start: string;
|
|
75
|
-
packageManager: string;
|
|
76
|
-
cookbookPort: number;
|
|
77
|
-
};
|
|
78
|
-
config: {
|
|
79
|
-
[key: string]: string | number | boolean;
|
|
80
|
-
};
|
|
81
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Enable latest features
|
|
4
|
-
"lib": ["ESNext", "DOM"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
|
|
22
|
-
// Some stricter flags (disabled by default)
|
|
23
|
-
"noUnusedLocals": false,
|
|
24
|
-
"noUnusedParameters": false,
|
|
25
|
-
"noPropertyAccessFromIndexSignature": false
|
|
26
|
-
}
|
|
27
|
-
}
|