Move to Yarn 1.6.0 (#17741)

This commit is contained in:
Kim Joar Bekkelund 2018-04-17 18:53:12 +02:00 committed by Spencer
parent 30aa1318dc
commit 6be9df01af
10 changed files with 740 additions and 139609 deletions

View file

@ -15,7 +15,6 @@
/packages/eslint-config-kibana
/packages/eslint-plugin-kibana-custom
/packages/kbn-pm/dist
/packages/kbn-pm/vendor
/packages/kbn-plugin-generator/sao_template/template
/packages/kbn-ui-framework/dist
/packages/kbn-ui-framework/doc_site/build

View file

@ -305,6 +305,6 @@
},
"engines": {
"node": "8.11.0",
"yarn": "^1.3.2"
"yarn": "^1.6.0"
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,6 +0,0 @@
// This is placed directly in `./src` to be consistent with the relative
// location from `./dist` in the production build
import { join } from 'path';
export const yarnPath = join(__dirname, '../vendor/yarn-1.3.2.js');

View file

@ -1,5 +1,4 @@
import { spawn, spawnStreaming } from './child_process';
import { yarnPath } from '../paths';
import { Project } from './project';
/**
@ -18,7 +17,7 @@ export async function installInDir(
// We pass the mutex flag to ensure only one instance of yarn runs at any
// given time (e.g. to avoid conflicts).
await spawn(yarnPath, options, {
await spawn('yarn', options, {
cwd: directory,
});
}
@ -35,7 +34,7 @@ export async function runScriptInPackage(
cwd: pkg.path,
};
await spawn(yarnPath, ['run', script, ...args], execOpts);
await spawn('yarn', ['run', script, ...args], execOpts);
}
/**
@ -50,7 +49,7 @@ export function runScriptInPackageStreaming(
cwd: pkg.path,
};
return spawnStreaming(yarnPath, ['run', script, ...args], execOpts, {
return spawnStreaming('yarn', ['run', script, ...args], execOpts, {
prefix: pkg.name,
});
}

View file

@ -1,14 +0,0 @@
Kibana ships with a vendored version of Yarn, which is used to install
dependencies when preparing the production build of Kibana.
The currently vendored version of Yarn contains the bugfix in
https://github.com/yarnpkg/yarn/pull/5059, which handles optional dependencies.
To build a new Yarn bundle, check out that pull request and run:
```
yarn build-bundle
```
This will create the file `artifacts/yarn-1.3.2.js`, which can be renamed and
moved to this folder.

File diff suppressed because one or more lines are too long

View file

@ -52,7 +52,7 @@ export default {
],
testPathIgnorePatterns: [
'<rootDir>/packages/kbn-ui-framework/(dist|doc_site|generator-kui)/',
'<rootDir>/packages/kbn-pm/(dist|vendor)/',
'<rootDir>/packages/kbn-pm/dist/',
'integration_tests/'
],
transform: {

View file

@ -15,7 +15,6 @@ export const IGNORE_FILE_GLOBS = [
'**/Gruntfile.js',
'tasks/config/**/*',
'tasks/build/docker/docs/{Dockerfile,docker-compose.yml}',
'packages/kbn-pm/vendor/yarn-1.3.2.js'
];

View file

@ -1,17 +1,12 @@
import { execFile } from 'child_process';
module.exports = function (grunt) {
grunt.registerTask('_build:installDependencies', function () {
// We rely on a local version of Yarn that contains the bugfix from
// https://github.com/yarnpkg/yarn/pull/5059. Once this fix is merged
// and released we can use Yarn directly in the build.
const yarn = require.resolve('../../packages/kbn-pm/vendor/yarn-1.3.2.js');
// We're using `pure-lockfile` instead of `frozen-lockfile` because we
// rewrite `link:` dependencies to `file:` dependencies earlier in the
// build. This means the lockfile won't be consistent, so instead of
// verifying it, we just skip writing a new lockfile. However, this does
// still use the existing lockfile for dependency resolution.
execFile(yarn, ['--production', '--ignore-optional', '--pure-lockfile'], {
execFile('yarn', ['--production', '--ignore-optional', '--pure-lockfile'], {
cwd: grunt.config.process('<%= root %>/build/kibana')
}, this.async());
});