@seedcli/core 0.1.0
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/LICENSE +21 -0
- package/dist/command/help.d.ts +59 -0
- package/dist/command/help.d.ts.map +1 -0
- package/dist/command/help.js +216 -0
- package/dist/command/help.js.map +1 -0
- package/dist/command/parser.d.ts +27 -0
- package/dist/command/parser.d.ts.map +1 -0
- package/dist/command/parser.js +259 -0
- package/dist/command/parser.js.map +1 -0
- package/dist/command/router.d.ts +34 -0
- package/dist/command/router.d.ts.map +1 -0
- package/dist/command/router.js +90 -0
- package/dist/command/router.js.map +1 -0
- package/dist/discovery/auto-discover.d.ts +26 -0
- package/dist/discovery/auto-discover.d.ts.map +1 -0
- package/dist/discovery/auto-discover.js +138 -0
- package/dist/discovery/auto-discover.js.map +1 -0
- package/dist/discovery/index.d.ts +3 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +2 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin/errors.d.ts +23 -0
- package/dist/plugin/errors.d.ts.map +1 -0
- package/dist/plugin/errors.js +45 -0
- package/dist/plugin/errors.js.map +1 -0
- package/dist/plugin/index.d.ts +6 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +6 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/loader.d.ts +12 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugin/loader.js +33 -0
- package/dist/plugin/loader.js.map +1 -0
- package/dist/plugin/registry.d.ts +32 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/registry.js +101 -0
- package/dist/plugin/registry.js.map +1 -0
- package/dist/plugin/topo-sort.d.ts +8 -0
- package/dist/plugin/topo-sort.d.ts.map +1 -0
- package/dist/plugin/topo-sort.js +60 -0
- package/dist/plugin/topo-sort.js.map +1 -0
- package/dist/plugin/validator.d.ts +17 -0
- package/dist/plugin/validator.d.ts.map +1 -0
- package/dist/plugin/validator.js +58 -0
- package/dist/plugin/validator.js.map +1 -0
- package/dist/runtime/builder.d.ts +70 -0
- package/dist/runtime/builder.d.ts.map +1 -0
- package/dist/runtime/builder.js +108 -0
- package/dist/runtime/builder.js.map +1 -0
- package/dist/runtime/runtime.d.ts +53 -0
- package/dist/runtime/runtime.d.ts.map +1 -0
- package/dist/runtime/runtime.js +424 -0
- package/dist/runtime/runtime.js.map +1 -0
- package/dist/types/args.d.ts +93 -0
- package/dist/types/args.d.ts.map +1 -0
- package/dist/types/args.js +9 -0
- package/dist/types/args.js.map +1 -0
- package/dist/types/command.d.ts +60 -0
- package/dist/types/command.d.ts.map +1 -0
- package/dist/types/command.js +26 -0
- package/dist/types/command.js.map +1 -0
- package/dist/types/config.d.ts +61 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +17 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/extension.d.ts +30 -0
- package/dist/types/extension.d.ts.map +1 -0
- package/dist/types/extension.js +16 -0
- package/dist/types/extension.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/modules.d.ts +47 -0
- package/dist/types/modules.d.ts.map +1 -0
- package/dist/types/modules.js +5 -0
- package/dist/types/modules.js.map +1 -0
- package/dist/types/plugin.d.ts +40 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +17 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/types/toolbox.d.ts +54 -0
- package/dist/types/toolbox.d.ts.map +1 -0
- package/dist/types/toolbox.js +2 -0
- package/dist/types/toolbox.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seed CLI framework configuration — used in `seed.config.ts`.
|
|
3
|
+
*/
|
|
4
|
+
export interface SeedConfig {
|
|
5
|
+
build?: {
|
|
6
|
+
/** JS bundle options (Tier 2) */
|
|
7
|
+
bundle?: {
|
|
8
|
+
/** Output directory (default: "dist") */
|
|
9
|
+
outdir?: string;
|
|
10
|
+
/** Use Bun shebang instead of Node.js */
|
|
11
|
+
bun?: boolean;
|
|
12
|
+
/** Minify the output */
|
|
13
|
+
minify?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Binary compilation options (Tier 3) */
|
|
16
|
+
compile?: {
|
|
17
|
+
/** Target platforms */
|
|
18
|
+
targets?: string[];
|
|
19
|
+
/** Glob patterns to embed into binary */
|
|
20
|
+
embed?: string[];
|
|
21
|
+
/** Explicit asset mappings */
|
|
22
|
+
assets?: Array<{
|
|
23
|
+
src: string;
|
|
24
|
+
dest: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
dev?: {
|
|
29
|
+
/** Entry point (default: auto-detect from package.json bin) */
|
|
30
|
+
entry?: string;
|
|
31
|
+
/** Files to watch (default: "src/**") */
|
|
32
|
+
watch?: string[];
|
|
33
|
+
/** Files to ignore */
|
|
34
|
+
ignore?: string[];
|
|
35
|
+
/** Clear terminal on restart */
|
|
36
|
+
clearScreen?: boolean;
|
|
37
|
+
/** Default args for dev mode */
|
|
38
|
+
args?: string[];
|
|
39
|
+
};
|
|
40
|
+
plugins?: {
|
|
41
|
+
/** Timeout for plugin setup in milliseconds (default: 10000) */
|
|
42
|
+
setupTimeout?: number;
|
|
43
|
+
/** Plugin-specific config overrides */
|
|
44
|
+
[pluginName: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Identity function for type-safe framework config files.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* // seed.config.ts
|
|
52
|
+
* import { defineConfig } from "@seedcli/core";
|
|
53
|
+
*
|
|
54
|
+
* export default defineConfig({
|
|
55
|
+
* build: { compile: { targets: ["bun-darwin-arm64"] } },
|
|
56
|
+
* dev: { entry: "src/index.ts" },
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function defineConfig(config: SeedConfig): SeedConfig;
|
|
61
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,KAAK,CAAC,EAAE;QACP,iCAAiC;QACjC,MAAM,CAAC,EAAE;YACR,yCAAyC;YACzC,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,yCAAyC;YACzC,GAAG,CAAC,EAAE,OAAO,CAAC;YACd,wBAAwB;YACxB,MAAM,CAAC,EAAE,OAAO,CAAC;SACjB,CAAC;QACF,0CAA0C;QAC1C,OAAO,CAAC,EAAE;YACT,uBAAuB;YACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;YACnB,yCAAyC;YACzC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;YACjB,8BAA8B;YAC9B,MAAM,CAAC,EAAE,KAAK,CAAC;gBAAE,GAAG,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;SAC9C,CAAC;KACF,CAAC;IACF,GAAG,CAAC,EAAE;QACL,+DAA+D;QAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,yCAAyC;QACzC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,sBAAsB;QACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,gCAAgC;QAChC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,gCAAgC;QAChC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE;QACT,gEAAgE;QAChE,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,uCAAuC;QACvC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;KAC9B,CAAC;CACF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE3D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity function for type-safe framework config files.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* // seed.config.ts
|
|
6
|
+
* import { defineConfig } from "@seedcli/core";
|
|
7
|
+
*
|
|
8
|
+
* export default defineConfig({
|
|
9
|
+
* build: { compile: { targets: ["bun-darwin-arm64"] } },
|
|
10
|
+
* dev: { entry: "src/index.ts" },
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export function defineConfig(config) {
|
|
15
|
+
return config;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC9C,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Toolbox } from "./toolbox.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extension configuration — defines how a plugin extends the toolbox.
|
|
4
|
+
*/
|
|
5
|
+
export interface ExtensionConfig {
|
|
6
|
+
/** Extension name (must be unique across all plugins) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Human-readable description */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Other extensions this depends on (resolved via topological sort) */
|
|
11
|
+
dependencies?: string[];
|
|
12
|
+
/** Called during toolbox assembly, before any command runs */
|
|
13
|
+
setup: (toolbox: Toolbox<Record<string, unknown>, Record<string, unknown>>) => Promise<void> | void;
|
|
14
|
+
/** Called during cleanup, after command completes */
|
|
15
|
+
teardown?: (toolbox: Toolbox<Record<string, unknown>, Record<string, unknown>>) => Promise<void> | void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Define an extension with type safety.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const authExtension = defineExtension({
|
|
22
|
+
* name: "auth",
|
|
23
|
+
* setup: async (toolbox) => {
|
|
24
|
+
* toolbox.auth = { getToken: () => "..." };
|
|
25
|
+
* },
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function defineExtension(config: ExtensionConfig): ExtensionConfig;
|
|
30
|
+
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/types/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,8DAA8D;IAC9D,KAAK,EAAE,CACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC9D,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE1B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CACV,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC9D,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAExE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define an extension with type safety.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* const authExtension = defineExtension({
|
|
6
|
+
* name: "auth",
|
|
7
|
+
* setup: async (toolbox) => {
|
|
8
|
+
* toolbox.auth = { getToken: () => "..." };
|
|
9
|
+
* },
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function defineExtension(config) {
|
|
14
|
+
return config;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/types/extension.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACtD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { PrintModule } from "@seedcli/print";
|
|
2
|
+
export type { StringsModule } from "@seedcli/strings";
|
|
3
|
+
export type { ArgDef, ArgType, FlagDef, FlagType, InferArgs, InferFlags, ResolveArgType, ResolveFlagType, } from "./args.js";
|
|
4
|
+
export { arg, flag } from "./args.js";
|
|
5
|
+
export type { Command, CommandConfig, Middleware } from "./command.js";
|
|
6
|
+
export { command } from "./command.js";
|
|
7
|
+
export type { SeedConfig } from "./config.js";
|
|
8
|
+
export { defineConfig } from "./config.js";
|
|
9
|
+
export type { ExtensionConfig } from "./extension.js";
|
|
10
|
+
export { defineExtension } from "./extension.js";
|
|
11
|
+
export type { PluginConfig } from "./plugin.js";
|
|
12
|
+
export { definePlugin } from "./plugin.js";
|
|
13
|
+
export type { Toolbox, ToolboxExtensions } from "./toolbox.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EACX,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// ─── Core Types ───
|
|
2
|
+
// ─── Factory Functions ───
|
|
3
|
+
export { arg, flag } from "./args.js";
|
|
4
|
+
export { command } from "./command.js";
|
|
5
|
+
export { defineConfig } from "./config.js";
|
|
6
|
+
export { defineExtension } from "./extension.js";
|
|
7
|
+
export { definePlugin } from "./plugin.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AAcrB,4BAA4B;AAC5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Print module — structured logging, colors, spinner, table, etc.
|
|
3
|
+
* Full implementation in @seedcli/print.
|
|
4
|
+
*/
|
|
5
|
+
export interface PrintModule {
|
|
6
|
+
info(msg: string): void;
|
|
7
|
+
success(msg: string): void;
|
|
8
|
+
warning(msg: string): void;
|
|
9
|
+
error(msg: string): void;
|
|
10
|
+
debug(msg: string): void;
|
|
11
|
+
highlight(msg: string): void;
|
|
12
|
+
muted(msg: string): void;
|
|
13
|
+
newline(): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Filesystem module placeholder.
|
|
17
|
+
* Full implementation in @seedcli/filesystem.
|
|
18
|
+
*/
|
|
19
|
+
export interface FilesystemModule {
|
|
20
|
+
read(path: string, encoding?: string): Promise<string>;
|
|
21
|
+
write(path: string, data: string): Promise<void>;
|
|
22
|
+
exists(path: string): Promise<boolean>;
|
|
23
|
+
remove(path: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* System module placeholder.
|
|
27
|
+
* Full implementation in @seedcli/system.
|
|
28
|
+
*/
|
|
29
|
+
export interface SystemModule {
|
|
30
|
+
exec(command: string): Promise<{
|
|
31
|
+
stdout: string;
|
|
32
|
+
stderr: string;
|
|
33
|
+
exitCode: number;
|
|
34
|
+
}>;
|
|
35
|
+
which(executable: string): Promise<string | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Strings module placeholder.
|
|
39
|
+
* Full implementation in @seedcli/strings.
|
|
40
|
+
*/
|
|
41
|
+
export interface StringsModule {
|
|
42
|
+
camelCase(str: string): string;
|
|
43
|
+
pascalCase(str: string): string;
|
|
44
|
+
snakeCase(str: string): string;
|
|
45
|
+
kebabCase(str: string): string;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/types/modules.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrF,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../src/types/modules.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,8CAA8C;AAC9C,8EAA8E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Command } from "./command.js";
|
|
2
|
+
import type { ExtensionConfig } from "./extension.js";
|
|
3
|
+
/**
|
|
4
|
+
* Plugin definition — the shape returned by `definePlugin()`.
|
|
5
|
+
*/
|
|
6
|
+
export interface PluginConfig {
|
|
7
|
+
/** Plugin name (lowercase, alphanumeric, hyphens) */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Human-readable description */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Plugin version (semver) */
|
|
12
|
+
version: string;
|
|
13
|
+
/** Seed CLI framework version range requirement (e.g. ">=1.0.0") */
|
|
14
|
+
seedcli?: string;
|
|
15
|
+
/** Peer plugin dependencies with version ranges */
|
|
16
|
+
peerPlugins?: Record<string, string>;
|
|
17
|
+
/** Commands contributed by this plugin */
|
|
18
|
+
commands?: Command[];
|
|
19
|
+
/** Extensions contributed by this plugin */
|
|
20
|
+
extensions?: ExtensionConfig[];
|
|
21
|
+
/** Path to templates directory */
|
|
22
|
+
templates?: string;
|
|
23
|
+
/** Default configuration values */
|
|
24
|
+
defaults?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Define a plugin with type safety.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* export default definePlugin({
|
|
31
|
+
* name: "deploy",
|
|
32
|
+
* version: "1.0.0",
|
|
33
|
+
* seedcli: ">=1.0.0",
|
|
34
|
+
* commands: [deployCmd],
|
|
35
|
+
* extensions: [deployExtension],
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function definePlugin(config: PluginConfig): PluginConfig;
|
|
40
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IAErB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAE/B,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAE/D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define a plugin with type safety.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* export default definePlugin({
|
|
6
|
+
* name: "deploy",
|
|
7
|
+
* version: "1.0.0",
|
|
8
|
+
* seedcli: ">=1.0.0",
|
|
9
|
+
* commands: [deployCmd],
|
|
10
|
+
* extensions: [deployExtension],
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export function definePlugin(config) {
|
|
15
|
+
return config;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB;IAChD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ConfigModule } from "@seedcli/config";
|
|
2
|
+
import type { HttpModule } from "@seedcli/http";
|
|
3
|
+
import type { PackageManagerModule } from "@seedcli/package-manager";
|
|
4
|
+
import type { PatchingModule } from "@seedcli/patching";
|
|
5
|
+
import type { PrintModule } from "@seedcli/print";
|
|
6
|
+
import type { PromptModule } from "@seedcli/prompt";
|
|
7
|
+
import type { StringsModule } from "@seedcli/strings";
|
|
8
|
+
import type { TemplateModule } from "@seedcli/template";
|
|
9
|
+
/**
|
|
10
|
+
* Empty interface — plugins extend this via declaration merging.
|
|
11
|
+
*
|
|
12
|
+
* Example (in a plugin's types.ts):
|
|
13
|
+
* ```ts
|
|
14
|
+
* declare module "@seedcli/core" {
|
|
15
|
+
* interface ToolboxExtensions {
|
|
16
|
+
* deploy: {
|
|
17
|
+
* toS3(bucket: string, path: string): Promise<void>;
|
|
18
|
+
* };
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export interface ToolboxExtensions {
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The toolbox is the main object passed to every command's `run` function.
|
|
27
|
+
* It provides access to all framework modules and per-command typed args/flags.
|
|
28
|
+
*/
|
|
29
|
+
export interface Toolbox<TArgs = Record<string, never>, TFlags = Record<string, never>> extends ToolboxExtensions {
|
|
30
|
+
args: TArgs;
|
|
31
|
+
flags: TFlags;
|
|
32
|
+
parameters: {
|
|
33
|
+
raw: string[];
|
|
34
|
+
argv: string[];
|
|
35
|
+
command: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
print?: PrintModule;
|
|
38
|
+
prompt?: PromptModule;
|
|
39
|
+
filesystem?: typeof import("@seedcli/filesystem");
|
|
40
|
+
system?: typeof import("@seedcli/system");
|
|
41
|
+
http?: HttpModule;
|
|
42
|
+
template?: TemplateModule;
|
|
43
|
+
strings?: StringsModule;
|
|
44
|
+
semver?: typeof import("@seedcli/semver");
|
|
45
|
+
packageManager?: PackageManagerModule;
|
|
46
|
+
config?: ConfigModule;
|
|
47
|
+
patching?: PatchingModule;
|
|
48
|
+
meta: {
|
|
49
|
+
version: string;
|
|
50
|
+
commandName: string;
|
|
51
|
+
brand: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=toolbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../src/types/toolbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,iBAAiB;CAAG;AAIrC;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CACrF,SAAQ,iBAAiB;IAEzB,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACX,GAAG,EAAE,MAAM,EAAE,CAAC;QACd,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;KAC5B,CAAC;IAGF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,UAAU,CAAC,EAAE,cAAc,qBAAqB,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,cAAc,iBAAiB,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,iBAAiB,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAG1B,IAAI,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbox.js","sourceRoot":"","sources":["../../src/types/toolbox.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@seedcli/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core runtime, builder API, command system, and arg parser for Seed CLI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Rully Ardiansyah <rully@dreamshive.io>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/SeedCLI/seed",
|
|
11
|
+
"directory": "packages/core"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://seedcli.dev",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"cli",
|
|
16
|
+
"framework",
|
|
17
|
+
"command",
|
|
18
|
+
"args",
|
|
19
|
+
"parser",
|
|
20
|
+
"bun",
|
|
21
|
+
"typescript"
|
|
22
|
+
],
|
|
23
|
+
"engines": {
|
|
24
|
+
"bun": ">=1.3.0"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "bun test",
|
|
43
|
+
"typecheck": "tsc --noEmit"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@seedcli/completions": "^0.1.0",
|
|
47
|
+
"@seedcli/config": "^0.1.0",
|
|
48
|
+
"@seedcli/filesystem": "^0.1.0",
|
|
49
|
+
"@seedcli/http": "^0.1.0",
|
|
50
|
+
"@seedcli/package-manager": "^0.1.0",
|
|
51
|
+
"@seedcli/patching": "^0.1.0",
|
|
52
|
+
"@seedcli/print": "^0.1.0",
|
|
53
|
+
"@seedcli/prompt": "^0.1.0",
|
|
54
|
+
"@seedcli/semver": "^0.1.0",
|
|
55
|
+
"@seedcli/strings": "^0.1.0",
|
|
56
|
+
"@seedcli/system": "^0.1.0",
|
|
57
|
+
"@seedcli/template": "^0.1.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {}
|
|
60
|
+
}
|