bunli 0.1.0 → 0.2.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.
@@ -9,5 +9,7 @@ declare const _default: import("@bunli/core").Command<{
9
9
  runtime: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodEnum<["bun", "node"]>>>;
10
10
  targets: import("@bunli/core").CLIOption<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>>;
11
11
  watch: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
12
- }>;
12
+ }, {}, string> & {
13
+ name: "build";
14
+ };
13
15
  export default _default;
@@ -1,8 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  declare const _default: import("@bunli/core").Command<{
3
3
  entry: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodString>>;
4
+ commandsDir: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodString>>;
5
+ generate: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
6
+ clearScreen: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
4
7
  watch: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
5
8
  inspect: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
6
9
  port: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodNumber>>;
7
- }>;
10
+ }, {}, string> & {
11
+ name: "dev";
12
+ };
8
13
  export default _default;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ declare const _default: import("@bunli/core").Command<{
3
+ commandsDir: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodString>>;
4
+ output: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodString>>;
5
+ watch: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
6
+ }, {}, string> & {
7
+ name: "generate";
8
+ };
9
+ export default _default;
@@ -6,5 +6,7 @@ declare const _default: import("@bunli/core").Command<{
6
6
  git: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
7
7
  install: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
8
8
  'package-manager': import("@bunli/core").CLIOption<z.ZodDefault<z.ZodEnum<["bun", "pnpm", "yarn", "npm"]>>>;
9
- }>;
9
+ }, {}, string> & {
10
+ name: "init";
11
+ };
10
12
  export default _default;
@@ -6,5 +6,7 @@ declare const _default: import("@bunli/core").Command<{
6
6
  github: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodBoolean>>;
7
7
  dry: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
8
8
  all: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
9
- }>;
9
+ }, {}, string> & {
10
+ name: "release";
11
+ };
10
12
  export default _default;
@@ -6,5 +6,7 @@ declare const _default: import("@bunli/core").Command<{
6
6
  bail: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
7
7
  timeout: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodNumber>>;
8
8
  all: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
9
- }>;
9
+ }, {}, string> & {
10
+ name: "test";
11
+ };
10
12
  export default _default;
