create-bunli 0.5.0 → 0.5.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.
- package/package.json +4 -4
- package/dist/templates/advanced/.bunli/commands.gen.report.json +0 -6
- package/dist/templates/advanced/.bunli/commands.gen.ts +0 -66
- package/dist/templates/basic/.bunli/commands.gen.report.json +0 -6
- package/dist/templates/basic/.bunli/commands.gen.ts +0 -66
- package/dist/templates/monorepo/.bunli/commands.gen.report.json +0 -6
- package/dist/templates/monorepo/.bunli/commands.gen.ts +0 -66
- package/templates/advanced/.bunli/commands.gen.report.json +0 -6
- package/templates/advanced/.bunli/commands.gen.ts +0 -66
- package/templates/basic/.bunli/commands.gen.report.json +0 -6
- package/templates/basic/.bunli/commands.gen.ts +0 -66
- package/templates/monorepo/.bunli/commands.gen.report.json +0 -6
- package/templates/monorepo/.bunli/commands.gen.ts +0 -66
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-bunli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Scaffold new Bunli CLI projects",
|
|
6
6
|
"bin": {
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"prepublishOnly": "bun run build"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@bunli/core": "0.4
|
|
51
|
-
"@bunli/test": "0.2
|
|
52
|
-
"@bunli/utils": "0.2
|
|
50
|
+
"@bunli/core": "0.5.4",
|
|
51
|
+
"@bunli/test": "0.3.2",
|
|
52
|
+
"@bunli/utils": "0.3.2",
|
|
53
53
|
"giget": "^2.0.0",
|
|
54
54
|
"zod": "^4.3.6"
|
|
55
55
|
},
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated by Bunli.
|
|
2
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
3
|
-
|
|
4
|
-
import type { Command, CLI, GeneratedOptionMeta, RegisteredCommands, CommandOptions, GeneratedCommandMeta } from '@bunli/core'
|
|
5
|
-
import { createGeneratedHelpers, registerGeneratedStore } from '@bunli/core'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Narrow list of command names to avoid typeof-cycles in types
|
|
10
|
-
const names = [] as const
|
|
11
|
-
type GeneratedNames = typeof names[number]
|
|
12
|
-
|
|
13
|
-
const modules: Record<GeneratedNames, Command<any>> = {
|
|
14
|
-
|
|
15
|
-
} as const
|
|
16
|
-
|
|
17
|
-
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
18
|
-
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
export const generated = registerGeneratedStore(createGeneratedHelpers(modules, metadata))
|
|
22
|
-
|
|
23
|
-
export const commands = generated.commands
|
|
24
|
-
export const commandMeta = generated.metadata
|
|
25
|
-
|
|
26
|
-
export interface GeneratedCLI {
|
|
27
|
-
register(cli?: CLI<any>): GeneratedCLI
|
|
28
|
-
list(): Array<{
|
|
29
|
-
name: GeneratedNames
|
|
30
|
-
command: (typeof modules)[GeneratedNames]
|
|
31
|
-
metadata: (typeof metadata)[GeneratedNames]
|
|
32
|
-
}>
|
|
33
|
-
get<Name extends GeneratedNames>(name: Name): (typeof modules)[Name]
|
|
34
|
-
getMetadata<Name extends GeneratedNames>(name: Name): (typeof metadata)[Name]
|
|
35
|
-
getFlags<Name extends keyof RegisteredCommands & string>(name: Name): CommandOptions<Name>
|
|
36
|
-
getFlagsMeta<Name extends GeneratedNames>(name: Name): Record<string, GeneratedOptionMeta>
|
|
37
|
-
withCLI(cli: CLI<any>): { execute(name: string, options: unknown): Promise<void> }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const cli: GeneratedCLI = {
|
|
41
|
-
register: (cliInstance?: CLI<any>) => { generated.register(cliInstance); return cli },
|
|
42
|
-
list: () => generated.list(),
|
|
43
|
-
get: <Name extends GeneratedNames>(name: Name) => generated.get(name),
|
|
44
|
-
getMetadata: <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name),
|
|
45
|
-
getFlags: <Name extends keyof RegisteredCommands & string>(name: Name) => generated.getFlags(name) as CommandOptions<Name>,
|
|
46
|
-
getFlagsMeta: <Name extends GeneratedNames>(name: Name) => generated.getFlagsMeta(name),
|
|
47
|
-
withCLI: (cliInstance) => generated.withCLI(cliInstance)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Enhanced helper functions
|
|
51
|
-
export const listCommands = () => generated.list().map(c => c.name)
|
|
52
|
-
export const getCommandApi = <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name)
|
|
53
|
-
export const getTypedFlags = <Name extends GeneratedNames>(name: Name) => generated.getFlags(name) as CommandOptions<Name>
|
|
54
|
-
export const validateCommand = <Name extends GeneratedNames>(name: Name, flags: Record<string, unknown>) => generated.validateCommand(name, flags)
|
|
55
|
-
export const findCommandByName = <Name extends GeneratedNames>(name: Name) => generated.findByName(name)
|
|
56
|
-
export const findCommandsByDescription = (searchTerm: string) => generated.findByDescription(searchTerm)
|
|
57
|
-
export const getCommandNames = () => generated.getCommandNames()
|
|
58
|
-
|
|
59
|
-
// Auto-register on import for zero-config usage
|
|
60
|
-
export default cli
|
|
61
|
-
|
|
62
|
-
// Ensure module augmentation happens on import
|
|
63
|
-
declare module '@bunli/core' {
|
|
64
|
-
// Precise key mapping without typeof cycles
|
|
65
|
-
interface RegisteredCommands extends Record<GeneratedNames, Command<any>> {}
|
|
66
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated by Bunli.
|
|
2
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
3
|
-
|
|
4
|
-
import type { Command, CLI, GeneratedOptionMeta, RegisteredCommands, CommandOptions, GeneratedCommandMeta } from '@bunli/core'
|
|
5
|
-
import { createGeneratedHelpers, registerGeneratedStore } from '@bunli/core'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Narrow list of command names to avoid typeof-cycles in types
|
|
10
|
-
const names = [] as const
|
|
11
|
-
type GeneratedNames = typeof names[number]
|
|
12
|
-
|
|
13
|
-
const modules: Record<GeneratedNames, Command<any>> = {
|
|
14
|
-
|
|
15
|
-
} as const
|
|
16
|
-
|
|
17
|
-
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
18
|
-
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
export const generated = registerGeneratedStore(createGeneratedHelpers(modules, metadata))
|
|
22
|
-
|
|
23
|
-
export const commands = generated.commands
|
|
24
|
-
export const commandMeta = generated.metadata
|
|
25
|
-
|
|
26
|
-
export interface GeneratedCLI {
|
|
27
|
-
register(cli?: CLI<any>): GeneratedCLI
|
|
28
|
-
list(): Array<{
|
|
29
|
-
name: GeneratedNames
|
|
30
|
-
command: (typeof modules)[GeneratedNames]
|
|
31
|
-
metadata: (typeof metadata)[GeneratedNames]
|
|
32
|
-
}>
|
|
33
|
-
get<Name extends GeneratedNames>(name: Name): (typeof modules)[Name]
|
|
34
|
-
getMetadata<Name extends GeneratedNames>(name: Name): (typeof metadata)[Name]
|
|
35
|
-
getFlags<Name extends keyof RegisteredCommands & string>(name: Name): CommandOptions<Name>
|
|
36
|
-
getFlagsMeta<Name extends GeneratedNames>(name: Name): Record<string, GeneratedOptionMeta>
|
|
37
|
-
withCLI(cli: CLI<any>): { execute(name: string, options: unknown): Promise<void> }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const cli: GeneratedCLI = {
|
|
41
|
-
register: (cliInstance?: CLI<any>) => { generated.register(cliInstance); return cli },
|
|
42
|
-
list: () => generated.list(),
|
|
43
|
-
get: <Name extends GeneratedNames>(name: Name) => generated.get(name),
|
|
44
|
-
getMetadata: <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name),
|
|
45
|
-
getFlags: <Name extends keyof RegisteredCommands & string>(name: Name) => generated.getFlags(name) as CommandOptions<Name>,
|
|
46
|
-
getFlagsMeta: <Name extends GeneratedNames>(name: Name) => generated.getFlagsMeta(name),
|
|
47
|
-
withCLI: (cliInstance) => generated.withCLI(cliInstance)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Enhanced helper functions
|
|
51
|
-
export const listCommands = () => generated.list().map(c => c.name)
|
|
52
|
-
export const getCommandApi = <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name)
|
|
53
|
-
export const getTypedFlags = <Name extends GeneratedNames>(name: Name) => generated.getFlags(name) as CommandOptions<Name>
|
|
54
|
-
export const validateCommand = <Name extends GeneratedNames>(name: Name, flags: Record<string, unknown>) => generated.validateCommand(name, flags)
|
|
55
|
-
export const findCommandByName = <Name extends GeneratedNames>(name: Name) => generated.findByName(name)
|
|
56
|
-
export const findCommandsByDescription = (searchTerm: string) => generated.findByDescription(searchTerm)
|
|
57
|
-
export const getCommandNames = () => generated.getCommandNames()
|
|
58
|
-
|
|
59
|
-
// Auto-register on import for zero-config usage
|
|
60
|
-
export default cli
|
|
61
|
-
|
|
62
|
-
// Ensure module augmentation happens on import
|
|
63
|
-
declare module '@bunli/core' {
|
|
64
|
-
// Precise key mapping without typeof cycles
|
|
65
|
-
interface RegisteredCommands extends Record<GeneratedNames, Command<any>> {}
|
|
66
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated by Bunli.
|
|
2
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
3
|
-
|
|
4
|
-
import type { Command, CLI, GeneratedOptionMeta, RegisteredCommands, CommandOptions, GeneratedCommandMeta } from '@bunli/core'
|
|
5
|
-
import { createGeneratedHelpers, registerGeneratedStore } from '@bunli/core'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Narrow list of command names to avoid typeof-cycles in types
|
|
10
|
-
const names = [] as const
|
|
11
|
-
type GeneratedNames = typeof names[number]
|
|
12
|
-
|
|
13
|
-
const modules: Record<GeneratedNames, Command<any>> = {
|
|
14
|
-
|
|
15
|
-
} as const
|
|
16
|
-
|
|
17
|
-
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
18
|
-
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
export const generated = registerGeneratedStore(createGeneratedHelpers(modules, metadata))
|
|
22
|
-
|
|
23
|
-
export const commands = generated.commands
|
|
24
|
-
export const commandMeta = generated.metadata
|
|
25
|
-
|
|
26
|
-
export interface GeneratedCLI {
|
|
27
|
-
register(cli?: CLI<any>): GeneratedCLI
|
|
28
|
-
list(): Array<{
|
|
29
|
-
name: GeneratedNames
|
|
30
|
-
command: (typeof modules)[GeneratedNames]
|
|
31
|
-
metadata: (typeof metadata)[GeneratedNames]
|
|
32
|
-
}>
|
|
33
|
-
get<Name extends GeneratedNames>(name: Name): (typeof modules)[Name]
|
|
34
|
-
getMetadata<Name extends GeneratedNames>(name: Name): (typeof metadata)[Name]
|
|
35
|
-
getFlags<Name extends keyof RegisteredCommands & string>(name: Name): CommandOptions<Name>
|
|
36
|
-
getFlagsMeta<Name extends GeneratedNames>(name: Name): Record<string, GeneratedOptionMeta>
|
|
37
|
-
withCLI(cli: CLI<any>): { execute(name: string, options: unknown): Promise<void> }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const cli: GeneratedCLI = {
|
|
41
|
-
register: (cliInstance?: CLI<any>) => { generated.register(cliInstance); return cli },
|
|
42
|
-
list: () => generated.list(),
|
|
43
|
-
get: <Name extends GeneratedNames>(name: Name) => generated.get(name),
|
|
44
|
-
getMetadata: <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name),
|
|
45
|
-
getFlags: <Name extends keyof RegisteredCommands & string>(name: Name) => generated.getFlags(name) as CommandOptions<Name>,
|
|
46
|
-
getFlagsMeta: <Name extends GeneratedNames>(name: Name) => generated.getFlagsMeta(name),
|
|
47
|
-
withCLI: (cliInstance) => generated.withCLI(cliInstance)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Enhanced helper functions
|
|
51
|
-
export const listCommands = () => generated.list().map(c => c.name)
|
|
52
|
-
export const getCommandApi = <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name)
|
|
53
|
-
export const getTypedFlags = <Name extends GeneratedNames>(name: Name) => generated.getFlags(name) as CommandOptions<Name>
|
|
54
|
-
export const validateCommand = <Name extends GeneratedNames>(name: Name, flags: Record<string, unknown>) => generated.validateCommand(name, flags)
|
|
55
|
-
export const findCommandByName = <Name extends GeneratedNames>(name: Name) => generated.findByName(name)
|
|
56
|
-
export const findCommandsByDescription = (searchTerm: string) => generated.findByDescription(searchTerm)
|
|
57
|
-
export const getCommandNames = () => generated.getCommandNames()
|
|
58
|
-
|
|
59
|
-
// Auto-register on import for zero-config usage
|
|
60
|
-
export default cli
|
|
61
|
-
|
|
62
|
-
// Ensure module augmentation happens on import
|
|
63
|
-
declare module '@bunli/core' {
|
|
64
|
-
// Precise key mapping without typeof cycles
|
|
65
|
-
interface RegisteredCommands extends Record<GeneratedNames, Command<any>> {}
|
|
66
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated by Bunli.
|
|
2
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
3
|
-
|
|
4
|
-
import type { Command, CLI, GeneratedOptionMeta, RegisteredCommands, CommandOptions, GeneratedCommandMeta } from '@bunli/core'
|
|
5
|
-
import { createGeneratedHelpers, registerGeneratedStore } from '@bunli/core'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Narrow list of command names to avoid typeof-cycles in types
|
|
10
|
-
const names = [] as const
|
|
11
|
-
type GeneratedNames = typeof names[number]
|
|
12
|
-
|
|
13
|
-
const modules: Record<GeneratedNames, Command<any>> = {
|
|
14
|
-
|
|
15
|
-
} as const
|
|
16
|
-
|
|
17
|
-
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
18
|
-
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
export const generated = registerGeneratedStore(createGeneratedHelpers(modules, metadata))
|
|
22
|
-
|
|
23
|
-
export const commands = generated.commands
|
|
24
|
-
export const commandMeta = generated.metadata
|
|
25
|
-
|
|
26
|
-
export interface GeneratedCLI {
|
|
27
|
-
register(cli?: CLI<any>): GeneratedCLI
|
|
28
|
-
list(): Array<{
|
|
29
|
-
name: GeneratedNames
|
|
30
|
-
command: (typeof modules)[GeneratedNames]
|
|
31
|
-
metadata: (typeof metadata)[GeneratedNames]
|
|
32
|
-
}>
|
|
33
|
-
get<Name extends GeneratedNames>(name: Name): (typeof modules)[Name]
|
|
34
|
-
getMetadata<Name extends GeneratedNames>(name: Name): (typeof metadata)[Name]
|
|
35
|
-
getFlags<Name extends keyof RegisteredCommands & string>(name: Name): CommandOptions<Name>
|
|
36
|
-
getFlagsMeta<Name extends GeneratedNames>(name: Name): Record<string, GeneratedOptionMeta>
|
|
37
|
-
withCLI(cli: CLI<any>): { execute(name: string, options: unknown): Promise<void> }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const cli: GeneratedCLI = {
|
|
41
|
-
register: (cliInstance?: CLI<any>) => { generated.register(cliInstance); return cli },
|
|
42
|
-
list: () => generated.list(),
|
|
43
|
-
get: <Name extends GeneratedNames>(name: Name) => generated.get(name),
|
|
44
|
-
getMetadata: <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name),
|
|
45
|
-
getFlags: <Name extends keyof RegisteredCommands & string>(name: Name) => generated.getFlags(name) as CommandOptions<Name>,
|
|
46
|
-
getFlagsMeta: <Name extends GeneratedNames>(name: Name) => generated.getFlagsMeta(name),
|
|
47
|
-
withCLI: (cliInstance) => generated.withCLI(cliInstance)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Enhanced helper functions
|
|
51
|
-
export const listCommands = () => generated.list().map(c => c.name)
|
|
52
|
-
export const getCommandApi = <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name)
|
|
53
|
-
export const getTypedFlags = <Name extends GeneratedNames>(name: Name) => generated.getFlags(name) as CommandOptions<Name>
|
|
54
|
-
export const validateCommand = <Name extends GeneratedNames>(name: Name, flags: Record<string, unknown>) => generated.validateCommand(name, flags)
|
|
55
|
-
export const findCommandByName = <Name extends GeneratedNames>(name: Name) => generated.findByName(name)
|
|
56
|
-
export const findCommandsByDescription = (searchTerm: string) => generated.findByDescription(searchTerm)
|
|
57
|
-
export const getCommandNames = () => generated.getCommandNames()
|
|
58
|
-
|
|
59
|
-
// Auto-register on import for zero-config usage
|
|
60
|
-
export default cli
|
|
61
|
-
|
|
62
|
-
// Ensure module augmentation happens on import
|
|
63
|
-
declare module '@bunli/core' {
|
|
64
|
-
// Precise key mapping without typeof cycles
|
|
65
|
-
interface RegisteredCommands extends Record<GeneratedNames, Command<any>> {}
|
|
66
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated by Bunli.
|
|
2
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
3
|
-
|
|
4
|
-
import type { Command, CLI, GeneratedOptionMeta, RegisteredCommands, CommandOptions, GeneratedCommandMeta } from '@bunli/core'
|
|
5
|
-
import { createGeneratedHelpers, registerGeneratedStore } from '@bunli/core'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Narrow list of command names to avoid typeof-cycles in types
|
|
10
|
-
const names = [] as const
|
|
11
|
-
type GeneratedNames = typeof names[number]
|
|
12
|
-
|
|
13
|
-
const modules: Record<GeneratedNames, Command<any>> = {
|
|
14
|
-
|
|
15
|
-
} as const
|
|
16
|
-
|
|
17
|
-
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
18
|
-
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
export const generated = registerGeneratedStore(createGeneratedHelpers(modules, metadata))
|
|
22
|
-
|
|
23
|
-
export const commands = generated.commands
|
|
24
|
-
export const commandMeta = generated.metadata
|
|
25
|
-
|
|
26
|
-
export interface GeneratedCLI {
|
|
27
|
-
register(cli?: CLI<any>): GeneratedCLI
|
|
28
|
-
list(): Array<{
|
|
29
|
-
name: GeneratedNames
|
|
30
|
-
command: (typeof modules)[GeneratedNames]
|
|
31
|
-
metadata: (typeof metadata)[GeneratedNames]
|
|
32
|
-
}>
|
|
33
|
-
get<Name extends GeneratedNames>(name: Name): (typeof modules)[Name]
|
|
34
|
-
getMetadata<Name extends GeneratedNames>(name: Name): (typeof metadata)[Name]
|
|
35
|
-
getFlags<Name extends keyof RegisteredCommands & string>(name: Name): CommandOptions<Name>
|
|
36
|
-
getFlagsMeta<Name extends GeneratedNames>(name: Name): Record<string, GeneratedOptionMeta>
|
|
37
|
-
withCLI(cli: CLI<any>): { execute(name: string, options: unknown): Promise<void> }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const cli: GeneratedCLI = {
|
|
41
|
-
register: (cliInstance?: CLI<any>) => { generated.register(cliInstance); return cli },
|
|
42
|
-
list: () => generated.list(),
|
|
43
|
-
get: <Name extends GeneratedNames>(name: Name) => generated.get(name),
|
|
44
|
-
getMetadata: <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name),
|
|
45
|
-
getFlags: <Name extends keyof RegisteredCommands & string>(name: Name) => generated.getFlags(name) as CommandOptions<Name>,
|
|
46
|
-
getFlagsMeta: <Name extends GeneratedNames>(name: Name) => generated.getFlagsMeta(name),
|
|
47
|
-
withCLI: (cliInstance) => generated.withCLI(cliInstance)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Enhanced helper functions
|
|
51
|
-
export const listCommands = () => generated.list().map(c => c.name)
|
|
52
|
-
export const getCommandApi = <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name)
|
|
53
|
-
export const getTypedFlags = <Name extends GeneratedNames>(name: Name) => generated.getFlags(name) as CommandOptions<Name>
|
|
54
|
-
export const validateCommand = <Name extends GeneratedNames>(name: Name, flags: Record<string, unknown>) => generated.validateCommand(name, flags)
|
|
55
|
-
export const findCommandByName = <Name extends GeneratedNames>(name: Name) => generated.findByName(name)
|
|
56
|
-
export const findCommandsByDescription = (searchTerm: string) => generated.findByDescription(searchTerm)
|
|
57
|
-
export const getCommandNames = () => generated.getCommandNames()
|
|
58
|
-
|
|
59
|
-
// Auto-register on import for zero-config usage
|
|
60
|
-
export default cli
|
|
61
|
-
|
|
62
|
-
// Ensure module augmentation happens on import
|
|
63
|
-
declare module '@bunli/core' {
|
|
64
|
-
// Precise key mapping without typeof cycles
|
|
65
|
-
interface RegisteredCommands extends Record<GeneratedNames, Command<any>> {}
|
|
66
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated by Bunli.
|
|
2
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
3
|
-
|
|
4
|
-
import type { Command, CLI, GeneratedOptionMeta, RegisteredCommands, CommandOptions, GeneratedCommandMeta } from '@bunli/core'
|
|
5
|
-
import { createGeneratedHelpers, registerGeneratedStore } from '@bunli/core'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Narrow list of command names to avoid typeof-cycles in types
|
|
10
|
-
const names = [] as const
|
|
11
|
-
type GeneratedNames = typeof names[number]
|
|
12
|
-
|
|
13
|
-
const modules: Record<GeneratedNames, Command<any>> = {
|
|
14
|
-
|
|
15
|
-
} as const
|
|
16
|
-
|
|
17
|
-
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
18
|
-
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
export const generated = registerGeneratedStore(createGeneratedHelpers(modules, metadata))
|
|
22
|
-
|
|
23
|
-
export const commands = generated.commands
|
|
24
|
-
export const commandMeta = generated.metadata
|
|
25
|
-
|
|
26
|
-
export interface GeneratedCLI {
|
|
27
|
-
register(cli?: CLI<any>): GeneratedCLI
|
|
28
|
-
list(): Array<{
|
|
29
|
-
name: GeneratedNames
|
|
30
|
-
command: (typeof modules)[GeneratedNames]
|
|
31
|
-
metadata: (typeof metadata)[GeneratedNames]
|
|
32
|
-
}>
|
|
33
|
-
get<Name extends GeneratedNames>(name: Name): (typeof modules)[Name]
|
|
34
|
-
getMetadata<Name extends GeneratedNames>(name: Name): (typeof metadata)[Name]
|
|
35
|
-
getFlags<Name extends keyof RegisteredCommands & string>(name: Name): CommandOptions<Name>
|
|
36
|
-
getFlagsMeta<Name extends GeneratedNames>(name: Name): Record<string, GeneratedOptionMeta>
|
|
37
|
-
withCLI(cli: CLI<any>): { execute(name: string, options: unknown): Promise<void> }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const cli: GeneratedCLI = {
|
|
41
|
-
register: (cliInstance?: CLI<any>) => { generated.register(cliInstance); return cli },
|
|
42
|
-
list: () => generated.list(),
|
|
43
|
-
get: <Name extends GeneratedNames>(name: Name) => generated.get(name),
|
|
44
|
-
getMetadata: <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name),
|
|
45
|
-
getFlags: <Name extends keyof RegisteredCommands & string>(name: Name) => generated.getFlags(name) as CommandOptions<Name>,
|
|
46
|
-
getFlagsMeta: <Name extends GeneratedNames>(name: Name) => generated.getFlagsMeta(name),
|
|
47
|
-
withCLI: (cliInstance) => generated.withCLI(cliInstance)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Enhanced helper functions
|
|
51
|
-
export const listCommands = () => generated.list().map(c => c.name)
|
|
52
|
-
export const getCommandApi = <Name extends GeneratedNames>(name: Name) => generated.getMetadata(name)
|
|
53
|
-
export const getTypedFlags = <Name extends GeneratedNames>(name: Name) => generated.getFlags(name) as CommandOptions<Name>
|
|
54
|
-
export const validateCommand = <Name extends GeneratedNames>(name: Name, flags: Record<string, unknown>) => generated.validateCommand(name, flags)
|
|
55
|
-
export const findCommandByName = <Name extends GeneratedNames>(name: Name) => generated.findByName(name)
|
|
56
|
-
export const findCommandsByDescription = (searchTerm: string) => generated.findByDescription(searchTerm)
|
|
57
|
-
export const getCommandNames = () => generated.getCommandNames()
|
|
58
|
-
|
|
59
|
-
// Auto-register on import for zero-config usage
|
|
60
|
-
export default cli
|
|
61
|
-
|
|
62
|
-
// Ensure module augmentation happens on import
|
|
63
|
-
declare module '@bunli/core' {
|
|
64
|
-
// Precise key mapping without typeof cycles
|
|
65
|
-
interface RegisteredCommands extends Record<GeneratedNames, Command<any>> {}
|
|
66
|
-
}
|