Skip to content

Commit

Permalink
fix: fix workspace object config detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko Kruschke committed Nov 17, 2023
1 parent 9636773 commit 0730bde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/update-ts-references.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0730bde

Please sign in to comment.