create-bunli 0.7.0 → 0.8.1

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.
Files changed (106) hide show
  1. package/README.md +18 -6
  2. package/dist/cli.d.ts +1 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +372 -195
  5. package/dist/create-project.d.ts +5 -4
  6. package/dist/create-project.d.ts.map +1 -0
  7. package/dist/create.d.ts +4 -3
  8. package/dist/create.d.ts.map +1 -0
  9. package/dist/index.d.ts +6 -3
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +344 -187
  12. package/dist/steps.d.ts +36 -0
  13. package/dist/steps.d.ts.map +1 -0
  14. package/dist/template-engine.d.ts +3 -2
  15. package/dist/template-engine.d.ts.map +1 -0
  16. package/dist/templates/advanced/README.md +8 -4
  17. package/dist/templates/advanced/bunli.config.ts +19 -19
  18. package/dist/templates/advanced/package.json +9 -4
  19. package/dist/templates/advanced/src/commands/config.ts +129 -118
  20. package/dist/templates/advanced/src/commands/init.ts +53 -59
  21. package/dist/templates/advanced/src/commands/serve.ts +77 -82
  22. package/dist/templates/advanced/src/commands/validate.ts +58 -64
  23. package/dist/templates/advanced/src/index.ts +30 -29
  24. package/dist/templates/advanced/src/utils/config.ts +48 -47
  25. package/dist/templates/advanced/src/utils/constants.ts +6 -6
  26. package/dist/templates/advanced/src/utils/glob.ts +29 -28
  27. package/dist/templates/advanced/src/utils/validator.ts +60 -61
  28. package/dist/templates/advanced/template.json +2 -6
  29. package/dist/templates/advanced/tsconfig.json +1 -1
  30. package/dist/templates/basic/README.md +1 -1
  31. package/dist/templates/basic/bunli.config.ts +17 -17
  32. package/dist/templates/basic/package.json +4 -3
  33. package/dist/templates/basic/src/commands/hello.ts +20 -25
  34. package/dist/templates/basic/src/index.ts +9 -8
  35. package/dist/templates/basic/template.json +2 -6
  36. package/dist/templates/basic/tsconfig.json +1 -1
  37. package/dist/templates/monorepo/README.md +1 -1
  38. package/dist/templates/monorepo/bunli.config.ts +21 -21
  39. package/dist/templates/monorepo/package.json +3 -2
  40. package/dist/templates/monorepo/packages/cli/package.json +10 -5
  41. package/dist/templates/monorepo/packages/cli/src/index.ts +13 -13
  42. package/dist/templates/monorepo/packages/cli/tsconfig.json +3 -6
  43. package/dist/templates/monorepo/packages/core/package.json +6 -5
  44. package/dist/templates/monorepo/packages/core/scripts/build.ts +10 -10
  45. package/dist/templates/monorepo/packages/core/src/commands/analyze.ts +58 -56
  46. package/dist/templates/monorepo/packages/core/src/commands/process.ts +39 -46
  47. package/dist/templates/monorepo/packages/core/src/index.ts +3 -3
  48. package/dist/templates/monorepo/packages/core/src/types.ts +15 -15
  49. package/dist/templates/monorepo/packages/core/tsconfig.json +3 -5
  50. package/dist/templates/monorepo/packages/utils/package.json +6 -5
  51. package/dist/templates/monorepo/packages/utils/scripts/build.ts +10 -10
  52. package/dist/templates/monorepo/packages/utils/src/format.ts +19 -19
  53. package/dist/templates/monorepo/packages/utils/src/index.ts +3 -3
  54. package/dist/templates/monorepo/packages/utils/src/json.ts +4 -4
  55. package/dist/templates/monorepo/packages/utils/src/logger.ts +9 -9
  56. package/dist/templates/monorepo/packages/utils/tsconfig.json +2 -2
  57. package/dist/templates/monorepo/template.json +2 -6
  58. package/dist/templates/monorepo/tsconfig.json +1 -1
  59. package/dist/templates/monorepo/turbo.json +1 -1
  60. package/dist/types.d.ts +2 -1
  61. package/dist/types.d.ts.map +1 -0
  62. package/package.json +35 -34
  63. package/templates/advanced/README.md +8 -4
  64. package/templates/advanced/bunli.config.ts +19 -19
  65. package/templates/advanced/package.json +9 -4
  66. package/templates/advanced/src/commands/config.ts +129 -118
  67. package/templates/advanced/src/commands/init.ts +53 -59
  68. package/templates/advanced/src/commands/serve.ts +77 -82
  69. package/templates/advanced/src/commands/validate.ts +58 -64
  70. package/templates/advanced/src/index.ts +30 -29
  71. package/templates/advanced/src/utils/config.ts +48 -47
  72. package/templates/advanced/src/utils/constants.ts +6 -6
  73. package/templates/advanced/src/utils/glob.ts +29 -28
  74. package/templates/advanced/src/utils/validator.ts +60 -61
  75. package/templates/advanced/template.json +2 -6
  76. package/templates/advanced/tsconfig.json +1 -1
  77. package/templates/basic/README.md +1 -1
  78. package/templates/basic/bunli.config.ts +17 -17
  79. package/templates/basic/package.json +4 -3
  80. package/templates/basic/src/commands/hello.ts +20 -25
  81. package/templates/basic/src/index.ts +9 -8
  82. package/templates/basic/template.json +2 -6
  83. package/templates/basic/tsconfig.json +1 -1
  84. package/templates/monorepo/README.md +1 -1
  85. package/templates/monorepo/bunli.config.ts +21 -21
  86. package/templates/monorepo/package.json +3 -2
  87. package/templates/monorepo/packages/cli/package.json +10 -5
  88. package/templates/monorepo/packages/cli/src/index.ts +13 -13
  89. package/templates/monorepo/packages/cli/tsconfig.json +3 -6
  90. package/templates/monorepo/packages/core/package.json +6 -5
  91. package/templates/monorepo/packages/core/scripts/build.ts +10 -10
  92. package/templates/monorepo/packages/core/src/commands/analyze.ts +58 -56
  93. package/templates/monorepo/packages/core/src/commands/process.ts +39 -46
  94. package/templates/monorepo/packages/core/src/index.ts +3 -3
  95. package/templates/monorepo/packages/core/src/types.ts +15 -15
  96. package/templates/monorepo/packages/core/tsconfig.json +3 -5
  97. package/templates/monorepo/packages/utils/package.json +6 -5
  98. package/templates/monorepo/packages/utils/scripts/build.ts +10 -10
  99. package/templates/monorepo/packages/utils/src/format.ts +19 -19
  100. package/templates/monorepo/packages/utils/src/index.ts +3 -3
  101. package/templates/monorepo/packages/utils/src/json.ts +4 -4
  102. package/templates/monorepo/packages/utils/src/logger.ts +9 -9
  103. package/templates/monorepo/packages/utils/tsconfig.json +2 -2
  104. package/templates/monorepo/template.json +2 -6
  105. package/templates/monorepo/tsconfig.json +1 -1
  106. package/templates/monorepo/turbo.json +1 -1