package/dist/config.d.ts CHANGED
@@ -1,175 +1,41 @@
1
- import { z } from 'zod';
2
- export declare const bunliConfigSchema: z.ZodObject<{
3
- name: z.ZodOptional<z.ZodString>;
4
- version: z.ZodOptional<z.ZodString>;
5
- description: z.ZodOptional<z.ZodString>;
6
- commands: z.ZodOptional<z.ZodObject<{
7
- manifest: z.ZodOptional<z.ZodString>;
8
- directory: z.ZodOptional<z.ZodString>;
9
- }, "strip", z.ZodTypeAny, {
10
- manifest?: string | undefined;
11
- directory?: string | undefined;
12
- }, {
13
- manifest?: string | undefined;
14
- directory?: string | undefined;
15
- }>>;
16
- build: z.ZodOptional<z.ZodObject<{
17
- entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
18
- outdir: z.ZodOptional<z.ZodString>;
19
- targets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
- compress: z.ZodOptional<z.ZodBoolean>;
21
- external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
- minify: z.ZodOptional<z.ZodBoolean>;
23
- sourcemap: z.ZodOptional<z.ZodBoolean>;
24
- }, "strip", z.ZodTypeAny, {
25
- entry?: string | string[] | undefined;
26
- outdir?: string | undefined;
27
- targets?: string[] | undefined;
28
- compress?: boolean | undefined;
29
- external?: string[] | undefined;
30
- minify?: boolean | undefined;
31
- sourcemap?: boolean | undefined;
32
- }, {
33
- entry?: string | string[] | undefined;
34
- outdir?: string | undefined;
35
- targets?: string[] | undefined;
36
- compress?: boolean | undefined;
37
- external?: string[] | undefined;
38
- minify?: boolean | undefined;
39
- sourcemap?: boolean | undefined;
40
- }>>;
41
- dev: z.ZodOptional<z.ZodObject<{
42
- watch: z.ZodOptional<z.ZodBoolean>;
43
- inspect: z.ZodOptional<z.ZodBoolean>;
44
- port: z.ZodOptional<z.ZodNumber>;
45
- }, "strip", z.ZodTypeAny, {
46
- watch?: boolean | undefined;
47
- inspect?: boolean | undefined;
48
- port?: number | undefined;
49
- }, {
50
- watch?: boolean | undefined;
51
- inspect?: boolean | undefined;
52
- port?: number | undefined;
53
- }>>;
54
- test: z.ZodOptional<z.ZodObject<{
55
- pattern: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
56
- coverage: z.ZodOptional<z.ZodBoolean>;
57
- watch: z.ZodOptional<z.ZodBoolean>;
58
- }, "strip", z.ZodTypeAny, {
59
- watch?: boolean | undefined;
60
- pattern?: string | string[] | undefined;
61
- coverage?: boolean | undefined;
62
- }, {
63
- watch?: boolean | undefined;
64
- pattern?: string | string[] | undefined;
65
- coverage?: boolean | undefined;
66
- }>>;
67
- release: z.ZodOptional<z.ZodObject<{
68
- npm: z.ZodOptional<z.ZodBoolean>;
69
- github: z.ZodOptional<z.ZodBoolean>;
70
- tagFormat: z.ZodOptional<z.ZodString>;
71
- conventionalCommits: z.ZodOptional<z.ZodBoolean>;
72
- }, "strip", z.ZodTypeAny, {
73
- npm?: boolean | undefined;
74
- github?: boolean | undefined;
75
- tagFormat?: string | undefined;
76
- conventionalCommits?: boolean | undefined;
77
- }, {
78
- npm?: boolean | undefined;
79
- github?: boolean | undefined;
80
- tagFormat?: string | undefined;
81
- conventionalCommits?: boolean | undefined;
82
- }>>;
83
- workspace: z.ZodOptional<z.ZodObject<{
84
- packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
85
- shared: z.ZodOptional<z.ZodAny>;
86
- versionStrategy: z.ZodOptional<z.ZodEnum<["fixed", "independent"]>>;
87
- }, "strip", z.ZodTypeAny, {
88
- packages?: string[] | undefined;
89
- shared?: any;
90
- versionStrategy?: "fixed" | "independent" | undefined;
91
- }, {
92
- packages?: string[] | undefined;
93
- shared?: any;
94
- versionStrategy?: "fixed" | "independent" | undefined;
95
- }>>;
96
- }, "strip", z.ZodTypeAny, {
97
- name?: string | undefined;
98
- version?: string | undefined;
99
- description?: string | undefined;
100
- commands?: {
101
- manifest?: string | undefined;
102
- directory?: string | undefined;
103
- } | undefined;
104
- build?: {
105
- entry?: string | string[] | undefined;
106
- outdir?: string | undefined;
107
- targets?: string[] | undefined;
108
- compress?: boolean | undefined;
109
- external?: string[] | undefined;
110
- minify?: boolean | undefined;
111
- sourcemap?: boolean | undefined;
112
- } | undefined;
113
- dev?: {
114
- watch?: boolean | undefined;
115
- inspect?: boolean | undefined;
116
- port?: number | undefined;
117
- } | undefined;
118
- test?: {
119
- watch?: boolean | undefined;
120
- pattern?: string | string[] | undefined;
121
- coverage?: boolean | undefined;
122
- } | undefined;
123
- release?: {
124
- npm?: boolean | undefined;
125
- github?: boolean | undefined;
126
- tagFormat?: string | undefined;
127
- conventionalCommits?: boolean | undefined;
128
- } | undefined;
129
- workspace?: {
130
- packages?: string[] | undefined;
131
- shared?: any;
132
- versionStrategy?: "fixed" | "independent" | undefined;
133
- } | undefined;
134
- }, {
135
- name?: string | undefined;
136
- version?: string | undefined;
137
- description?: string | undefined;
1
+ export type LoadedConfig = {
2
+ name?: string;
3
+ version?: string;
4
+ description?: string;
138
5
  commands?: {
139
- manifest?: string | undefined;
140
- directory?: string | undefined;
141
- } | undefined;
142
- build?: {
143
- entry?: string | string[] | undefined;
144
- outdir?: string | undefined;
145
- targets?: string[] | undefined;
146
- compress?: boolean | undefined;
147
- external?: string[] | undefined;
148
- minify?: boolean | undefined;
149
- sourcemap?: boolean | undefined;
150
- } | undefined;
151
- dev?: {
152
- watch?: boolean | undefined;
153
- inspect?: boolean | undefined;
154
- port?: number | undefined;
155
- } | undefined;
156
- test?: {
157
- watch?: boolean | undefined;
158
- pattern?: string | string[] | undefined;
159
- coverage?: boolean | undefined;
160
- } | undefined;
161
- release?: {
162
- npm?: boolean | undefined;
163
- github?: boolean | undefined;
164
- tagFormat?: string | undefined;
165
- conventionalCommits?: boolean | undefined;
166
- } | undefined;
167
- workspace?: {
168
- packages?: string[] | undefined;
6
+ manifest?: string;
7
+ directory?: string;
8
+ };
9
+ build: {
10
+ entry?: string | string[];
11
+ outdir?: string;
12
+ targets?: string[];
13
+ compress?: boolean;
14
+ minify?: boolean;
15
+ external?: string[];
16
+ sourcemap?: boolean;
17
+ };
18
+ dev: {
19
+ watch?: boolean;
20
+ inspect?: boolean;
21
+ port?: number;
22
+ };
23
+ test: {
24
+ pattern?: string | string[];
25
+ coverage?: boolean;
26
+ watch?: boolean;
27
+ };
28
+ workspace: {
29
+ packages?: string[];
169
30
  shared?: any;
170
- versionStrategy?: "fixed" | "independent" | undefined;
171
- } | undefined;
172
- }>;
173
- export type BunliConfig = z.infer<typeof bunliConfigSchema>;
174
- export declare function loadConfig(cwd?: string): Promise<BunliConfig>;
175
- export declare function defineConfig(config: BunliConfig): BunliConfig;
31
+ versionStrategy?: 'fixed' | 'independent';
32
+ };
33
+ release: {
34
+ npm?: boolean;
35
+ github?: boolean;
36
+ tagFormat?: string;
37
+ conventionalCommits?: boolean;
38
+ };
39
+ plugins?: any[];
40
+ };
41
+ export declare function loadConfig(cwd?: string): Promise<LoadedConfig>;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export { defineConfig, loadConfig, type BunliConfig } from './config.js';
1
+ export { loadConfig } from './config.js';
2
+ export { defineConfig, type BunliConfig } from '@bunli/core';
2
3
  export { findEntry } from './utils/find-entry.js';
