Skip to content

Commit 5fe4d62

Browse files
authored
refactor: improve nuxi integration
refactor: improve nuxi integration
2 parents b291caf + e281d6c commit 5fe4d62

File tree

11 files changed

+103
-112
lines changed

11 files changed

+103
-112
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,4 +1068,4 @@
10681068
"magicast": "0.2.10"
10691069
}
10701070
}
1071-
}
1071+
}

pnpm-lock.yaml

Lines changed: 75 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { ThemeIcon, QuickPickItem, window } from 'vscode';
2-
import { newTerminal, projectRootDirectory, jiti, detectPackageManagerByName } from '../../utils';
2+
import { newTerminal, projectRootDirectory, detectPackageManagerByName } from '../../utils';
33
import { nuxtDev, nuxtBuild, nuxtGenerate, nuxtCleanUp, nuxtAnalyze, nuxtInfo } from './commonCommands';
44
import { handleModuleCommand, handleAddCommand, handleDevtoolsCommand } from './multiStepCommands';
5-
import { cliCommands } from '../../nuxtCLI';
5+
import { tryImportNuxi } from '../../nuxi';
66

77
const pm = detectPackageManagerByName();
88
const runCommand = pm ? pm.runCommand : 'npx';
@@ -38,7 +38,12 @@ const shouldDirectlyRun = (command: any) => directlyExecutableCommands.includes(
3838
const shouldIndirectlyRun = (command: any) => indirectlyExecutableCommands.includes(command);
3939

4040
const showCLICommands = async () => {
41-
const commands = Object.keys(await cliCommands);
41+
const nuxi = await tryImportNuxi()
42+
if (!nuxi) {
43+
console.log('nuxi not found')
44+
return
45+
}
46+
const commands = Object.keys(nuxi.main.subCommands);
4247

4348
const options = {
4449
placeHolder: 'Select a command',

src/commands/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { createMiddleware, directCreateMiddleware } from './Middleware'
77
import { createNitroAPI, directCreateNitroAPI, createNitroRoute, directCreateNitroRoute, createNitroPlugin, createNitroMiddleware, createNitroUtil } from './Nitro'
88
import { projectStructure, appConfig, nuxtIgnore, nuxtRC } from './Structure'
99
import { openDocumentation, openModules } from './externalLinks'
10-
import { nuxtDev, nuxtBuild, nuxtGenerate, nuxtCleanUp, nuxtAnalyze, nuxtInfo, showCLICommands } from './NuxtCLI'
10+
import { nuxtDev, nuxtBuild, nuxtGenerate, nuxtCleanUp, nuxtAnalyze, nuxtInfo, showCLICommands } from './Nuxi'
1111
import { createStore, directCreateStore } from './Store'
1212
import { installDependencies, searchAndInstallDependencies } from './InstallDependencies'
1313
import { openSettings } from '../utils/navigation'

0 commit comments

Comments
 (0)