Skip to content

Commit 1aa3d2d

Browse files
authored
feat: replace prompts with @clack/prompts (#935)
1 parent 0216c08 commit 1aa3d2d

File tree

4 files changed

+29
-45
lines changed

4 files changed

+29
-45
lines changed

‎packages/devtools-wizard/package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525
"prepack": "pnpm build"
2626
},
2727
"dependencies": {
28+
"@clack/prompts": "catalog:prod",
2829
"consola": "catalog:prod",
2930
"diff": "catalog:frontend",
3031
"execa": "catalog:prod",
3132
"magicast": "catalog:prod",
3233
"pathe": "catalog:frontend",
3334
"pkg-types": "catalog:prod",
34-
"prompts": "catalog:prod",
3535
"semver": "catalog:prod"
3636
},
3737
"devDependencies": {
3838
"@types/diff": "catalog:types",
39-
"@types/prompts": "catalog:types",
4039
"unbuild": "catalog:buildtools"
4140
}
4241
}

‎packages/devtools-wizard/src/builtin.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { existsSync } from 'node:fs'
22
import fsp from 'node:fs/promises'
33
import { relative } from 'node:path'
4+
import * as p from '@clack/prompts'
45
import { consola } from 'consola'
56
import { colors } from 'consola/utils'
67
import { diffLines } from 'diff'
78
import { parseModule } from 'magicast'
89
import { join } from 'pathe'
9-
import prompts from 'prompts'
1010

1111
function findNuxtConfig(cwd: string) {
1212
const names = [
@@ -61,14 +61,12 @@ async function toggleConfig(cwd: string, value?: boolean) {
6161
printDiffToCLI(source, generated)
6262
consola.log('')
6363

64-
const { confirm } = await prompts({
65-
type: 'confirm',
66-
name: 'confirm',
64+
const confirm = await p.confirm({
6765
message: 'Continue?',
68-
initial: true,
66+
initialValue: true,
6967
})
7068

71-
if (!confirm)
69+
if (confirm !== true)
7270
return false
7371

7472
await fsp.writeFile(nuxtConfig, `${generated.trimEnd()}\n`, 'utf-8')

‎pnpm-lock.yaml‎

Lines changed: 23 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ catalogs:
113113
playground:
114114
'@exampledev/new.css': ^1.1.3
115115
prod:
116+
'@clack/prompts': ^1.0.1
116117
'@nuxt/kit': ^4.3.1
117118
'@vue/devtools-kit': ^8.0.6
118119
consola: ^3.4.2
@@ -128,7 +129,6 @@ catalogs:
128129
magicast: ^0.5.2
129130
nypm: ^0.6.5
130131
pkg-types: ^2.3.0
131-
prompts: ^2.4.2
132132
semver: ^7.7.4
133133
simple-git: ^3.30.0
134134
sirv: ^3.0.2
@@ -143,7 +143,6 @@ catalogs:
143143
'@types/markdown-it': ^14.1.2
144144
'@types/markdown-it-link-attributes': ^3.0.5
145145
'@types/node': ^25.2.3
146-
'@types/prompts': ^2.4.9
147146
'@types/which': ^3.0.4
148147
'@types/ws': ^8.18.1
149148
'@unhead/schema': ^2.1.4

0 commit comments

Comments
 (0)