@@ -3,8 +3,12 @@ import * as os from "node:os";
33import * as path from "node:path" ;
44
55import { resolveCloudApiKey , THESYS_KEYS_URL } from "../auth/mint" ;
6- import { printLogTail , QUIET_COMMAND_CAPTURE_LIMIT } from "../lib/command-output" ;
7- import { promptForProviderKey , resolveImmediate } from "../lib/create-helpers" ;
6+ import {
7+ promptForProviderKey ,
8+ resolveImmediate ,
9+ runDependencyInstall ,
10+ withProgress ,
11+ } from "../lib/create-helpers" ;
812import { aiSetupFromTemplate , createFunnelProps } from "../lib/create-telemetry" ;
913import type { CreateAppOptions , EnvResult , TemplateName } from "../lib/create-types" ;
1014import {
@@ -21,15 +25,13 @@ import {
2125 resolveOverlay ,
2226 type OverlayManifest ,
2327} from "../lib/overlays" ;
24- import { runCommand } from "../lib/process-runner" ;
2528import {
2629 rejectConflictingScaffoldSelectors ,
2730 resolveProject ,
2831 templatesFromOverlays ,
2932} from "../lib/projects" ;
3033import { resolveArgs } from "../lib/resolve-args" ;
3134import { resolveTemplateSource } from "../lib/scaffold-template" ;
32- import { withSpinner } from "../lib/spinner" ;
3335import { resolveAvailableTarget } from "../lib/target-dir" ;
3436import { CliCancelledError , CreateError , telemetry } from "../lib/telemetry" ;
3537import { cliErrorProperties , processErrorProperties } from "../lib/utils" ;
@@ -224,7 +226,9 @@ export async function runCreateApp(options: CreateAppOptions): Promise<void> {
224226 ) ;
225227 }
226228
227- const templateSource = await templateSourcePromise ;
229+ const templateSource = template
230+ ? await withProgress ( "Fetching template..." , ( ) => templateSourcePromise , options . verbose )
231+ : await templateSourcePromise ;
228232 const templateDir = templateSource ?. dir ;
229233 const overlays = templateDir ? listOverlays ( templateDir ) : [ ] ;
230234 const overlayNames = overlays . map ( ( overlay ) => overlay . name ) ;
@@ -261,9 +265,6 @@ export async function runCreateApp(options: CreateAppOptions): Promise<void> {
261265 "MISSING_REQUIRED_ARG" ,
262266 ) ;
263267 }
264- if ( templateSource . origin === "github" ) {
265- console . info ( "Checked out template from GitHub.\n" ) ;
266- }
267268
268269 const backendFramework = project . name ;
269270 if ( ! overlayNames . includes ( backendFramework ) ) {
@@ -484,41 +485,22 @@ export async function runCreateApp(options: CreateAppOptions): Promise<void> {
484485 template,
485486 ai_setup : aiSetup ,
486487 } ) ;
487- const runInstall = ( ) =>
488- options . verbose
489- ? runCommand ( packageManager . runCmd , installArgs , targetDir )
490- : runCommand ( packageManager . runCmd , installArgs , targetDir , {
491- echo : false ,
492- stdin : "ignore" ,
493- captureLimit : QUIET_COMMAND_CAPTURE_LIMIT ,
494- env : {
495- ...process . env ,
496- npm_config_loglevel : "error" ,
497- NPM_CONFIG_LOGLEVEL : "error" ,
498- } ,
499- } ) ;
500-
501- if ( options . verbose ) {
502- console . info ( `Installing dependencies with: ${ installCmd } \n` ) ;
503- }
504- const installResult = options . verbose
505- ? await runInstall ( )
506- : await withSpinner ( "Installing dependencies..." , runInstall ) ;
488+ const installResult = await runDependencyInstall ( {
489+ verbose : options . verbose ,
490+ command : packageManager . runCmd ,
491+ args : installArgs ,
492+ cwd : targetDir ,
493+ installCmd,
494+ } ) ;
507495 if ( ! installResult . error && installResult . status === 0 ) {
508496 dependencyInstalled = true ;
509- if ( ! options . verbose ) {
510- console . info ( "✓ Dependencies installed\n" ) ;
511- }
512497 telemetry . capture ( "cli_dependency_install_succeeded" , {
513498 ...createFunnelProps ( "dependency_install_succeeded" ) ,
514499 template,
515500 ai_setup : aiSetup ,
516501 dependency_installed : dependencyInstalled ,
517502 } ) ;
518503 } else {
519- if ( ! options . verbose ) {
520- printLogTail ( installResult . diagnosticTail , "install log (tail)" ) ;
521- }
522504 const properties = processErrorProperties ( installResult , "dependency_install" , {
523505 error_class : "dependency" ,
524506 error_code : "NONZERO_EXIT" ,
0 commit comments