create-bunli 0.8.0 → 0.8.2

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 (104) hide show
  1. package/README.md +18 -6
  2. package/dist/cli.js +589 -560
  3. package/dist/create-project.d.ts +4 -4
  4. package/dist/create-project.d.ts.map +1 -1
  5. package/dist/create.d.ts +3 -3
  6. package/dist/create.d.ts.map +1 -1
  7. package/dist/index.d.ts +5 -5
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +518 -512
  10. package/dist/steps.d.ts +5 -5
  11. package/dist/steps.d.ts.map +1 -1
  12. package/dist/template-engine.d.ts +2 -2
  13. package/dist/template-engine.d.ts.map +1 -1
  14. package/dist/templates/advanced/README.md +8 -4
  15. package/dist/templates/advanced/bunli.config.ts +19 -19
  16. package/dist/templates/advanced/package.json +8 -4
  17. package/dist/templates/advanced/src/commands/config.ts +129 -119
  18. package/dist/templates/advanced/src/commands/init.ts +53 -60
  19. package/dist/templates/advanced/src/commands/serve.ts +77 -83
  20. package/dist/templates/advanced/src/commands/validate.ts +58 -66
  21. package/dist/templates/advanced/src/index.ts +30 -29
  22. package/dist/templates/advanced/src/utils/config.ts +48 -47
  23. package/dist/templates/advanced/src/utils/constants.ts +6 -6
  24. package/dist/templates/advanced/src/utils/glob.ts +29 -28
  25. package/dist/templates/advanced/src/utils/validator.ts +60 -61
  26. package/dist/templates/advanced/template.json +2 -6
  27. package/dist/templates/advanced/tsconfig.json +1 -1
  28. package/dist/templates/basic/README.md +1 -1
  29. package/dist/templates/basic/bunli.config.ts +17 -17
  30. package/dist/templates/basic/package.json +3 -3
  31. package/dist/templates/basic/src/commands/hello.ts +20 -26
  32. package/dist/templates/basic/src/index.ts +9 -8
  33. package/dist/templates/basic/template.json +2 -6
  34. package/dist/templates/basic/tsconfig.json +1 -1
  35. package/dist/templates/monorepo/README.md +1 -1
  36. package/dist/templates/monorepo/bunli.config.ts +21 -21
  37. package/dist/templates/monorepo/package.json +3 -3
  38. package/dist/templates/monorepo/packages/cli/package.json +9 -5
  39. package/dist/templates/monorepo/packages/cli/src/index.ts +13 -13
  40. package/dist/templates/monorepo/packages/cli/tsconfig.json +2 -5
  41. package/dist/templates/monorepo/packages/core/package.json +4 -4
  42. package/dist/templates/monorepo/packages/core/scripts/build.ts +10 -10
  43. package/dist/templates/monorepo/packages/core/src/commands/analyze.ts +58 -57
  44. package/dist/templates/monorepo/packages/core/src/commands/process.ts +39 -47
  45. package/dist/templates/monorepo/packages/core/src/index.ts +3 -3
  46. package/dist/templates/monorepo/packages/core/src/types.ts +15 -15
  47. package/dist/templates/monorepo/packages/core/tsconfig.json +2 -4
  48. package/dist/templates/monorepo/packages/utils/package.json +4 -4
  49. package/dist/templates/monorepo/packages/utils/scripts/build.ts +10 -10
  50. package/dist/templates/monorepo/packages/utils/src/format.ts +19 -19
  51. package/dist/templates/monorepo/packages/utils/src/index.ts +3 -3
  52. package/dist/templates/monorepo/packages/utils/src/json.ts +4 -4
  53. package/dist/templates/monorepo/packages/utils/src/logger.ts +9 -9
  54. package/dist/templates/monorepo/packages/utils/tsconfig.json +1 -1
  55. package/dist/templates/monorepo/template.json +2 -6
  56. package/dist/templates/monorepo/tsconfig.json +1 -1
  57. package/dist/templates/monorepo/turbo.json +1 -1
  58. package/dist/types.d.ts +1 -1
  59. package/dist/types.d.ts.map +1 -1
  60. package/package.json +28 -28
  61. package/templates/advanced/README.md +8 -4
  62. package/templates/advanced/bunli.config.ts +19 -19
  63. package/templates/advanced/package.json +8 -4
  64. package/templates/advanced/src/commands/config.ts +129 -119
  65. package/templates/advanced/src/commands/init.ts +53 -60
  66. package/templates/advanced/src/commands/serve.ts +77 -83
  67. package/templates/advanced/src/commands/validate.ts +58 -66
  68. package/templates/advanced/src/index.ts +30 -29
  69. package/templates/advanced/src/utils/config.ts +48 -47
  70. package/templates/advanced/src/utils/constants.ts +6 -6
  71. package/templates/advanced/src/utils/glob.ts +29 -28
  72. package/templates/advanced/src/utils/validator.ts +60 -61
  73. package/templates/advanced/template.json +2 -6
  74. package/templates/advanced/tsconfig.json +1 -1
  75. package/templates/basic/README.md +1 -1
  76. package/templates/basic/bunli.config.ts +17 -17
  77. package/templates/basic/package.json +3 -3
  78. package/templates/basic/src/commands/hello.ts +20 -26
  79. package/templates/basic/src/index.ts +9 -8
  80. package/templates/basic/template.json +2 -6
  81. package/templates/basic/tsconfig.json +1 -1
  82. package/templates/monorepo/README.md +1 -1
  83. package/templates/monorepo/bunli.config.ts +21 -21
  84. package/templates/monorepo/package.json +3 -3
  85. package/templates/monorepo/packages/cli/package.json +9 -5
  86. package/templates/monorepo/packages/cli/src/index.ts +13 -13
  87. package/templates/monorepo/packages/cli/tsconfig.json +2 -5
  88. package/templates/monorepo/packages/core/package.json +4 -4
  89. package/templates/monorepo/packages/core/scripts/build.ts +10 -10
  90. package/templates/monorepo/packages/core/src/commands/analyze.ts +58 -57
  91. package/templates/monorepo/packages/core/src/commands/process.ts +39 -47
  92. package/templates/monorepo/packages/core/src/index.ts +3 -3
  93. package/templates/monorepo/packages/core/src/types.ts +15 -15
  94. package/templates/monorepo/packages/core/tsconfig.json +2 -4
  95. package/templates/monorepo/packages/utils/package.json +4 -4
  96. package/templates/monorepo/packages/utils/scripts/build.ts +10 -10
  97. package/templates/monorepo/packages/utils/src/format.ts +19 -19
  98. package/templates/monorepo/packages/utils/src/index.ts +3 -3
  99. package/templates/monorepo/packages/utils/src/json.ts +4 -4
  100. package/templates/monorepo/packages/utils/src/logger.ts +9 -9
  101. package/templates/monorepo/packages/utils/tsconfig.json +1 -1
  102. package/templates/monorepo/template.json +2 -6
  103. package/templates/monorepo/tsconfig.json +1 -1
  104. package/templates/monorepo/turbo.json +1 -1
