Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"consola": "^3.3.3",
"defu": "^6.1.4",
"eslint": "^9.17.0",
"execa": "^9.5.2",
"fuse.js": "^7.0.0",
"giget": "^1.2.3",
"h3": "^1.13.0",
Expand All @@ -76,6 +75,7 @@
"scule": "^1.3.0",
"semver": "^7.6.3",
"std-env": "^3.8.0",
"tinyexec": "^0.3.2",
"typescript": "^5.7.2",
"ufo": "^1.5.4",
"unbuild": "^3.2.0",
Expand Down
104 changes: 3 additions & 101 deletions pnpm-lock.yaml

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

11 changes: 6 additions & 5 deletions src/commands/build-module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execa } from 'execa'
import { x } from 'tinyexec'
import { consola } from 'consola'
import { resolve } from 'pathe'
import { defineCommand } from 'citty'
Expand Down Expand Up @@ -52,10 +52,11 @@ export default defineCommand({
execArgs.unshift(MODULE_BUILDER_PKG)
}

await execa(cmd, execArgs, {
cwd,
preferLocal: true,
stdio: 'inherit',
await x(cmd, execArgs, {
nodeOptions: {
cwd,
stdio: 'inherit',
},
})
},
})
10 changes: 6 additions & 4 deletions src/commands/devtools.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'pathe'
import { execa } from 'execa'
import { x } from 'tinyexec'
import { defineCommand } from 'citty'

import { cwdArgs, legacyRootDirArgs } from './_shared'
Expand All @@ -26,12 +26,14 @@ export default defineCommand({
process.exit(1)
}

await execa(
await x(
'npx',
['@nuxt/devtools-wizard@latest', ctx.args.command, cwd],
{
stdio: 'inherit',
cwd,
nodeOptions: {
stdio: 'inherit',
cwd,
},
},
)
},
Expand Down
16 changes: 11 additions & 5 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { DownloadTemplateResult } from 'giget'
import { relative, resolve } from 'pathe'
import { consola } from 'consola'
import { installDependencies } from 'nypm'
import { x } from 'tinyexec'
import type { PackageManagerName } from 'nypm'
import { defineCommand } from 'citty'

Expand Down Expand Up @@ -145,12 +146,17 @@ export default defineCommand({
}
if (ctx.args.gitInit) {
consola.info('Initializing git repository...\n')
const { execa } = await import('execa')
await execa('git', ['init', template.dir], {
stdio: 'inherit',
}).catch((err) => {
try {
await x('git', ['init', template.dir], {
throwOnError: true,
nodeOptions: {
stdio: 'inherit',
},
})
}
catch (err) {
consola.warn(`Failed to initialize git repository: ${err}`)
})
}
}

// Display next steps
Expand Down
4 changes: 2 additions & 2 deletions src/commands/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, promises as fsp } from 'node:fs'
import { dirname, relative } from 'node:path'
import { execa } from 'execa'
import { x } from 'tinyexec'
import { setupDotenv } from 'c12'
import { resolve } from 'pathe'
import { consola } from 'consola'
Expand Down Expand Up @@ -100,6 +100,6 @@ export default defineCommand({
consola.info(`Starting preview command: \`${nitroJSON.commands.preview}\``)
const [command, ...commandArgs] = nitroJSON.commands.preview.split(' ')
consola.log('')
await execa(command, commandArgs, { stdio: 'inherit', cwd: outputPath })
await x(command, commandArgs, { nodeOptions: { stdio: 'inherit', cwd: outputPath } })
},
})
Loading
Loading