Skip to content

Commit ef04de2

Browse files
committed
Fix socket optimize regression
1 parent e577de2 commit ef04de2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/commands/optimize/add-overrides.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ type AddOverridesState = {
3939
updated: Set<string>
4040
updatedInWorkspaces: Set<string>
4141
warnedPnpmWorkspaceRequiresNpm: boolean
42-
workspacePkgJsonPaths: string[]
4342
}
4443

4544
const { NPM, PNPM, YARN_CLASSIC } = constants
@@ -68,11 +67,11 @@ export async function addOverrides(
6867
addedInWorkspaces: new Set(),
6968
updated: new Set(),
7069
updatedInWorkspaces: new Set(),
71-
warnedPnpmWorkspaceRequiresNpm: false,
72-
workspacePkgJsonPaths: await globWorkspace(agent, rootPath)
70+
warnedPnpmWorkspaceRequiresNpm: false
7371
}
7472
} = { __proto__: null, ...options } as AddOverridesOptions
75-
const isWorkspace = state.workspacePkgJsonPaths.length > 0
73+
const workspacePkgJsonPaths = await globWorkspace(agent, pkgPath)
74+
const isWorkspace = workspacePkgJsonPaths.length > 0
7675
const isWorkspaceRoot = pkgPath === rootPath
7776
const isLockScanned = isWorkspaceRoot && !prod
7877
const workspaceName = isWorkspaceRoot ? '' : path.relative(rootPath, pkgPath)
@@ -230,16 +229,15 @@ export async function addOverrides(
230229

231230
if (isWorkspace) {
232231
// Chunk package names to process them in parallel 3 at a time.
233-
await pEach(state.workspacePkgJsonPaths, 3, async workspacePkgJsonPath => {
232+
await pEach(workspacePkgJsonPaths, 3, async workspacePkgJsonPath => {
234233
const otherState = await addOverrides(
235234
pkgEnvDetails,
236235
path.dirname(workspacePkgJsonPath),
237236
{
238237
logger,
239238
pin,
240239
prod,
241-
spinner,
242-
state
240+
spinner
243241
}
244242
)
245243
for (const key of [

0 commit comments

Comments
 (0)