Skip to content
Source
Sign inSign up
TanStack/alt-cli

fix:spinner rending during deps installation step #2

Openatybdot(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/2/headopened

Showing 2 changed files with 21 additions and 4 deletions.

x
0 of 2 viewed, 2 left
5 additions and 0 deletions.changeset/warm-forks-live.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/cli': minor
+---
+​
+fix:spinner not rendering properly during deps installation
16 additions and 4 deletionspackages/cli/src/commands/create.tsModified
View file
@@ -420,10 +420,22 @@
}, 1000)
​
try {
- const { execSync } = await import('node:child_process')
- const installCmd =
- packageManager === 'yarn' ? 'yarn' : `${packageManager} install`
- execSync(installCmd, { cwd: targetDir, stdio: 'ignore' })
+ const { spawn } = await import('node:child_process')
+ const installCmd = packageManager === 'yarn' ? 'yarn' : packageManager
+ const args = packageManager === 'yarn' ? [] : ['install']
+ await new Promise<void>((resolve, reject) => {
+ const child = spawn(installCmd, args, {
+ cwd: targetDir,
+ stdio: 'ignore',
+ shell: true,
+ })