3
4
  export declare const version = "0.1.0";
package/dist/index.js CHANGED
@@ -1,47 +1,8 @@
1
1
  // @bun
2
2
  // src/config.ts
3
- import { z } from "zod";
3
+ import { bunliConfigSchema } from "@bunli/core";
4
4
  import path from "path";
5
5
  import { existsSync } from "fs";
6
- var bunliConfigSchema = z.object({
7
- name: z.string().optional(),
8
- version: z.string().optional(),
9
- description: z.string().optional(),
10
- commands: z.object({
11
- manifest: z.string().optional(),
12
- directory: z.string().optional()
13
- }).optional(),
14
- build: z.object({
15
- entry: z.string().or(z.array(z.string())).optional(),
16
- outdir: z.string().optional(),
17
- targets: z.array(z.string()).optional(),
18
- compress: z.boolean().optional(),
19
- external: z.array(z.string()).optional(),
20
- minify: z.boolean().optional(),
21
- sourcemap: z.boolean().optional()
22
- }).optional(),
23
- dev: z.object({
24
- watch: z.boolean().optional(),
25
- inspect: z.boolean().optional(),
26
- port: z.number().optional()
27
- }).optional(),
28
- test: z.object({
29
- pattern: z.string().or(z.array(z.string())).optional(),
30
- coverage: z.boolean().optional(),
31
- watch: z.boolean().optional()
32
- }).optional(),
33
- release: z.object({
34
- npm: z.boolean().optional(),
35
- github: z.boolean().optional(),
36
- tagFormat: z.string().optional(),
37
- conventionalCommits: z.boolean().optional()
38
- }).optional(),
39
- workspace: z.object({
40
- packages: z.array(z.string()).optional(),
41
- shared: z.any().optional(),
42
- versionStrategy: z.enum(["fixed", "independent"]).optional()
43
- }).optional()
44
- });
45
6
  var CONFIG_NAMES = [
46
7
  "bunli.config.ts",
47
8
  "bunli.config.js",
@@ -53,19 +14,76 @@ async function loadConfig(cwd = process.cwd()) {
53
14
  if (existsSync(configPath)) {
54
15
  try {
55
16
  const module = await import(configPath);
56
- const config = module.default || module;
57
- return bunliConfigSchema.parse(config);
17
+ const config = bunliConfigSchema.parse(module.default || module);
18
+ return {
19
+ ...config,
20
+ build: {
21
+ targets: ["native"],
22
+ compress: false,
23
+ minify: false,
24
+ sourcemap: true,
25
+ ...config.build
26
+ },
27
+ dev: {
28
+ watch: true,
29
+ inspect: false,
30
+ ...config.dev
31
+ },
32
+ test: {
33
+ pattern: ["**/*.test.ts", "**/*.spec.ts"],
34
+ coverage: false,
35
+ watch: false,
36
+ ...config.test
37
+ },
38
+ workspace: {
39
+ versionStrategy: "fixed",
40
+ ...config.workspace
41
+ },
42
+ release: {
43
+ npm: true,
44
+ github: false,
45
+ tagFormat: "v{{version}}",
46
+ conventionalCommits: true,
47
+ ...config.release
48
+ }
49
+ };
58
50
  } catch (error) {
59
51
  console.error(`Error loading config from ${configPath}:`, error);
60
52
  throw error;
61
53
  }
62
54
  }
63
55
  }
64
- return {};
65
- }
66
- function defineConfig(config) {
67
- return config;
56
+ return {
57
+ build: {
58
+ targets: ["native"],
59
+ compress: false,
60
+ minify: false,
61
+ sourcemap: true
62
+ },
63
+ dev: {
64
+ watch: true,
65
+ inspect: false
66
+ },
67
+ test: {
68
+ pattern: ["**/*.test.ts", "**/*.spec.ts"],
69
+ coverage: false,
70
+ watch: false
71
+ },
72
+ workspace: {
73
+ versionStrategy: "fixed"
74
+ },
75
+ release: {
76
+ npm: true,
77
+ github: false,
78
+ tagFormat: "v{{version}}",
79
+ conventionalCommits: true
80
+ }
81
+ };
68
82
  }
83
+
84
+ // src/index.ts
85
+ import { defineConfig } from "@bunli/core";
86
+
69
87
  // src/utils/find-entry.ts
70
88
  import { existsSync as existsSync2 } from "fs";
71
89
  import path2 from "path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "The Bunli CLI toolchain for developing, building, and distributing CLIs",
6
6
  "bin": {
@@ -43,18 +43,17 @@
43
43
  "build:standalone": "bun run scripts/build.ts --compile",
44
44
  "build:binaries": "bun run scripts/release-binaries.ts",
45
45
  "test": "bun test",
46
- "type-check": "tsc --noEmit",
46
+ "typecheck": "tsc --noEmit",
47
47
  "prepublishOnly": "bun run build"
48
48
  },
49
49
  "dependencies": {
50
- "@bunli/core": "0.1.0",
51
- "@bunli/utils": "0.1.0",
52
- "glob": "^11.0.0",
50
+ "@bunli/core": "0.2.0",
51
+ "@bunli/generator": "0.2.0",
52
+ "@bunli/utils": "0.2.0",
53
53
  "zod": "^3.24.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/bun": "latest",
57
- "bun-types": "latest",
58
57
  "typescript": "^5.8.0"
59
58
  }
60
59
  }