@@ -1,49 +1,50 @@
1
- import { Glob } from 'bun'
2
- import path from 'node:path'
1
+ import path from "node:path";
2
+
3
+ import { Glob } from "bun";
3
4
 
4
5
  export interface GlobOptions {
5
- include?: string[]
6
- exclude?: string[]
6
+ include?: string[];
7
+ exclude?: string[];
7
8
  }
8
9
 
9
10
  export async function glob(patterns: string[], options: GlobOptions = {}): Promise<string[]> {
10
- const { include = [], exclude = [] } = options
11
-
11
+ const { include = [], exclude = [] } = options;
12
+
12
13
  // Combine user patterns with include patterns
13
- const allPatterns = [...patterns, ...include]
14
-
14
+ const allPatterns = [...patterns, ...include];
15
+
15
16
  // Convert exclude patterns to absolute paths
16
- const excludePatterns = exclude.map(pattern => {
17
- if (pattern.startsWith('/')) {
18
- return pattern
17
+ const excludePatterns = exclude.map((pattern) => {
18
+ if (pattern.startsWith("/")) {
19
+ return pattern;
19
20
  }
20
- return path.join(process.cwd(), pattern)
21
- })
22
-
23
- const results = new Set<string>()
24
-
21
+ return path.join(process.cwd(), pattern);
22
+ });
23
+
24
+ const results = new Set<string>();
25
+
25
26
  for (const pattern of allPatterns) {
26
- const glob = new Glob(pattern)
27
-
27
+ const glob = new Glob(pattern);
28
+
28
29
  for await (const file of glob.scan({
29
30
  cwd: process.cwd(),
30
- absolute: true
31
+ absolute: true,
31
32
  })) {
32
33
  // Check if file should be excluded
33
- let shouldExclude = false
34
-
34
+ let shouldExclude = false;
35
+
35
36
  for (const excludePattern of excludePatterns) {
36
37
  if (file.includes(excludePattern)) {
37
- shouldExclude = true
38
- break
38
+ shouldExclude = true;
39
+ break;
39
40
  }
40
41
  }
41
-
42
+
42
43
  if (!shouldExclude) {
43
- results.add(file)
44
+ results.add(file);
44
45
  }
45
46
  }
46
47
  }
47
-
48
- return Array.from(results).sort()
49
- }
48
+
49
+ return Array.from(results).sort();
50
+ }
@@ -1,131 +1,130 @@
1
1
  export interface ValidationResult {
2
- file: string
3
- errors: ValidationIssue[]
4
- warnings: ValidationIssue[]
2
+ file: string;
3
+ errors: ValidationIssue[];
4
+ warnings: ValidationIssue[];
5
5
  }