@@ -1,84 +1,85 @@
1
- import { CONFIG_FILE_NAME, DEFAULT_CONFIG } from './constants.js'
2
- import path from 'node:path'
1
+ import path from "node:path";
2
+
3
+ import { CONFIG_FILE_NAME, DEFAULT_CONFIG } from "./constants.js";
3
4
 
4
5
  export interface Config {
5
- rules?: Record<string, any>
6
+ rules?: Record<string, any>;
6
7
  server?: {
7
- port?: number
8
- host?: string
9
- open?: boolean
10
- cors?: boolean
11
- }
12
- include?: string[]
13
- exclude?: string[]
8
+ port?: number;
9
+ host?: string;
10
+ open?: boolean;
11
+ cors?: boolean;
12
+ };
13
+ include?: string[];
14
+ exclude?: string[];
14
15
  cache?: {
15
- enabled?: boolean
16
- directory?: string
17
- }
16
+ enabled?: boolean;
17
+ directory?: string;
18
+ };
18
19
  hooks?: {
19
- beforeValidate?: (files: string[]) => Promise<void>
20
- afterValidate?: (results: any) => Promise<void>
21
- }
20
+ beforeValidate?: (files: string[]) => Promise<void>;
21
+ afterValidate?: (results: any) => Promise<void>;
22
+ };
22
23
  }
23
24
 
24
- let cachedConfig: Config | null = null
25
+ let cachedConfig: Config | null = null;
25
26
 
