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 commit 5686010b46
.
* move the --json argument before `workspaces` so it still works
* update kbn/pm dist
This commit is contained in:
parent
7276087e8a
commit
12de6a8459
5 changed files with 19 additions and 9 deletions
|
@ -486,6 +486,6 @@
|
|||
},
|
||||
"engines": {
|
||||
"node": "10.18.0",
|
||||
"yarn": "1.21.1"
|
||||
"yarn": "^1.21.1"
|
||||
}
|
||||
}
|
||||
|
|
12
packages/kbn-pm/dist/index.js
vendored
12
packages/kbn-pm/dist/index.js
vendored
|
@ -56572,12 +56572,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}`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,8 @@ if [[ "$installNode" == "true" || ! $(which yarn) ]]; then
|
|||
###
|
||||
### downloading yarn
|
||||
###
|
||||
npm install -g "yarn@$(node -e "console.log(require('./package.json').engines.yarn)")"
|
||||
yarnVersion="$(node -e "console.log(String(require('./package.json').engines.yarn || '').replace(/^[^\d]+/,''))")"
|
||||
npm install -g "yarn@^${yarnVersion}"
|
||||
fi
|
||||
|
||||
###
|
||||
|
|
|
@ -351,7 +351,7 @@
|
|||
"xregexp": "4.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"yarn": "1.21.1"
|
||||
"yarn": "^1.21.1"
|
||||
},
|
||||
"workspaces": {
|
||||
"nohoist": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue