create-bunli 0.1.3 โ†’ 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.
Files changed (35) hide show
  1. package/README.md +13 -0
  2. package/dist/cli.js +1 -1
  3. package/dist/templates/advanced/bunli.config.ts +29 -0
  4. package/dist/templates/advanced/package.json +1 -1
  5. package/dist/templates/advanced/tsconfig.json +1 -1
  6. package/dist/templates/basic/bunli.config.ts +29 -0
  7. package/dist/templates/basic/package.json +1 -1
  8. package/dist/templates/basic/tsconfig.json +1 -1
  9. package/dist/templates/monorepo/README.md +2 -2
  10. package/dist/templates/monorepo/bunli.config.ts +34 -0
  11. package/dist/templates/monorepo/package.json +1 -1
  12. package/dist/templates/monorepo/packages/cli/package.json +1 -1
  13. package/dist/templates/monorepo/packages/core/package.json +1 -1
  14. package/dist/templates/monorepo/packages/utils/package.json +1 -1
  15. package/dist/templates/monorepo/tsconfig.json +1 -1
  16. package/dist/templates/monorepo/turbo.json +1 -1
  17. package/package.json +6 -5
  18. package/templates/advanced/bunli.config.ts +29 -0
  19. package/templates/advanced/package.json +1 -1
  20. package/templates/advanced/tsconfig.json +1 -1
  21. package/templates/basic/bunli.config.ts +29 -0
  22. package/templates/basic/package.json +1 -1
  23. package/templates/basic/tsconfig.json +1 -1
  24. package/templates/monorepo/README.md +2 -2
  25. package/templates/monorepo/bunli.config.ts +34 -0
  26. package/templates/monorepo/package.json +1 -1
  27. package/templates/monorepo/packages/cli/package.json +1 -1
  28. package/templates/monorepo/packages/core/package.json +1 -1
  29. package/templates/monorepo/packages/utils/package.json +1 -1
  30. package/templates/monorepo/tsconfig.json +1 -1
  31. package/templates/monorepo/turbo.json +1 -1
  32. package/dist/templates/advanced/test/commands.test.ts +0 -34
  33. package/dist/templates/basic/test/hello.test.ts +0 -26
  34. package/templates/advanced/test/commands.test.ts +0 -34
  35. package/templates/basic/test/hello.test.ts +0 -26
package/README.md CHANGED
@@ -21,6 +21,7 @@ create-bunli my-cli
21
21
  - ๐Ÿงช **Testing included** - Comes with @bunli/test for CLI testing
22
22
  - ๐ŸŽจ **Best practices** - Follows Bunli conventions and patterns
23
23
  - ๐ŸŒ **Flexible sources** - Use bundled templates or any GitHub repository
24
+ - โšก **Type generation** - All templates include codegen for enhanced developer experience
24
25
 
25
26
  ## Usage
26
27
 
@@ -205,6 +206,18 @@ Templates can include a `template.json` manifest:
205
206
  }
206
207
  ```
207
208
 
209
+ ### Type Generation
210
+
211
+ All templates include type generation configuration for enhanced developer experience:
212
+
213
+ This provides:
214
+ - **Autocomplete** for command names and options
215
+ - **Type safety** at compile time
216
+ - **IntelliSense** for command metadata
217
+ - **CLI wrappers** for programmatic execution
218
+
219
+ Learn more in the [Type Generation Guide](/docs/guides/type-generation).
220
+
208
221
  ### Template Variables
209
222
 
210
223
  Use these variables in your template files:
package/dist/cli.js CHANGED
@@ -277,7 +277,7 @@ async function run() {
277
277
  } else if (args[0] && !args[0].startsWith("-") && args[0] !== "create") {
278
278
  process.argv.splice(2, 0, "create");
279
279
  }
280
- const cli = createCLI({
280
+ const cli = await createCLI({
281
281
  name: "create-bunli",
282
282
  version: "0.1.0",
283
283
  description: "Scaffold new Bunli CLI projects"
@@ -0,0 +1,29 @@
1
+ import { defineConfig } from '@bunli/core'
2
+
3
+ export default defineConfig({
4
+ name: '{{name}}',
5
+ version: '{{version}}',
6
+ description: '{{description}}',
7
+
8
+ plugins: [],
9
+
10
+ build: {
11
+ entry: './src/index.ts',
12
+ outdir: './dist',
13
+ targets: ['darwin-arm64', 'darwin-x64', 'linux-x64', 'windows-x64'],
14
+ minify: true,
15
+ sourcemap: true,
16
+ compress: true
17
+ },
18
+
19
+ dev: {
20
+ watch: true,
21
+ inspect: false
22
+ },
23
+
24
+ test: {
25
+ pattern: ['**/*.test.ts', '**/*.spec.ts'],
26
+ coverage: true,
27
+ watch: false
28
+ }
29
+ })
@@ -13,7 +13,7 @@
13
13
  "build": "bunli build",
14
14
  "test": "bun test",
15
15
  "test:watch": "bun test --watch",
16
- "type-check": "tsc --noEmit",
16
+ "typecheck": "tsc --noEmit",
17
17
  "lint": "tsc --noEmit",
18
18
  "prepare": "bun run build"
19
19
  },
@@ -12,7 +12,7 @@
12
12
  "declarationMap": true,
13
13
  "outDir": "./dist",
14
14
  "rootDir": "./src",
15
- "types": ["bun-types"],
15
+ "types": ["bun"],
16
16
  "noUnusedLocals": true,
17
17
  "noUnusedParameters": true,
18
18
  "noImplicitReturns": true,
@@ -0,0 +1,29 @@
1
+ import { defineConfig } from '@bunli/core'
2
+
3
+ export default defineConfig({
4
+ name: '{{name}}',
5
+ version: '{{version}}',
6
+ description: '{{description}}',
7
+
8
+ build: {
9
+ entry: './src/index.ts',
10
+ outdir: './dist',
11
+ targets: ['native'],
12
+ minify: true,
13
+ sourcemap: true,
14
+ compress: false
15
+ },
16
+
17
+ dev: {
18
+ watch: true,
19
+ inspect: true
20
+ },
21
+
22
+ test: {
23
+ pattern: ['**/*.test.ts', '**/*.spec.ts'],
24
+ coverage: true,
25
+ watch: false
26
+ },
27
+
28
+ plugins: [],
29
+ })
@@ -11,7 +11,7 @@
11
11
  "dev": "bun run src/index.ts",
12
12
  "build": "bunli build",
13
13
  "test": "bun test",
14
- "type-check": "tsc --noEmit"
14
+ "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "dependencies": {
17
17
  "@bunli/core": "latest"
@@ -12,7 +12,7 @@
12
12
  "declarationMap": true,
13
13
  "outDir": "./dist",
14
14
  "rootDir": "./src",
15
- "types": ["bun-types"]
15
+ "types": ["bun"]
16
16
  },
17
17
  "include": ["src/**/*"],
18
18
  "exclude": ["node_modules", "dist", "test/**/*"]
@@ -32,7 +32,7 @@ bun run build
32
32
  bun test
33
33
 
34
34
  # Type check
35
- bun run type-check
35
+ bun run typecheck
36
36
  ```
37
37
 
38
38
  ## Creating a New Package
@@ -62,7 +62,7 @@ bun run release
62
62
  - `dev` - Run all packages in development mode
63
63
  - `build` - Build all packages
64
64
  - `test` - Run all tests
65
- - `type-check` - Type check all packages
65
+ - `typecheck` - Type check all packages
66
66
  - `lint` - Lint all packages
67
67
  - `clean` - Clean all build artifacts
68
68
  - `changeset` - Create a new changeset
@@ -0,0 +1,34 @@
1
+ import { defineConfig } from '@bunli/core'
2
+
3
+ export default defineConfig({
4
+ name: '{{name}}',
5
+ version: '{{version}}',
6
+ description: '{{description}}',
7
+
8
+ plugins: [],
9
+
10
+ build: {
11
+ entry: './packages/core/src/index.ts',
12
+ outdir: './packages/core/dist',
13
+ targets: ['darwin-arm64', 'darwin-x64', 'linux-x64', 'windows-x64'],
14
+ minify: true,
15
+ compress: true,
16
+ sourcemap: true
17
+ },
18
+
19
+ dev: {
20
+ watch: true,
21
+ inspect: false
22
+ },
23
+
24
+ test: {
25
+ pattern: ['**/*.test.ts', '**/*.spec.ts'],
26
+ coverage: true,
27
+ watch: false
28
+ },
29
+
30
+ workspace: {
31
+ packages: ['./packages/*'],
32
+ versionStrategy: 'fixed'
33
+ }
34
+ })
@@ -12,7 +12,7 @@
12
12
  "dev": "turbo run dev",
13
13
  "build": "turbo run build",
14
14
  "test": "turbo run test",
15
- "type-check": "turbo run type-check",
15
+ "typecheck": "turbo run typecheck",
16
16
  "lint": "turbo run lint",
17
17
  "clean": "turbo run clean && rm -rf node_modules",
18
18
  "changeset": "changeset",
@@ -12,7 +12,7 @@
12
12
  "dev": "bun run src/index.ts",
13
13
  "build": "bunli build",
14
14
  "test": "bun test",
15
- "type-check": "tsc --noEmit",
15
+ "typecheck": "tsc --noEmit",
16
16
  "clean": "rm -rf dist"
17
17
  },
18
18
  "dependencies": {
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "bun scripts/build.ts && bun run tsc",
18
18
  "test": "bun test",
19
- "type-check": "tsc --noEmit",
19
+ "typecheck": "tsc --noEmit",
20
20
  "clean": "rm -rf dist"
21
21
  },
22
22
  "dependencies": {
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "bun scripts/build.ts && bun run tsc",
18
18
  "test": "bun test",
19
- "type-check": "tsc --noEmit",
19
+ "typecheck": "tsc --noEmit",
20
20
  "clean": "rm -rf dist"
21
21
  },
22
22
  "devDependencies": {
@@ -8,7 +8,7 @@
8
8
  "skipLibCheck": true,
9
9
  "forceConsistentCasingInFileNames": true,
10
10
  "resolveJsonModule": true,
11
- "types": ["bun-types"]
11
+ "types": ["bun"]
12
12
  },
13
13
  "exclude": ["node_modules", "dist", "build", ".turbo"]
14
14
  }
@@ -14,7 +14,7 @@
14
14
  "lint": {
15
15
  "dependsOn": ["^build"]
16
16
  },
17
- "type-check": {
17
+ "typecheck": {
18
18
  "dependsOn": ["^build"]
19
19
  },
20
20
  "dev": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bunli",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Scaffold new Bunli CLI projects",
6
6
  "bin": {
@@ -43,12 +43,13 @@
43
43
  "dev": "bun run src/cli.ts",
44
44
  "build": "bun scripts/build.ts && bun run tsc",
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",
50
+ "@bunli/core": "0.2.0",
51
+ "@bunli/utils": "0.2.0",
52
+ "@bunli/test": "0.2.0",
52
53
  "giget": "^2.0.0",
53
54
  "zod": "^3.25.67"
54
55
  },
@@ -56,4 +57,4 @@
56
57
  "@types/bun": "latest",
57
58
  "typescript": "^5.8.0"
58
59
  }
59
- }
60
+ }
@@ -0,0 +1,29 @@
1
+ import { defineConfig } from '@bunli/core'
2
+
3
+ export default defineConfig({
4
+ name: '{{name}}',
5
+ version: '{{version}}',
6
+ description: '{{description}}',
7
+
8
+ plugins: [],
9
+
10
+ build: {
11
+ entry: './src/index.ts',
12
+ outdir: './dist',
13
+ targets: ['darwin-arm64', 'darwin-x64', 'linux-x64', 'windows-x64'],
14
+ minify: true,
15
+ sourcemap: true,
16
+ compress: true
17
+ },
18
+
19
+ dev: {
20
+ watch: true,
21
+ inspect: false
22
+ },
23
+
24
+ test: {
25
+ pattern: ['**/*.test.ts', '**/*.spec.ts'],
26
+ coverage: true,
27
+ watch: false
28
+ }
29
+ })
@@ -13,7 +13,7 @@
13
13
  "build": "bunli build",
14
14
  "test": "bun test",
15
15
  "test:watch": "bun test --watch",
16
- "type-check": "tsc --noEmit",
16
+ "typecheck": "tsc --noEmit",
17
17
  "lint": "tsc --noEmit",
18
18
  "prepare": "bun run build"
19
19
  },
@@ -12,7 +12,7 @@
12
12
  "declarationMap": true,
13
13
  "outDir": "./dist",
14
14
  "rootDir": "./src",
15
- "types": ["bun-types"],
15
+ "types": ["bun"],
16
16
  "noUnusedLocals": true,
17
17
  "noUnusedParameters": true,
18
18
  "noImplicitReturns": true,
@@ -0,0 +1,29 @@
1
+ import { defineConfig } from '@bunli/core'
2
+
3
+ export default defineConfig({
4
+ name: '{{name}}',
5
+ version: '{{version}}',
6
+ description: '{{description}}',
7
+
8
+ build: {
9
+ entry: './src/index.ts',
10
+ outdir: './dist',
11
+ targets: ['native'],
12
+ minify: true,
13
+ sourcemap: true,
14
+ compress: false
15
+ },
16
+
17
+ dev: {
18
+ watch: true,
19
+ inspect: true
20
+ },
21
+
22
+ test: {
23
+ pattern: ['**/*.test.ts', '**/*.spec.ts'],
24
+ coverage: true,
25
+ watch: false
26
+ },
27
+
28
+ plugins: [],
29
+ })
@@ -11,7 +11,7 @@
11
11
  "dev": "bun run src/index.ts",
