mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Fix compatibility with yarn 1.22.0 (#56917)
* Revert "force yarn 1.21.1 until we can handle invalid output of 1.22.0 (#56914)" This reverts commit5686010b46
. * move the --json argument before `workspaces` so it still works * update kbn/pm dist (cherry picked from commit12de6a8459
)
This commit is contained in:
parent
66249b1f75
commit
a39524c6f5
2 changed files with 15 additions and 6 deletions
12
packages/kbn-pm/dist/index.js
vendored
12
packages/kbn-pm/dist/index.js
vendored
|
@ -56565,12 +56565,18 @@ function runScriptInPackageStreaming(script, args, pkg) {
|
|||
});
|
||||
}
|
||||
async function yarnWorkspacesInfo(directory) {
|
||||
const workspacesInfo = await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['workspaces', 'info', '--json'], {
|
||||
const {
|
||||
stdout
|
||||
} = await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['--json', 'workspaces', 'info'], {
|
||||
cwd: directory,
|
||||
stdio: 'pipe'
|
||||
});
|
||||
const stdout = JSON.parse(workspacesInfo.stdout);
|
||||
return JSON.parse(stdout.data);
|
||||
|
||||
try {
|
||||
return JSON.parse(JSON.parse(stdout).data);
|
||||
} catch (error) {
|
||||
throw new Error(`'yarn workspaces info --json' produced unexpected output: \n${stdout}`);
|
||||
}
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
|
|
@ -67,11 +67,14 @@ export function runScriptInPackageStreaming(script: string, args: string[], pkg:
|
|||
}
|
||||
|
||||
export async function yarnWorkspacesInfo(directory: string): Promise<WorkspacesInfo> {
|
||||
const workspacesInfo = await spawn('yarn', ['workspaces', 'info', '--json'], {
|
||||
const { stdout } = await spawn('yarn', ['--json', 'workspaces', 'info'], {
|
||||
cwd: directory,
|
||||
stdio: 'pipe',
|
||||
});
|
||||
|
||||
const stdout = JSON.parse(workspacesInfo.stdout);
|
||||
return JSON.parse(stdout.data);
|
||||
try {
|
||||
return JSON.parse(JSON.parse(stdout).data);
|
||||
} catch (error) {
|
||||
throw new Error(`'yarn workspaces info --json' produced unexpected output: \n${stdout}`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue