bunli 0.4.0 → 0.5.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/dist/cli.js +70 -57
- package/dist/commands/build.d.ts +5 -2
- package/dist/commands/init.d.ts +11 -2
- package/dist/commands/release.d.ts +5 -1
- package/dist/commands/test.d.ts +1 -1
- package/dist/config.d.ts +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -88
- package/package.json +4 -4
package/dist/commands/build.d.ts
CHANGED
|
@@ -6,8 +6,11 @@ declare const _default: import("@bunli/core").Command<{
|
|
|
6
6
|
minify: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodBoolean>>;
|
|
7
7
|
sourcemap: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodBoolean>>;
|
|
8
8
|
bytecode: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
|
9
|
-
runtime: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodEnum<
|
|
10
|
-
|
|
9
|
+
runtime: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
bun: "bun";
|
|
11
|
+
node: "node";
|
|
12
|
+
}>>>;
|
|
13
|
+
targets: import("@bunli/core").CLIOption<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>>;
|
|
11
14
|
watch: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
|
12
15
|
}, {}, string> & {
|
|
13
16
|
name: "build";
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const _default: import("@bunli/core").Command<{
|
|
3
3
|
name: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodString>>;
|
|
4
|
-
template: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodEnum<
|
|
4
|
+
template: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
basic: "basic";
|
|
6
|
+
advanced: "advanced";
|
|
7
|
+
monorepo: "monorepo";
|
|
8
|
+
}>>>;
|
|
5
9
|
dir: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodString>>;
|
|
6
10
|
git: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
|
7
11
|
install: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
|
8
|
-
'package-manager': import("@bunli/core").CLIOption<z.ZodDefault<z.ZodEnum<
|
|
12
|
+
'package-manager': import("@bunli/core").CLIOption<z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
bun: "bun";
|
|
14
|
+
npm: "npm";
|
|
15
|
+
pnpm: "pnpm";
|
|
16
|
+
yarn: "yarn";
|
|
17
|
+
}>>>;
|
|
9
18
|
}, {}, string> & {
|
|
10
19
|
name: "init";
|
|
11
20
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const _default: import("@bunli/core").Command<{
|
|
3
|
-
version: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodUnion<[z.ZodEnum<
|
|
3
|
+
version: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
4
|
+
patch: "patch";
|
|
5
|
+
minor: "minor";
|
|
6
|
+
major: "major";
|
|
7
|
+
}>, z.ZodString]>>>;
|
|
4
8
|
tag: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodString>>;
|
|
5
9
|
npm: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodBoolean>>;
|
|
6
10
|
github: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodBoolean>>;
|
package/dist/commands/test.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const _default: import("@bunli/core").Command<{
|
|
3
|
-
pattern: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
3
|
+
pattern: import("@bunli/core").CLIOption<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
4
4
|
watch: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
|
5
5
|
coverage: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
|
6
6
|
bail: import("@bunli/core").CLIOption<z.ZodDefault<z.ZodBoolean>>;
|
package/dist/config.d.ts
CHANGED
|
@@ -10,33 +10,33 @@ export type LoadedConfig = {
|
|
|
10
10
|
build: {
|
|
11
11
|
entry?: string | string[];
|
|
12
12
|
outdir?: string;
|
|
13
|
-
targets
|
|
14
|
-
compress
|
|
15
|
-
minify
|
|
13
|
+
targets: string[];
|
|
14
|
+
compress: boolean;
|
|
15
|
+
minify: boolean;
|
|
16
16
|
external?: string[];
|
|
17
|
-
sourcemap
|
|
17
|
+
sourcemap: boolean;
|
|
18
18
|
};
|
|
19
19
|
dev: {
|
|
20
|
-
watch
|
|
21
|
-
inspect
|
|
20
|
+
watch: boolean;
|
|
21
|
+
inspect: boolean;
|
|
22
22
|
port?: number;
|
|
23
23
|
};
|
|
24
24
|
test: {
|
|
25
|
-
pattern
|
|
26
|
-
coverage
|
|
27
|
-
watch
|
|
25
|
+
pattern: string | string[];
|
|
26
|
+
coverage: boolean;
|
|
27
|
+
watch: boolean;
|
|
28
28
|
};
|
|
29
29
|
workspace: {
|
|
30
30
|
packages?: string[];
|
|
31
31
|
shared?: any;
|
|
32
|
-
versionStrategy
|
|
32
|
+
versionStrategy: 'fixed' | 'independent';
|
|
33
33
|
};
|
|
34
34
|
release: {
|
|
35
|
-
npm
|
|
36
|
-
github
|
|
37
|
-
tagFormat
|
|
38
|
-
conventionalCommits
|
|
35
|
+
npm: boolean;
|
|
36
|
+
github: boolean;
|
|
37
|
+
tagFormat: string;
|
|
38
|
+
conventionalCommits: boolean;
|
|
39
39
|
};
|
|
40
|
-
plugins
|
|
40
|
+
plugins: any[];
|
|
41
41
|
};
|
|
42
42
|
export declare function loadConfig(cwd?: string): Promise<LoadedConfig>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,92 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/config.ts
|
|
3
|
-
import { bunliConfigSchema } from "@bunli/core";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { existsSync } from "fs";
|
|
6
|
-
var CONFIG_NAMES = [
|
|
7
|
-
"bunli.config.ts",
|
|
8
|
-
"bunli.config.js",
|
|
9
|
-
"bunli.config.mjs"
|
|
10
|
-
];
|
|
11
|
-
async function loadConfig(cwd = process.cwd()) {
|
|
12
|
-
for (const configName of CONFIG_NAMES) {
|
|
13
|
-
const configPath = path.join(cwd, configName);
|
|
14
|
-
if (existsSync(configPath)) {
|
|
15
|
-
try {
|
|
16
|
-
const module = await import(configPath);
|
|
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
|
-
};
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error(`Error loading config from ${configPath}:`, error);
|
|
52
|
-
throw error;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
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
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
2
|
// src/index.ts
|
|
3
|
+
import { loadConfig } from "@bunli/core";
|
|
85
4
|
import { defineConfig } from "@bunli/core";
|
|
86
5
|
|
|
87
6
|
// src/utils/find-entry.ts
|
|
88
|
-
import { existsSync
|
|
89
|
-
import
|
|
7
|
+
import { existsSync } from "fs";
|
|
8
|
+
import path from "path";
|
|
90
9
|
var COMMON_ENTRIES = [
|
|
91
10
|
"src/cli.ts",
|
|
92
11
|
"src/index.ts",
|
|
@@ -103,13 +22,13 @@ var COMMON_ENTRIES = [
|
|
|
103
22
|
];
|
|
104
23
|
async function findEntry(cwd = process.cwd()) {
|
|
105
24
|
for (const entry of COMMON_ENTRIES) {
|
|
106
|
-
const fullPath =
|
|
107
|
-
if (
|
|
25
|
+
const fullPath = path.join(cwd, entry);
|
|
26
|
+
if (existsSync(fullPath)) {
|
|
108
27
|
return entry;
|
|
109
28
|
}
|
|
110
29
|
}
|
|
111
|
-
const pkgPath =
|
|
112
|
-
if (
|
|
30
|
+
const pkgPath = path.join(cwd, "package.json");
|
|
31
|
+
if (existsSync(pkgPath)) {
|
|
113
32
|
try {
|
|
114
33
|
const pkg = await Bun.file(pkgPath).json();
|
|
115
34
|
if (pkg.bin) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Bunli CLI toolchain for developing, building, and distributing CLIs",
|
|
6
6
|
"bin": {
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@bunli/core": "0.4.0",
|
|
51
51
|
"@bunli/generator": "0.4.0",
|
|
52
52
|
"@bunli/utils": "0.2.0",
|
|
53
|
-
"zod": "^3.
|
|
53
|
+
"zod": "^4.3.6"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@types/bun": "
|
|
57
|
-
"typescript": "^5.8.
|
|
56
|
+
"@types/bun": "1.3.7",
|
|
57
|
+
"typescript": "^5.8.3"
|
|
58
58
|
}
|
|
59
59
|
}
|