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,5 +1,5 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "@tsconfig/bun/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
5
  "rootDir": "./src",
@@ -8,8 +8,5 @@
8
8
  },
9
9
  "include": ["src/**/*"],
10
10
  "exclude": ["node_modules", "dist", "test/**/*"],
11
- "references": [
12
- { "path": "../core" },
13
- { "path": "../utils" }
14
- ]
15
- }
11
+ "references": [{ "path": "../core" }, { "path": "../utils" }]
12
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@{{name}}/core",
3
3
  "version": "0.1.0",
4
- "type": "module",
5
4
  "description": "Core functionality for {{name}}",
6
- "author": "{{author}}",
7
5
  "license": "MIT",
6
+ "author": "{{author}}",
7
+ "type": "module",
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
10
  "exports": {
@@ -14,9 +14,9 @@
14
14
  }
15
15
  },
16
16
  "scripts": {
17
- "build": "bun scripts/build.ts && bun run tsc",
17
+ "build": "bun scripts/build.ts && bun run tsgo",
18
18
  "test": "bun test",
19
- "typecheck": "tsc --noEmit",
19
+ "typecheck": "tsgo --noEmit",
20
20
  "clean": "rm -rf dist"
21
21
  },
22
22
  "dependencies": {
@@ -26,7 +26,8 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@bunli/test": "latest",
29
+ "@tsconfig/bun": "catalog:",
29
30
  "@types/bun": "latest",
30
31
  "typescript": "^5.0.0"
31
32
  }
32
- }
33
+ }
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env bun
2
- import { $ } from 'bun'
2
+ import { $ } from "bun";
3
3
 
4
4
  // Clean dist directory
5
- await $`rm -rf dist`
6
- await $`mkdir -p dist`
5
+ await $`rm -rf dist`;
6
+ await $`mkdir -p dist`;
7
7
 
8
8
  // Build TypeScript files
9
9
  await Bun.build({
10
- entrypoints: ['./src/index.ts'],
11
- outdir: './dist',
12
- target: 'bun',
13
- format: 'esm',
10
+ entrypoints: ["./src/index.ts"],
11
+ outdir: "./dist",
12
+ target: "bun",
13
+ format: "esm",
14
14
  minify: false,
15
- external: ['@bunli/core', '@{{name}}/utils', 'zod']
16
- })
15
+ external: ["@bunli/core", "@{{name}}/utils", "zod"],
16
+ });
17
17
 
18
- console.log('✅ @{{name}}/core built successfully')
18
+ console.log("✅ @{{name}}/core built successfully");
@@ -1,91 +1,93 @@
1
- import { defineCommand, option } from '@bunli/core'
2
- import { z } from 'zod'
3
- import { logger, formatTable } from '@{{name}}/utils'
4
- import type { AnalyzeResult } from '../types.js'
1
+ import { defineCommand, option } from "@bunli/core";
2
+ import { logger, formatTable } from "@{{name}}/utils";
3
+ import { z } from "zod";
4
+
5
+ import type { AnalyzeResult } from "../types.js";
5
6
 
6
7
  const analyzeCommand = defineCommand({
7
- name: 'analyze',
8
- description: 'Analyze files and generate reports',
8
+ name: "analyze",
9
+ description: "Analyze files and generate reports",
9
10
  options: {
10
- detailed: option(
11
- z.boolean().default(false),
12
- {
13
- short: 'd',
14
- description: 'Show detailed analysis'
15
- }
16
- )
11
+ detailed: option(z.boolean().default(false), {
12
+ short: "d",
13
+ description: "Show detailed analysis",
14
+ argumentKind: "flag",
15
+ }),
17
16
  },
18
17
  handler: async ({ positional, flags, colors }) => {
19
- const files = positional
18
+ const files = positional;
20
19
  if (files.length === 0) {
21
- logger.error('Usage: analyze <file...>')
22
- process.exit(1)
20
+ logger.error("Usage: analyze <file...>");
21
+ process.exit(1);
23
22
  }
24
23
 
25
- logger.info('Starting analysis...')
26
-
27
- const results: AnalyzeResult[] = []
28
-
24
+ logger.info("Starting analysis...");
25
+
26
+ const results: AnalyzeResult[] = [];
27
+
29
28
  for (const file of files) {
30
29
  try {
31
- const result = await analyzeFile(file)
32
- results.push(result)
30
+ const result = await analyzeFile(file);
31
+ results.push(result);
33
32
  } catch (error) {
34
- logger.error(`Failed to analyze ${file}:`, error)
33
+ logger.error(`Failed to analyze ${file}:`, error);
35
34
  }
36
35
  }
37
-
36
+
38
37
  // Display results
39
- console.log()
40
- console.log(colors.bold('Analysis Results:'))
41
- console.log()
42
-
43
- const tableData = results.map(r => ({
38
+ console.log();
39
+ console.log(colors.bold("Analysis Results:"));
40
+ console.log();
41
+
42
+ const tableData = results.map((r) => ({
44
43
  File: r.file,
45
44
  Lines: r.metrics.lines,
46
45
  Words: r.metrics.words,
47
- Issues: r.issues.length
48
- }))
49
-
50
- console.log(formatTable(tableData))
51
-
46
+ Issues: r.issues.length,
47
+ }));
48
+
49
+ console.log(formatTable(tableData));
50
+
52
51
  if (flags.detailed) {
53
- console.log()
54
- console.log(colors.bold('Detailed Issues:'))
55
-
52
+ console.log();
53
+ console.log(colors.bold("Detailed Issues:"));
54
+
56
55
  for (const result of results) {
57
56
  if (result.issues.length > 0) {
58
- console.log()
59
- console.log(colors.underline(result.file))
60
-
57
+ console.log();
58
+ console.log(colors.underline(result.file));
59
+
61
60
  for (const issue of result.issues) {
62
- const icon = issue.type === 'error' ? '' :
63
- issue.type === 'warning' ? '⚠' : 'ℹ'
64
- const color = issue.type === 'error' ? colors.red :
65
- issue.type === 'warning' ? colors.yellow : colors.blue
66
-
67
- console.log(color(` ${icon} ${issue.line}:${issue.column} ${issue.message}`))
61
+ const icon = issue.type === "error" ? "" : issue.type === "warning" ? "⚠" : "ℹ";
62
+ const color =
63
+ issue.type === "error"
64
+ ? colors.red
65
+ : issue.type === "warning"
66
+ ? colors.yellow
67
+ : colors.blue;
68
+
69
+ console.log(color(` ${icon} ${issue.line}:${issue.column} ${issue.message}`));
68
70
  }
69
71
  }
70
72
  }
71
73
  }
72
- }
73
- })
74
+ },
75
+ });
74
76
 
75
77
  async function analyzeFile(file: string): Promise<AnalyzeResult> {
76
- const content = await Bun.file(file).text()
77
- const lines = content.split('\n')
78
- const words = content.split(/\\s+/).filter(w => w.length > 0)
79
-
78
+ const content = await Bun.file(file).text();
79
+ const lines = content.split("\n");
80
+ const words = content.split(/\\s+/).filter((w) => w.length > 0);
81
+
80
82
  return {
81
83
  file,
82
84
  metrics: {
83
85
  lines: lines.length,
84
86
  characters: content.length,
85
- words: words.length
87
+ words: words.length,
86
88
  },
87
- issues: []
88
- }
89
+ issues: [],
90
+ };
89
91
  }
90
92
 
91
- export default analyzeCommand
93
+ export default analyzeCommand;
@@ -1,71 +1,64 @@
1
- import { defineCommand, option } from '@bunli/core'
2
- import { z } from 'zod'
3
- import { logger } from '@{{name}}/utils'
4
- import type { ProcessOptions } from '../types.js'
1
+ import { defineCommand, option } from "@bunli/core";
2
+ import { logger } from "@{{name}}/utils";
3
+ import { z } from "zod";
4
+
5
+ import type { ProcessOptions } from "../types.js";
5
6
 