6
6
 
7
7
  export interface ValidationIssue {
8
- line: number
9
- column: number
10
- message: string
11
- rule: string
8
+ line: number;
9
+ column: number;
10
+ message: string;
11
+ rule: string;
12
12
  }
13
13
 
14
14
  export interface ValidateOptions {
15
- rules?: Record<string, any>
16
- fix?: boolean
17
- cache?: boolean
15
+ rules?: Record<string, any>;
16
+ fix?: boolean;
17
+ cache?: boolean;
18
18
  }
19
19
 
20
20
  export async function validateFiles(
21
21
  files: string[],
22
- options: ValidateOptions = {}
22
+ options: ValidateOptions = {},
23
23
  ): Promise<ValidationResult[]> {
24
- const { rules = {}, fix = false } = options
25
- const results: ValidationResult[] = []
26
-
24
+ const { rules = {}, fix = false } = options;
25
+ const results: ValidationResult[] = [];
26
+
27
27
  for (const file of files) {
28
- const result = await validateFile(file, rules, fix)
29
- results.push(result)
28
+ const result = await validateFile(file, rules, fix);
29
+ results.push(result);
30
30
  }
31
-
32
- return results
31
+
32
+ return results;
33
33
  }
34
34
 
35
35
  async function validateFile(
36
36
  filePath: string,
37
37
  rules: Record<string, any>,
38
- fix: boolean
38
+ fix: boolean,
39
39
  ): Promise<ValidationResult> {
40
- const errors: ValidationIssue[] = []
41
- const warnings: ValidationIssue[] = []
42
-
40
+ const errors: ValidationIssue[] = [];
41
+ const warnings: ValidationIssue[] = [];
42
+
43
43
  try {
44
- const content = await Bun.file(filePath).text()
45
- const lines = content.split('\n')
46
-
44
+ const content = await Bun.file(filePath).text();
45
+ const lines = content.split("\n");
46
+
47
47
  // Example rule implementations
48
48
  if (rules.noConsoleLog) {
49
49
  lines.forEach((line, index) => {
50
- const match = line.match(/console\.log\s*\(/)
50
+ const match = line.match(/console\.log\s*\(/);
51
51
  if (match) {
52
52
  errors.push({
53
53
  line: index + 1,
54
54
  column: match.index! + 1,
55
- message: 'console.log is not allowed',
56
- rule: 'noConsoleLog'
57
- })
55
+ message: "console.log is not allowed",
56
+ rule: "noConsoleLog",
57
+ });
58
58
  }
59
- })
59
+ });
60
60
  }
