From 0730bdeb46c291692d58ad76dc27b6b8dc5eb403 Mon Sep 17 00:00:00 2001 From: Mirko Kruschke Date: Sat, 18 Nov 2023 00:15:15 +0100 Subject: [PATCH] fix: fix workspace object config detection --- src/update-ts-references.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/update-ts-references.js b/src/update-ts-references.js index 661ffcb..9aabaf4 100644 --- a/src/update-ts-references.js +++ b/src/update-ts-references.js @@ -214,6 +214,10 @@ const execute = async ({ const packageJson = require(path.join(cwd, PACKAGE_JSON)); let workspaces = packageJson.workspaces; + if(workspaces && !Array.isArray(workspaces)) { + workspaces = workspaces.packages; + } + if (!workspaces && fs.existsSync(path.join(cwd, 'lerna.json'))) { const lernaJson = require(path.join(cwd, 'lerna.json')); workspaces = lernaJson.packages; @@ -244,10 +248,6 @@ const execute = async ({ ); } - if (!Array.isArray(workspaces)) { - workspaces = workspaces.packages; - } - const packageFilePaths = await getAllPackageJsons(workspaces, cwd); if (verbose) { console.log('packageFilePaths', packageFilePaths);