6
7
  const processCommand = defineCommand({
7
- name: 'process',
8
- description: 'Process input files',
8
+ name: "process",
9
+ description: "Process input files",
9
10
  options: {
10
- output: option(
11
- z.string().optional(),
12
- {
13
- short: 'o',
14
- description: 'Output directory'
15
- }
16
- ),
17
- format: option(
18
- z.enum(['json', 'yaml', 'text']).default('json'),
19
- {
20
- short: 'f',
21
- description: 'Output format'
22
- }
23
- ),
24
- verbose: option(
25
- z.boolean().default(false),
26
- {
27
- short: 'v',
28
- description: 'Verbose output'
29
- }
30
- )
11
+ output: option(z.string().optional(), {
12
+ short: "o",
13
+ description: "Output directory",
14
+ }),
15
+ format: option(z.enum(["json", "yaml", "text"]).default("json"), {
16
+ short: "f",
17
+ description: "Output format",
18
+ }),
19
+ verbose: option(z.boolean().default(false), {
20
+ short: "v",
21
+ description: "Verbose output",
22
+ argumentKind: "flag",
23
+ }),
31
24
  },
32
25
  handler: async ({ positional, flags, spinner }) => {
33
- const files = positional
26
+ const files = positional;
34
27
  if (files.length === 0) {
35
- logger.error('Usage: process <file...>')
36
- process.exit(1)
28
+ logger.error("Usage: process <file...>");
29
+ process.exit(1);
37
30
  }
38
31
 
39
- const spin = spinner('Processing files...')
40
- spin.start()
41
-
32
+ const spin = spinner("Processing files...");
33
+ spin.start();
34
+
42
35
  try {
43
36
  for (const file of files) {
44
37
  if (flags.verbose) {
45
- logger.info(`Processing ${file}`)
38
+ logger.info(`Processing ${file}`);
46
39
  }
47
-
40
+
48
41
  // Process logic here
49
42
  await processFile(file, {
50
43
  input: file,
51
44
  output: flags.output,
52
45
  format: flags.format,
53
- verbose: flags.verbose
54
- })
46
+ verbose: flags.verbose,
47
+ });
55
48
  }
56
-
57
- spin.succeed(`Processed ${files.length} files`)
49
+
50
+ spin.succeed(`Processed ${files.length} files`);
58
51
  } catch (error) {
59
- spin.fail('Processing failed')
60
- logger.error(error)
61
- process.exit(1)
52
+ spin.fail("Processing failed");
53
+ logger.error(error);
54
+ process.exit(1);
62
55
  }
63
- }
64
- })
56
+ },
57
+ });
65
58
 
66
59
  async function processFile(file: string, options: ProcessOptions): Promise<void> {
67
60
  // Implementation here
68
- logger.debug(`Processing ${file} with options:`, options)
61
+ logger.debug(`Processing ${file} with options:`, options);
69
62
  }
70
63
 
71
- export default processCommand
64
+ export default processCommand;
@@ -1,3 +1,3 @@
1
- export { default as processCommand } from './commands/process.js'
2
- export { default as analyzeCommand } from './commands/analyze.js'
3
- export type { ProcessOptions, AnalyzeResult } from './types.js'
1
+ export { default as processCommand } from "./commands/process.js";
2
+ export { default as analyzeCommand } from "./commands/analyze.js";
3
+ export type { ProcessOptions, AnalyzeResult } from "./types.js";
@@ -1,21 +1,21 @@
1
1
  export interface ProcessOptions {
2
- input: string
3
- output?: string
4
- format?: 'json' | 'yaml' | 'text'
5
- verbose?: boolean
2
+ input: string;
3
+ output?: string;
4
+ format?: "json" | "yaml" | "text";
5
+ verbose?: boolean;
6
6
  }
7
7
 
8
8
  export interface AnalyzeResult {
9
- file: string
9
+ file: string;
10
10
  metrics: {
11
- lines: number
12
- characters: number
13
- words: number
14
- }
11
+ lines: number;
12
+ characters: number;
13
+ words: number;
14
+ };
15
15
  issues: Array<{
16
- type: 'error' | 'warning' | 'info'
17
- line: number
18
- column: number
19
- message: string
20
- }>
21
- }
16
+ type: "error" | "warning" | "info";
17
+ line: number;
18
+ column: number;
19
+ message: string;
20
+ }>;
21
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "@tsconfig/bun/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
5
  "rootDir": "./src",
@@ -9,7 +9,5 @@
9
9
  },
10
10
  "include": ["src/**/*"],
11
11
  "exclude": ["node_modules", "dist", "test/**/*"],
12
- "references": [
13
- { "path": "../utils" }
14
- ]
15
- }
12
+ "references": [{ "path": "../utils" }]
13
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@{{name}}/utils",
3
3
  "version": "0.1.0",
4
- "type": "module",
5
4
  "description": "Shared utilities for {{name}}",
6
- "author": "{{author}}",
7
5
  "license": "MIT",
6
+ "author": "{{author}}",
7
+ "type": "module",
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
10
  "exports": {
@@ -14,13 +14,14 @@
14
14
  }
15
15
  },
16
16
  "scripts": {
17
- "build": "bun scripts/build.ts && bun run tsc",
17
+ "build": "bun scripts/build.ts && bun run tsgo",
18
18
  "test": "bun test",
19
- "typecheck": "tsc --noEmit",
19
+ "typecheck": "tsgo --noEmit",
20
20
  "clean": "rm -rf dist"
21
21
  },
22
22
  "devDependencies": {
23
+ "@tsconfig/bun": "catalog:",
23
24
  "@types/bun": "latest",
24
25
  "typescript": "^5.0.0"
25
26
  }
26
- }
27
+ }
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env bun
2
- import { $ } from 'bun'
2
+ import { $ } from "bun";
3
3
 
4
4
  // Clean dist directory
5
- await $`rm -rf dist`
6
- await $`mkdir -p dist`
5
+ await $`rm -rf dist`;
6
+ await $`mkdir -p dist`;
7
7
 
8
8
  // Build TypeScript files
9
9
  await Bun.build({
10
- entrypoints: ['./src/index.ts'],
11
- outdir: './dist',
12
- target: 'bun',
13
- format: 'esm',
14
- minify: false
15
- })
10
+ entrypoints: ["./src/index.ts"],
11
+ outdir: "./dist",
12
+ target: "bun",
13
+ format: "esm",
14
+ minify: false,
15
+ });
16
16
 
17
- console.log('✅ @{{name}}/utils built successfully')
17
+ console.log("✅ @{{name}}/utils built successfully");
@@ -1,27 +1,27 @@
1
1
  export function formatTable(data: Record<string, any>[]): string {
2
- if (data.length === 0) return ''
3
-
4
- const headers = Object.keys(data[0])
5
- const rows = data.map(item => headers.map(h => String(item[h] ?? '')))
6
-
2
+ if (data.length === 0) return "";
3
+
4
+ const headers = Object.keys(data[0]);
5
+ const rows = data.map((item) => headers.map((h) => String(item[h] ?? "")));
6
+
7
7
  // Calculate column widths
8
8
  const widths = headers.map((h, i) => {
9
- const headerWidth = h.length
10
- const maxDataWidth = Math.max(...rows.map(r => r[i].length))
11
- return Math.max(headerWidth, maxDataWidth)
12
- })
13
-
9
+ const headerWidth = h.length;
10
+ const maxDataWidth = Math.max(...rows.map((r) => r[i].length));
11
+ return Math.max(headerWidth, maxDataWidth);
12
+ });
13
+
14
14
  // Build table
15
- const lines: string[] = []
16
-
15
+ const lines: string[] = [];
16
+
17
17
  // Header
18
- lines.push(headers.map((h, i) => h.padEnd(widths[i])).join(' '))
19
- lines.push(widths.map(w => '-'.repeat(w)).join(' '))
20
-
18
+ lines.push(headers.map((h, i) => h.padEnd(widths[i])).join(" "));
19
+ lines.push(widths.map((w) => "-".repeat(w)).join(" "));
20
+
21
21
  // Rows
22
22
  for (const row of rows) {
23
- lines.push(row.map((cell, i) => cell.padEnd(widths[i])).join(' '))
23
+ lines.push(row.map((cell, i) => cell.padEnd(widths[i])).join(" "));
24
24
  }
25
-
26
- return lines.join('\\n')
27
- }
25
+
26
+ return lines.join("\\n");
27
+ }
@@ -1,3 +1,3 @@
1
- export { logger } from './logger.js'
2
- export { formatTable } from './format.js'
3
- export { parseJSON, stringifyJSON } from './json.js'
1
+ export { logger } from "./logger.js";
2
+ export { formatTable } from "./format.js";
3
+ export { parseJSON, stringifyJSON } from "./json.js";
@@ -1,11 +1,11 @@
1
1
  export function parseJSON<T = any>(text: string): T {
2
2
  try {
3
- return JSON.parse(text)
3
+ return JSON.parse(text);
4
4
  } catch (error) {
5
- throw new Error(`Invalid JSON: ${error}`)
5
+ throw new Error(`Invalid JSON: ${error}`);
6
6
  }
7
7
  }
8
8
 
9
9
  export function stringifyJSON(data: any, pretty = false): string {
10
- return JSON.stringify(data, null, pretty ? 2 : 0)
11
- }
10
+ return JSON.stringify(data, null, pretty ? 2 : 0);
11
+ }
@@ -1,19 +1,19 @@
1
1
  export const logger = {
2
2
  debug: (...args: any[]) => {
3
3
  if (process.env.DEBUG) {
4
- console.log('[DEBUG]', ...args)
4
+ console.log("[DEBUG]", ...args);
5
5
  }
6
6
  },
7
-
7
+
8
8
  info: (...args: any[]) => {
9
- console.log('[INFO]', ...args)
9
+ console.log("[INFO]", ...args);
10
10
  },
11
-
11
+
12
12
  warn: (...args: any[]) => {
13
- console.warn('[WARN]', ...args)
13
+ console.warn("[WARN]", ...args);
14
14
  },
15
-
15
+
16
16
  error: (...args: any[]) => {
17
- console.error('[ERROR]', ...args)
18
- }
19
- }
17
+ console.error("[ERROR]", ...args);
18
+ },
19
+ };
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "@tsconfig/bun/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
5
  "rootDir": "./src",
@@ -9,4 +9,4 @@
9
9
  },
10
10
  "include": ["src/**/*"],
11
11
  "exclude": ["node_modules", "dist", "test/**/*"]
12
- }
12
+ }
@@ -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
+ }
@@ -11,4 +11,4 @@
11
11
  "types": ["bun"]
12
12
  },
13
13
  "exclude": ["node_modules", "dist", "build", ".turbo"]
14
- }
14
+ }
@@ -25,4 +25,4 @@
25
25
  "cache": false
26
26
  }
27
27
  }
28
- }
28
+ }
package/dist/types.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface TemplateManifest {
30
30
  export interface TemplateVariable {
31
31
  name: string;
32
32
  message: string;
33
- type?: 'string' | 'boolean' | 'number' | 'select';
33
+ type?: "string" | "boolean" | "number" | "select";
34
34
  default?: any;
35
35
  choices?: Array<{
36
36
  label: string;
@@ -43,3 +43,4 @@ export interface Template {
43
43
  description: string;
44
44
  files: Record<string, string>;
45
45
  }
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;IACF,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAClD,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,GAAG,MAAM,CAAC;CAC7C;AAGD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B"}