26
27
  export async function loadConfig(configPath?: string): Promise<Config> {
27
28
  // Return cached config if available
28
29
  if (cachedConfig && !configPath) {
29
- return cachedConfig
30
+ return cachedConfig;
30
31
  }
31
-
32
- const finalPath = configPath || path.join(process.cwd(), CONFIG_FILE_NAME)
33
-
32
+
33
+ const finalPath = configPath || path.join(process.cwd(), CONFIG_FILE_NAME);
34
+
34
35
  try {
35
36
  // Check if config file exists
36
- const file = Bun.file(finalPath)
37
+ const file = Bun.file(finalPath);
37
38
  if (!(await file.exists())) {
38
- return DEFAULT_CONFIG
39
+ return DEFAULT_CONFIG;
39
40
  }
40
-
41
+
41
42
  // Import the config file
42
- const configModule = await import(finalPath)
43
- const config = configModule.default || configModule
44
-
43
+ const configModule = await import(finalPath);
44
+ const config = configModule.default || configModule;
45
+
45
46
  // Merge with defaults
46
47
  const mergedConfig: Config = {
47
48
  ...DEFAULT_CONFIG,
48
49
  ...config,
49
50
  server: {
50
51
  ...DEFAULT_CONFIG.server,
51
- ...(config.server || {})
52
- }
53
- }
52
+ ...(config.server || {}),
53
+ },
54
+ };
54
55
 
55
- cachedConfig = mergedConfig
56
- return mergedConfig
56
+ cachedConfig = mergedConfig;
57
+ return mergedConfig;
57
58
  } catch (error) {
58
- console.warn(`Failed to load config from ${finalPath}:`, error)
59
- return DEFAULT_CONFIG
59
+ console.warn(`Failed to load config from ${finalPath}:`, error);
60
+ return DEFAULT_CONFIG;
60
61
  }
61
62
  }
62
63
 
63
64
  export async function saveConfig(config: Config): Promise<void> {
64
- const configPath = path.join(process.cwd(), CONFIG_FILE_NAME)
65
-
65
+ const configPath = path.join(process.cwd(), CONFIG_FILE_NAME);
66
+
66
67
  // Convert config to ES module format
67
- const content = `export default ${JSON.stringify(config, null, 2)}`
68
-
69
- await Bun.write(configPath, content)
70
-
68
+ const content = `export default ${JSON.stringify(config, null, 2)}`;
69
+
70
+ await Bun.write(configPath, content);
71
+
71
72
  // Clear cache
72
- cachedConfig = null
73
+ cachedConfig = null;
73
74
  }
74
75
 
75
76
  export async function getConfigPath(): Promise<string> {
76
- const configPath = path.join(process.cwd(), CONFIG_FILE_NAME)
77
- const file = Bun.file(configPath)
78
-
77
+ const configPath = path.join(process.cwd(), CONFIG_FILE_NAME);
78
+ const file = Bun.file(configPath);
79
+
79
80
  if (await file.exists()) {
80
- return configPath
81
+ return configPath;
81
82
  }
82
-
83
- return 'No config file found'
83
+
84
+ return "No config file found";
84
85
  }
@@ -1,12 +1,12 @@
1
- export const CONFIG_FILE_NAME = '{{name}}.config.js'
1
+ export const CONFIG_FILE_NAME = "{{name}}.config.js";
2
2
 
3
3
  export const DEFAULT_CONFIG = {
4
4
  rules: {},
5
5
  server: {
6
6
  port: 3000,
7
- host: 'localhost',
8
- open: true
7
+ host: "localhost",
8
+ open: true,
9
9
  },
10
- include: ['src/**/*.{js,ts}'],
11
- exclude: ['node_modules', 'dist']
12
- }
10
+ include: ["src/**/*.{js,ts}"],
11
+ exclude: ["node_modules", "dist"],
12
+ };
@@ -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,12 +1,12 @@
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",
@@ -18,8 +18,8 @@
18
18
  "@bunli/core": "latest"
19
19
  },
20
20
  "devDependencies": {
21
- "@tsconfig/bun": "catalog:",
22
21
  "@bunli/test": "latest",
22
+ "@tsconfig/bun": "1.0.10",
23
23
  "@types/bun": "latest",
24
24
  "bunli": "latest",
25
25
  "typescript": "^5.0.0"
@@ -28,4 +28,4 @@
28
28
  "entry": "./src/index.ts",
29
29
  "outDir": "./dist"
30
30
  }
31
- }
31
+ }
@@ -1,32 +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
- argumentKind: 'flag'
21
- }
22
- )
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
+ }),
23
17
  },
24
18
  handler: async ({ flags, colors }) => {
25
- const greeting = `Hello, ${flags.name}`
26
- const message = flags.excited ? `${greeting}!` : `${greeting}.`
27
-
28
- console.log(colors.green(message))
29
- }
30
- })
19
+ const greeting = `Hello, ${flags.name}`;
20
+ const message = flags.excited ? `${greeting}!` : `${greeting}.`;
31
21
 
32
- 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