Skip to content

Commit eae8ed2

Browse files
committed
fix(create-app): installations, close #6
1 parent 1cf38a8 commit eae8ed2

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

packages/create-app/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const argv = require('minimist')(process.argv.slice(2))
88
const prompts = require('prompts')
99
const execa = require('execa')
1010
const { cyan, blue, yellow, bold, dim, green } = require('kolorist')
11-
const { parseNi, run } = require('@antfu/ni')
1211
const { version } = require('./package.json')
1312

1413
const cwd = process.cwd()
@@ -108,9 +107,18 @@ async function init() {
108107
})
109108

110109
if (yes) {
111-
await run(parseNi, ['-C', related])
112-
// await execa(pkgManager, ['-C', related, 'install'], { stdio: 'inherit' })
113-
await execa(pkgManager, ['-C', related, 'run', 'dev'], { stdio: 'inherit' })
110+
const { agent } = await prompts({
111+
name: 'agent',
112+
type: 'select',
113+
message: 'Choose the agent',
114+
choices: ['npm', 'yarn', 'pnpm'].map(i => ({ value: i, title: i })),
115+
})
116+
117+
if (!agent)
118+
return
119+
120+
await execa(agent, ['install'], { stdio: 'inherit', cwd: root })
121+
await execa(agent, ['run', 'dev'], { stdio: 'inherit', cwd: root })
114122
}
115123
else {
116124
console.log(dim('\n start it later by:\n'))

packages/create-app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"homepage": "https://sli.dev",
1717
"bugs": "https://github.com/slidevjs/slidev/issues",
1818
"dependencies": {
19-
"@antfu/ni": "^0.7.0",
2019
"execa": "^5.0.0",
2120
"kolorist": "^1.4.1",
2221
"minimist": "^1.2.5",

pnpm-lock.yaml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)