61
-
61
+
62
62
  if (rules.noDebugger) {
63
63
  lines.forEach((line, index) => {
64
- const match = line.match(/\bdebugger\b/)
64
+ const match = line.match(/\bdebugger\b/);
65
65
  if (match) {
66
66
  errors.push({
67
67
  line: index + 1,
68
68
  column: match.index! + 1,
69
- message: 'debugger statement is not allowed',
70
- rule: 'noDebugger'
71
- })
69
+ message: "debugger statement is not allowed",
70
+ rule: "noDebugger",
71
+ });
72
72
  }
73
- })
73
+ });
74
74
  }
75
-
75
+
76
76
  if (rules.maxLineLength) {
77
- const maxLength = typeof rules.maxLineLength === 'number' ? rules.maxLineLength : 100
77
+ const maxLength = typeof rules.maxLineLength === "number" ? rules.maxLineLength : 100;
78
78
  lines.forEach((line, index) => {
79
79
  if (line.length > maxLength) {
80
80
  warnings.push({
81
81
  line: index + 1,
82
82
  column: maxLength + 1,
83
83
  message: `Line exceeds maximum length of ${maxLength}`,
84
- rule: 'maxLineLength'
85
- })
84
+ rule: "maxLineLength",
85
+ });
86
86
  }
87
- })
87
+ });
88
88
  }
89
-
89
+
90
90
  if (rules.requireFileHeader) {
91
- if (!content.startsWith('/*') && !content.startsWith('//')) {
91
+ if (!content.startsWith("/*") && !content.startsWith("//")) {
92
92
  errors.push({
93
93
  line: 1,
94
94
  column: 1,
95
- message: 'File must start with a header comment',
96
- rule: 'requireFileHeader'
97
- })
95
+ message: "File must start with a header comment",
96
+ rule: "requireFileHeader",
97
+ });
98
98
  }
99
99
  }
100
-
100
+
101
101
  // Auto-fix if requested
102
102
  if (fix && errors.length > 0) {
103
103
  // This is a simplified example - real fix logic would be more complex
104
- let fixedContent = content
105
-
104
+ let fixedContent = content;
105
+
106
106
  if (rules.noConsoleLog) {
107
- fixedContent = fixedContent.replace(/console\.log\s*\([^)]*\);?/g, '')
107
+ fixedContent = fixedContent.replace(/console\.log\s*\([^)]*\);?/g, "");
108
108
  }
109
-
109
+
110
110
  if (rules.noDebugger) {
111
- fixedContent = fixedContent.replace(/\bdebugger\b;?/g, '')
111
+ fixedContent = fixedContent.replace(/\bdebugger\b;?/g, "");
112
112
  }
113
-
114
- await Bun.write(filePath, fixedContent)
113
+
114
+ await Bun.write(filePath, fixedContent);
115
115
  }
116
-
117
116
  } catch (error) {
118
117
  errors.push({
119
118
  line: 0,
120
119
  column: 0,
121
120
  message: `Failed to validate file: ${error}`,
122
- rule: 'system'
123
- })
121
+ rule: "system",
122
+ });
124
123
  }
125
-
124
+
126
125
  return {
127
126
  file: filePath,
128
127
  errors,
129
- warnings
130
- }
131
- }
128
+ warnings,
129
+ };
130
+ }
@@ -35,10 +35,6 @@
35
35
  }
36
36
  ],
37
37
  "files": {
38
- "exclude": [
39
- "node_modules/**",
40
- ".git/**",
41
- "template.json"
42
- ]
38
+ "exclude": ["node_modules/**", ".git/**", "template.json"]
43
39
  }
44
- }
40
+ }
@@ -20,4 +20,4 @@
20
20
  },
21
21
  "include": ["src/**/*"],
22
22
  "exclude": ["node_modules", "dist", "test/**/*"]
23
- }
23
+ }
@@ -38,4 +38,4 @@ bun test
38
38
 
39
39
  ## License
40
40
 
41
- MIT
41
+ MIT
@@ -1,33 +1,33 @@
1
- import { defineConfig } from '@bunli/core'
1
+ import { defineConfig } from "@bunli/core";
2
2
 
3
3
  export default defineConfig({
4
- name: '{{name}}',
5
- version: '{{version}}',
6
- description: '{{description}}',
7
-
4
+ name: "{{name}}",
5
+ version: "{{version}}",
6
+ description: "{{description}}",
7
+
8
8
  commands: {
9
- directory: './src/commands'
9
+ directory: "./src/commands",
10
10
  },
11
-
11
+
12
12
  build: {
13
- entry: './src/index.ts',
14
- outdir: './dist',
15
- targets: ['native'],
13
+ entry: "./src/index.ts",
14
+ outdir: "./dist",
15
+ targets: ["native"],
16
16
  minify: true,
17
17
  sourcemap: true,
18
- compress: false
18
+ compress: false,
19
19
  },
20
-
20
+
21
21
  dev: {
22
22
  watch: true,
23
- inspect: true
23
+ inspect: true,
24
24
  },
25
-
25
+
26
26
  test: {
27
- pattern: ['**/*.test.ts', '**/*.spec.ts'],
27
+ pattern: ["**/*.test.ts", "**/*.spec.ts"],
28
28
  coverage: true,
29
- watch: false
29
+ watch: false,
30
30
  },
31
31
 
32
32
  plugins: [],
33
- })
33
+ });
@@ -1,24 +1,25 @@
1
1
  {
2
2
  "name": "{{name}}",
3
3
  "version": "0.1.0",
4
- "type": "module",
5
4
  "description": "{{description}}",
6
5
  "author": "{{author}}",
7
6
  "bin": {
8
7
  "{{name}}": "./dist/index.js"
9
8
  },
9
+ "type": "module",
10
10
  "scripts": {
11
11
  "postinstall": "bunli generate",
12
12
  "dev": "bun run src/index.ts",
13
13
  "build": "bunli build",
14
14
  "test": "bun test",
15
- "typecheck": "tsc --noEmit"
15
+ "typecheck": "tsgo --noEmit"
16
16
  },
17
17
  "dependencies": {
18
18
  "@bunli/core": "latest"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@bunli/test": "latest",
22
+ "@tsconfig/bun": "catalog:",
22
23
  "@types/bun": "latest",
23
24
  "bunli": "latest",
24
25
  "typescript": "^5.0.0"
@@ -27,4 +28,4 @@
27
28
  "entry": "./src/index.ts",
28
29
  "outDir": "./dist"
29
30
  }
30
- }
31
+ }
@@ -1,31 +1,26 @@
1
- import { defineCommand, option } from '@bunli/core'
2
- import { z } from 'zod'
1
+ import { defineCommand, option } from "@bunli/core";
2
+ import { z } from "zod";
3
3
 
4
4
  const helloCommand = defineCommand({
5
- name: 'hello',
6
- description: 'Say hello to someone',
5
+ name: "hello",
6
+ description: "Say hello to someone",
7
7
  options: {
8
- name: option(
9
- z.string().default('World'),
10
- {
11
- description: 'Name to greet',
12
- short: 'n'
13
- }
14
- ),
15
- excited: option(
16
- z.boolean().default(false),
17
- {
18
- description: 'Add excitement!',
19
- short: 'e'
20
- }
21
- )
8
+ name: option(z.string().default("World"), {
9
+ description: "Name to greet",
10
+ short: "n",
11
+ }),
12
+ excited: option(z.boolean().default(false), {
13
+ description: "Add excitement!",
14
+ short: "e",
15
+ argumentKind: "flag",
16
+ }),
22
17
  },
23
18
  handler: async ({ flags, colors }) => {
24
- const greeting = `Hello, ${flags.name}`
25
- const message = flags.excited ? `${greeting}!` : `${greeting}.`
26
-
27
- console.log(colors.green(message))
28
- }
29
- })
19
+ const greeting = `Hello, ${flags.name}`;
20
+ const message = flags.excited ? `${greeting}!` : `${greeting}.`;
30
21
 
31
- export default helloCommand
22
+ console.log(colors.green(message));
23
+ },
24
+ });
25
+
26
+ export default helloCommand;
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env bun
2
- import { createCLI } from '@bunli/core'
3
- import helloCommand from './commands/hello.js'
2
+ import { createCLI } from "@bunli/core";
3
+
4
+ import helloCommand from "./commands/hello.js";
4
5
 
5
6
  const cli = await createCLI({
6
- name: '{{name}}',
7
- version: '0.1.0',
8
- description: '{{description}}'
9
- })
7
+ name: "{{name}}",
8
+ version: "0.1.0",
9
+ description: "{{description}}",
10
+ });
10
11
 
11
- cli.command(helloCommand)
12
+ cli.command(helloCommand);
12
13
 
13
- await cli.run()
14
+ await cli.run();
@@ -22,10 +22,6 @@
22
22
  }
23
23
  ],
24
24
  "files": {
25
- "exclude": [
26
- "node_modules/**",
27
- ".git/**",
28
- "template.json"
29
- ]
25
+ "exclude": ["node_modules/**", ".git/**", "template.json"]
30
26
  }
31
- }
27
+ }
@@ -16,4 +16,4 @@
16
16
  },
17
17
  "include": ["src/**/*"],
18
18
  "exclude": ["node_modules", "dist", "test/**/*"]
19
- }
19
+ }
@@ -71,4 +71,4 @@ bun run release
71
71
 
72
72
  ## License
73
73
 
74
- MIT
74
+ MIT
@@ -1,38 +1,38 @@
1
- import { defineConfig } from '@bunli/core'
1
+ import { defineConfig } from "@bunli/core";
2
2
 
3
3
  export default defineConfig({
4
- name: '{{name}}',
5
- version: '{{version}}',
6
- description: '{{description}}',
7
-
4
+ name: "{{name}}",
5
+ version: "{{version}}",
6
+ description: "{{description}}",
7
+
8
8
  commands: {
9
- directory: './packages/core/src/commands'
9
+ directory: "./packages/core/src/commands",
10
10
  },
11
-
11
+
12
12
  plugins: [],
13
13
 
14
14
  build: {
15
- entry: './packages/core/src/index.ts',
16
- outdir: './packages/core/dist',
17
- targets: ['darwin-arm64', 'darwin-x64', 'linux-x64', 'windows-x64'],
15
+ entry: "./packages/core/src/index.ts",
16
+ outdir: "./packages/core/dist",
17
+ targets: ["darwin-arm64", "darwin-x64", "linux-x64", "windows-x64"],
18
18
  minify: true,
19
19
  compress: true,
20
- sourcemap: true
20
+ sourcemap: true,
21
21
  },
22
-
22
+
23
23
  dev: {
24
24
  watch: true,
25
- inspect: false
25
+ inspect: false,
26
26
  },
27
-
27
+
28
28
  test: {
29
- pattern: ['**/*.test.ts', '**/*.spec.ts'],
29
+ pattern: ["**/*.test.ts", "**/*.spec.ts"],
30
30
  coverage: true,
31
- watch: false
31
+ watch: false,
32
32
  },
33
-
33
+
34
34
  workspace: {
35
- packages: ['./packages/*'],
36
- versionStrategy: 'fixed'
37
- }
38
- })
35
+ packages: ["./packages/*"],
36
+ versionStrategy: "fixed",
37
+ },
38
+ });
@@ -2,12 +2,12 @@
2
2
  "name": "{{name}}",
