@bomb.sh/tab 0.0.1-pre.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.
@@ -0,0 +1,173 @@
1
+ import "../t-Zhhzaib1.js";
2
+ import "../shared-BGWjvggn.js";
3
+ import "../consola.36c0034f-CftISWio.js";
4
+ import { createMain, defineCommand, tab$1 as tab } from "../citty-BJEnxM_0.js";
5
+
6
+ //#region examples/demo.citty.ts
7
+ const main = defineCommand({
8
+ meta: {
9
+ name: "vite",
10
+ version: "0.0.0",
11
+ description: "Vite CLI"
12
+ },
13
+ args: {
14
+ project: {
15
+ type: "positional",
16
+ description: "Project name",
17
+ required: true
18
+ },
19
+ config: {
20
+ type: "string",
21
+ description: "Use specified config file",
22
+ alias: "c"
23
+ },
24
+ mode: {
25
+ type: "string",
26
+ description: "Set env mode",
27
+ alias: "m"
28
+ },
29
+ logLevel: {
30
+ type: "string",
31
+ description: "info | warn | error | silent",
32
+ alias: "l"
33
+ }
34
+ },
35
+ run: (_ctx) => {}
36
+ });
37
+ const devCommand = defineCommand({
38
+ meta: {
39
+ name: "dev",
40
+ description: "Start dev server"
41
+ },
42
+ args: {
43
+ host: {
44
+ type: "string",
45
+ description: "Specify hostname",
46
+ alias: "H"
47
+ },
48
+ port: {
49
+ type: "string",
50
+ description: "Specify port",
51
+ alias: "p"
52
+ },
53
+ verbose: {
54
+ type: "boolean",
55
+ description: "Enable verbose logging",
56
+ alias: "v"
57
+ },
58
+ quiet: {
59
+ type: "boolean",
60
+ description: "Suppress output"
61
+ }
62
+ },
63
+ run: () => {}
64
+ });
65
+ const buildCommand = defineCommand({
66
+ meta: {
67
+ name: "build",
68
+ description: "Build project"
69
+ },
70
+ run: () => {}
71
+ });
72
+ const startCommand = defineCommand({
73
+ meta: {
74
+ name: "start",
75
+ description: "Start development server"
76
+ },
77
+ run: () => {}
78
+ });
79
+ const copyCommand = defineCommand({
80
+ meta: {
81
+ name: "copy",
82
+ description: "Copy files"
83
+ },
84
+ args: {
85
+ source: {
86
+ type: "positional",
87
+ description: "Source file or directory",
88
+ required: true
89
+ },
90
+ destination: {
91
+ type: "positional",
92
+ description: "Destination file or directory",
93
+ required: true
94
+ }
95
+ },
96
+ run: () => {}
97
+ });
98
+ const lintCommand = defineCommand({
99
+ meta: {
100
+ name: "lint",
101
+ description: "Lint project"
102
+ },
103
+ args: { files: {
104
+ type: "positional",
105
+ description: "Files to lint",
106
+ required: false
107
+ } },
108
+ run: () => {}
109
+ });
110
+ devCommand.subCommands = {
111
+ build: buildCommand,
112
+ start: startCommand
113
+ };
114
+ main.subCommands = {
115
+ dev: devCommand,
116
+ copy: copyCommand,
117
+ lint: lintCommand
118
+ };
119
+ const completion = await tab(main, {
120
+ args: { project: function(complete) {
121
+ complete("my-app", "My application");
122
+ complete("my-lib", "My library");
123
+ complete("my-tool", "My tool");
124
+ } },
125
+ options: {
126
+ config: function(complete) {
127
+ complete("vite.config.ts", "Vite config file");
128
+ complete("vite.config.js", "Vite config file");
129
+ },
130
+ mode: function(complete) {
131
+ complete("development", "Development mode");
132
+ complete("production", "Production mode");
133
+ },
134
+ logLevel: function(complete) {
135
+ complete("info", "Info level");
136
+ complete("warn", "Warn level");
137
+ complete("error", "Error level");
138
+ complete("silent", "Silent level");
139
+ }
140
+ },
141
+ subCommands: {
142
+ copy: { args: {
143
+ source: function(complete) {
144
+ complete("src/", "Source directory");
145
+ complete("dist/", "Distribution directory");
146
+ complete("public/", "Public assets");
147
+ },
148
+ destination: function(complete) {
149
+ complete("build/", "Build output");
150
+ complete("release/", "Release directory");
151
+ complete("backup/", "Backup location");
152
+ }
153
+ } },
154
+ lint: { args: { files: function(complete) {
155
+ complete("main.ts", "Main file");
156
+ complete("index.ts", "Index file");
157
+ } } },
158
+ dev: { options: {
159
+ port: function(complete) {
160
+ complete("3000", "Development server port");
161
+ complete("8080", "Alternative port");
162
+ },
163
+ host: function(complete) {
164
+ complete("localhost", "Localhost");
165
+ complete("0.0.0.0", "All interfaces");
166
+ }
167
+ } }
168
+ }
169
+ });
170
+ const cli = createMain(main);
171
+ cli();
172
+
173
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };