diff --git a/src/main/generate.mjs b/src/main/generate.mjs index 3d1836c2..00491d7a 100644 --- a/src/main/generate.mjs +++ b/src/main/generate.mjs @@ -2,6 +2,7 @@ import { stat } from 'node:fs/promises' import { getPkgManager } from './lib/get-package-manager.mjs' import { importOrLocal } from './lib/import-or-local.mjs' import errors from './errors.mjs' +import split from 'split2' export const prepareFolder = async (path, tempNames, logger) => { const s = await stat(path) @@ -136,7 +137,16 @@ export const createApp = async (projectDir, { projectName, services, entrypoint, await generator.prepare() await generator.writeFiles() - await execa(pkgManager, ['install'], { cwd: projectDir }) + const child = execa(pkgManager, ['install'], { cwd: projectDir }) + + child.stdout.pipe(split()).on('data', (line) => { + logger.info(line) + }) + + child.stderr.pipe(split()).on('data', (line) => { + logger.error(line) + }) + await child logger.info('App created!') } diff --git a/test/main/create-app.test.mjs b/test/main/create-app.test.mjs index 6b137228..500dcd86 100644 --- a/test/main/create-app.test.mjs +++ b/test/main/create-app.test.mjs @@ -113,4 +113,4 @@ test('Create app', async (t) => { } catch (err) { test.fails('Should have not thrown an error') } -}, 50000) +}, 60000)