@@ -17,6 +17,7 @@ import {
1717 resolveDesktopConfigPath ,
1818 desktopConfigWritePath ,
1919} from './desktopConfig.js'
20+ import { addToDesktopConfig } from './config.js'
2021
2122const require = createRequire ( import . meta. url )
2223const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
@@ -340,16 +341,7 @@ export async function runPrepareModules(workspaceRoot, _stdio = 'inherit') {
340341 }
341342}
342343
343- function loadConfigUtil ( workspaceRoot ) {
344- const utilPath = join (
345- workspaceRoot ,
346- 'node_modules/@owdproject/nx/dist/utils/utilConfig.js' ,
347- )
348- if ( ! existsSync ( utilPath ) ) {
349- throw new Error ( 'Workspace install needs @owdproject/nx. Run `pnpm install` at the repo root.' )
350- }
351- return require ( utilPath )
352- }
344+
353345
354346export function printPlan ( { pkgName, kind, targetDir, source, branch, dryRun } ) {
355347 const kindMeta = KINDS [ kind ]
@@ -453,8 +445,7 @@ export async function runWorkspaceInstall({
453445 await cloneRepo ( targetDir , source . gitUrl , branch , workspaceRoot )
454446 await linkWorkspacePackage ( desktopPath , pkgName )
455447
456- const { addToDesktopConfig } = loadConfigUtil ( workspaceRoot )
457- addToDesktopConfig ( configPath , KINDS [ kind ] . configKey , pkgName )
448+ addToDesktopConfig ( configPath , workspaceRoot , KINDS [ kind ] . configKey , pkgName )
458449
459450 await runDevPrepare ( workspaceRoot , pkgName )
460451
@@ -464,8 +455,7 @@ export async function runWorkspaceInstall({
464455
465456export function runNpmInstall ( kind , pkgName , workspaceRoot , stdio = 'inherit' ) {
466457 return new Promise ( ( resolve , reject ) => {
467- const nxTarget = KINDS [ kind ] . nx
468- const child = spawn ( 'pnpm' , [ 'nx' , 'run' , nxTarget , `--name=${ pkgName } ` ] , {
458+ const child = spawn ( 'node' , [ 'scripts/install-app.mjs' , pkgName , `--kind=${ kind } ` ] , {
469459 stdio,
470460 shell : true ,
471461 cwd : workspaceRoot ,
0 commit comments