Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(nuxt): use built-in consola prompts #23205

Merged
merged 1 commit into from Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/nuxt/package.json
Expand Up @@ -89,7 +89,6 @@
"pathe": "^1.1.1",
"perfect-debounce": "^1.0.0",
"pkg-types": "^1.0.3",
"prompts": "^2.4.2",
"scule": "^1.0.0",
"std-env": "^3.4.3",
"strip-literal": "^1.3.0",
Expand All @@ -111,7 +110,6 @@
"@parcel/watcher": "2.3.0",
"@types/estree": "1.0.1",
"@types/fs-extra": "11.0.1",
"@types/prompts": "2.4.4",
"@vitejs/plugin-vue": "4.3.4",
"unbuild": "latest",
"vite": "4.4.9",
Expand Down
4 changes: 1 addition & 3 deletions packages/nuxt/src/core/features.ts
Expand Up @@ -2,7 +2,6 @@ import { addDependency } from 'nypm'
import { resolvePackageJSON } from 'pkg-types'
import { logger } from '@nuxt/kit'
import { isCI } from 'std-env'
import prompts from 'prompts'

export async function ensurePackageInstalled (rootDir: string, name: string, searchPaths?: string[]) {
if (await resolvePackageJSON(name, { url: searchPaths }).catch(() => null)) {
Expand All @@ -14,10 +13,9 @@ export async function ensurePackageInstalled (rootDir: string, name: string, sea
return false
}

const { confirm } = await prompts({
const confirm = await logger.prompt(`Do you want to install ${name} package?`, {
type: 'confirm',
name: 'confirm',
message: `Do you want to install ${name} package?`,
initial: true
})

Expand Down
33 changes: 4 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.