12
12
  "build": "bunli build",
13
13
  "test": "bun test",
14
- "type-check": "tsc --noEmit"
14
+ "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "dependencies": {
17
17
  "@bunli/core": "latest"
@@ -12,7 +12,7 @@
12
12
  "declarationMap": true,
13
13
  "outDir": "./dist",
14
14
  "rootDir": "./src",
15
- "types": ["bun-types"]
15
+ "types": ["bun"]
16
16
  },
17
17
  "include": ["src/**/*"],
18
18
  "exclude": ["node_modules", "dist", "test/**/*"]
@@ -32,7 +32,7 @@ bun run build
32
32
  bun test
33
33
 
34
34
  # Type check
35
- bun run type-check
35
+ bun run typecheck
36
36
  ```
37
37
 
38
38
  ## Creating a New Package
@@ -62,7 +62,7 @@ bun run release
62
62
  - `dev` - Run all packages in development mode
63
63
  - `build` - Build all packages
64
64
  - `test` - Run all tests
65
- - `type-check` - Type check all packages
65
+ - `typecheck` - Type check all packages
66
66
  - `lint` - Lint all packages
67
67
  - `clean` - Clean all build artifacts
68
68
  - `changeset` - Create a new changeset
@@ -0,0 +1,34 @@
1
+ import { defineConfig } from '@bunli/core'
2
+
3
+ export default defineConfig({
4
+ name: '{{name}}',
5
+ version: '{{version}}',
6
+ description: '{{description}}',
7
+
8
+ plugins: [],
9
+
10
+ build: {
11
+ entry: './packages/core/src/index.ts',
12
+ outdir: './packages/core/dist',
13
+ targets: ['darwin-arm64', 'darwin-x64', 'linux-x64', 'windows-x64'],
14
+ minify: true,
15
+ compress: true,
16
+ sourcemap: true
17
+ },
18
+
19
+ dev: {
20
+ watch: true,
21
+ inspect: false
22
+ },
23
+
24
+ test: {
25
+ pattern: ['**/*.test.ts', '**/*.spec.ts'],
26
+ coverage: true,
27
+ watch: false
28
+ },
29
+
30
+ workspace: {
31
+ packages: ['./packages/*'],
32
+ versionStrategy: 'fixed'
33
+ }
34
+ })
@@ -12,7 +12,7 @@
12
12
  "dev": "turbo run dev",
13
13
  "build": "turbo run build",
14
14
  "test": "turbo run test",
15
- "type-check": "turbo run type-check",
15
+ "typecheck": "turbo run typecheck",
16
16
  "lint": "turbo run lint",
17
17
  "clean": "turbo run clean && rm -rf node_modules",
18
18
  "changeset": "changeset",
@@ -12,7 +12,7 @@
12
12
  "dev": "bun run src/index.ts",
13
13
  "build": "bunli build",
14
14
  "test": "bun test",
15
- "type-check": "tsc --noEmit",
15
+ "typecheck": "tsc --noEmit",
16
16
  "clean": "rm -rf dist"
17
17
  },
18
18
  "dependencies": {
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "bun scripts/build.ts && bun run tsc",
18
18
  "test": "bun test",
19
- "type-check": "tsc --noEmit",
19
+ "typecheck": "tsc --noEmit",
20
20
  "clean": "rm -rf dist"
21
21
  },
22
22
  "dependencies": {
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "bun scripts/build.ts && bun run tsc",
18
18
  "test": "bun test",
19
- "type-check": "tsc --noEmit",
19
+ "typecheck": "tsc --noEmit",
20
20
  "clean": "rm -rf dist"
21
21
  },
22
22
  "devDependencies": {
@@ -8,7 +8,7 @@
8
8
  "skipLibCheck": true,
9
9
  "forceConsistentCasingInFileNames": true,
10
10
  "resolveJsonModule": true,
11
- "types": ["bun-types"]
11
+ "types": ["bun"]
12
12
  },
13
13
  "exclude": ["node_modules", "dist", "build", ".turbo"]
14
14
  }
@@ -14,7 +14,7 @@
14
14
  "lint": {
15
15
  "dependsOn": ["^build"]
16
16
  },
17
- "type-check": {
17
+ "typecheck": {
18
18
  "dependsOn": ["^build"]
19
19
  },
20
20
  "dev": {
@@ -1,34 +0,0 @@
1
- import { test, expect } from 'bun:test'
2
- import { testCommand, expectCommand } from '@bunli/test'
3
- import { initCommand } from '../src/commands/init.js'
4
- import { validateCommand } from '../src/commands/validate.js'
5
- import { configCommand } from '../src/commands/config.js'
6
-
7
- test('init command - creates config file', async () => {
8
- const result = await testCommand(initCommand, {
9
- flags: { template: 'minimal', force: true }
10
- })
11
-
12
- expectCommand(result).toHaveSucceeded()
13
- expectCommand(result).toContainInStdout('Config file created')
14
- })
15
-
16
- test('validate command - reports errors', async () => {
17
- const result = await testCommand(validateCommand, {
18
- args: ['src/**/*.ts'],
19
- flags: { fix: false }
20
- })
21
-
22
- // Result depends on actual files, but command should run
23
- expect(result.exitCode).toBeDefined()
24
- })
25
-
26
- test('config list command', async () => {
27
- const listCommand = configCommand.subcommands?.find(cmd => cmd.name === 'list')
28
- expect(listCommand).toBeDefined()
29
-
30
- const result = await testCommand(listCommand!, {})
31
-
32
- expectCommand(result).toHaveSucceeded()
33
- expectCommand(result).toContainInStdout('Configuration:')
34
- })
@@ -1,26 +0,0 @@
1
- import { test, expect } from 'bun:test'
2
- import { testCommand, expectCommand } from '@bunli/test'
3
- import { helloCommand } from '../src/commands/hello.js'
4
-
5
- test('hello command - default name', async () => {
6
- const result = await testCommand(helloCommand)
7
-
8
- expectCommand(result).toHaveSucceeded()
9
- expectCommand(result).toContainInStdout('Hello, World.')
10
- })
11
-
12
- test('hello command - custom name', async () => {
13
- const result = await testCommand(helloCommand, {
14
- flags: { name: 'Alice' }
15
- })
16
-
17
- expectCommand(result).toContainInStdout('Hello, Alice.')
18
- })
19
-
20
- test('hello command - excited flag', async () => {
21
- const result = await testCommand(helloCommand, {
22
- flags: { name: 'Bob', excited: true }
23
- })
24
-
25
- expectCommand(result).toContainInStdout('Hello, Bob!')
26
- })
@@ -1,34 +0,0 @@
1
- import { test, expect } from 'bun:test'
2
- import { testCommand, expectCommand } from '@bunli/test'
3
- import { initCommand } from '../src/commands/init.js'
4
- import { validateCommand } from '../src/commands/validate.js'
5
- import { configCommand } from '../src/commands/config.js'
6
-
7
- test('init command - creates config file', async () => {
8
- const result = await testCommand(initCommand, {
9
- flags: { template: 'minimal', force: true }
10
- })
11
-
12
- expectCommand(result).toHaveSucceeded()
13
- expectCommand(result).toContainInStdout('Config file created')
14
- })
15
-
16
- test('validate command - reports errors', async () => {
17
- const result = await testCommand(validateCommand, {
18
- args: ['src/**/*.ts'],
19
- flags: { fix: false }
20
- })
21
-
22
- // Result depends on actual files, but command should run
23
- expect(result.exitCode).toBeDefined()
24
- })
25
-
26
- test('config list command', async () => {
27
- const listCommand = configCommand.subcommands?.find(cmd => cmd.name === 'list')
28
- expect(listCommand).toBeDefined()
29
-
30
- const result = await testCommand(listCommand!, {})
31
-
32
- expectCommand(result).toHaveSucceeded()
33
- expectCommand(result).toContainInStdout('Configuration:')
34
- })
@@ -1,26 +0,0 @@
1
- import { test, expect } from 'bun:test'
2
- import { testCommand, expectCommand } from '@bunli/test'
3
- import { helloCommand } from '../src/commands/hello.js'
4
-
5
- test('hello command - default name', async () => {
6
- const result = await testCommand(helloCommand)
7
-
8
- expectCommand(result).toHaveSucceeded()
9
- expectCommand(result).toContainInStdout('Hello, World.')
10
- })
11
-
12
- test('hello command - custom name', async () => {
13
- const result = await testCommand(helloCommand, {
14
- flags: { name: 'Alice' }
15
- })
16
-
17
- expectCommand(result).toContainInStdout('Hello, Alice.')
18
- })
19
-
20
- test('hello command - excited flag', async () => {
21
- const result = await testCommand(helloCommand, {
22
- flags: { name: 'Bob', excited: true }
23
- })
24
-
25
- expectCommand(result).toContainInStdout('Hello, Bob!')
26
- })