Skip to content

Commit 5a89727

Browse files
[autofix.ci] apply automated fixes
1 parent 2e68892 commit 5a89727

File tree

3 files changed

+71
-72
lines changed

3 files changed

+71
-72
lines changed

packages/nuxi/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
"prepack": "unbuild",
3939
"test:dist": "node ./bin/nuxi.mjs info ./playground"
4040
},
41+
"dependencies": {
42+
"@bomb.sh/tab": "^0.0.4",
43+
"nuxi": "3.16.0"
44+
},
4145
"devDependencies": {
4246
"@nuxt/kit": "^4.1.2",
4347
"@nuxt/schema": "^4.1.2",
@@ -79,9 +83,5 @@
7983
"unplugin-purge-polyfills": "^0.1.0",
8084
"vitest": "^3.2.4",
8185
"youch": "^4.1.0-beta.11"
82-
},
83-
"dependencies": {
84-
"@bomb.sh/tab": "^0.0.4",
85-
"nuxi": "3.16.0"
8686
}
8787
}

packages/nuxi/src/completions.ts

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,83 @@ import type { CommandDef } from 'citty'
22
import tab from '@bomb.sh/tab/citty'
33

44
export async function initCompletions(command: CommandDef) {
5-
const completion = await tab(command as any)
5+
const completion = await tab(command as any)
66

7-
const devCommand = completion.commands.get('dev')
8-
if (devCommand) {
9-
const portOption = devCommand.options.get('port')
10-
if (portOption) {
11-
portOption.handler = (complete) => {
12-
complete('3000', 'Default development port')
13-
complete('3001', 'Alternative port')
14-
complete('8080', 'Common alternative port')
15-
}
16-
}
7+
const devCommand = completion.commands.get('dev')
8+
if (devCommand) {
9+
const portOption = devCommand.options.get('port')
10+
if (portOption) {
11+
portOption.handler = (complete) => {
12+
complete('3000', 'Default development port')
13+
complete('3001', 'Alternative port')
14+
complete('8080', 'Common alternative port')
15+
}
16+
}
1717

18-
const hostOption = devCommand.options.get('host')
19-
if (hostOption) {
20-
hostOption.handler = (complete) => {
21-
complete('localhost', 'Local development')
22-
complete('0.0.0.0', 'Listen on all interfaces')
23-
complete('127.0.0.1', 'Loopback address')
24-
}
25-
}
18+
const hostOption = devCommand.options.get('host')
19+
if (hostOption) {
20+
hostOption.handler = (complete) => {
21+
complete('localhost', 'Local development')
22+
complete('0.0.0.0', 'Listen on all interfaces')
23+
complete('127.0.0.1', 'Loopback address')
24+
}
2625
}
26+
}
2727

28-
const buildCommand = completion.commands.get('build')
29-
if (buildCommand) {
30-
const presetOption = buildCommand.options.get('preset')
31-
if (presetOption) {
32-
presetOption.handler = (complete) => {
33-
complete('node-server', 'Node.js server')
34-
complete('static', 'Static hosting')
35-
complete('cloudflare-pages', 'Cloudflare Pages')
36-
complete('vercel', 'Vercel')
37-
complete('netlify', 'Netlify')
38-
complete('aws-lambda', 'AWS Lambda')
39-
complete('azure', 'Azure')
40-
complete('firebase', 'Firebase')
41-
complete('deno-deploy', 'Deno Deploy')
42-
complete('bun', 'Bun runtime')
43-
}
44-
}
28+
const buildCommand = completion.commands.get('build')
29+
if (buildCommand) {
30+
const presetOption = buildCommand.options.get('preset')
31+
if (presetOption) {
32+
presetOption.handler = (complete) => {
33+
complete('node-server', 'Node.js server')
34+
complete('static', 'Static hosting')
35+
complete('cloudflare-pages', 'Cloudflare Pages')
36+
complete('vercel', 'Vercel')
37+
complete('netlify', 'Netlify')
38+
complete('aws-lambda', 'AWS Lambda')
39+
complete('azure', 'Azure')
40+
complete('firebase', 'Firebase')
41+
complete('deno-deploy', 'Deno Deploy')
42+
complete('bun', 'Bun runtime')
43+
}
4544
}
45+
}
4646

47-
const initCommand = completion.commands.get('init')
48-
if (initCommand) {
49-
const templateOption = initCommand.options.get('template')
50-
if (templateOption) {
51-
templateOption.handler = (complete) => {
52-
complete('v3', 'Nuxt 3 template')
53-
complete('v4', 'Nuxt 4 template')
54-
}
55-
}
47+
const initCommand = completion.commands.get('init')
48+
if (initCommand) {
49+
const templateOption = initCommand.options.get('template')
50+
if (templateOption) {
51+
templateOption.handler = (complete) => {
52+
complete('v3', 'Nuxt 3 template')
53+
complete('v4', 'Nuxt 4 template')
54+
}
5655
}
56+
}
5757

58-
const addCommand = completion.commands.get('add')
59-
if (addCommand) {
60-
const cwdOption = addCommand.options.get('cwd')
61-
if (cwdOption) {
62-
cwdOption.handler = (complete) => {
63-
complete('.', 'Current directory')
64-
}
65-
}
58+
const addCommand = completion.commands.get('add')
59+
if (addCommand) {
60+
const cwdOption = addCommand.options.get('cwd')
61+
if (cwdOption) {
62+
cwdOption.handler = (complete) => {
63+
complete('.', 'Current directory')
64+
}
6665
}
66+
}
6767

68-
const logLevelCommands = ['dev', 'build', 'generate', 'preview', 'prepare']
69-
for (const cmdName of logLevelCommands) {
70-
const cmd = completion.commands.get(cmdName)
71-
if (cmd) {
72-
const logLevelOption = cmd.options.get('logLevel')
73-
if (logLevelOption) {
74-
logLevelOption.handler = (complete) => {
75-
complete('silent', 'No logs')
76-
complete('info', 'Standard logging')
77-
complete('verbose', 'Detailed logging')
78-
}
79-
}
68+
const logLevelCommands = ['dev', 'build', 'generate', 'preview', 'prepare']
69+
for (const cmdName of logLevelCommands) {
70+
const cmd = completion.commands.get(cmdName)
71+
if (cmd) {
72+
const logLevelOption = cmd.options.get('logLevel')
73+
if (logLevelOption) {
74+
logLevelOption.handler = (complete) => {
75+
complete('silent', 'No logs')
76+
complete('info', 'Standard logging')
77+
complete('verbose', 'Detailed logging')
8078
}
79+
}
8180
}
81+
}
8282

83-
return completion
83+
return completion
8484
}
85-

packages/nuxi/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const main = defineCommand({
7272
},
7373
})
7474

75-
export const runMain = async () => {
75+
export async function runMain() {
7676
const { initCompletions } = await import('./completions')
7777
await initCompletions(main as any)
7878

0 commit comments

Comments
 (0)