3
3
  "version": "0.0.0",
4
4
  "private": true,
5
- "type": "module",
6
5
  "description": "{{description}}",
7
6
  "author": "{{author}}",
8
7
  "workspaces": [
9
8
  "packages/*"
10
9
  ],
10
+ "type": "module",
11
11
  "scripts": {
12
12
  "postinstall": "bunli generate",
13
13
  "dev": "turbo run dev",
@@ -22,8 +22,9 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@changesets/cli": "^2.27.0",
25
+ "@tsconfig/bun": "catalog:",
25
26
  "@types/bun": "latest",
26
27
  "turbo": "latest",
27
28
  "typescript": "^5.0.0"
28
29
  }
29
- }
30
+ }
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@{{name}}/cli",
3
3
  "version": "0.1.0",
4
- "type": "module",
5
4
  "description": "CLI for {{name}}",
6
- "author": "{{author}}",
7
5
  "license": "MIT",
6
+ "author": "{{author}}",
8
7
  "bin": {
9
8
  "{{name}}": "./dist/index.js"
10
9
  },
10
+ "type": "module",
11
11
  "scripts": {
12
12
  "postinstall": "bunli generate",
13
13
  "dev": "bun run src/index.ts",
14
14
  "build": "bunli build",
15
15
  "test": "bun test",
16
- "typecheck": "tsc --noEmit",
16
+ "typecheck": "tsgo --noEmit",
17
17
  "clean": "rm -rf dist"
18
18
  },
19
19
  "dependencies": {
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@bunli/test": "latest",
26
+ "@tsconfig/bun": "catalog:",
26
27
  "@types/bun": "latest",
27
28
  "bunli": "latest",
28
29
  "typescript": "^5.0.0"
@@ -30,6 +31,10 @@
30
31
  "bunli": {
31
32
  "entry": "./src/index.ts",
32
33
  "outDir": "./dist",
33
- "external": ["@bunli/core", "@{{name}}/core", "@{{name}}/utils"]
34
+ "external": [
35
+ "@bunli/core",
36
+ "@{{name}}/core",
37
+ "@{{name}}/utils"
38
+ ]
34
39
  }
35
- }
40
+ }
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env bun
2
- import { createCLI } from '@bunli/core'
3
- import { logger } from '@{{name}}/utils'
4
- import { processCommand, analyzeCommand } from '@{{name}}/core'
2
+ import { createCLI } from "@bunli/core";
3
+ import { processCommand, analyzeCommand } from "@{{name}}/core";
4
+ import { logger } from "@{{name}}/utils";
5
5
 
6
6
  const cli = await createCLI({
7
- name: '{{name}}',
8
- version: '0.1.0',
9
- description: '{{description}}'
10
- })
7
+ name: "{{name}}",
8
+ version: "0.1.0",
9
+ description: "{{description}}",
10
+ });
11
11
 
12
12
  // Add commands
13
- cli.command(processCommand)
14
- cli.command(analyzeCommand)
13
+ cli.command(processCommand);
14
+ cli.command(analyzeCommand);
15
15
 
16
16
  // Run CLI
17
17
  try {
18
- await cli.run()
18
+ await cli.run();
19
19
  } catch (error) {
20
- logger.error('CLI failed:', error)
21
- process.exit(1)
22
- }
20
+ logger.error("CLI failed:", error);
21
+ process.exit(1);
22
+ }