bunki 0.5.2 → 0.6.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/README.md CHANGED
@@ -147,15 +147,19 @@ HTML sanitized; external links hardened; unsafe tags stripped.
147
147
 
148
148
  ## Changelog
149
149
 
150
- v0.3.1 (this release)
150
+ v0.5.3 (current)
151
151
 
152
- - Export map + sideEffects=false for tree-shaking
153
- - Prepack build cleanup
154
- - Concise docs & publish prep
152
+ - Modularized CLI commands (init, new, generate, serve, css, images:push)
153
+ - Dependency-injected command handlers for easier unit testing
154
+ - Switched CLI entry to Bun.main/Bun.argv
155
+ - Added/updated tests for init/new handlers; all suites green
156
+ - Minor CSS command robustness and exit handling
155
157
 
156
- v0.3.0
158
+ v0.3.x
157
159
 
158
160
  - PostCSS pipeline + `css` command
161
+ - Export map + sideEffects=false for tree-shaking
162
+ - Prepack build cleanup
159
163
 
160
164
  ## Contribute
161
165
 
@@ -0,0 +1,18 @@
1
+ import { Command } from "commander";
2
+ import { loadConfig } from "../../config";
3
+ import { getDefaultCSSConfig, processCSS, watchCSS } from "../../utils/css-processor";
4
+ interface CssDeps {
5
+ loadConfig: typeof loadConfig;
6
+ processCSS: typeof processCSS;
7
+ watchCSS: typeof watchCSS;
8
+ getDefaultCSSConfig: typeof getDefaultCSSConfig;
9
+ logger: Pick<typeof console, "log" | "error">;
10
+ exit: (code: number) => void;
11
+ }
12
+ export declare function handleCssCommand(options: {
13
+ config: string;
14
+ output: string;
15
+ watch?: boolean;
16
+ }, deps?: CssDeps): Promise<void>;
17
+ export declare function registerCssCommand(program: Command): Command;
18
+ export {};
@@ -0,0 +1,17 @@
1
+ import { Command } from "commander";
2
+ import { loadConfig } from "../../config";
3
+ import { SiteGenerator } from "../../site-generator";
4
+ interface GenerateDeps {
5
+ loadConfig: typeof loadConfig;
6
+ createGenerator: (opts: ConstructorParameters<typeof SiteGenerator>[0]) => SiteGenerator;
7
+ logger: Pick<typeof console, "log" | "error">;
8
+ exit: (code: number) => void;
9
+ }
10
+ export declare function handleGenerateCommand(options: {
11
+ config: string;
12
+ content: string;
13
+ output: string;
14
+ templates: string;
15
+ }, deps?: GenerateDeps): Promise<void>;
16
+ export declare function registerGenerateCommand(program: Command): Command;
17
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Command } from "commander";
2
+ import { uploadImages } from "../../utils/image-uploader";
3
+ interface ImagesPushDeps {
4
+ uploadImages: typeof uploadImages;
5
+ logger: Pick<typeof console, "error">;
6
+ exit: (code: number) => void;
7
+ }
8
+ export declare function handleImagesPushCommand(options: {
9
+ domain?: string;
10
+ images: string;
11
+ outputJson?: string;
12
+ }, deps?: ImagesPushDeps): Promise<void>;
13
+ export declare function registerImagesPushCommand(program: Command): Command;
14
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Command } from "commander";
2
+ import { createDefaultConfig } from "../../config";
3
+ import { ensureDir } from "../../utils/file-utils";
4
+ type WriteFileFn = (filePath: string, data: string) => Promise<number>;
5
+ interface InitDependencies {
6
+ createDefaultConfig: typeof createDefaultConfig;
7
+ ensureDir: typeof ensureDir;
8
+ writeFile: WriteFileFn;
9
+ logger: Pick<typeof console, "log" | "error">;
10
+ exit: (code: number) => void;
11
+ }
12
+ export declare function handleInitCommand(options: {
13
+ config: string;
14
+ }, deps?: InitDependencies): Promise<void>;
15
+ export declare function registerInitCommand(program: Command, deps?: InitDependencies): Command;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Command } from "commander";
2
+ type WriteFileFn = (filePath: string, data: string) => Promise<number>;
3
+ interface NewDeps {
4
+ writeFile: WriteFileFn;
5
+ now: () => Date;
6
+ logger: Pick<typeof console, "log" | "error">;
7
+ exit: (code: number) => void;
8
+ }
9
+ export declare function handleNewCommand(title: string, options: {
10
+ tags?: string;
11
+ }, deps?: NewDeps): Promise<string>;
12
+ export declare function registerNewCommand(program: Command): Command;
13
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Command } from "commander";
2
+ import { startServer } from "../../server";
3
+ interface ServeDeps {
4
+ startServer: typeof startServer;
5
+ logger: Pick<typeof console, "error">;
6
+ exit: (code: number) => void;
7
+ }
8
+ export declare function handleServeCommand(options: {
9
+ output: string;
10
+ port: string;
11
+ }, deps?: ServeDeps): Promise<void>;
12
+ export declare function registerServeCommand(program: Command): Command;
13
+ export {};