From f9d6390666e10c34c5a31308e5a09e50203d640e Mon Sep 17 00:00:00 2001 From: Eduardo Roth Date: Thu, 9 May 2024 18:00:35 -0600 Subject: [PATCH] fix(add-angular-to-qwik): check if @nx/devkit is installed --- packages/add-angular-to-qwik/bin/add-angular-to-qwik.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/add-angular-to-qwik/bin/add-angular-to-qwik.ts b/packages/add-angular-to-qwik/bin/add-angular-to-qwik.ts index 4bcaa93..8a5e517 100644 --- a/packages/add-angular-to-qwik/bin/add-angular-to-qwik.ts +++ b/packages/add-angular-to-qwik/bin/add-angular-to-qwik.ts @@ -51,6 +51,7 @@ export const commandsObject: yargs.Argv = yargs async function main(parsedArgs: yargs.Arguments) { let isQwikNxInstalled = false; + let isNxDevkitInstalled = false; const pm = getRelevantPackageManagerCommand(); output.log({ @@ -78,6 +79,13 @@ async function main(parsedArgs: yargs.Arguments) { if (!isQwikNxInstalled) { execSync(`${pm.add} qwik-nx@latest nx@latest`, { stdio: [0, 1, 2] }); } + + isNxDevkitInstalled = checkIfPackageInstalled('@nx/devkit'); + + if (!isNxDevkitInstalled) { + execSync(`${pm.addDev} @nx/devkit@latest`, { stdio: [0, 1, 2] }); + } + const installMaterialExample = parsedArgs['installMaterialExample']; const installMaterialExampleFlag = installMaterialExample === true || installMaterialExample === false @@ -130,6 +138,7 @@ function getRelevantPackageManagerCommand() { return { install: pmc.install, add: pmc.add, + addDev: pmc.addDev, uninstall, }; }