diff --git a/docs/development/core-development.asciidoc b/docs/development/core-development.asciidoc index 45f52c16ee33..ed04a6f12eae 100644 --- a/docs/development/core-development.asciidoc +++ b/docs/development/core-development.asciidoc @@ -15,4 +15,6 @@ include::core/development-modules.asciidoc[] include::core/development-elasticsearch.asciidoc[] +include::core/development-unit-tests.asciidoc[] + include::core/development-functional-tests.asciidoc[] diff --git a/docs/development/core/development-unit-tests.asciidoc b/docs/development/core/development-unit-tests.asciidoc new file mode 100644 index 000000000000..486cb5e2caed --- /dev/null +++ b/docs/development/core/development-unit-tests.asciidoc @@ -0,0 +1,82 @@ +[[development-unit-tests]] +=== Unit Testing + +We use unit tests to make sure that individual software units of {kib} perform as they were designed to. + +[float] +=== Current Frameworks + +{kib} is migrating unit testing from `Mocha` to `Jest`. Legacy unit tests still exist in `Mocha` but all new unit tests should be written in `Jest`. + +[float] +==== Mocha (legacy) + +Mocha tests are contained in `__tests__` directories. + +*Running Mocha Unit Tests* + +["source","shell"] +----------- +yarn test:mocha +----------- + +[float] +==== Jest +Jest tests are stored in the same directory as source code files with the `.test.{js,ts,tsx}` suffix. + +*Running Jest Unit Tests* + +["source","shell"] +----------- +yarn test:jest +----------- + +[float] +===== Writing Jest Unit Tests + +In order to write those tests there are two main things you need to be aware of. +The first one is the different between `jest.mock` and `jest.doMock` +and the second one our `jest mocks file pattern`. As we are running `js` and `ts` +test files with `babel-jest` both techniques are needed +specially for the tests implemented on Typescript in order to benefit from the +auto-inference types feature. + +[float] +===== Jest.mock vs Jest.doMock + +Both methods are essentially the same on their roots however the `jest.mock` +calls will get hoisted to the top of the file and can only reference variables +prefixed with `mock`. On the other hand, `jest.doMock` won't be hoisted and can +reference pretty much any variable we want, however we have to assure those referenced +variables are instantiated at the time we need them which lead us to the next +section where we'll talk about our jest mock files pattern. + +[float] +===== Jest Mock Files Pattern + +Specially on typescript it is pretty common to have in unit tests +`jest.doMock` calls which reference for example imported types. Any error +will thrown from doing that however the test will fail. The reason behind that +is because despite the `jest.doMock` isn't being hoisted by `babel-jest` the +import with the types we are referencing will be hoisted to the top and at the +time we'll call the function that variable would not be defined. + +In order to prevent that we develop a protocol that should be followed: + +- Each module could provide a standard mock in `mymodule.mock.ts` in case +there are other tests that could benefit from using definitions here. +This file would not have any `jest.mock` calls, just dummy objects. + +- Each test defines its mocks in `mymodule.test.mocks.ts`. This file +could import relevant mocks from the generalised module's mocks +file `(*.mock.ts)` and call `jest.mock` for each of them. If there is +any relevant dummy mock objects to generalise (and to be used by +other tests), the dummy objects could be defined directly on this file. + +- Each test would import its mocks from the test mocks +file mymodule.test.mocks.ts. `mymodule.test.ts` has an import +like: `import * as Mocks from './mymodule.test.mocks'`, +`import { mockX } from './mymodule.test.mocks'` +or just `import './mymodule.test.mocks'` if there isn't anything +exported to be used. + diff --git a/package.json b/package.json index 45a51a175455..950180ec6eba 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,9 @@ ] }, "dependencies": { + "@babel/core": "^7.3.4", + "@babel/polyfill": "^7.2.5", + "@babel/register": "^7.0.0", "@elastic/datemath": "5.0.2", "@elastic/eui": "9.4.2", "@elastic/filesaver": "1.1.2", @@ -120,10 +123,7 @@ "angular-sanitize": "1.6.5", "angular-sortable-view": "0.0.15", "autoprefixer": "^9.1.0", - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-polyfill": "6.26.0", - "babel-register": "6.26.0", + "babel-loader": "8.0.5", "bluebird": "3.5.3", "boom": "^7.2.0", "brace": "0.11.1", @@ -260,7 +260,7 @@ "@octokit/rest": "^15.10.0", "@types/angular": "1.6.50", "@types/angular-mocks": "^1.7.0", - "@types/babel-core": "^6.25.5", + "@types/babel__core": "^7.1.0", "@types/bluebird": "^3.1.1", "@types/boom": "^7.2.0", "@types/chance": "^1.0.0", @@ -272,7 +272,7 @@ "@types/delete-empty": "^2.0.0", "@types/elasticsearch": "^5.0.30", "@types/enzyme": "^3.1.12", - "@types/eslint": "^4.16.2", + "@types/eslint": "^4.16.6", "@types/execa": "^0.9.0", "@types/fetch-mock": "7.2.1", "@types/getopts": "^2.0.0", @@ -317,8 +317,8 @@ "@types/zen-observable": "^0.8.0", "angular-mocks": "1.4.7", "archiver": "^3.0.0", - "babel-eslint": "^9.0.0", - "babel-jest": "^23.6.0", + "babel-eslint": "^10.0.1", + "babel-jest": "^24.1.0", "backport": "4.4.1", "chai": "3.5.0", "chance": "1.0.10", @@ -332,17 +332,17 @@ "enzyme-adapter-react-16": "^1.9.0", "enzyme-adapter-utils": "^1.10.0", "enzyme-to-json": "^3.3.4", - "eslint": "^5.6.0", - "eslint-config-prettier": "^3.1.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.26.2", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-mocha": "^5.2.0", + "eslint": "^5.15.1", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.3.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^2.6.2", - "eslint-plugin-react": "^7.11.1", + "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-react": "^7.12.4", "faker": "1.1.0", "fetch-mock": "7.3.0", "geckodriver": "1.12.2", @@ -353,7 +353,7 @@ "grunt-karma": "2.0.0", "grunt-peg": "^2.0.1", "grunt-run": "0.7.0", - "gulp-babel": "^7.0.1", + "gulp-babel": "^8.0.0", "gulp-sourcemaps": "2.6.4", "has-ansi": "^3.0.0", "image-diff": "1.6.0", @@ -399,9 +399,6 @@ "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", "tree-kill": "^1.1.0", - "ts-jest": "^23.1.4", - "ts-loader": "^5.2.2", - "ts-node": "^7.0.1", "tslint": "^5.11.0", "tslint-config-prettier": "^1.15.0", "tslint-microsoft-contrib": "^6.0.0", diff --git a/packages/elastic-datemath/.babelrc b/packages/elastic-datemath/.babelrc index e39c0afafdd9..26138d48b71b 100644 --- a/packages/elastic-datemath/.babelrc +++ b/packages/elastic-datemath/.babelrc @@ -1,13 +1,16 @@ { - "presets": [["env", { - "targets": { - "node": "current", - "browsers": [ - "last 2 versions", - "> 5%", - "Safari 7", - ] + "presets": [ + ["@babel/preset-env", { + "targets": { + "node": "current", + "browsers": [ + "last 2 versions", + "> 5%", + "Safari 7" + ] + } } - }]], + ] + ], "plugins": ["add-module-exports"] -} \ No newline at end of file +} diff --git a/packages/elastic-datemath/package.json b/packages/elastic-datemath/package.json index 3b626077f5ea..77c545709a3c 100644 --- a/packages/elastic-datemath/package.json +++ b/packages/elastic-datemath/package.json @@ -11,9 +11,9 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "babel-cli": "^6.26.0", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-preset-env": "^1.7.0", + "@babel/cli": "^7.2.3", + "@babel/preset-env": "^7.3.4", + "babel-plugin-add-module-exports": "^1.0.0", "moment": "^2.13.0" }, "dependencies": { diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index d2e639eebbbe..c4a5a99e4c97 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,15 +15,15 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { - "babel-eslint": "^9.0.0", - "eslint": "^5.6.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.22.1", - "eslint-plugin-mocha": "^5.2.0", + "babel-eslint": "^10.0.1", + "eslint": "^5.14.1", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.3.0", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-react": "^7.12.4" } } diff --git a/packages/kbn-babel-code-parser/package.json b/packages/kbn-babel-code-parser/package.json index 23e7c29f22df..addc53028565 100755 --- a/packages/kbn-babel-code-parser/package.json +++ b/packages/kbn-babel-code-parser/package.json @@ -15,7 +15,7 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "babel-cli": "^6.26.0" + "@babel/cli": "^7.2.3" }, "dependencies": { "@kbn/babel-preset": "1.0.0", diff --git a/packages/kbn-babel-preset/common_preset.js b/packages/kbn-babel-preset/common_preset.js index a2d4495adc54..e67a2db5a380 100644 --- a/packages/kbn-babel-preset/common_preset.js +++ b/packages/kbn-babel-preset/common_preset.js @@ -19,20 +19,33 @@ module.exports = { presets: [ - require.resolve('babel-preset-react'), + require.resolve('@babel/preset-typescript'), + require.resolve('@babel/preset-react') ], plugins: [ require.resolve('babel-plugin-add-module-exports'), - // stage 3 - require.resolve('babel-plugin-transform-async-generator-functions'), - require.resolve('babel-plugin-transform-object-rest-spread'), - // the class properties proposal was merged with the private fields proposal + // The class properties proposal was merged with the private fields proposal // into the "class fields" proposal. Babel doesn't support this combined // proposal yet, which includes private field, so this transform is // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 // // See https://github.com/babel/proposals/issues/12 for progress - require.resolve('babel-plugin-transform-class-properties'), + require.resolve('@babel/plugin-proposal-class-properties'), ], + overrides: [ + { + // Babel 7 don't support the namespace feature on typescript code. + // With namespaces only used for type declarations, we can securely + // strip them off for babel on x-pack infra plugin + // + // See https://github.com/babel/babel/issues/8244#issuecomment-466548733 + test: /x-pack[\/\\]plugins[\/\\]infra[\/\\].*[\/\\]graphql/, + plugins: [ + [ + require.resolve('babel-plugin-typescript-strip-namespaces'), + ], + ] + } + ] }; diff --git a/packages/kbn-babel-preset/common_preset_7.js b/packages/kbn-babel-preset/common_preset_7.js deleted file mode 100644 index df72f382e2b0..000000000000 --- a/packages/kbn-babel-preset/common_preset_7.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -module.exports = { - presets: [ - require.resolve('@babel/preset-react'), - require.resolve('@babel/preset-typescript'), - ], - plugins: [ - require.resolve('babel7-plugin-add-module-exports'), - // stage 3 - require.resolve('@babel/plugin-proposal-async-generator-functions'), - require.resolve('@babel/plugin-proposal-object-rest-spread'), - - // the class properties proposal was merged with the private fields proposal - // into the "class fields" proposal. Babel doesn't support this combined - // proposal yet, which includes private field, so this transform is - // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 - // - // See https://github.com/babel/proposals/issues/12 for progress - require.resolve('@babel/plugin-proposal-class-properties'), - ], -}; diff --git a/packages/kbn-babel-preset/node_preset.js b/packages/kbn-babel-preset/node_preset.js index 04d6dd3609e8..ac4dc17e6380 100644 --- a/packages/kbn-babel-preset/node_preset.js +++ b/packages/kbn-babel-preset/node_preset.js @@ -17,34 +17,37 @@ * under the License. */ -module.exports = { - presets: [ - [ - require.resolve('babel-preset-env'), - { - targets: { - // only applies the necessary transformations based on the - // current node.js processes version. For example: running - // `nvm install 8 && node ./src/cli` will run kibana in node - // version 8 and babel will stop transpiling async/await - // because they are supported in the "current" version of node - node: 'current', - }, +module.exports = () => { + return { + presets: [ + [ + require.resolve('@babel/preset-env'), + { + targets: { + // only applies the necessary transformations based on the + // current node.js processes version. For example: running + // `nvm install 8 && node ./src/cli` will run kibana in node + // version 8 and babel will stop transpiling async/await + // because they are supported in the "current" version of node + node: 'current', + }, - // replaces `import "babel-polyfill"` with a list of require statements - // for just the polyfills that the target versions don't already supply - // on their own - useBuiltIns: true, - }, + // replaces `import "@babel/polyfill"` with a list of require statements + // for just the polyfills that the target versions don't already supply + // on their own + useBuiltIns: 'entry', + modules: 'cjs' + }, + ], + require('./common_preset'), ], - require('./common_preset'), - ], - plugins: [ - [ - require.resolve('babel-plugin-transform-define'), - { - 'global.__BUILT_WITH_BABEL__': 'true' - } + plugins: [ + [ + require.resolve('babel-plugin-transform-define'), + { + 'global.__BUILT_WITH_BABEL__': 'true' + } + ] ] - ] + }; }; diff --git a/packages/kbn-babel-preset/node_preset_7.js b/packages/kbn-babel-preset/node_preset_7.js deleted file mode 100644 index b57dd58dd9f1..000000000000 --- a/packages/kbn-babel-preset/node_preset_7.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -module.exports = () => ({ - presets: [ - [ - require.resolve('@babel/preset-env'), - { - targets: { - // only applies the necessary transformations based on the - // current node.js processes version. For example: running - // `nvm install 8 && node ./src/cli` will run kibana in node - // version 8 and babel will stop transpiling async/await - // because they are supported in the "current" version of node - node: 'current', - }, - - // replaces `import "babel-polyfill"` with a list of require statements - // for just the polyfills that the target versions don't already supply - // on their own - useBuiltIns: 'entry', - }, - ], - require('./common_preset_7'), - ], - plugins: [ - [ - require.resolve('babel-plugin-transform-define'), - { - 'global.__BUILT_WITH_BABEL__': 'true' - } - ] - ] -}); diff --git a/packages/kbn-babel-preset/package.json b/packages/kbn-babel-preset/package.json index 41c03c054267..79ee6bbe39c0 100644 --- a/packages/kbn-babel-preset/package.json +++ b/packages/kbn-babel-preset/package.json @@ -4,20 +4,12 @@ "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@babel/core": "^7.3.4", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-class-properties": "^7.3.4", - "@babel/plugin-proposal-object-rest-spread": "^7.3.4", + "@babel/preset-react":"^7.0.0", "@babel/preset-env": "^7.3.4", - "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.3.3", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-transform-async-generator-functions": "^6.24.1", - "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-add-module-exports": "^1.0.0", "babel-plugin-transform-define": "^1.3.1", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "babel7-plugin-add-module-exports": "npm:babel-plugin-add-module-exports@^1.0.0" + "babel-plugin-typescript-strip-namespaces": "^1.1.1" } } diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 97bfa44a049d..df5745bc33f8 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -17,21 +17,24 @@ * under the License. */ -module.exports = { - presets: [ - [ - require.resolve('babel-preset-env'), - { - targets: { - browsers: [ - 'last 2 versions', - '> 5%', - 'Safari 7', // for PhantomJS support: https://github.com/elastic/kibana/issues/27136 - ], +module.exports = () => { + return { + presets: [ + [ + require.resolve('@babel/preset-env'), + { + targets: { + browsers: [ + 'last 2 versions', + '> 5%', + 'Safari 7', // for PhantomJS support: https://github.com/elastic/kibana/issues/27136 + ], + }, + useBuiltIns: 'entry', + modules: 'cjs' }, - useBuiltIns: true, - }, - ], - require('./common_preset'), - ] + ], + require('./common_preset'), + ] + }; }; diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index af39ffecf669..4fbc80d6e679 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -19,9 +19,9 @@ "tslib": "^1.9.3" }, "devDependencies": { + "@babel/cli": "^7.2.3", "@kbn/babel-preset": "1.0.0", "@kbn/expect": "1.0.0", - "babel-cli": "^6.26.0", "chance": "1.0.6" } } diff --git a/packages/kbn-eslint-plugin-eslint/package.json b/packages/kbn-eslint-plugin-eslint/package.json index b35387384071..e2024b54a620 100644 --- a/packages/kbn-eslint-plugin-eslint/package.json +++ b/packages/kbn-eslint-plugin-eslint/package.json @@ -4,8 +4,8 @@ "private": true, "license": "Apache-2.0", "peerDependencies": { - "eslint": "^5.6.0", - "babel-eslint": "^9.0.0" + "eslint": "^5.14.1", + "babel-eslint": "^10.0.1" }, "dependencies": { "dedent": "^0.7.0" diff --git a/packages/kbn-i18n/tsconfig.json b/packages/kbn-i18n/tsconfig.json index 3b757d1240bd..d3dae3078c1d 100644 --- a/packages/kbn-i18n/tsconfig.json +++ b/packages/kbn-i18n/tsconfig.json @@ -1,20 +1,20 @@ -{ - "extends": "../../tsconfig.json", - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "types/intl_format_cache.d.ts", - "types/intl_relativeformat.d.ts" - ], - "exclude": [ - "target" - ], - "compilerOptions": { - "declaration": true, - "declarationDir": "./target/types", - "types": [ - "jest", - "node" - ] - } -} +{ + "extends": "../../tsconfig.json", + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + "types/intl_format_cache.d.ts", + "types/intl_relativeformat.d.ts" + ], + "exclude": [ + "target" + ], + "compilerOptions": { + "declaration": true, + "declarationDir": "./target/types", + "types": [ + "jest", + "node" + ] + } +} diff --git a/packages/kbn-interpreter/.babelrc b/packages/kbn-interpreter/.babelrc index 57a5cc3669eb..875cbcde9d0e 100644 --- a/packages/kbn-interpreter/.babelrc +++ b/packages/kbn-interpreter/.babelrc @@ -1,8 +1,7 @@ { "presets": ["@kbn/babel-preset/webpack_preset"], "plugins": [ - ["babel-plugin-transform-runtime", { - "polyfill": false, + ["@babel/plugin-transform-runtime", { "regenerator": true }] ] diff --git a/packages/kbn-interpreter/package.json b/packages/kbn-interpreter/package.json index 290e02cb2b2e..ded8f38bff49 100644 --- a/packages/kbn-interpreter/package.json +++ b/packages/kbn-interpreter/package.json @@ -9,19 +9,20 @@ "kbn:watch": "node scripts/build --dev --watch" }, "dependencies": { + "@babel/runtime": "^7.3.4", "@kbn/i18n": "1.0.0", "lodash": "npm:@elastic/lodash@3.10.1-kibana1", "lodash.clone": "^4.5.0", "uuid": "3.0.1" }, "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "7.3.4", + "@babel/plugin-transform-runtime": "^7.3.4", + "@babel/polyfill": "7.2.5", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", - "babel-cli": "^6.26.0", - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-polyfill": "6.20.0", + "babel-loader": "8.0.5", "copy-webpack-plugin": "^4.6.0", "css-loader": "1.0.0", "del": "^3.0.0", diff --git a/packages/kbn-interpreter/tasks/build/server_code_transformer.js b/packages/kbn-interpreter/tasks/build/server_code_transformer.js index 5db4dc13640c..b1185f475219 100644 --- a/packages/kbn-interpreter/tasks/build/server_code_transformer.js +++ b/packages/kbn-interpreter/tasks/build/server_code_transformer.js @@ -19,7 +19,7 @@ const { extname } = require('path'); -const { transform } = require('babel-core'); +const { transform } = require('@babel/core'); exports.createServerCodeTransformer = (sourceMaps) => { return (content, path) => { diff --git a/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js b/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js index 01dc9323352a..519e529c20bf 100644 --- a/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js +++ b/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js @@ -28,15 +28,14 @@ describe('js support', () => { it('transpiles js file', () => { const transformer = createServerCodeTransformer(); expect(transformer(JS_FIXTURE, JS_FIXTURE_PATH)).toMatchInlineSnapshot(` -"'use strict'; +"\\"use strict\\"; -var _util = require('util'); - -var _util2 = _interopRequireDefault(_util); +var _util = _interopRequireDefault(require(\\"util\\")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -console.log(_util2.default.format('hello world')); /* eslint-disable */" +/* eslint-disable */ +console.log(_util.default.format('hello world'));" `); }); diff --git a/packages/kbn-plugin-generator/sao_template/template/package_template.json b/packages/kbn-plugin-generator/sao_template/template/package_template.json index 80e6ae8642e1..7a6d0842a164 100644 --- a/packages/kbn-plugin-generator/sao_template/template/package_template.json +++ b/packages/kbn-plugin-generator/sao_template/template/package_template.json @@ -27,15 +27,15 @@ "@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana", "@kbn/expect": "1.0.0", "@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers", - "babel-eslint": "^9.0.0", - "eslint": "^5.6.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.26.2", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-mocha": "^5.2.0", + "babel-eslint": "^10.0.1", + "eslint": "^5.14.1", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.3.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-react": "^7.12.4" } } diff --git a/packages/kbn-plugin-helpers/lib/utils.js b/packages/kbn-plugin-helpers/lib/utils.js index ee82b9a8fd57..d9a5b9148208 100644 --- a/packages/kbn-plugin-helpers/lib/utils.js +++ b/packages/kbn-plugin-helpers/lib/utils.js @@ -25,7 +25,7 @@ function babelRegister() { const plugin = pluginConfig(); try { - // add support for moved babel-register source: https://github.com/elastic/kibana/pull/13973 + // add support for moved @babel/register source: https://github.com/elastic/kibana/pull/13973 require(resolve(plugin.kibanaRoot, 'src/setup_node_env/babel_register')); // eslint-disable-line import/no-dynamic-require } catch (error) { if (error.code === 'MODULE_NOT_FOUND') { diff --git a/packages/kbn-pm/.babelrc b/packages/kbn-pm/.babelrc index f34e55f9b7ba..1ca768097a7e 100644 --- a/packages/kbn-pm/.babelrc +++ b/packages/kbn-pm/.babelrc @@ -1,10 +1,14 @@ { "presets": [ - "stage-3", - ["env", { + "@babel/typescript", + ["@babel/preset-env", { "targets": { "node": "current" } }] + ], + "plugins": [ + "@babel/proposal-class-properties", + "@babel/proposal-object-rest-spread" ] -} \ No newline at end of file +} diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 1f990b2101e3..b2fa23cf4dc2 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -87,146 +87,90 @@ module.exports = /************************************************************************/ /******/ ([ /* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _cli__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "run", function() { return _cli__WEBPACK_IMPORTED_MODULE_0__["run"]; }); + +/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(371); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["buildProductionProjects"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); + +/* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(134); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return _utils_workspaces__WEBPACK_IMPORTED_MODULE_2__["copyWorkspacePackages"]; }); + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _cli = __webpack_require__(1); - -Object.defineProperty(exports, 'run', { - enumerable: true, - get: function () { - return _cli.run; - } -}); - -var _production = __webpack_require__(371); - -Object.defineProperty(exports, 'buildProductionProjects', { - enumerable: true, - get: function () { - return _production.buildProductionProjects; - } -}); -Object.defineProperty(exports, 'prepareExternalProjectDependencies', { - enumerable: true, - get: function () { - return _production.prepareExternalProjectDependencies; - } -}); - -var _workspaces = __webpack_require__(134); - -Object.defineProperty(exports, 'copyWorkspacePackages', { - enumerable: true, - get: function () { - return _workspaces.copyWorkspacePackages; - } -}); /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "run", function() { return run; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); +/* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dedent__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var getopts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var getopts__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(getopts__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(361); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; -let run = exports.run = (() => { - var _ref = _asyncToGenerator(function* (argv) { - // We can simplify this setup (and remove this extra handling) once Yarn - // starts forwarding the `--` directly to this script, see - // https://github.com/yarnpkg/yarn/blob/b2d3e1a8fe45ef376b716d597cc79b38702a9320/src/cli/index.js#L174-L182 - if (argv.includes('--')) { - _log.log.write(_chalk2.default.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); - process.exit(1); - } - const options = (0, _getopts2.default)(argv, { - alias: { - e: 'exclude', - h: 'help', - i: 'include' - }, - boolean: ['prefer-offline', 'frozen-lockfile'] - }); - const args = options._; - if (options.help || args.length === 0) { - help(); - return; - } - // This `rootPath` is relative to `./dist/` as that's the location of the - // built version of this tool. - const rootPath = (0, _path.resolve)(__dirname, '../../../'); - const commandName = args[0]; - const extraArgs = args.slice(1); - const commandOptions = { options, extraArgs, rootPath }; - const command = _commands.commands[commandName]; - if (command === undefined) { - _log.log.write(_chalk2.default.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); - process.exit(1); - } - yield (0, _run.runCommand)(command, commandOptions); - }); - return function run(_x) { - return _ref.apply(this, arguments); - }; -})(); -var _chalk = __webpack_require__(2); -var _chalk2 = _interopRequireDefault(_chalk); - -var _dedent = __webpack_require__(14); - -var _dedent2 = _interopRequireDefault(_dedent); - -var _getopts = __webpack_require__(15); - -var _getopts2 = _interopRequireDefault(_getopts); - -var _path = __webpack_require__(16); - -var _commands = __webpack_require__(17); - -var _run = __webpack_require__(361); - -var _log = __webpack_require__(33); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ function help() { - const availableCommands = Object.keys(_commands.commands).map(commandName => _commands.commands[commandName]).map(command => `${command.name} - ${command.description}`); - _log.log.write(_dedent2.default` + const availableCommands = Object.keys(_commands__WEBPACK_IMPORTED_MODULE_4__["commands"]).map(commandName => _commands__WEBPACK_IMPORTED_MODULE_4__["commands"][commandName]).map(command => `${command.name} - ${command.description}`); + _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(dedent__WEBPACK_IMPORTED_MODULE_1___default.a` usage: kbn [] By default commands are run for Kibana itself, all packages in the 'packages/' @@ -245,6 +189,50 @@ function help() { `); } +async function run(argv) { + // We can simplify this setup (and remove this extra handling) once Yarn + // starts forwarding the `--` directly to this script, see + // https://github.com/yarnpkg/yarn/blob/b2d3e1a8fe45ef376b716d597cc79b38702a9320/src/cli/index.js#L174-L182 + if (argv.includes('--')) { + _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); + process.exit(1); + } + + const options = getopts__WEBPACK_IMPORTED_MODULE_2___default()(argv, { + alias: { + e: 'exclude', + h: 'help', + i: 'include' + }, + boolean: ['prefer-offline', 'frozen-lockfile'] + }); + const args = options._; + + if (options.help || args.length === 0) { + help(); + return; + } // This `rootPath` is relative to `./dist/` as that's the location of the + // built version of this tool. + + + const rootPath = Object(path__WEBPACK_IMPORTED_MODULE_3__["resolve"])(__dirname, '../../../'); + const commandName = args[0]; + const extraArgs = args.slice(1); + const commandOptions = { + options, + extraArgs, + rootPath + }; + const command = _commands__WEBPACK_IMPORTED_MODULE_4__["commands"][commandName]; + + if (command === undefined) { + _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); + process.exit(1); + } + + await Object(_run__WEBPACK_IMPORTED_MODULE_5__["runCommand"])(command, commandOptions); +} + /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { @@ -2452,24 +2440,15 @@ module.exports = require("path"); /***/ }), /* 17 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.commands = undefined; - -var _bootstrap = __webpack_require__(18); - -var _clean = __webpack_require__(136); - -var _run = __webpack_require__(159); - -var _watch = __webpack_require__(160); - +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commands", function() { return commands; }); +/* harmony import */ var _bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); +/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(136); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159); +/* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(160); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -2488,117 +2467,137 @@ var _watch = __webpack_require__(160); * specific language governing permissions and limitations * under the License. */ -const commands = exports.commands = { - bootstrap: _bootstrap.BootstrapCommand, - clean: _clean.CleanCommand, - run: _run.RunCommand, - watch: _watch.WatchCommand + + + + +const commands = { + bootstrap: _bootstrap__WEBPACK_IMPORTED_MODULE_0__["BootstrapCommand"], + clean: _clean__WEBPACK_IMPORTED_MODULE_1__["CleanCommand"], + run: _run__WEBPACK_IMPORTED_MODULE_2__["RunCommand"], + watch: _watch__WEBPACK_IMPORTED_MODULE_3__["WatchCommand"] }; /***/ }), /* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BootstrapCommand", function() { return BootstrapCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_link_project_executables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BootstrapCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _link_project_executables = __webpack_require__(19); - -var _log = __webpack_require__(33); - -var _parallelize = __webpack_require__(34); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -const BootstrapCommand = exports.BootstrapCommand = { - description: 'Install dependencies and crosslink projects', - name: 'bootstrap', - run(projects, projectGraph, { options }) { - return _asyncToGenerator(function* () { - const batchedProjectsByWorkspace = (0, _projects.topologicallyBatchProjects)(projects, projectGraph, { - batchByWorkspace: true - }); - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - const extraArgs = [...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), ...(options['prefer-offline'] === true ? ['--prefer-offline'] : [])]; - _log.log.write(_chalk2.default.bold('\nRunning installs in topological order:')); - for (const batch of batchedProjectsByWorkspace) { - for (const project of batch) { - if (project.isWorkspaceProject) { - _log.log.write(`Skipping workspace project: ${project.name}`); - continue; - } - if (project.hasDependencies()) { - yield project.installDependencies({ extraArgs }); - } - } - } - _log.log.write(_chalk2.default.bold('\nInstalls completed, linking package executables:\n')); - yield (0, _link_project_executables.linkProjectExecutables)(projects, projectGraph); - /** - * At the end of the bootstrapping process we call all `kbn:bootstrap` scripts - * in the list of projects. We do this because some projects need to be - * transpiled before they can be used. Ideally we shouldn't do this unless we - * have to, as it will slow down the bootstrapping process. - */ - _log.log.write(_chalk2.default.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); - yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { - var _ref = _asyncToGenerator(function* (pkg) { - if (pkg.hasScript('kbn:bootstrap')) { - yield pkg.runScriptStreaming('kbn:bootstrap'); - } - }); - return function (_x) { - return _ref.apply(this, arguments); - }; - })()); - _log.log.write(_chalk2.default.green.bold('\nBootstrapping completed!\n')); - })(); +const BootstrapCommand = { + description: 'Install dependencies and crosslink projects', + name: 'bootstrap', + + async run(projects, projectGraph, { + options + }) { + const batchedProjectsByWorkspace = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_4__["topologicallyBatchProjects"])(projects, projectGraph, { + batchByWorkspace: true + }); + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_4__["topologicallyBatchProjects"])(projects, projectGraph); + const extraArgs = [...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), ...(options['prefer-offline'] === true ? ['--prefer-offline'] : [])]; + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nRunning installs in topological order:')); + + for (const batch of batchedProjectsByWorkspace) { + for (const project of batch) { + if (project.isWorkspaceProject) { + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(`Skipping workspace project: ${project.name}`); + continue; + } + + if (project.hasDependencies()) { + await project.installDependencies({ + extraArgs + }); + } + } } + + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nInstalls completed, linking package executables:\n')); + await Object(_utils_link_project_executables__WEBPACK_IMPORTED_MODULE_1__["linkProjectExecutables"])(projects, projectGraph); + /** + * At the end of the bootstrapping process we call all `kbn:bootstrap` scripts + * in the list of projects. We do this because some projects need to be + * transpiled before they can be used. Ideally we shouldn't do this unless we + * have to, as it will slow down the bootstrapping process. + */ + + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); + await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_3__["parallelizeBatches"])(batchedProjects, async pkg => { + if (pkg.hasScript('kbn:bootstrap')) { + await pkg.runScriptStreaming('kbn:bootstrap'); + } + }); + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green.bold('\nBootstrapping completed!\n')); + } + }; /***/ }), /* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkProjectExecutables", function() { return linkProjectExecutables; }); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.linkProjectExecutables = undefined; /** * Yarn does not link the executables from dependencies that are installed @@ -2608,130 +2607,122 @@ exports.linkProjectExecutables = undefined; * dependencies, and manually linking their executables if defined. The logic * for linking was mostly adapted from lerna: https://github.com/lerna/lerna/blob/1d7eb9eeff65d5a7de64dea73613b1bf6bfa8d57/src/PackageUtilities.js#L348 */ -let linkProjectExecutables = exports.linkProjectExecutables = (() => { - var _ref = _asyncToGenerator(function* (projectsByName, projectGraph) { - for (const [projectName, projectDeps] of projectGraph) { - const project = projectsByName.get(projectName); - const binsDir = (0, _path.resolve)(project.nodeModulesLocation, '.bin'); - for (const projectDep of projectDeps) { - const executables = projectDep.getExecutables(); - for (const name of Object.keys(executables)) { - const srcPath = executables[name]; - // existing logic from lerna -- ensure that the bin we are going to - // point to exists or ignore it - if (!(yield (0, _fs.isFile)(srcPath))) { - continue; - } - const dest = (0, _path.resolve)(binsDir, name); - // Get relative project path with normalized path separators. - const projectRelativePath = (0, _path.relative)(project.path, srcPath).split(_path.sep).join('/'); - _log.log.write(_chalk2.default`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); - yield (0, _fs.mkdirp)((0, _path.dirname)(dest)); - yield (0, _fs.createSymlink)(srcPath, dest, 'exec'); - yield (0, _fs.chmod)(dest, '755'); - } - } +async function linkProjectExecutables(projectsByName, projectGraph) { + for (const [projectName, projectDeps] of projectGraph) { + const project = projectsByName.get(projectName); + const binsDir = Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(project.nodeModulesLocation, '.bin'); + + for (const projectDep of projectDeps) { + const executables = projectDep.getExecutables(); + + for (const name of Object.keys(executables)) { + const srcPath = executables[name]; // existing logic from lerna -- ensure that the bin we are going to + // point to exists or ignore it + + if (!(await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["isFile"])(srcPath))) { + continue; } - }); - return function linkProjectExecutables(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + const dest = Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(binsDir, name); // Get relative project path with normalized path separators. -var _path = __webpack_require__(16); - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _fs = __webpack_require__(20); - -var _log = __webpack_require__(33); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ + const projectRelativePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["relative"])(project.path, srcPath).split(path__WEBPACK_IMPORTED_MODULE_0__["sep"]).join('/'); + _log__WEBPACK_IMPORTED_MODULE_3__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_1___default.a`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); + await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["mkdirp"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["dirname"])(dest)); + await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["createSymlink"])(srcPath, dest, 'exec'); + await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["chmod"])(dest, '755'); + } + } + } +} /***/ }), /* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unlink", function() { return unlink; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyDirectory", function() { return copyDirectory; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chmod", function() { return chmod; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readFile", function() { return readFile; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mkdirp", function() { return mkdirp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDirectory", function() { return isDirectory; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSymlink", function() { return createSymlink; }); +/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); +/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cmd_shim__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31); +/* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(mkdirp__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32); +/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(ncp__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_5__); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createSymlink = exports.isFile = exports.isDirectory = exports.mkdirp = exports.readFile = exports.chmod = exports.copyDirectory = exports.unlink = undefined; -let statTest = (() => { - var _ref = _asyncToGenerator(function* (path, block) { - try { - return block((yield stat(path))); - } catch (e) { - if (e.code === 'ENOENT') { - return false; - } - throw e; - } - }); - return function statTest(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + + +const stat = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.stat); +const readFile = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.readFile); +const symlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.symlink); +const chmod = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.chmod); +const cmdShim = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(cmd_shim__WEBPACK_IMPORTED_MODULE_0___default.a); +const mkdirp = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(mkdirp__WEBPACK_IMPORTED_MODULE_2___default.a); +const unlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlink); +const copyDirectory = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(ncp__WEBPACK_IMPORTED_MODULE_3__["ncp"]); + + +async function statTest(path, block) { + try { + return block((await stat(path))); + } catch (e) { + if (e.code === 'ENOENT') { + return false; + } + + throw e; + } +} /** * Test if a path points to a directory. * @param path */ -let isDirectory = exports.isDirectory = (() => { - var _ref2 = _asyncToGenerator(function* (path) { - return yield statTest(path, function (stats) { - return stats.isDirectory(); - }); - }); - - return function isDirectory(_x3) { - return _ref2.apply(this, arguments); - }; -})(); +async function isDirectory(path) { + return await statTest(path, stats => stats.isDirectory()); +} /** * Test if a path points to a regular file. * @param path */ - -let isFile = exports.isFile = (() => { - var _ref3 = _asyncToGenerator(function* (path) { - return yield statTest(path, function (stats) { - return stats.isFile(); - }); - }); - - return function isFile(_x4) { - return _ref3.apply(this, arguments); - }; -})(); +async function isFile(path) { + return await statTest(path, stats => stats.isFile()); +} /** * Create a symlink at dest that points to src. Adapted from * https://github.com/lerna/lerna/blob/2f1b87d9e2295f587e4ac74269f714271d8ed428/src/FileSystemUtilities.js#L103. @@ -2743,96 +2734,32 @@ let isFile = exports.isFile = (() => { * for executable files on windows. */ +async function createSymlink(src, dest, type) { + if (process.platform === 'win32') { + if (type === 'exec') { + await cmdShim(src, dest); + } else { + await forceCreate(src, dest, type); + } + } else { + const posixType = type === 'exec' ? 'file' : type; + const relativeSource = Object(path__WEBPACK_IMPORTED_MODULE_4__["relative"])(Object(path__WEBPACK_IMPORTED_MODULE_4__["dirname"])(dest), src); + await forceCreate(relativeSource, dest, posixType); + } +} -let createSymlink = exports.createSymlink = (() => { - var _ref4 = _asyncToGenerator(function* (src, dest, type) { - if (process.platform === 'win32') { - if (type === 'exec') { - yield cmdShim(src, dest); - } else { - yield forceCreate(src, dest, type); - } - } else { - const posixType = type === 'exec' ? 'file' : type; - const relativeSource = (0, _path.relative)((0, _path.dirname)(dest), src); - yield forceCreate(relativeSource, dest, posixType); - } - }); +async function forceCreate(src, dest, type) { + try { + // If something exists at `dest` we need to remove it first. + await unlink(dest); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } - return function createSymlink(_x5, _x6, _x7) { - return _ref4.apply(this, arguments); - }; -})(); - -let forceCreate = (() => { - var _ref5 = _asyncToGenerator(function* (src, dest, type) { - try { - // If something exists at `dest` we need to remove it first. - yield unlink(dest); - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } - } - yield symlink(src, dest, type); - }); - - return function forceCreate(_x8, _x9, _x10) { - return _ref5.apply(this, arguments); - }; -})(); - -var _cmdShim = __webpack_require__(21); - -var _cmdShim2 = _interopRequireDefault(_cmdShim); - -var _fs = __webpack_require__(23); - -var _fs2 = _interopRequireDefault(_fs); - -var _mkdirp = __webpack_require__(31); - -var _mkdirp2 = _interopRequireDefault(_mkdirp); - -var _ncp = __webpack_require__(32); - -var _path = __webpack_require__(16); - -var _util = __webpack_require__(29); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -const stat = (0, _util.promisify)(_fs2.default.stat); -const readFile = (0, _util.promisify)(_fs2.default.readFile); -const symlink = (0, _util.promisify)(_fs2.default.symlink); -const chmod = (0, _util.promisify)(_fs2.default.chmod); -const cmdShim = (0, _util.promisify)(_cmdShim2.default); -const mkdirp = (0, _util.promisify)(_mkdirp2.default); -const unlink = exports.unlink = (0, _util.promisify)(_fs2.default.unlink); -const copyDirectory = exports.copyDirectory = (0, _util.promisify)(_ncp.ncp); -exports.chmod = chmod; -exports.readFile = readFile; -exports.mkdirp = mkdirp; + await symlink(src, dest, type); +} /***/ }), /* 21 */ @@ -4179,14 +4106,11 @@ function ncp (source, dest, options, callback) { /***/ }), /* 33 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -4205,7 +4129,7 @@ Object.defineProperty(exports, "__esModule", { * specific language governing permissions and limitations * under the License. */ -const log = exports.log = { +const log = { /** * Log something to the console. Ideally we would use a real logger in * kbn-pm, but that's a pretty big change for now. @@ -4215,19 +4139,17 @@ const log = exports.log = { // tslint:disable no-console console.log(...args); } + }; /***/ }), /* 34 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallelizeBatches", function() { return parallelizeBatches; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallelize", function() { return parallelize; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -4246,252 +4168,258 @@ Object.defineProperty(exports, "__esModule", { * specific language governing permissions and limitations * under the License. */ -let parallelizeBatches = exports.parallelizeBatches = (() => { - var _ref = _asyncToGenerator(function* (batches, fn) { - for (const batch of batches) { - // We need to make sure the entire batch has completed before we can move on - // to the next batch - yield parallelize(batch, fn); +async function parallelizeBatches(batches, fn) { + for (const batch of batches) { + // We need to make sure the entire batch has completed before we can move on + // to the next batch + await parallelize(batch, fn); + } +} +async function parallelize(items, fn, concurrency = 4) { + if (items.length === 0) { + return; + } + + return new Promise((resolve, reject) => { + let activePromises = 0; + const values = items.slice(0); + + async function scheduleItem(item) { + activePromises++; + + try { + await fn(item); + activePromises--; + + if (values.length > 0) { + // We have more work to do, so we schedule the next promise + scheduleItem(values.shift()); + } else if (activePromises === 0) { + // We have no more values left, and all items have completed, so we've + // completed all the work. + resolve(); } - }); + } catch (error) { + reject(error); + } + } - return function parallelizeBatches(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); - -let parallelize = exports.parallelize = (() => { - var _ref2 = _asyncToGenerator(function* (items, fn, concurrency = 4) { - if (items.length === 0) { - return; - } - return new Promise(function (resolve, reject) { - let scheduleItem = (() => { - var _ref3 = _asyncToGenerator(function* (item) { - activePromises++; - try { - yield fn(item); - activePromises--; - if (values.length > 0) { - // We have more work to do, so we schedule the next promise - scheduleItem(values.shift()); - } else if (activePromises === 0) { - // We have no more values left, and all items have completed, so we've - // completed all the work. - resolve(); - } - } catch (error) { - reject(error); - } - }); - - return function scheduleItem(_x5) { - return _ref3.apply(this, arguments); - }; - })(); - - let activePromises = 0; - const values = items.slice(0); - - values.splice(0, concurrency).map(scheduleItem); - }); - }); - - return function parallelize(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + values.splice(0, concurrency).map(scheduleItem); + }); +} /***/ }), /* 35 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProjects", function() { return getProjects; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProjectGraph", function() { return buildProjectGraph; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topologicallyBatchProjects", function() { return topologicallyBatchProjects; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includeTransitiveProjects", function() { return includeTransitiveProjects; }); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52); +/* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53); +/* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(134); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getProjects = undefined; -let getProjects = exports.getProjects = (() => { - var _ref = _asyncToGenerator(function* (rootPath, projectsPathsPatterns, { include = [], exclude = [] } = {}) { - const projects = new Map(); - const workspaceProjectsPaths = yield (0, _workspaces.workspacePackagePaths)(rootPath); - for (const pattern of projectsPathsPatterns) { - const pathsToProcess = yield packagesFromGlobPattern({ pattern, rootPath }); - for (const filePath of pathsToProcess) { - const projectConfigPath = normalize(filePath); - const projectDir = _path2.default.dirname(projectConfigPath); - const project = yield _project.Project.fromPath(projectDir); - if (workspaceProjectsPaths.indexOf(filePath) >= 0) { - project.isWorkspaceProject = true; - } - const excludeProject = exclude.includes(project.name) || include.length > 0 && !include.includes(project.name); - if (excludeProject) { - continue; - } - if (projects.has(project.name)) { - throw new _errors.CliError(`There are multiple projects with the same name [${project.name}]`, { - name: project.name, - paths: [project.path, projects.get(project.name).path] - }); - } - projects.set(project.name, project); - } - } - return projects; + + + +const glob = Object(util__WEBPACK_IMPORTED_MODULE_2__["promisify"])(glob__WEBPACK_IMPORTED_MODULE_0___default.a); +async function getProjects(rootPath, projectsPathsPatterns, { + include = [], + exclude = [] +} = {}) { + const projects = new Map(); + const workspaceProjectsPaths = await Object(_workspaces__WEBPACK_IMPORTED_MODULE_5__["workspacePackagePaths"])(rootPath); + + for (const pattern of projectsPathsPatterns) { + const pathsToProcess = await packagesFromGlobPattern({ + pattern, + rootPath }); - return function getProjects(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + for (const filePath of pathsToProcess) { + const projectConfigPath = normalize(filePath); + const projectDir = path__WEBPACK_IMPORTED_MODULE_1___default.a.dirname(projectConfigPath); + const project = await _project__WEBPACK_IMPORTED_MODULE_4__["Project"].fromPath(projectDir); -exports.buildProjectGraph = buildProjectGraph; -exports.topologicallyBatchProjects = topologicallyBatchProjects; -exports.includeTransitiveProjects = includeTransitiveProjects; + if (workspaceProjectsPaths.indexOf(filePath) >= 0) { + project.isWorkspaceProject = true; + } -var _glob = __webpack_require__(36); + const excludeProject = exclude.includes(project.name) || include.length > 0 && !include.includes(project.name); -var _glob2 = _interopRequireDefault(_glob); + if (excludeProject) { + continue; + } -var _path = __webpack_require__(16); + if (projects.has(project.name)) { + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`There are multiple projects with the same name [${project.name}]`, { + name: project.name, + paths: [project.path, projects.get(project.name).path] + }); + } -var _path2 = _interopRequireDefault(_path); + projects.set(project.name, project); + } + } -var _util = __webpack_require__(29); - -var _errors = __webpack_require__(52); - -var _project = __webpack_require__(53); - -var _workspaces = __webpack_require__(134); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -const glob = (0, _util.promisify)(_glob2.default); - -function packagesFromGlobPattern({ pattern, rootPath }) { - const globOptions = { - cwd: rootPath, - // Should throw in case of unusual errors when reading the file system - strict: true, - // Always returns absolute paths for matched files - absolute: true, - // Do not match ** against multiple filenames - // (This is only specified because we currently don't have a need for it.) - noglobstar: true - }; - return glob(_path2.default.join(pattern, 'package.json'), globOptions); + return projects; } -// https://github.com/isaacs/node-glob/blob/master/common.js#L104 + +function packagesFromGlobPattern({ + pattern, + rootPath +}) { + const globOptions = { + cwd: rootPath, + // Should throw in case of unusual errors when reading the file system + strict: true, + // Always returns absolute paths for matched files + absolute: true, + // Do not match ** against multiple filenames + // (This is only specified because we currently don't have a need for it.) + noglobstar: true + }; + return glob(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(pattern, 'package.json'), globOptions); +} // https://github.com/isaacs/node-glob/blob/master/common.js#L104 // glob always returns "\\" as "/" in windows, so everyone // gets normalized because we can't have nice things. + + function normalize(dir) { - return _path2.default.normalize(dir); + return path__WEBPACK_IMPORTED_MODULE_1___default.a.normalize(dir); } + function buildProjectGraph(projects) { - const projectGraph = new Map(); - for (const project of projects.values()) { - const projectDeps = []; - const dependencies = project.allDependencies; - for (const depName of Object.keys(dependencies)) { - if (projects.has(depName)) { - const dep = projects.get(depName); - const dependentProjectIsInWorkspace = project.isWorkspaceProject || project.json.name === 'kibana'; - project.ensureValidProjectDependency(dep, dependentProjectIsInWorkspace); - projectDeps.push(dep); - } - } - projectGraph.set(project.name, projectDeps); + const projectGraph = new Map(); + + for (const project of projects.values()) { + const projectDeps = []; + const dependencies = project.allDependencies; + + for (const depName of Object.keys(dependencies)) { + if (projects.has(depName)) { + const dep = projects.get(depName); + const dependentProjectIsInWorkspace = project.isWorkspaceProject || project.json.name === 'kibana'; + project.ensureValidProjectDependency(dep, dependentProjectIsInWorkspace); + projectDeps.push(dep); + } } - return projectGraph; + + projectGraph.set(project.name, projectDeps); + } + + return projectGraph; } -function topologicallyBatchProjects(projectsToBatch, projectGraph, { batchByWorkspace = false } = {}) { - // We're going to be chopping stuff out of this list, so copy it. - const projectsLeftToBatch = new Set(projectsToBatch.keys()); - const batches = []; - if (batchByWorkspace) { - const workspaceRootProject = Array.from(projectsToBatch.values()).find(p => p.isWorkspaceRoot); - if (!workspaceRootProject) { - throw new _errors.CliError(`There was no yarn workspace root found.`); - } - // Push in the workspace root first. - batches.push([workspaceRootProject]); - projectsLeftToBatch.delete(workspaceRootProject.name); - // In the next batch, push in all workspace projects. - const workspaceBatch = []; - for (const projectName of projectsLeftToBatch) { - const project = projectsToBatch.get(projectName); - if (project.isWorkspaceProject) { - workspaceBatch.push(project); - projectsLeftToBatch.delete(projectName); - } - } - batches.push(workspaceBatch); +function topologicallyBatchProjects(projectsToBatch, projectGraph, { + batchByWorkspace = false +} = {}) { + // We're going to be chopping stuff out of this list, so copy it. + const projectsLeftToBatch = new Set(projectsToBatch.keys()); + const batches = []; + + if (batchByWorkspace) { + const workspaceRootProject = Array.from(projectsToBatch.values()).find(p => p.isWorkspaceRoot); + + if (!workspaceRootProject) { + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`There was no yarn workspace root found.`); + } // Push in the workspace root first. + + + batches.push([workspaceRootProject]); + projectsLeftToBatch.delete(workspaceRootProject.name); // In the next batch, push in all workspace projects. + + const workspaceBatch = []; + + for (const projectName of projectsLeftToBatch) { + const project = projectsToBatch.get(projectName); + + if (project.isWorkspaceProject) { + workspaceBatch.push(project); + projectsLeftToBatch.delete(projectName); + } } - while (projectsLeftToBatch.size > 0) { - // Get all projects that have no remaining dependencies within the repo - // that haven't yet been picked. - const batch = []; - for (const projectName of projectsLeftToBatch) { - const projectDeps = projectGraph.get(projectName); - const needsDependenciesBatched = projectDeps.some(dep => projectsLeftToBatch.has(dep.name)); - if (!needsDependenciesBatched) { - batch.push(projectsToBatch.get(projectName)); - } - } - // If we weren't able to find a project with no remaining dependencies, - // then we've encountered a cycle in the dependency graph. - const hasCycles = batch.length === 0; - if (hasCycles) { - const cycleProjectNames = [...projectsLeftToBatch]; - const message = 'Encountered a cycle in the dependency graph. Projects in cycle are:\n' + cycleProjectNames.join(', '); - throw new _errors.CliError(message); - } - batches.push(batch); - batch.forEach(project => projectsLeftToBatch.delete(project.name)); + + batches.push(workspaceBatch); + } + + while (projectsLeftToBatch.size > 0) { + // Get all projects that have no remaining dependencies within the repo + // that haven't yet been picked. + const batch = []; + + for (const projectName of projectsLeftToBatch) { + const projectDeps = projectGraph.get(projectName); + const needsDependenciesBatched = projectDeps.some(dep => projectsLeftToBatch.has(dep.name)); + + if (!needsDependenciesBatched) { + batch.push(projectsToBatch.get(projectName)); + } + } // If we weren't able to find a project with no remaining dependencies, + // then we've encountered a cycle in the dependency graph. + + + const hasCycles = batch.length === 0; + + if (hasCycles) { + const cycleProjectNames = [...projectsLeftToBatch]; + const message = 'Encountered a cycle in the dependency graph. Projects in cycle are:\n' + cycleProjectNames.join(', '); + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](message); } - return batches; + + batches.push(batch); + batch.forEach(project => projectsLeftToBatch.delete(project.name)); + } + + return batches; } -function includeTransitiveProjects(subsetOfProjects, allProjects, { onlyProductionDependencies = false } = {}) { - const dependentProjects = new Map(); - // the current list of packages we are expanding using breadth-first-search - const toProcess = [...subsetOfProjects]; - while (toProcess.length > 0) { - const project = toProcess.shift(); - const dependencies = onlyProductionDependencies ? project.productionDependencies : project.allDependencies; - Object.keys(dependencies).forEach(dep => { - if (allProjects.has(dep)) { - toProcess.push(allProjects.get(dep)); - } - }); - dependentProjects.set(project.name, project); - } - return dependentProjects; +function includeTransitiveProjects(subsetOfProjects, allProjects, { + onlyProductionDependencies = false +} = {}) { + const dependentProjects = new Map(); // the current list of packages we are expanding using breadth-first-search + + const toProcess = [...subsetOfProjects]; + + while (toProcess.length > 0) { + const project = toProcess.shift(); + const dependencies = onlyProductionDependencies ? project.productionDependencies : project.allDependencies; + Object.keys(dependencies).forEach(dep => { + if (allProjects.has(dep)) { + toProcess.push(allProjects.get(dep)); + } + }); + dependentProjects.set(project.name, project); + } + + return dependentProjects; } /***/ }), @@ -7854,14 +7782,11 @@ function onceStrict (fn) { /***/ }), /* 52 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CliError", function() { return CliError; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -7881,207 +7806,33 @@ Object.defineProperty(exports, "__esModule", { * under the License. */ class CliError extends Error { - constructor(message, meta = {}) { - super(message); - this.meta = meta; - } + constructor(message, meta = {}) { + super(message); + this.meta = meta; + } + } -exports.CliError = CliError; /***/ }), /* 53 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return Project; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54); +/* harmony import */ var _scripts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Project = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _path = __webpack_require__(16); - -var _util = __webpack_require__(29); - -var _errors = __webpack_require__(52); - -var _log = __webpack_require__(33); - -var _package_json = __webpack_require__(54); - -var _scripts = __webpack_require__(95); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -class Project { - constructor(packageJson, projectPath) { - this.isWorkspaceRoot = false; - this.isWorkspaceProject = false; - this.json = Object.freeze(packageJson); - this.path = projectPath; - this.packageJsonLocation = (0, _path.resolve)(this.path, 'package.json'); - this.nodeModulesLocation = (0, _path.resolve)(this.path, 'node_modules'); - this.targetLocation = (0, _path.resolve)(this.path, 'target'); - this.productionDependencies = this.json.dependencies || {}; - this.devDependencies = this.json.devDependencies || {}; - this.allDependencies = _extends({}, this.devDependencies, this.productionDependencies); - this.isWorkspaceRoot = this.json.hasOwnProperty('workspaces'); - this.scripts = this.json.scripts || {}; - } - static fromPath(path) { - return _asyncToGenerator(function* () { - const pkgJson = yield (0, _package_json.readPackageJson)(path); - return new Project(pkgJson, path); - })(); - } - get name() { - return this.json.name; - } - ensureValidProjectDependency(project, dependentProjectIsInWorkspace) { - const versionInPackageJson = this.allDependencies[project.name]; - let expectedVersionInPackageJson; - if (dependentProjectIsInWorkspace) { - expectedVersionInPackageJson = project.json.version; - } else { - const relativePathToProject = normalizePath((0, _path.relative)(this.path, project.path)); - expectedVersionInPackageJson = `link:${relativePathToProject}`; - } - // No issues! - if (versionInPackageJson === expectedVersionInPackageJson) { - return; - } - let problemMsg; - if ((0, _package_json.isLinkDependency)(versionInPackageJson) && dependentProjectIsInWorkspace) { - problemMsg = `but should be using a workspace`; - } else if ((0, _package_json.isLinkDependency)(versionInPackageJson)) { - problemMsg = `using 'link:', but the path is wrong`; - } else { - problemMsg = `but it's not using the local package`; - } - throw new _errors.CliError(`[${this.name}] depends on [${project.name}] ${problemMsg}. Update its package.json to the expected value below.`, { - actual: `"${project.name}": "${versionInPackageJson}"`, - expected: `"${project.name}": "${expectedVersionInPackageJson}"`, - package: `${this.name} (${this.packageJsonLocation})` - }); - } - getBuildConfig() { - return this.json.kibana && this.json.kibana.build || {}; - } - /** - * Returns the directory that should be copied into the Kibana build artifact. - * This config can be specified to only include the project's build artifacts - * instead of everything located in the project directory. - */ - getIntermediateBuildDirectory() { - return (0, _path.resolve)(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); - } - getCleanConfig() { - return this.json.kibana && this.json.kibana.clean || {}; - } - hasScript(name) { - return name in this.scripts; - } - getExecutables() { - const raw = this.json.bin; - if (!raw) { - return {}; - } - if (typeof raw === 'string') { - return { - [this.name]: (0, _path.resolve)(this.path, raw) - }; - } - if (typeof raw === 'object') { - const binsConfig = {}; - for (const binName of Object.keys(raw)) { - binsConfig[binName] = (0, _path.resolve)(this.path, raw[binName]); - } - return binsConfig; - } - throw new _errors.CliError(`[${this.name}] has an invalid "bin" field in its package.json, ` + `expected an object or a string`, { - binConfig: (0, _util.inspect)(raw), - package: `${this.name} (${this.packageJsonLocation})` - }); - } - runScript(scriptName, args = []) { - var _this = this; - - return _asyncToGenerator(function* () { - _log.log.write(_chalk2.default.bold(`\n\nRunning script [${_chalk2.default.green(scriptName)}] in [${_chalk2.default.green(_this.name)}]:\n`)); - return (0, _scripts.runScriptInPackage)(scriptName, args, _this); - })(); - } - runScriptStreaming(scriptName, args = []) { - return (0, _scripts.runScriptInPackageStreaming)(scriptName, args, this); - } - hasDependencies() { - return Object.keys(this.allDependencies).length > 0; - } - installDependencies({ extraArgs }) { - var _this2 = this; - - return _asyncToGenerator(function* () { - _log.log.write(_chalk2.default.bold(`\n\nInstalling dependencies in [${_chalk2.default.green(_this2.name)}]:\n`)); - return (0, _scripts.installInDir)(_this2.path, extraArgs); - })(); - } -} -exports.Project = Project; // We normalize all path separators to `/` in generated files - -function normalizePath(path) { - return path.replace(/[\\\/]+/g, '/'); -} - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isLinkDependency = undefined; -exports.readPackageJson = readPackageJson; -exports.writePackageJson = writePackageJson; - -var _readPkg = __webpack_require__(55); - -var _readPkg2 = _interopRequireDefault(_readPkg); - -var _writePkg = __webpack_require__(83); - -var _writePkg2 = _interopRequireDefault(_writePkg); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* * Licensed to Elasticsearch B.V. under one or more contributor @@ -8101,13 +7852,210 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * specific language governing permissions and limitations * under the License. */ + + + + + + + +class Project { + static async fromPath(path) { + const pkgJson = await Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["readPackageJson"])(path); + return new Project(pkgJson, path); + } + + constructor(packageJson, projectPath) { + _defineProperty(this, "json", void 0); + + _defineProperty(this, "packageJsonLocation", void 0); + + _defineProperty(this, "nodeModulesLocation", void 0); + + _defineProperty(this, "targetLocation", void 0); + + _defineProperty(this, "path", void 0); + + _defineProperty(this, "allDependencies", void 0); + + _defineProperty(this, "productionDependencies", void 0); + + _defineProperty(this, "devDependencies", void 0); + + _defineProperty(this, "scripts", void 0); + + _defineProperty(this, "isWorkspaceRoot", false); + + _defineProperty(this, "isWorkspaceProject", false); + + this.json = Object.freeze(packageJson); + this.path = projectPath; + this.packageJsonLocation = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, 'package.json'); + this.nodeModulesLocation = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, 'node_modules'); + this.targetLocation = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, 'target'); + this.productionDependencies = this.json.dependencies || {}; + this.devDependencies = this.json.devDependencies || {}; + this.allDependencies = _objectSpread({}, this.devDependencies, this.productionDependencies); + this.isWorkspaceRoot = this.json.hasOwnProperty('workspaces'); + this.scripts = this.json.scripts || {}; + } + + get name() { + return this.json.name; + } + + ensureValidProjectDependency(project, dependentProjectIsInWorkspace) { + const versionInPackageJson = this.allDependencies[project.name]; + let expectedVersionInPackageJson; + + if (dependentProjectIsInWorkspace) { + expectedVersionInPackageJson = project.json.version; + } else { + const relativePathToProject = normalizePath(Object(path__WEBPACK_IMPORTED_MODULE_1__["relative"])(this.path, project.path)); + expectedVersionInPackageJson = `link:${relativePathToProject}`; + } // No issues! + + + if (versionInPackageJson === expectedVersionInPackageJson) { + return; + } + + let problemMsg; + + if (Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["isLinkDependency"])(versionInPackageJson) && dependentProjectIsInWorkspace) { + problemMsg = `but should be using a workspace`; + } else if (Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["isLinkDependency"])(versionInPackageJson)) { + problemMsg = `using 'link:', but the path is wrong`; + } else { + problemMsg = `but it's not using the local package`; + } + + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`[${this.name}] depends on [${project.name}] ${problemMsg}. Update its package.json to the expected value below.`, { + actual: `"${project.name}": "${versionInPackageJson}"`, + expected: `"${project.name}": "${expectedVersionInPackageJson}"`, + package: `${this.name} (${this.packageJsonLocation})` + }); + } + + getBuildConfig() { + return this.json.kibana && this.json.kibana.build || {}; + } + /** + * Returns the directory that should be copied into the Kibana build artifact. + * This config can be specified to only include the project's build artifacts + * instead of everything located in the project directory. + */ + + + getIntermediateBuildDirectory() { + return Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); + } + + getCleanConfig() { + return this.json.kibana && this.json.kibana.clean || {}; + } + + hasScript(name) { + return name in this.scripts; + } + + getExecutables() { + const raw = this.json.bin; + + if (!raw) { + return {}; + } + + if (typeof raw === 'string') { + return { + [this.name]: Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, raw) + }; + } + + if (typeof raw === 'object') { + const binsConfig = {}; + + for (const binName of Object.keys(raw)) { + binsConfig[binName] = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, raw[binName]); + } + + return binsConfig; + } + + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`[${this.name}] has an invalid "bin" field in its package.json, ` + `expected an object or a string`, { + binConfig: Object(util__WEBPACK_IMPORTED_MODULE_2__["inspect"])(raw), + package: `${this.name} (${this.packageJsonLocation})` + }); + } + + async runScript(scriptName, args = []) { + _log__WEBPACK_IMPORTED_MODULE_4__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\n\nRunning script [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(scriptName)}] in [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(this.name)}]:\n`)); + return Object(_scripts__WEBPACK_IMPORTED_MODULE_6__["runScriptInPackage"])(scriptName, args, this); + } + + runScriptStreaming(scriptName, args = []) { + return Object(_scripts__WEBPACK_IMPORTED_MODULE_6__["runScriptInPackageStreaming"])(scriptName, args, this); + } + + hasDependencies() { + return Object.keys(this.allDependencies).length > 0; + } + + async installDependencies({ + extraArgs + }) { + _log__WEBPACK_IMPORTED_MODULE_4__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\n\nInstalling dependencies in [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(this.name)}]:\n`)); + return Object(_scripts__WEBPACK_IMPORTED_MODULE_6__["installInDir"])(this.path, extraArgs); + } + +} // We normalize all path separators to `/` in generated files + +function normalizePath(path) { + return path.replace(/[\\\/]+/g, '/'); +} + +/***/ }), +/* 54 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readPackageJson", function() { return readPackageJson; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writePackageJson", function() { return writePackageJson; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkDependency", function() { return isLinkDependency; }); +/* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55); +/* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(read_pkg__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83); +/* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(write_pkg__WEBPACK_IMPORTED_MODULE_1__); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + function readPackageJson(dir) { - return (0, _readPkg2.default)(dir, { normalize: false }); + return read_pkg__WEBPACK_IMPORTED_MODULE_0___default()(dir, { + normalize: false + }); } function writePackageJson(path, json) { - return (0, _writePkg2.default)(path, json); + return write_pkg__WEBPACK_IMPORTED_MODULE_1___default()(path, json); } -const isLinkDependency = exports.isLinkDependency = depVersion => depVersion.startsWith('link:'); +const isLinkDependency = depVersion => depVersion.startsWith('link:'); /***/ }), /* 55 */ @@ -13769,165 +13717,141 @@ module.exports = str => { /***/ }), /* 95 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installInDir", function() { return installInDir; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackage", function() { return runScriptInPackage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackageStreaming", function() { return runScriptInPackageStreaming; }); +/* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.runScriptInPackage = exports.installInDir = undefined; - /** * Install all dependencies in the given directory */ -let installInDir = exports.installInDir = (() => { - var _ref = _asyncToGenerator(function* (directory, extraArgs = []) { - const options = ['install', '--non-interactive', ...extraArgs]; - // We pass the mutex flag to ensure only one instance of yarn runs at any - // given time (e.g. to avoid conflicts). - yield (0, _child_process.spawn)('yarn', options, { - cwd: directory - }); - }); +async function installInDir(directory, extraArgs = []) { + const options = ['install', '--non-interactive', ...extraArgs]; // We pass the mutex flag to ensure only one instance of yarn runs at any + // given time (e.g. to avoid conflicts). - return function installInDir(_x) { - return _ref.apply(this, arguments); - }; -})(); + await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', options, { + cwd: directory + }); +} /** * Run script in the given directory */ - -let runScriptInPackage = exports.runScriptInPackage = (() => { - var _ref2 = _asyncToGenerator(function* (script, args, pkg) { - const execOpts = { - cwd: pkg.path - }; - yield (0, _child_process.spawn)('yarn', ['run', script, ...args], execOpts); - }); - - return function runScriptInPackage(_x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); +async function runScriptInPackage(script, args, pkg) { + const execOpts = { + cwd: pkg.path + }; + await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['run', script, ...args], execOpts); +} /** * Run script in the given directory */ - -exports.runScriptInPackageStreaming = runScriptInPackageStreaming; - -var _child_process = __webpack_require__(96); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - function runScriptInPackageStreaming(script, args, pkg) { - const execOpts = { - cwd: pkg.path - }; - return (0, _child_process.spawnStreaming)('yarn', ['run', script, ...args], execOpts, { - prefix: pkg.name - }); + const execOpts = { + cwd: pkg.path + }; + return Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawnStreaming"])('yarn', ['run', script, ...args], execOpts, { + prefix: pkg.name + }); } /***/ }), /* 96 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawn", function() { return spawn; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawnStreaming", function() { return spawnStreaming; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97); +/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var log_symbols__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(125); +/* harmony import */ var log_symbols__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(log_symbols__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(126); +/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -exports.spawn = spawn; -exports.spawnStreaming = spawnStreaming; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _execa = __webpack_require__(97); - -var _execa2 = _interopRequireDefault(_execa); - -var _logSymbols = __webpack_require__(125); - -var _logSymbols2 = _interopRequireDefault(_logSymbols); - -var _strongLogTransformer = __webpack_require__(126); - -var _strongLogTransformer2 = _interopRequireDefault(_strongLogTransformer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function generateColors() { - const colorWheel = [_chalk2.default.cyan, _chalk2.default.magenta, _chalk2.default.blue, _chalk2.default.yellow, _chalk2.default.green]; - const count = colorWheel.length; - let children = 0; - return () => colorWheel[children++ % count]; + const colorWheel = [chalk__WEBPACK_IMPORTED_MODULE_0___default.a.cyan, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.magenta, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.blue, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.yellow, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green]; + const count = colorWheel.length; + let children = 0; + return () => colorWheel[children++ % count]; } + function spawn(command, args, opts) { - return (0, _execa2.default)(command, args, _extends({}, opts, { - stdio: 'inherit' - })); + return execa__WEBPACK_IMPORTED_MODULE_1___default()(command, args, _objectSpread({}, opts, { + stdio: 'inherit' + })); } const nextColor = generateColors(); -function spawnStreaming(command, args, opts, { prefix }) { - const spawned = (0, _execa2.default)(command, args, _extends({}, opts, { - stdio: ['ignore', 'pipe', 'pipe'] - })); - const color = nextColor(); - const prefixedStdout = (0, _strongLogTransformer2.default)({ tag: `${color.bold(prefix)}:` }); - const prefixedStderr = (0, _strongLogTransformer2.default)({ - mergeMultiline: true, - tag: `${_logSymbols2.default.error} ${color.bold(prefix)}:` - }); - spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); - spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); - return spawned; +function spawnStreaming(command, args, opts, { + prefix +}) { + const spawned = execa__WEBPACK_IMPORTED_MODULE_1___default()(command, args, _objectSpread({}, opts, { + stdio: ['ignore', 'pipe', 'pipe'] + })); + const color = nextColor(); + const prefixedStdout = strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default()({ + tag: `${color.bold(prefix)}:` + }); + const prefixedStderr = strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default()({ + mergeMultiline: true, + tag: `${log_symbols__WEBPACK_IMPORTED_MODULE_2___default.a.error} ${color.bold(prefix)}:` + }); + spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); + spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); + return spawned; } /***/ }), @@ -17702,306 +17626,290 @@ module.exports = {"name":"strong-log-transformer","version":"2.1.0","description /***/ }), /* 134 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "workspacePackagePaths", function() { return workspacePackagePaths; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return copyWorkspacePackages; }); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54); +/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.copyWorkspacePackages = exports.workspacePackagePaths = undefined; - -let workspacePackagePaths = exports.workspacePackagePaths = (() => { - var _ref = _asyncToGenerator(function* (rootPath) { - const rootPkgJson = yield (0, _package_json.readPackageJson)(_path2.default.join(rootPath, 'package.json')); - if (!rootPkgJson.workspaces) { - return []; - } - const workspacesPathsPatterns = rootPkgJson.workspaces.packages; - let workspaceProjectsPaths = []; - for (const pattern of workspacesPathsPatterns) { - workspaceProjectsPaths = workspaceProjectsPaths.concat((yield packagesFromGlobPattern({ pattern, rootPath }))); - } - // Filter out exclude glob patterns - for (const pattern of workspacesPathsPatterns) { - if (pattern.startsWith('!')) { - const pathToRemove = _path2.default.join(rootPath, pattern.slice(1), 'package.json'); - workspaceProjectsPaths = workspaceProjectsPaths.filter(function (p) { - return p !== pathToRemove; - }); - } - } - return workspaceProjectsPaths; - }); - - return function workspacePackagePaths(_x) { - return _ref.apply(this, arguments); - }; -})(); - -let copyWorkspacePackages = exports.copyWorkspacePackages = (() => { - var _ref2 = _asyncToGenerator(function* (rootPath) { - const workspaceProjects = yield getWorkspaceProjects(rootPath); - for (const project of workspaceProjects.values()) { - const dest = _path2.default.resolve(rootPath, 'node_modules', project.name); - // Remove the symlink - yield (0, _fs.unlink)(dest); - // Copy in the package - yield (0, _fs.copyDirectory)(project.path, dest); - } - }); - - return function copyWorkspacePackages(_x2) { - return _ref2.apply(this, arguments); - }; -})(); - -let getWorkspaceProjects = (() => { - var _ref3 = _asyncToGenerator(function* (rootPath) { - const projectPaths = (0, _config.getProjectPaths)(rootPath, {}); - const projects = yield (0, _projects.getProjects)(rootPath, projectPaths); - for (const [key, project] of projects.entries()) { - if (!project.isWorkspaceProject) { - projects.delete(key); - } - } - return projects; - }); - - return function getWorkspaceProjects(_x3) { - return _ref3.apply(this, arguments); - }; -})(); - -var _glob = __webpack_require__(36); - -var _glob2 = _interopRequireDefault(_glob); - -var _path = __webpack_require__(16); - -var _path2 = _interopRequireDefault(_path); - -var _util = __webpack_require__(29); - -var _config = __webpack_require__(135); - -var _fs = __webpack_require__(20); - -var _package_json = __webpack_require__(54); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -const glob = (0, _util.promisify)(_glob2.default); -function packagesFromGlobPattern({ pattern, rootPath }) { - const globOptions = { - cwd: rootPath, - // Should throw in case of unusual errors when reading the file system - strict: true, - // Always returns absolute paths for matched files - absolute: true, - // Do not match ** against multiple filenames - // (This is only specified because we currently don't have a need for it.) - noglobstar: true - }; - return glob(_path2.default.join(pattern, 'package.json'), globOptions); + + +const glob = Object(util__WEBPACK_IMPORTED_MODULE_2__["promisify"])(glob__WEBPACK_IMPORTED_MODULE_0___default.a); +async function workspacePackagePaths(rootPath) { + const rootPkgJson = await Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["readPackageJson"])(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(rootPath, 'package.json')); + + if (!rootPkgJson.workspaces) { + return []; + } + + const workspacesPathsPatterns = rootPkgJson.workspaces.packages; + let workspaceProjectsPaths = []; + + for (const pattern of workspacesPathsPatterns) { + workspaceProjectsPaths = workspaceProjectsPaths.concat((await packagesFromGlobPattern({ + pattern, + rootPath + }))); + } // Filter out exclude glob patterns + + + for (const pattern of workspacesPathsPatterns) { + if (pattern.startsWith('!')) { + const pathToRemove = path__WEBPACK_IMPORTED_MODULE_1___default.a.join(rootPath, pattern.slice(1), 'package.json'); + workspaceProjectsPaths = workspaceProjectsPaths.filter(p => p !== pathToRemove); + } + } + + return workspaceProjectsPaths; +} +async function copyWorkspacePackages(rootPath) { + const workspaceProjects = await getWorkspaceProjects(rootPath); + + for (const project of workspaceProjects.values()) { + const dest = path__WEBPACK_IMPORTED_MODULE_1___default.a.resolve(rootPath, 'node_modules', project.name); // Remove the symlink + + await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["unlink"])(dest); // Copy in the package + + await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["copyDirectory"])(project.path, dest); + } +} + +async function getWorkspaceProjects(rootPath) { + const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(rootPath, {}); + const projects = await Object(_projects__WEBPACK_IMPORTED_MODULE_6__["getProjects"])(rootPath, projectPaths); + + for (const [key, project] of projects.entries()) { + if (!project.isWorkspaceProject) { + projects.delete(key); + } + } + + return projects; +} + +function packagesFromGlobPattern({ + pattern, + rootPath +}) { + const globOptions = { + cwd: rootPath, + // Should throw in case of unusual errors when reading the file system + strict: true, + // Always returns absolute paths for matched files + absolute: true, + // Do not match ** against multiple filenames + // (This is only specified because we currently don't have a need for it.) + noglobstar: true + }; + return glob(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(pattern, 'package.json'), globOptions); } /***/ }), /* 135 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProjectPaths", function() { return getProjectPaths; }); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getProjectPaths = getProjectPaths; - -var _path = __webpack_require__(16); - /** * Returns all the paths where plugins are located */ function getProjectPaths(rootPath, options) { - const skipKibanaPlugins = Boolean(options['skip-kibana-plugins']); - const ossOnly = Boolean(options.oss); - const projectPaths = [rootPath, (0, _path.resolve)(rootPath, 'packages/*')]; - // This is needed in order to install the dependencies for the declared - // plugin functional used in the selenium functional tests. - // As we are now using the webpack dll for the client vendors dependencies - // when we run the plugin functional tests against the distributable - // dependencies used by such plugins like @eui, react and react-dom can't - // be loaded from the dll as the context is different from the one declared - // into the webpack dll reference plugin. - // In anyway, have a plugin declaring their own dependencies is the - // correct and the expect behavior. - projectPaths.push((0, _path.resolve)(rootPath, 'test/plugin_functional/plugins/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'test/interpreter_functional/plugins/*')); - if (!ossOnly) { - projectPaths.push((0, _path.resolve)(rootPath, 'x-pack')); - projectPaths.push((0, _path.resolve)(rootPath, 'x-pack/plugins/*')); - } - if (!skipKibanaPlugins) { - projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*')); - projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*/packages/*')); - projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*/plugins/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'plugins/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'plugins/*/packages/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'plugins/*/plugins/*')); - } - return projectPaths; -} /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ + const skipKibanaPlugins = Boolean(options['skip-kibana-plugins']); + const ossOnly = Boolean(options.oss); + const projectPaths = [rootPath, Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'packages/*')]; // This is needed in order to install the dependencies for the declared + // plugin functional used in the selenium functional tests. + // As we are now using the webpack dll for the client vendors dependencies + // when we run the plugin functional tests against the distributable + // dependencies used by such plugins like @eui, react and react-dom can't + // be loaded from the dll as the context is different from the one declared + // into the webpack dll reference plugin. + // In anyway, have a plugin declaring their own dependencies is the + // correct and the expect behavior. + + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'test/plugin_functional/plugins/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'test/interpreter_functional/plugins/*')); + + if (!ossOnly) { + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'x-pack')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'x-pack/plugins/*')); + } + + if (!skipKibanaPlugins) { + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*/packages/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*/plugins/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*/packages/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*/plugins/*')); + } + + return projectPaths; +} /***/ }), /* 136 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CleanCommand", function() { return CleanCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(137); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(152); +/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ora__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CleanCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _del = __webpack_require__(137); - -var _del2 = _interopRequireDefault(_del); - -var _ora = __webpack_require__(152); - -var _ora2 = _interopRequireDefault(_ora); - -var _path = __webpack_require__(16); - -var _fs = __webpack_require__(20); - -var _log = __webpack_require__(33); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -const CleanCommand = exports.CleanCommand = { - description: 'Remove the node_modules and target directories from all projects.', - name: 'clean', - run(projects) { - return _asyncToGenerator(function* () { - const toDelete = []; - for (const project of projects.values()) { - if (yield (0, _fs.isDirectory)(project.nodeModulesLocation)) { - toDelete.push({ - cwd: project.path, - pattern: (0, _path.relative)(project.path, project.nodeModulesLocation) - }); - } - if (yield (0, _fs.isDirectory)(project.targetLocation)) { - toDelete.push({ - cwd: project.path, - pattern: (0, _path.relative)(project.path, project.targetLocation) - }); - } - const { extraPatterns } = project.getCleanConfig(); - if (extraPatterns) { - toDelete.push({ - cwd: project.path, - pattern: extraPatterns - }); - } - } - if (toDelete.length === 0) { - _log.log.write(_chalk2.default.bold.green('\n\nNothing to delete')); - } else { - _log.log.write(_chalk2.default.bold.red('\n\nDeleting:\n')); - /** - * In order to avoid patterns like `/build` in packages from accidentally - * impacting files outside the package we use `process.chdir()` to change - * the cwd to the package and execute `del()` without the `force` option - * so it will check that each file being deleted is within the package. - * - * `del()` does support a `cwd` option, but it's only for resolving the - * patterns and does not impact the cwd check. - */ - const originalCwd = process.cwd(); - try { - for (const _ref of toDelete) { - const { pattern, cwd } = _ref; - process.chdir(cwd); - const promise = (0, _del2.default)(pattern); - _ora2.default.promise(promise, (0, _path.relative)(originalCwd, (0, _path.join)(cwd, String(pattern)))); - yield promise; - } - } finally { - process.chdir(originalCwd); - } - } - })(); + +const CleanCommand = { + description: 'Remove the node_modules and target directories from all projects.', + name: 'clean', + + async run(projects) { + const toDelete = []; + + for (const project of projects.values()) { + if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(project.nodeModulesLocation)) { + toDelete.push({ + cwd: project.path, + pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.nodeModulesLocation) + }); + } + + if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(project.targetLocation)) { + toDelete.push({ + cwd: project.path, + pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.targetLocation) + }); + } + + const { + extraPatterns + } = project.getCleanConfig(); + + if (extraPatterns) { + toDelete.push({ + cwd: project.path, + pattern: extraPatterns + }); + } } + + if (toDelete.length === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.green('\n\nNothing to delete')); + } else { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.red('\n\nDeleting:\n')); + /** + * In order to avoid patterns like `/build` in packages from accidentally + * impacting files outside the package we use `process.chdir()` to change + * the cwd to the package and execute `del()` without the `force` option + * so it will check that each file being deleted is within the package. + * + * `del()` does support a `cwd` option, but it's only for resolving the + * patterns and does not impact the cwd check. + */ + + const originalCwd = process.cwd(); + + try { + for (const _ref of toDelete) { + const { + pattern, + cwd + } = _ref; + process.chdir(cwd); + const promise = del__WEBPACK_IMPORTED_MODULE_1___default()(pattern); + ora__WEBPACK_IMPORTED_MODULE_2___default.a.promise(promise, Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(originalCwd, Object(path__WEBPACK_IMPORTED_MODULE_3__["join"])(cwd, String(pattern)))); + await promise; + } + } finally { + process.chdir(originalCwd); + } + } + } + }; /***/ }), @@ -19652,202 +19560,16 @@ module.exports = {"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼", /***/ }), /* 159 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.RunCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _log = __webpack_require__(33); - -var _parallelize = __webpack_require__(34); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -const RunCommand = exports.RunCommand = { - description: 'Run script defined in package.json in each package that contains that script.', - name: 'run', - run(projects, projectGraph, { extraArgs }) { - return _asyncToGenerator(function* () { - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - if (extraArgs.length === 0) { - _log.log.write(_chalk2.default.red.bold('\nNo script specified')); - process.exit(1); - } - const scriptName = extraArgs[0]; - const scriptArgs = extraArgs.slice(1); - _log.log.write(_chalk2.default.bold(`\nRunning script [${_chalk2.default.green(scriptName)}] in batched topological order\n`)); - yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { - var _ref = _asyncToGenerator(function* (pkg) { - if (pkg.hasScript(scriptName)) { - yield pkg.runScriptStreaming(scriptName, scriptArgs); - } - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - })()); - })(); - } -}; - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.WatchCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _log = __webpack_require__(33); - -var _parallelize = __webpack_require__(34); - -var _projects = __webpack_require__(35); - -var _watch = __webpack_require__(161); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -/** - * Name of the script in the package/project package.json file to run during `kbn watch`. - */ -const watchScriptName = 'kbn:watch'; -/** - * Name of the Kibana project. - */ -const kibanaProjectName = 'kibana'; -/** - * Command that traverses through list of available projects/packages that have `kbn:watch` script in their - * package.json files, groups them into topology aware batches and then processes theses batches one by one - * running `kbn:watch` scripts in parallel within the same batch. - * - * Command internally relies on the fact that most of the build systems that are triggered by `kbn:watch` - * will emit special "marker" once build/watch process is ready that we can use as completion condition for - * the `kbn:watch` script and eventually for the entire batch. Currently we support completion "markers" for - * `webpack` and `tsc` only, for the rest we rely on predefined timeouts. - */ -const WatchCommand = exports.WatchCommand = { - description: 'Runs `kbn:watch` script for every project.', - name: 'watch', - run(projects, projectGraph) { - return _asyncToGenerator(function* () { - const projectsToWatch = new Map(); - for (const project of projects.values()) { - // We can't watch project that doesn't have `kbn:watch` script. - if (project.hasScript(watchScriptName)) { - projectsToWatch.set(project.name, project); - } - } - if (projectsToWatch.size === 0) { - _log.log.write(_chalk2.default.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); - return; - } - const projectNames = Array.from(projectsToWatch.keys()); - _log.log.write(_chalk2.default.bold(_chalk2.default.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); - // Kibana should always be run the last, so we don't rely on automatic - // topological batching and push it to the last one-entry batch manually. - const shouldWatchKibanaProject = projectsToWatch.delete(kibanaProjectName); - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projectsToWatch, projectGraph); - if (shouldWatchKibanaProject) { - batchedProjects.push([projects.get(kibanaProjectName)]); - } - yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { - var _ref = _asyncToGenerator(function* (pkg) { - const completionHint = yield (0, _watch.waitUntilWatchIsReady)(pkg.runScriptStreaming(watchScriptName).stdout); - _log.log.write(_chalk2.default.bold(`[${_chalk2.default.green(pkg.name)}] Initial build completed (${completionHint}).`)); - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - })()); - })(); - } -}; - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.waitUntilWatchIsReady = waitUntilWatchIsReady; - -var _rxjs = __webpack_require__(162); - -var Rx = _interopRequireWildcard(_rxjs); - -var _operators = __webpack_require__(261); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/** - * Number of milliseconds we wait before we fall back to the default watch handler. - */ +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RunCommand", function() { return RunCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -19866,27 +19588,198 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; * specific language governing permissions and limitations * under the License. */ + + + + +const RunCommand = { + description: 'Run script defined in package.json in each package that contains that script.', + name: 'run', + + async run(projects, projectGraph, { + extraArgs + }) { + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_3__["topologicallyBatchProjects"])(projects, projectGraph); + + if (extraArgs.length === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red.bold('\nNo script specified')); + process.exit(1); + } + + const scriptName = extraArgs[0]; + const scriptArgs = extraArgs.slice(1); + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\nRunning script [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(scriptName)}] in batched topological order\n`)); + await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_2__["parallelizeBatches"])(batchedProjects, async pkg => { + if (pkg.hasScript(scriptName)) { + await pkg.runScriptStreaming(scriptName, scriptArgs); + } + }); + } + +}; + +/***/ }), +/* 160 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WatchCommand", function() { return WatchCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35); +/* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(161); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + + + + + +/** + * Name of the script in the package/project package.json file to run during `kbn watch`. + */ +const watchScriptName = 'kbn:watch'; +/** + * Name of the Kibana project. + */ + +const kibanaProjectName = 'kibana'; +/** + * Command that traverses through list of available projects/packages that have `kbn:watch` script in their + * package.json files, groups them into topology aware batches and then processes theses batches one by one + * running `kbn:watch` scripts in parallel within the same batch. + * + * Command internally relies on the fact that most of the build systems that are triggered by `kbn:watch` + * will emit special "marker" once build/watch process is ready that we can use as completion condition for + * the `kbn:watch` script and eventually for the entire batch. Currently we support completion "markers" for + * `webpack` and `tsc` only, for the rest we rely on predefined timeouts. + */ + +const WatchCommand = { + description: 'Runs `kbn:watch` script for every project.', + name: 'watch', + + async run(projects, projectGraph) { + const projectsToWatch = new Map(); + + for (const project of projects.values()) { + // We can't watch project that doesn't have `kbn:watch` script. + if (project.hasScript(watchScriptName)) { + projectsToWatch.set(project.name, project); + } + } + + if (projectsToWatch.size === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); + return; + } + + const projectNames = Array.from(projectsToWatch.keys()); + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); // Kibana should always be run the last, so we don't rely on automatic + // topological batching and push it to the last one-entry batch manually. + + const shouldWatchKibanaProject = projectsToWatch.delete(kibanaProjectName); + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_3__["topologicallyBatchProjects"])(projectsToWatch, projectGraph); + + if (shouldWatchKibanaProject) { + batchedProjects.push([projects.get(kibanaProjectName)]); + } + + await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_2__["parallelizeBatches"])(batchedProjects, async pkg => { + const completionHint = await Object(_utils_watch__WEBPACK_IMPORTED_MODULE_4__["waitUntilWatchIsReady"])(pkg.runScriptStreaming(watchScriptName).stdout); + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`[${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(pkg.name)}] Initial build completed (${completionHint}).`)); + }); + } + +}; + +/***/ }), +/* 161 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waitUntilWatchIsReady", function() { return waitUntilWatchIsReady; }); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(162); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(261); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +/** + * Number of milliseconds we wait before we fall back to the default watch handler. + */ + const defaultHandlerDelay = 3000; /** * If default watch handler is used, then it's the number of milliseconds we wait for * any build output before we consider watch task ready. */ + const defaultHandlerReadinessTimeout = 2000; -function getWatchHandlers(buildOutput$, { handlerDelay = defaultHandlerDelay, handlerReadinessTimeout = defaultHandlerReadinessTimeout }) { - const typescriptHandler = buildOutput$.pipe((0, _operators.first)(data => data.includes('$ tsc')), (0, _operators.map)(() => buildOutput$.pipe((0, _operators.first)(data => data.includes('Compilation complete.')), (0, _operators.mapTo)('tsc')))); - const webpackHandler = buildOutput$.pipe((0, _operators.first)(data => data.includes('$ webpack')), (0, _operators.map)(() => buildOutput$.pipe((0, _operators.first)(data => data.includes('Chunk Names')), (0, _operators.mapTo)('webpack')))); - const defaultHandler = Rx.of(undefined).pipe((0, _operators.delay)(handlerReadinessTimeout), (0, _operators.map)(() => buildOutput$.pipe((0, _operators.timeout)(handlerDelay), (0, _operators.catchError)(() => Rx.of('timeout'))))); +/** + * Describes configurable watch options. + */ + +function getWatchHandlers(buildOutput$, { + handlerDelay = defaultHandlerDelay, + handlerReadinessTimeout = defaultHandlerReadinessTimeout +}) { + const typescriptHandler = buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('$ tsc')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('Compilation complete.')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mapTo"])('tsc')))); + const webpackHandler = buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('$ webpack')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('Chunk Names')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mapTo"])('webpack')))); + const defaultHandler = rxjs__WEBPACK_IMPORTED_MODULE_0__["of"](undefined).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["delay"])(handlerReadinessTimeout), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["timeout"])(handlerDelay), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["catchError"])(() => rxjs__WEBPACK_IMPORTED_MODULE_0__["of"]('timeout'))))); return [typescriptHandler, webpackHandler, defaultHandler]; } + function waitUntilWatchIsReady(stream, opts = {}) { - const buildOutput$ = new Rx.Subject(); + const buildOutput$ = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"](); + const onDataListener = data => buildOutput$.next(data.toString('utf-8')); + const onEndListener = () => buildOutput$.complete(); + const onErrorListener = e => buildOutput$.error(e); + stream.once('end', onEndListener); stream.once('error', onErrorListener); stream.on('data', onDataListener); - return Rx.race(getWatchHandlers(buildOutput$, opts)).pipe((0, _operators.mergeMap)(whenReady => whenReady), (0, _operators.finalize)(() => { + return rxjs__WEBPACK_IMPORTED_MODULE_0__["race"](getWatchHandlers(buildOutput$, opts)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mergeMap"])(whenReady => whenReady), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["finalize"])(() => { stream.removeListener('data', onDataListener); stream.removeListener('end', onEndListener); stream.removeListener('error', onErrorListener); @@ -31474,108 +31367,96 @@ function zipAll(project) { /***/ }), /* 361 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runCommand", function() { return runCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var indent_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(362); +/* harmony import */ var indent_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(indent_string__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(363); +/* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(wrap_ansi__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); +/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(52); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); +/* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(370); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.runCommand = undefined; -let runCommand = exports.runCommand = (() => { - var _ref = _asyncToGenerator(function* (command, config) { - try { - _log.log.write(_chalk2.default.bold(`Running [${_chalk2.default.green(command.name)}] command from [${_chalk2.default.yellow(config.rootPath)}]:\n`)); - const projectPaths = (0, _config.getProjectPaths)(config.rootPath, config.options); - const projects = yield (0, _projects.getProjects)(config.rootPath, projectPaths, { - exclude: toArray(config.options.exclude), - include: toArray(config.options.include) - }); - if (projects.size === 0) { - _log.log.write(_chalk2.default.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); - return process.exit(1); - } - const projectGraph = (0, _projects.buildProjectGraph)(projects); - _log.log.write(_chalk2.default.bold(`Found [${_chalk2.default.green(projects.size.toString())}] projects:\n`)); - _log.log.write((0, _projects_tree.renderProjectsTree)(config.rootPath, projects)); - yield command.run(projects, projectGraph, config); - } catch (e) { - _log.log.write(_chalk2.default.bold.red(`\n[${command.name}] failed:\n`)); - if (e instanceof _errors.CliError) { - const msg = _chalk2.default.red(`CliError: ${e.message}\n`); - _log.log.write((0, _wrapAnsi2.default)(msg, 80)); - const keys = Object.keys(e.meta); - if (keys.length > 0) { - const metaOutput = keys.map(function (key) { - const value = e.meta[key]; - return `${key}: ${value}`; - }); - _log.log.write('Additional debugging info:\n'); - _log.log.write((0, _indentString2.default)(metaOutput.join('\n'), 3)); - } - } else { - _log.log.write(e.stack); - } - process.exit(1); - } + + + + + +async function runCommand(command, config) { + try { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`Running [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(command.name)}] command from [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.yellow(config.rootPath)}]:\n`)); + const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(config.rootPath, config.options); + const projects = await Object(_utils_projects__WEBPACK_IMPORTED_MODULE_6__["getProjects"])(config.rootPath, projectPaths, { + exclude: toArray(config.options.exclude), + include: toArray(config.options.include) }); - return function runCommand(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + if (projects.size === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); + return process.exit(1); + } -var _chalk = __webpack_require__(2); + const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_6__["buildProjectGraph"])(projects); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`Found [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(projects.size.toString())}] projects:\n`)); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(Object(_utils_projects_tree__WEBPACK_IMPORTED_MODULE_7__["renderProjectsTree"])(config.rootPath, projects)); + await command.run(projects, projectGraph, config); + } catch (e) { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.red(`\n[${command.name}] failed:\n`)); -var _chalk2 = _interopRequireDefault(_chalk); + if (e instanceof _utils_errors__WEBPACK_IMPORTED_MODULE_4__["CliError"]) { + const msg = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`CliError: ${e.message}\n`); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(wrap_ansi__WEBPACK_IMPORTED_MODULE_2___default()(msg, 80)); + const keys = Object.keys(e.meta); -var _indentString = __webpack_require__(362); - -var _indentString2 = _interopRequireDefault(_indentString); - -var _wrapAnsi = __webpack_require__(363); - -var _wrapAnsi2 = _interopRequireDefault(_wrapAnsi); - -var _config = __webpack_require__(135); - -var _errors = __webpack_require__(52); - -var _log = __webpack_require__(33); - -var _projects = __webpack_require__(35); - -var _projects_tree = __webpack_require__(370); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ + if (keys.length > 0) { + const metaOutput = keys.map(key => { + const value = e.meta[key]; + return `${key}: ${value}`; + }); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write('Additional debugging info:\n'); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(indent_string__WEBPACK_IMPORTED_MODULE_1___default()(metaOutput.join('\n'), 3)); + } + } else { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(e.stack); + } + process.exit(1); + } +} function toArray(value) { - if (value == null) { - return []; - } - return Array.isArray(value) ? value : [value]; + if (value == null) { + return []; + } + + return Array.isArray(value) ? value : [value]; } /***/ }), @@ -31966,25 +31847,168 @@ module.exports = () => { /***/ }), /* 370 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderProjectsTree", function() { return renderProjectsTree; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.renderProjectsTree = renderProjectsTree; +const projectKey = Symbol('__project'); +function renderProjectsTree(rootPath, projects) { + const projectsTree = buildProjectsTree(rootPath, projects); + return treeToString(createTreeStructure(projectsTree)); +} -var _chalk = __webpack_require__(2); +function treeToString(tree) { + return [tree.name].concat(childrenToStrings(tree.children, '')).join('\n'); +} -var _chalk2 = _interopRequireDefault(_chalk); +function childrenToStrings(tree, treePrefix) { + if (tree === undefined) { + return []; + } -var _path = __webpack_require__(16); + let strings = []; + tree.forEach((node, index) => { + const isLastNode = tree.length - 1 === index; + const nodePrefix = isLastNode ? '└── ' : '├── '; + const childPrefix = isLastNode ? ' ' : '│ '; + const childrenPrefix = treePrefix + childPrefix; + strings.push(`${treePrefix}${nodePrefix}${node.name}`); + strings = strings.concat(childrenToStrings(node.children, childrenPrefix)); + }); + return strings; +} -var _path2 = _interopRequireDefault(_path); +function createTreeStructure(tree) { + let name; + const children = []; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + for (const [dir, project] of tree.entries()) { + // This is a leaf node (aka a project) + if (typeof project === 'string') { + name = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(project); + continue; + } // If there's only one project and the key indicates it's a leaf node, we + // know that we're at a package folder that contains a package.json, so we + // "inline it" so we don't get unnecessary levels, i.e. we'll just see + // `foo` instead of `foo -> foo`. + + + if (project.size === 1 && project.has(projectKey)) { + const projectName = project.get(projectKey); + children.push({ + children: [], + name: dirOrProjectName(dir, projectName) + }); + continue; + } + + const subtree = createTreeStructure(project); // If the name is specified, we know there's a package at the "root" of the + // subtree itself. + + if (subtree.name !== undefined) { + const projectName = subtree.name; + children.push({ + children: subtree.children, + name: dirOrProjectName(dir, projectName) + }); + continue; + } // Special-case whenever we have one child, so we don't get unnecessary + // folders in the output. E.g. instead of `foo -> bar -> baz` we get + // `foo/bar/baz` instead. + + + if (subtree.children && subtree.children.length === 1) { + const child = subtree.children[0]; + const newName = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.dim(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(dir.toString(), child.name)); + children.push({ + children: child.children, + name: newName + }); + continue; + } + + children.push({ + children: subtree.children, + name: chalk__WEBPACK_IMPORTED_MODULE_0___default.a.dim(dir.toString()) + }); + } + + return { + name, + children + }; +} + +function dirOrProjectName(dir, projectName) { + return dir === projectName ? chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(dir) : chalk__WEBPACK_IMPORTED_MODULE_0___default.a`{dim ${dir.toString()} ({reset.green ${projectName}})}`; +} + +function buildProjectsTree(rootPath, projects) { + const tree = new Map(); + + for (const project of projects.values()) { + if (rootPath === project.path) { + tree.set(projectKey, project.name); + } else { + const relativeProjectPath = path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(rootPath, project.path); + addProjectToTree(tree, relativeProjectPath.split(path__WEBPACK_IMPORTED_MODULE_1___default.a.sep), project); + } + } + + return tree; +} + +function addProjectToTree(tree, pathParts, project) { + if (pathParts.length === 0) { + tree.set(projectKey, project.name); + } else { + const [currentDir, ...rest] = pathParts; + + if (!tree.has(currentDir)) { + tree.set(currentDir, new Map()); + } + + const subtree = tree.get(currentDir); + addProjectToTree(subtree, rest, project); + } +} + +/***/ }), +/* 371 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(372); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _build_production_projects__WEBPACK_IMPORTED_MODULE_0__["buildProductionProjects"]; }); + +/* harmony import */ var _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(553); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); /* * Licensed to Elasticsearch B.V. under one or more contributor @@ -32004,173 +32028,74 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * specific language governing permissions and limitations * under the License. */ -const projectKey = Symbol('__project'); -function renderProjectsTree(rootPath, projects) { - const projectsTree = buildProjectsTree(rootPath, projects); - return treeToString(createTreeStructure(projectsTree)); -} -function treeToString(tree) { - return [tree.name].concat(childrenToStrings(tree.children, '')).join('\n'); -} -function childrenToStrings(tree, treePrefix) { - if (tree === undefined) { - return []; - } - let strings = []; - tree.forEach((node, index) => { - const isLastNode = tree.length - 1 === index; - const nodePrefix = isLastNode ? '└── ' : '├── '; - const childPrefix = isLastNode ? ' ' : '│ '; - const childrenPrefix = treePrefix + childPrefix; - strings.push(`${treePrefix}${nodePrefix}${node.name}`); - strings = strings.concat(childrenToStrings(node.children, childrenPrefix)); - }); - return strings; -} -function createTreeStructure(tree) { - let name; - const children = []; - for (const [dir, project] of tree.entries()) { - // This is a leaf node (aka a project) - if (typeof project === 'string') { - name = _chalk2.default.green(project); - continue; - } - // If there's only one project and the key indicates it's a leaf node, we - // know that we're at a package folder that contains a package.json, so we - // "inline it" so we don't get unnecessary levels, i.e. we'll just see - // `foo` instead of `foo -> foo`. - if (project.size === 1 && project.has(projectKey)) { - const projectName = project.get(projectKey); - children.push({ - children: [], - name: dirOrProjectName(dir, projectName) - }); - continue; - } - const subtree = createTreeStructure(project); - // If the name is specified, we know there's a package at the "root" of the - // subtree itself. - if (subtree.name !== undefined) { - const projectName = subtree.name; - children.push({ - children: subtree.children, - name: dirOrProjectName(dir, projectName) - }); - continue; - } - // Special-case whenever we have one child, so we don't get unnecessary - // folders in the output. E.g. instead of `foo -> bar -> baz` we get - // `foo/bar/baz` instead. - if (subtree.children && subtree.children.length === 1) { - const child = subtree.children[0]; - const newName = _chalk2.default.dim(_path2.default.join(dir.toString(), child.name)); - children.push({ - children: child.children, - name: newName - }); - continue; - } - children.push({ - children: subtree.children, - name: _chalk2.default.dim(dir.toString()) - }); - } - return { name, children }; -} -function dirOrProjectName(dir, projectName) { - return dir === projectName ? _chalk2.default.green(dir) : _chalk2.default`{dim ${dir.toString()} ({reset.green ${projectName}})}`; -} -function buildProjectsTree(rootPath, projects) { - const tree = new Map(); - for (const project of projects.values()) { - if (rootPath === project.path) { - tree.set(projectKey, project.name); - } else { - const relativeProjectPath = _path2.default.relative(rootPath, project.path); - addProjectToTree(tree, relativeProjectPath.split(_path2.default.sep), project); - } - } - return tree; -} -function addProjectToTree(tree, pathParts, project) { - if (pathParts.length === 0) { - tree.set(projectKey, project.name); - } else { - const [currentDir, ...rest] = pathParts; - if (!tree.has(currentDir)) { - tree.set(currentDir, new Map()); - } - const subtree = tree.get(currentDir); - addProjectToTree(subtree, rest, project); - } -} - -/***/ }), -/* 371 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _build_production_projects = __webpack_require__(372); - -Object.defineProperty(exports, 'buildProductionProjects', { - enumerable: true, - get: function () { - return _build_production_projects.buildProductionProjects; - } -}); - -var _prepare_project_dependencies = __webpack_require__(553); - -Object.defineProperty(exports, 'prepareExternalProjectDependencies', { - enumerable: true, - get: function () { - return _prepare_project_dependencies.prepareExternalProjectDependencies; - } -}); /***/ }), /* 372 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return buildProductionProjects; }); +/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(373); +/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cpy__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(137); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); +/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(54); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(35); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.buildProductionProjects = undefined; -let buildProductionProjects = exports.buildProductionProjects = (() => { - var _ref = _asyncToGenerator(function* ({ kibanaRoot, buildRoots }) { - const projects = yield getProductionProjects(kibanaRoot); - const projectGraph = (0, _projects.buildProjectGraph)(projects); - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - const projectNames = [...projects.values()].map(function (project) { - return project.name; - }); - _log.log.write(`Preparing production build for [${projectNames.join(', ')}]`); - for (const batch of batchedProjects) { - for (const project of batch) { - yield deleteTarget(project); - yield buildProject(project); - for (const buildRoot of buildRoots) { - yield copyToBuild(project, kibanaRoot, buildRoot); - } - } - } - }); - return function buildProductionProjects(_x) { - return _ref.apply(this, arguments); - }; -})(); + + + + +async function buildProductionProjects({ + kibanaRoot, + buildRoots +}) { + const projects = await getProductionProjects(kibanaRoot); + const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["buildProjectGraph"])(projects); + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["topologicallyBatchProjects"])(projects, projectGraph); + const projectNames = [...projects.values()].map(project => project.name); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(`Preparing production build for [${projectNames.join(', ')}]`); + + for (const batch of batchedProjects) { + for (const project of batch) { + await deleteTarget(project); + await buildProject(project); + + for (const buildRoot of buildRoots) { + await copyToBuild(project, kibanaRoot, buildRoot); + } + } + } +} /** * Returns the subset of projects that should be built into the production * bundle. As we copy these into Kibana's `node_modules` during the build step, @@ -32178,48 +32103,32 @@ let buildProductionProjects = exports.buildProductionProjects = (() => { * we only include Kibana's transitive _production_ dependencies. */ +async function getProductionProjects(rootPath) { + const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(rootPath, {}); + const projects = await Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["getProjects"])(rootPath, projectPaths); + const productionProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["includeTransitiveProjects"])([projects.get('kibana')], projects, { + onlyProductionDependencies: true + }); // We remove Kibana, as we're already building Kibana -let getProductionProjects = (() => { - var _ref2 = _asyncToGenerator(function* (rootPath) { - const projectPaths = (0, _config.getProjectPaths)(rootPath, {}); - const projects = yield (0, _projects.getProjects)(rootPath, projectPaths); - const productionProjects = (0, _projects.includeTransitiveProjects)([projects.get('kibana')], projects, { - onlyProductionDependencies: true - }); - // We remove Kibana, as we're already building Kibana - productionProjects.delete('kibana'); - return productionProjects; + productionProjects.delete('kibana'); + return productionProjects; +} + +async function deleteTarget(project) { + const targetDir = project.targetLocation; + + if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(targetDir)) { + await del__WEBPACK_IMPORTED_MODULE_1___default()(targetDir, { + force: true }); + } +} - return function getProductionProjects(_x2) { - return _ref2.apply(this, arguments); - }; -})(); - -let deleteTarget = (() => { - var _ref3 = _asyncToGenerator(function* (project) { - const targetDir = project.targetLocation; - if (yield (0, _fs.isDirectory)(targetDir)) { - yield (0, _del2.default)(targetDir, { force: true }); - } - }); - - return function deleteTarget(_x3) { - return _ref3.apply(this, arguments); - }; -})(); - -let buildProject = (() => { - var _ref4 = _asyncToGenerator(function* (project) { - if (project.hasScript('build')) { - yield project.runScript('build'); - } - }); - - return function buildProject(_x4) { - return _ref4.apply(this, arguments); - }; -})(); +async function buildProject(project) { + if (project.hasScript('build')) { + await project.runScript('build'); + } +} /** * Copy all the project's files from its "intermediate build directory" and * into the build. The intermediate directory can either be the root of the @@ -32233,73 +32142,26 @@ let buildProject = (() => { */ -let copyToBuild = (() => { - var _ref5 = _asyncToGenerator(function* (project, kibanaRoot, buildRoot) { - // We want the package to have the same relative location within the build - const relativeProjectPath = (0, _path.relative)(kibanaRoot, project.path); - const buildProjectPath = (0, _path.resolve)(buildRoot, relativeProjectPath); - yield (0, _cpy2.default)(['**/*', '!node_modules/**'], buildProjectPath, { - cwd: project.getIntermediateBuildDirectory(), - dot: true, - nodir: true, - parents: true - }); - // If a project is using an intermediate build directory, we special-case our - // handling of `package.json`, as the project build process might have copied - // (a potentially modified) `package.json` into the intermediate build - // directory already. If so, we want to use that `package.json` as the basis - // for creating the production-ready `package.json`. If it's not present in - // the intermediate build, we fall back to using the project's already defined - // `package.json`. - const packageJson = (yield (0, _fs.isFile)((0, _path.join)(buildProjectPath, 'package.json'))) ? yield (0, _package_json.readPackageJson)(buildProjectPath) : project.json; - yield (0, _package_json.writePackageJson)(buildProjectPath, packageJson); - }); +async function copyToBuild(project, kibanaRoot, buildRoot) { + // We want the package to have the same relative location within the build + const relativeProjectPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["relative"])(kibanaRoot, project.path); + const buildProjectPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(buildRoot, relativeProjectPath); + await cpy__WEBPACK_IMPORTED_MODULE_0___default()(['**/*', '!node_modules/**'], buildProjectPath, { + cwd: project.getIntermediateBuildDirectory(), + dot: true, + nodir: true, + parents: true + }); // If a project is using an intermediate build directory, we special-case our + // handling of `package.json`, as the project build process might have copied + // (a potentially modified) `package.json` into the intermediate build + // directory already. If so, we want to use that `package.json` as the basis + // for creating the production-ready `package.json`. If it's not present in + // the intermediate build, we fall back to using the project's already defined + // `package.json`. - return function copyToBuild(_x5, _x6, _x7) { - return _ref5.apply(this, arguments); - }; -})(); - -var _cpy = __webpack_require__(373); - -var _cpy2 = _interopRequireDefault(_cpy); - -var _del = __webpack_require__(137); - -var _del2 = _interopRequireDefault(_del); - -var _path = __webpack_require__(16); - -var _config = __webpack_require__(135); - -var _fs = __webpack_require__(20); - -var _log = __webpack_require__(33); - -var _package_json = __webpack_require__(54); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ + const packageJson = (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isFile"])(Object(path__WEBPACK_IMPORTED_MODULE_2__["join"])(buildProjectPath, 'package.json'))) ? await Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_6__["readPackageJson"])(buildProjectPath) : project.json; + await Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_6__["writePackageJson"])(buildProjectPath, packageJson); +} /***/ }), /* 373 */ @@ -55765,67 +55627,31 @@ module.exports = CpyError; /***/ }), /* 553 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.prepareExternalProjectDependencies = undefined; - -/** - * This prepares the dependencies for an _external_ project. +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return prepareExternalProjectDependencies; }); +/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54); +/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ -let prepareExternalProjectDependencies = exports.prepareExternalProjectDependencies = (() => { - var _ref = _asyncToGenerator(function* (projectPath) { - const project = yield _project.Project.fromPath(projectPath); - if (!project.hasDependencies()) { - return; - } - const deps = project.allDependencies; - for (const depName of Object.keys(deps)) { - const depVersion = deps[depName]; - // Kibana currently only supports `link:` dependencies on Kibana's own - // packages, as these are packaged into the `node_modules` folder when - // Kibana is built, so we don't need to take any action to enable - // `require(...)` to resolve for these packages. - if ((0, _package_json.isLinkDependency)(depVersion) && !isKibanaDep(depVersion)) { - // For non-Kibana packages we need to set up symlinks during the - // installation process, but this is not something we support yet. - throw new Error('This plugin is using `link:` dependencies for non-Kibana packages'); - } - } - }); - - return function prepareExternalProjectDependencies(_x) { - return _ref.apply(this, arguments); - }; -})(); - -var _package_json = __webpack_require__(54); - -var _project = __webpack_require__(53); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ /** @@ -55833,7 +55659,35 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a * to the Kibana root directory or `../kibana-extra/{plugin}` relative * to Kibana itself. */ + const isKibanaDep = depVersion => depVersion.includes('../../kibana/'); +/** + * This prepares the dependencies for an _external_ project. + */ + + +async function prepareExternalProjectDependencies(projectPath) { + const project = await _utils_project__WEBPACK_IMPORTED_MODULE_1__["Project"].fromPath(projectPath); + + if (!project.hasDependencies()) { + return; + } + + const deps = project.allDependencies; + + for (const depName of Object.keys(deps)) { + const depVersion = deps[depName]; // Kibana currently only supports `link:` dependencies on Kibana's own + // packages, as these are packaged into the `node_modules` folder when + // Kibana is built, so we don't need to take any action to enable + // `require(...)` to resolve for these packages. + + if (Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_0__["isLinkDependency"])(depVersion) && !isKibanaDep(depVersion)) { + // For non-Kibana packages we need to set up symlinks during the + // installation process, but this is not something we support yet. + throw new Error('This plugin is using `link:` dependencies for non-Kibana packages'); + } + } +} /***/ }) /******/ ]); \ No newline at end of file diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 6248e919976d..86d67c0bcfe1 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -10,6 +10,11 @@ "prettier": "prettier --write './src/**/*.ts'" }, "devDependencies": { + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-class-properties": "^7.3.4", + "@babel/plugin-proposal-object-rest-spread": "^7.3.4", + "@babel/preset-env": "^7.3.4", + "@babel/preset-typescript": "^7.3.3", "@types/cmd-shim": "^2.0.0", "@types/cpy": "^5.1.0", "@types/dedent": "^0.7.0", @@ -32,10 +37,7 @@ "@types/tempy": "^0.1.0", "@types/wrap-ansi": "^2.0.14", "@types/write-pkg": "^3.1.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-preset-stage-3": "^6.24.1", + "babel-loader": "^8.0.5", "chalk": "^2.4.1", "cmd-shim": "^2.0.2", "cpy": "^7.0.1", @@ -60,7 +62,6 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.2.1", - "ts-loader": "^5.2.2", "typescript": "^3.3.3333", "unlazy-loader": "^0.1.3", "webpack": "^4.23.1", diff --git a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json index df6ad1d3d6d9..c1269fc7c037 100644 --- a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json +++ b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json @@ -4,10 +4,11 @@ "private": true, "main": "./target/index.js", "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1" + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/preset-env": "^7.3.4" }, "scripts": { - "build": "babel --presets env --out-dir target src" + "build": "babel --presets=@babel/preset-env --out-dir target src" } } diff --git a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json index 385aa59bffc7..8b8225594c5a 100644 --- a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json +++ b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json @@ -7,11 +7,12 @@ "@elastic/bar": "link:../bar" }, "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", + "@babel/core": "^7.3.4", + "@babel/cli": "^7.2.3", + "@babel/preset-env": "^7.3.4", "moment": "2.20.1" }, "scripts": { - "build": "babel --presets env --out-dir target src" + "build": "babel --presets=@babel/preset-env --out-dir target src" } } diff --git a/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap b/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap index 94642340e0d9..5049c692aae6 100644 --- a/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap +++ b/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap @@ -20,14 +20,15 @@ Array [ exports[`kbn-pm production builds and copies projects for production: packages/bar/package.json 1`] = ` Object { "devDependencies": Object { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/preset-env": "^7.3.4", }, "main": "./target/index.js", "name": "@elastic/bar", "private": true, "scripts": Object { - "build": "babel --presets env --out-dir target src", + "build": "babel --presets=@babel/preset-env --out-dir target src", }, "version": "1.0.0", } @@ -47,15 +48,16 @@ Object { "@elastic/bar": "link:../bar", }, "devDependencies": Object { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/preset-env": "^7.3.4", "moment": "2.20.1", }, "main": "./target/index.js", "name": "@elastic/foo", "private": true, "scripts": Object { - "build": "babel --presets env --out-dir target src", + "build": "babel --presets=@babel/preset-env --out-dir target src", }, "version": "1.0.0", } diff --git a/packages/kbn-pm/tsconfig.json b/packages/kbn-pm/tsconfig.json index f7c8cdab1678..2141c5502ae9 100644 --- a/packages/kbn-pm/tsconfig.json +++ b/packages/kbn-pm/tsconfig.json @@ -4,7 +4,7 @@ "dist" ], "include": [ - "./src/**/*.ts" + "./src/**/*.ts", ], "compilerOptions": { "types": [ diff --git a/packages/kbn-pm/webpack.config.js b/packages/kbn-pm/webpack.config.js index 1424850265e0..ff77d3cfb7e9 100644 --- a/packages/kbn-pm/webpack.config.js +++ b/packages/kbn-pm/webpack.config.js @@ -44,15 +44,6 @@ module.exports = { { loader: 'babel-loader', }, - { - loader: 'ts-loader', - options: { - compilerOptions: { - // enable esnext modules so webpack can do its thing better - module: 'esnext', - }, - }, - }, ], exclude: /node_modules/, }, diff --git a/packages/kbn-test/babel.config.js b/packages/kbn-test/babel.config.js index 962d7d3e05c5..ff657603f4c8 100644 --- a/packages/kbn-test/babel.config.js +++ b/packages/kbn-test/babel.config.js @@ -18,6 +18,6 @@ */ module.exports = { - presets: ['@kbn/babel-preset/node_preset_7'], + presets: ['@kbn/babel-preset/node_preset'], ignore: ['**/*.test.js'], }; diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json index aa57d854e14c..56790e8cb194 100644 --- a/packages/kbn-test/package.json +++ b/packages/kbn-test/package.json @@ -10,9 +10,9 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { + "@babel/cli": "^7.2.3", "@kbn/babel-preset": "1.0.0", - "@kbn/dev-utils": "1.0.0", - "@babel/cli": "^7.2.3" + "@kbn/dev-utils": "1.0.0" }, "dependencies": { "chalk": "^2.4.1", diff --git a/packages/kbn-ui-framework/doc_site/src/index.js b/packages/kbn-ui-framework/doc_site/src/index.js index 094437d85e6b..f53e8a608e1a 100644 --- a/packages/kbn-ui-framework/doc_site/src/index.js +++ b/packages/kbn-ui-framework/doc_site/src/index.js @@ -19,7 +19,7 @@ require('./main.scss'); -import 'babel-polyfill'; +import '@babel/polyfill'; import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json index 87e586e90ec2..f2b9c2f7e713 100644 --- a/packages/kbn-ui-framework/package.json +++ b/packages/kbn-ui-framework/package.json @@ -26,16 +26,16 @@ "uuid": "3.0.1" }, "peerDependencies": { - "enzyme": "3.2.0", - "enzyme-adapter-react-16": "^1.1.1" + "enzyme": "^3.8.0", + "enzyme-adapter-react-16": "^1.9.1" }, "devDependencies": { + "@babel/core": "^7.3.4", + "@babel/polyfill": "^7.2.5", "@elastic/eui": "0.0.23", "@kbn/babel-preset": "1.0.0", "autoprefixer": "6.5.4", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-polyfill": "^6.26.0", + "babel-loader": "^8.0.5", "brace": "0.10.0", "chalk": "^2.4.1", "chokidar": "1.6.0", @@ -43,7 +43,7 @@ "expose-loader": "^0.7.5", "file-loader": "^2.0.0", "grunt": "1.0.3", - "grunt-babel": "^7.0.0", + "grunt-babel": "^8.0.0", "grunt-contrib-clean": "^1.1.0", "grunt-contrib-copy": "^1.0.0", "highlight.js": "9.0.0", diff --git a/src/core/public/core_system.test.mocks.ts b/src/core/public/core_system.test.mocks.ts new file mode 100644 index 000000000000..cb3f45361d5f --- /dev/null +++ b/src/core/public/core_system.test.mocks.ts @@ -0,0 +1,92 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { basePathServiceMock } from './base_path/base_path_service.mock'; +import { chromeServiceMock } from './chrome/chrome_service.mock'; +import { fatalErrorsServiceMock } from './fatal_errors/fatal_errors_service.mock'; +import { httpServiceMock } from './http/http_service.mock'; +import { i18nServiceMock } from './i18n/i18n_service.mock'; +import { injectedMetadataServiceMock } from './injected_metadata/injected_metadata_service.mock'; +import { legacyPlatformServiceMock } from './legacy/legacy_service.mock'; +import { notificationServiceMock } from './notifications/notifications_service.mock'; +import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; + +export const MockLegacyPlatformService = legacyPlatformServiceMock.create(); +export const LegacyPlatformServiceConstructor = jest + .fn() + .mockImplementation(() => MockLegacyPlatformService); +jest.doMock('./legacy', () => ({ + LegacyPlatformService: LegacyPlatformServiceConstructor, +})); + +export const MockInjectedMetadataService = injectedMetadataServiceMock.create(); +export const InjectedMetadataServiceConstructor = jest + .fn() + .mockImplementation(() => MockInjectedMetadataService); +jest.doMock('./injected_metadata', () => ({ + InjectedMetadataService: InjectedMetadataServiceConstructor, +})); + +export const MockFatalErrorsService = fatalErrorsServiceMock.create(); +export const FatalErrorsServiceConstructor = jest + .fn() + .mockImplementation(() => MockFatalErrorsService); +jest.doMock('./fatal_errors', () => ({ + FatalErrorsService: FatalErrorsServiceConstructor, +})); + +export const MockI18nService = i18nServiceMock.create(); +export const I18nServiceConstructor = jest.fn().mockImplementation(() => MockI18nService); +jest.doMock('./i18n', () => ({ + I18nService: I18nServiceConstructor, +})); + +export const MockNotificationsService = notificationServiceMock.create(); +export const NotificationServiceConstructor = jest + .fn() + .mockImplementation(() => MockNotificationsService); +jest.doMock('./notifications', () => ({ + NotificationsService: NotificationServiceConstructor, +})); + +export const MockHttpService = httpServiceMock.create(); +export const HttpServiceConstructor = jest.fn().mockImplementation(() => MockHttpService); +jest.doMock('./http', () => ({ + HttpService: HttpServiceConstructor, +})); + +export const MockBasePathService = basePathServiceMock.create(); +export const BasePathServiceConstructor = jest.fn().mockImplementation(() => MockBasePathService); +jest.doMock('./base_path', () => ({ + BasePathService: BasePathServiceConstructor, +})); + +export const MockUiSettingsService = uiSettingsServiceMock.create(); +export const UiSettingsServiceConstructor = jest + .fn() + .mockImplementation(() => MockUiSettingsService); +jest.doMock('./ui_settings', () => ({ + UiSettingsService: UiSettingsServiceConstructor, +})); + +export const MockChromeService = chromeServiceMock.create(); +export const ChromeServiceConstructor = jest.fn().mockImplementation(() => MockChromeService); +jest.doMock('./chrome', () => ({ + ChromeService: ChromeServiceConstructor, +})); diff --git a/src/core/public/core_system.test.ts b/src/core/public/core_system.test.ts index 9d9620e3b085..3a8580127f15 100644 --- a/src/core/public/core_system.test.ts +++ b/src/core/public/core_system.test.ts @@ -17,73 +17,26 @@ * under the License. */ -import { basePathServiceMock } from './base_path/base_path_service.mock'; -import { chromeServiceMock } from './chrome/chrome_service.mock'; -import { fatalErrorsServiceMock } from './fatal_errors/fatal_errors_service.mock'; -import { httpServiceMock } from './http/http_service.mock'; -import { i18nServiceMock } from './i18n/i18n_service.mock'; -import { injectedMetadataServiceMock } from './injected_metadata/injected_metadata_service.mock'; -import { legacyPlatformServiceMock } from './legacy/legacy_service.mock'; -import { notificationServiceMock } from './notifications/notifications_service.mock'; -import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; - -const MockLegacyPlatformService = legacyPlatformServiceMock.create(); -const LegacyPlatformServiceConstructor = jest - .fn() - .mockImplementation(() => MockLegacyPlatformService); -jest.mock('./legacy', () => ({ - LegacyPlatformService: LegacyPlatformServiceConstructor, -})); - -const MockInjectedMetadataService = injectedMetadataServiceMock.create(); -const InjectedMetadataServiceConstructor = jest - .fn() - .mockImplementation(() => MockInjectedMetadataService); -jest.mock('./injected_metadata', () => ({ - InjectedMetadataService: InjectedMetadataServiceConstructor, -})); - -const MockFatalErrorsService = fatalErrorsServiceMock.create(); -const FatalErrorsServiceConstructor = jest.fn().mockImplementation(() => MockFatalErrorsService); -jest.mock('./fatal_errors', () => ({ - FatalErrorsService: FatalErrorsServiceConstructor, -})); - -const MockI18nService = i18nServiceMock.create(); -const I18nServiceConstructor = jest.fn().mockImplementation(() => MockI18nService); -jest.mock('./i18n', () => ({ - I18nService: I18nServiceConstructor, -})); - -const MockNotificationsService = notificationServiceMock.create(); -const NotificationServiceConstructor = jest.fn().mockImplementation(() => MockNotificationsService); -jest.mock('./notifications', () => ({ - NotificationsService: NotificationServiceConstructor, -})); - -const MockHttpService = httpServiceMock.create(); -const HttpServiceConstructor = jest.fn().mockImplementation(() => MockHttpService); -jest.mock('./http', () => ({ - HttpService: HttpServiceConstructor, -})); - -const MockBasePathService = basePathServiceMock.create(); -const BasePathServiceConstructor = jest.fn().mockImplementation(() => MockBasePathService); -jest.mock('./base_path', () => ({ - BasePathService: BasePathServiceConstructor, -})); - -const MockUiSettingsService = uiSettingsServiceMock.create(); -const UiSettingsServiceConstructor = jest.fn().mockImplementation(() => MockUiSettingsService); -jest.mock('./ui_settings', () => ({ - UiSettingsService: UiSettingsServiceConstructor, -})); - -const MockChromeService = chromeServiceMock.create(); -const ChromeServiceConstructor = jest.fn().mockImplementation(() => MockChromeService); -jest.mock('./chrome', () => ({ - ChromeService: ChromeServiceConstructor, -})); +import { + BasePathServiceConstructor, + ChromeServiceConstructor, + FatalErrorsServiceConstructor, + HttpServiceConstructor, + I18nServiceConstructor, + InjectedMetadataServiceConstructor, + LegacyPlatformServiceConstructor, + MockBasePathService, + MockChromeService, + MockFatalErrorsService, + MockHttpService, + MockI18nService, + MockInjectedMetadataService, + MockLegacyPlatformService, + MockNotificationsService, + MockUiSettingsService, + NotificationServiceConstructor, + UiSettingsServiceConstructor, +} from './core_system.test.mocks'; import { CoreSystem } from './core_system'; jest.spyOn(CoreSystem.prototype, 'stop'); diff --git a/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap b/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap index 531ce175cfd6..2b4066f4d912 100644 --- a/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap +++ b/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap @@ -52,8 +52,7 @@ exports[`rendering render matches snapshot 1`] = ` body={

diff --git a/src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts b/src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts new file mode 100644 index 000000000000..b998817a1bfc --- /dev/null +++ b/src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockRender = jest.fn(); +jest.mock('react-dom', () => { + return { + render: mockRender, + }; +}); diff --git a/src/core/public/fatal_errors/fatal_errors_service.test.ts b/src/core/public/fatal_errors/fatal_errors_service.test.ts index 6f3842fc4e0e..b1ad92c8c2f6 100644 --- a/src/core/public/fatal_errors/fatal_errors_service.test.ts +++ b/src/core/public/fatal_errors/fatal_errors_service.test.ts @@ -24,12 +24,7 @@ expect.addSnapshotSerializer({ print: () => `Rx.Observable`, }); -const mockRender = jest.fn(); -jest.mock('react-dom', () => { - return { - render: mockRender, - }; -}); +import { mockRender } from './fatal_errors_service.test.mocks'; import { FatalErrorsService } from './fatal_errors_service'; diff --git a/src/core/public/notifications/toasts/toasts_service.test.mocks.ts b/src/core/public/notifications/toasts/toasts_service.test.mocks.ts new file mode 100644 index 000000000000..90ea76c55156 --- /dev/null +++ b/src/core/public/notifications/toasts/toasts_service.test.mocks.ts @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockReactDomRender = jest.fn(); +export const mockReactDomUnmount = jest.fn(); +jest.mock('react-dom', () => ({ + render: mockReactDomRender, + unmountComponentAtNode: mockReactDomUnmount, +})); diff --git a/src/core/public/notifications/toasts/toasts_service.test.tsx b/src/core/public/notifications/toasts/toasts_service.test.tsx index d380ad5b77ea..849fdda97f93 100644 --- a/src/core/public/notifications/toasts/toasts_service.test.tsx +++ b/src/core/public/notifications/toasts/toasts_service.test.tsx @@ -17,12 +17,7 @@ * under the License. */ -const mockReactDomRender = jest.fn(); -const mockReactDomUnmount = jest.fn(); -jest.mock('react-dom', () => ({ - render: mockReactDomRender, - unmountComponentAtNode: mockReactDomUnmount, -})); +import { mockReactDomRender, mockReactDomUnmount } from './toasts_service.test.mocks'; import { ToastsService } from './toasts_service'; import { ToastsSetup } from './toasts_start'; diff --git a/src/core/public/ui_settings/ui_settings_service.test.mocks.ts b/src/core/public/ui_settings/ui_settings_service.test.mocks.ts new file mode 100644 index 000000000000..458a9efdea46 --- /dev/null +++ b/src/core/public/ui_settings/ui_settings_service.test.mocks.ts @@ -0,0 +1,57 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +function mockClass( + module: string, + Class: { new (...args: any[]): T }, + setup: (instance: any, args: any[]) => void +) { + const MockClass = jest.fn(function(this: any, ...args: any[]) { + setup(this, args); + }); + + // define the mock name which is used in some snapshots + MockClass.mockName(`Mock${Class.name}`); + + // define the class name for the MockClass which is used in other snapshots + Object.defineProperty(MockClass, 'name', { + value: `Mock${Class.name}`, + }); + + jest.doMock(module, () => ({ + [Class.name]: MockClass, + })); + + return MockClass; +} + +// Mock the UiSettingsApi class +import { UiSettingsApi } from './ui_settings_api'; +export const MockUiSettingsApi = mockClass('./ui_settings_api', UiSettingsApi, inst => { + inst.stop = jest.fn(); + inst.getLoadingCount$ = jest.fn().mockReturnValue({ + loadingCountObservable: true, + }); +}); + +// Mock the UiSettingsClient class +import { UiSettingsClient } from './ui_settings_client'; +export const MockUiSettingsClient = mockClass('./ui_settings_client', UiSettingsClient, inst => { + inst.stop = jest.fn(); +}); diff --git a/src/core/public/ui_settings/ui_settings_service.test.ts b/src/core/public/ui_settings/ui_settings_service.test.ts index e58b517984fc..f1bfab2981d6 100644 --- a/src/core/public/ui_settings/ui_settings_service.test.ts +++ b/src/core/public/ui_settings/ui_settings_service.test.ts @@ -17,44 +17,7 @@ * under the License. */ -function mockClass( - module: string, - Class: { new (...args: any[]): T }, - setup: (instance: any, args: any[]) => void -) { - const MockClass = jest.fn(function(this: any, ...args: any[]) { - setup(this, args); - }); - - // define the mock name which is used in some snapshots - MockClass.mockName(`Mock${Class.name}`); - - // define the class name for the MockClass which is used in other snapshots - Object.defineProperty(MockClass, 'name', { - value: `Mock${Class.name}`, - }); - - jest.mock(module, () => ({ - [Class.name]: MockClass, - })); - - return MockClass; -} - -// Mock the UiSettingsApi class -import { UiSettingsApi } from './ui_settings_api'; -const MockUiSettingsApi = mockClass('./ui_settings_api', UiSettingsApi, inst => { - inst.stop = jest.fn(); - inst.getLoadingCount$ = jest.fn().mockReturnValue({ - loadingCountObservable: true, - }); -}); - -// Mock the UiSettingsClient class -import { UiSettingsClient } from './ui_settings_client'; -const MockUiSettingsClient = mockClass('./ui_settings_client', UiSettingsClient, inst => { - inst.stop = jest.fn(); -}); +import { MockUiSettingsApi, MockUiSettingsClient } from './ui_settings_service.test.mocks'; import { basePathServiceMock } from '../base_path/base_path_service.mock'; import { httpServiceMock } from '../http/http_service.mock'; diff --git a/src/core/server/config/config_service.mock.ts b/src/core/server/config/config_service.mock.ts index d9f460905fc4..92b0f117b1a0 100644 --- a/src/core/server/config/config_service.mock.ts +++ b/src/core/server/config/config_service.mock.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + import { BehaviorSubject } from 'rxjs'; import { ObjectToConfigAdapter } from './object_to_config_adapter'; diff --git a/src/core/server/config/config_service.test.mocks.ts b/src/core/server/config/config_service.test.mocks.ts new file mode 100644 index 000000000000..8fa1ec997d62 --- /dev/null +++ b/src/core/server/config/config_service.test.mocks.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../../package.json', () => mockPackage); diff --git a/src/core/server/config/config_service.test.ts b/src/core/server/config/config_service.test.ts index 7a10d4992e2c..a054786c80f7 100644 --- a/src/core/server/config/config_service.test.ts +++ b/src/core/server/config/config_service.test.ts @@ -22,8 +22,7 @@ import { BehaviorSubject } from 'rxjs'; import { first } from 'rxjs/operators'; -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../../package.json', () => mockPackage); +import { mockPackage } from './config_service.test.mocks'; import { schema, Type, TypeOf } from '@kbn/config-schema'; diff --git a/src/core/server/config/env.test.mocks.ts b/src/core/server/config/env.test.mocks.ts new file mode 100644 index 000000000000..be65aa172707 --- /dev/null +++ b/src/core/server/config/env.test.mocks.ts @@ -0,0 +1,33 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +jest.mock('process', () => ({ + cwd() { + return '/test/cwd'; + }, +})); + +jest.mock('path', () => ({ + resolve(...pathSegments: string[]) { + return pathSegments.join('/'); + }, +})); + +export const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../../package.json', () => mockPackage); diff --git a/src/core/server/config/env.test.ts b/src/core/server/config/env.test.ts index 3c251b7339e4..13bd05c3b1c8 100644 --- a/src/core/server/config/env.test.ts +++ b/src/core/server/config/env.test.ts @@ -17,20 +17,7 @@ * under the License. */ -jest.mock('process', () => ({ - cwd() { - return '/test/cwd'; - }, -})); - -jest.mock('path', () => ({ - resolve(...pathSegments: string[]) { - return pathSegments.join('/'); - }, -})); - -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../../package.json', () => mockPackage); +import { mockPackage } from './env.test.mocks'; import { Env } from '.'; import { getEnvOptions } from './__mocks__/env'; diff --git a/src/core/server/config/raw_config_service.test.mocks.ts b/src/core/server/config/raw_config_service.test.mocks.ts new file mode 100644 index 000000000000..be43b0f64e65 --- /dev/null +++ b/src/core/server/config/raw_config_service.test.mocks.ts @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockGetConfigFromFiles = jest.fn(); + +jest.mock('./read_config', () => ({ + getConfigFromFiles: mockGetConfigFromFiles, +})); diff --git a/src/core/server/config/raw_config_service.test.ts b/src/core/server/config/raw_config_service.test.ts index 0cd0dc45cd93..361cef0d042e 100644 --- a/src/core/server/config/raw_config_service.test.ts +++ b/src/core/server/config/raw_config_service.test.ts @@ -17,11 +17,7 @@ * under the License. */ -const mockGetConfigFromFiles = jest.fn(); - -jest.mock('./read_config', () => ({ - getConfigFromFiles: mockGetConfigFromFiles, -})); +import { mockGetConfigFromFiles } from './raw_config_service.test.mocks'; import { first } from 'rxjs/operators'; import { RawConfigService } from '.'; diff --git a/src/core/server/elasticsearch/cluster_client.test.mocks.ts b/src/core/server/elasticsearch/cluster_client.test.mocks.ts new file mode 100644 index 000000000000..4a8553d1d5f9 --- /dev/null +++ b/src/core/server/elasticsearch/cluster_client.test.mocks.ts @@ -0,0 +1,35 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const MockClient = jest.fn(); +jest.mock('elasticsearch', () => ({ + // Jest types don't include `requireActual` right now. + ...jest.requireActual('elasticsearch'), + Client: MockClient, +})); + +export const MockScopedClusterClient = jest.fn(); +jest.mock('./scoped_cluster_client', () => ({ + ScopedClusterClient: MockScopedClusterClient, +})); + +export const mockParseElasticsearchClientConfig = jest.fn(); +jest.mock('./elasticsearch_client_config', () => ({ + parseElasticsearchClientConfig: mockParseElasticsearchClientConfig, +})); diff --git a/src/core/server/elasticsearch/cluster_client.test.ts b/src/core/server/elasticsearch/cluster_client.test.ts index da511c282981..30a1ac7a038e 100644 --- a/src/core/server/elasticsearch/cluster_client.test.ts +++ b/src/core/server/elasticsearch/cluster_client.test.ts @@ -19,22 +19,11 @@ import { ElasticsearchConfig } from './elasticsearch_config'; -const MockClient = jest.fn(); -jest.mock('elasticsearch', () => ({ - // Jest types don't include `requireActual` right now. - ...(jest as any).requireActual('elasticsearch'), - Client: MockClient, -})); - -const MockScopedClusterClient = jest.fn(); -jest.mock('./scoped_cluster_client', () => ({ - ScopedClusterClient: MockScopedClusterClient, -})); - -const mockParseElasticsearchClientConfig = jest.fn(); -jest.mock('./elasticsearch_client_config', () => ({ - parseElasticsearchClientConfig: mockParseElasticsearchClientConfig, -})); +import { + MockClient, + mockParseElasticsearchClientConfig, + MockScopedClusterClient, +} from './cluster_client.test.mocks'; import { errors } from 'elasticsearch'; import { get } from 'lodash'; diff --git a/src/dev/jest/ts_transform.js b/src/core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts similarity index 88% rename from src/dev/jest/ts_transform.js rename to src/core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts index f097ed2f8076..f6c6079822cb 100644 --- a/src/dev/jest/ts_transform.js +++ b/src/core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts @@ -17,5 +17,5 @@ * under the License. */ -require('../../setup_node_env'); -module.exports = require('./ts_transform.ts'); +export const mockReadFileSync = jest.fn(); +jest.mock('fs', () => ({ readFileSync: mockReadFileSync })); diff --git a/src/core/server/elasticsearch/elasticsearch_client_config.test.ts b/src/core/server/elasticsearch/elasticsearch_client_config.test.ts index f2eb30f73640..64fb41cb3e4e 100644 --- a/src/core/server/elasticsearch/elasticsearch_client_config.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_client_config.test.ts @@ -17,8 +17,7 @@ * under the License. */ -const mockReadFileSync = jest.fn(); -jest.mock('fs', () => ({ readFileSync: mockReadFileSync })); +import { mockReadFileSync } from './elasticsearch_client_config.test.mocks'; import { duration } from 'moment'; import { loggingServiceMock } from '../logging/logging_service.mock'; @@ -67,7 +66,7 @@ Object { }); test('parses fully specified config', () => { - mockReadFileSync.mockImplementation(path => `content-of-${path}`); + mockReadFileSync.mockImplementation((path: string) => `content-of-${path}`); const elasticsearchConfig: ElasticsearchClientConfig = { apiVersion: 'v7.0.0', @@ -607,7 +606,7 @@ Object { }); test('#ignoreCertAndKey = true', () => { - mockReadFileSync.mockImplementation(path => `content-of-${path}`); + mockReadFileSync.mockImplementation((path: string) => `content-of-${path}`); expect( parseElasticsearchClientConfig( diff --git a/src/core/server/elasticsearch/elasticsearch_service.mock.ts b/src/core/server/elasticsearch/elasticsearch_service.mock.ts index bbd7fda86c5e..57157adc2fac 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.mock.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.mock.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + import { BehaviorSubject } from 'rxjs'; import { ClusterClient } from './cluster_client'; import { ElasticsearchConfig } from './elasticsearch_config'; diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts b/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts new file mode 100644 index 000000000000..e87913a3c5e4 --- /dev/null +++ b/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const MockClusterClient = jest.fn(); +jest.mock('./cluster_client', () => ({ ClusterClient: MockClusterClient })); diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.ts b/src/core/server/elasticsearch/elasticsearch_service.test.ts index f880e318e717..0697d9152f0a 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.test.ts @@ -19,8 +19,7 @@ import { first } from 'rxjs/operators'; -const MockClusterClient = jest.fn(); -jest.mock('./cluster_client', () => ({ ClusterClient: MockClusterClient })); +import { MockClusterClient } from './elasticsearch_service.test.mocks'; import { BehaviorSubject, combineLatest } from 'rxjs'; import { Config, ConfigService, Env, ObjectToConfigAdapter } from '../config'; diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index f246ff6634b3..bc9a42b26fdf 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + import { Server, ServerOptions } from 'hapi'; import { HttpService } from './http_service'; diff --git a/src/core/server/http/http_service.test.mocks.ts b/src/core/server/http/http_service.test.mocks.ts new file mode 100644 index 000000000000..a0d7ff5069eb --- /dev/null +++ b/src/core/server/http/http_service.test.mocks.ts @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockHttpServer = jest.fn(); + +jest.mock('./http_server', () => ({ + HttpServer: mockHttpServer, +})); diff --git a/src/core/server/http/http_service.test.ts b/src/core/server/http/http_service.test.ts index 6ed3d13221dc..6c38162a0b7f 100644 --- a/src/core/server/http/http_service.test.ts +++ b/src/core/server/http/http_service.test.ts @@ -17,11 +17,7 @@ * under the License. */ -const mockHttpServer = jest.fn(); - -jest.mock('./http_server', () => ({ - HttpServer: mockHttpServer, -})); +import { mockHttpServer } from './http_service.test.mocks'; import { noop } from 'lodash'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/core/server/index.test.mocks.ts b/src/core/server/index.test.mocks.ts new file mode 100644 index 000000000000..c25772ea46de --- /dev/null +++ b/src/core/server/index.test.mocks.ts @@ -0,0 +1,40 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { httpServiceMock } from './http/http_service.mock'; +export const httpService = httpServiceMock.create(); +jest.doMock('./http/http_service', () => ({ + HttpService: jest.fn(() => httpService), +})); + +export const mockPluginsService = { setup: jest.fn(), stop: jest.fn() }; +jest.doMock('./plugins/plugins_service', () => ({ + PluginsService: jest.fn(() => mockPluginsService), +})); + +import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; +export const elasticsearchService = elasticsearchServiceMock.create(); +jest.doMock('./elasticsearch/elasticsearch_service', () => ({ + ElasticsearchService: jest.fn(() => elasticsearchService), +})); + +export const mockLegacyService = { setup: jest.fn(), stop: jest.fn() }; +jest.mock('./legacy/legacy_service', () => ({ + LegacyService: jest.fn(() => mockLegacyService), +})); diff --git a/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap b/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap index 050184b1f1d5..76d53b4b1cc5 100644 --- a/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap +++ b/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap @@ -28,6 +28,7 @@ Array [ "valueInBytes": 1073741824, }, }, + "httpsAgent": undefined, "log": Object { "context": Array [ "server", @@ -52,6 +53,7 @@ Array [ "trace": [MockFunction], "warn": [MockFunction], }, + "server": undefined, }, ], ] diff --git a/src/core/server/logging/appenders/appenders.test.mocks.ts b/src/core/server/logging/appenders/appenders.test.mocks.ts new file mode 100644 index 000000000000..551a4ac1bedc --- /dev/null +++ b/src/core/server/logging/appenders/appenders.test.mocks.ts @@ -0,0 +1,29 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockCreateLayout = jest.fn(); +jest.mock('../layouts/layouts', () => { + const { schema } = require('@kbn/config-schema'); + return { + Layouts: { + configSchema: schema.object({ kind: schema.literal('mock') }), + create: mockCreateLayout, + }, + }; +}); diff --git a/src/core/server/logging/appenders/appenders.test.ts b/src/core/server/logging/appenders/appenders.test.ts index df528f4c58cd..7cfd2158be33 100644 --- a/src/core/server/logging/appenders/appenders.test.ts +++ b/src/core/server/logging/appenders/appenders.test.ts @@ -17,16 +17,7 @@ * under the License. */ -const mockCreateLayout = jest.fn(); -jest.mock('../layouts/layouts', () => { - const { schema } = require('@kbn/config-schema'); - return { - Layouts: { - configSchema: schema.object({ kind: schema.literal('mock') }), - create: mockCreateLayout, - }, - }; -}); +import { mockCreateLayout } from './appenders.test.mocks'; import { LegacyAppender } from '../../legacy/logging/appenders/legacy_appender'; import { Appenders } from './appenders'; diff --git a/src/core/server/logging/appenders/file/file_appender.test.mocks.ts b/src/core/server/logging/appenders/file/file_appender.test.mocks.ts new file mode 100644 index 000000000000..a4e4532882f5 --- /dev/null +++ b/src/core/server/logging/appenders/file/file_appender.test.mocks.ts @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +jest.mock('../../layouts/layouts', () => { + const { schema } = require('@kbn/config-schema'); + return { + Layouts: { + configSchema: schema.object({ + kind: schema.literal('mock'), + }), + }, + }; +}); + +export const mockCreateWriteStream = jest.fn(); +jest.mock('fs', () => ({ createWriteStream: mockCreateWriteStream })); diff --git a/src/core/server/logging/appenders/file/file_appender.test.ts b/src/core/server/logging/appenders/file/file_appender.test.ts index 1d9ef3399595..fccca629f7d6 100644 --- a/src/core/server/logging/appenders/file/file_appender.test.ts +++ b/src/core/server/logging/appenders/file/file_appender.test.ts @@ -17,19 +17,7 @@ * under the License. */ -jest.mock('../../layouts/layouts', () => { - const { schema } = require('@kbn/config-schema'); - return { - Layouts: { - configSchema: schema.object({ - kind: schema.literal('mock'), - }), - }, - }; -}); - -const mockCreateWriteStream = jest.fn(); -jest.mock('fs', () => ({ createWriteStream: mockCreateWriteStream })); +import { mockCreateWriteStream } from './file_appender.test.mocks'; import { LogLevel } from '../../log_level'; import { LogRecord } from '../../log_record'; diff --git a/src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts b/src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts new file mode 100644 index 000000000000..d92465e4dd49 --- /dev/null +++ b/src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts @@ -0,0 +1,30 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockReaddir = jest.fn(); +export const mockReadFile = jest.fn(); +export const mockStat = jest.fn(); +jest.mock('fs', () => ({ + readdir: mockReaddir, + readFile: mockReadFile, + stat: mockStat, +})); + +export const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../../../package.json', () => mockPackage); diff --git a/src/core/server/plugins/discovery/plugin_discovery.test.ts b/src/core/server/plugins/discovery/plugin_discovery.test.ts index 266ad1780d47..ac02a21cbe7a 100644 --- a/src/core/server/plugins/discovery/plugin_discovery.test.ts +++ b/src/core/server/plugins/discovery/plugin_discovery.test.ts @@ -17,17 +17,7 @@ * under the License. */ -const mockReaddir = jest.fn(); -const mockReadFile = jest.fn(); -const mockStat = jest.fn(); -jest.mock('fs', () => ({ - readdir: mockReaddir, - readFile: mockReadFile, - stat: mockStat, -})); - -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../../../package.json', () => mockPackage); +import { mockPackage, mockReaddir, mockReadFile, mockStat } from './plugin_discovery.test.mocks'; import { resolve } from 'path'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts new file mode 100644 index 000000000000..eb8dc1e60958 --- /dev/null +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockReadFile = jest.fn(); +const mockStat = jest.fn(); +jest.mock('fs', () => ({ readFile: mockReadFile, stat: mockStat })); diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts index d6012e4a5e2e..082cd82e5e1f 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts @@ -19,9 +19,7 @@ import { PluginDiscoveryErrorType } from './plugin_discovery_error'; -const mockReadFile = jest.fn(); -const mockStat = jest.fn(); -jest.mock('fs', () => ({ readFile: mockReadFile, stat: mockStat })); +import { mockReadFile } from './plugin_manifest_parser.test.mocks'; import { resolve } from 'path'; import { parseManifest } from './plugin_manifest_parser'; diff --git a/src/core/server/plugins/plugin.test.ts b/src/core/server/plugins/plugin.test.ts index 284e9e10cb7b..2f2a73668a59 100644 --- a/src/core/server/plugins/plugin.test.ts +++ b/src/core/server/plugins/plugin.test.ts @@ -30,15 +30,15 @@ import { createPluginInitializerContext, createPluginSetupContext } from './plug const mockPluginInitializer = jest.fn(); const logger = loggingServiceMock.create(); -jest.mock( +jest.doMock( join('plugin-with-initializer-path', 'server'), () => ({ plugin: mockPluginInitializer }), { virtual: true } ); -jest.mock(join('plugin-without-initializer-path', 'server'), () => ({}), { +jest.doMock(join('plugin-without-initializer-path', 'server'), () => ({}), { virtual: true, }); -jest.mock(join('plugin-with-wrong-initializer-path', 'server'), () => ({ plugin: {} }), { +jest.doMock(join('plugin-with-wrong-initializer-path', 'server'), () => ({ plugin: {} }), { virtual: true, }); diff --git a/src/core/server/plugins/plugins_service.test.mocks.ts b/src/core/server/plugins/plugins_service.test.mocks.ts new file mode 100644 index 000000000000..13b492e382d6 --- /dev/null +++ b/src/core/server/plugins/plugins_service.test.mocks.ts @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../legacy/utils/package_json', () => ({ pkg: mockPackage })); + +export const mockDiscover = jest.fn(); +jest.mock('./discovery/plugins_discovery', () => ({ discover: mockDiscover })); + +jest.mock('./plugins_system'); diff --git a/src/core/server/plugins/plugins_service.test.ts b/src/core/server/plugins/plugins_service.test.ts index 553cb8a03138..2a3ce3a4f88d 100644 --- a/src/core/server/plugins/plugins_service.test.ts +++ b/src/core/server/plugins/plugins_service.test.ts @@ -17,13 +17,7 @@ * under the License. */ -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../legacy/utils/package_json', () => ({ pkg: mockPackage })); - -const mockDiscover = jest.fn(); -jest.mock('./discovery/plugins_discovery', () => ({ discover: mockDiscover })); - -jest.mock('./plugins_system'); +import { mockDiscover, mockPackage } from './plugins_service.test.mocks'; import { resolve } from 'path'; import { BehaviorSubject, from } from 'rxjs'; diff --git a/src/core/server/plugins/plugins_system.test.mocks.ts b/src/core/server/plugins/plugins_system.test.mocks.ts new file mode 100644 index 000000000000..9bcbba892fa2 --- /dev/null +++ b/src/core/server/plugins/plugins_system.test.mocks.ts @@ -0,0 +1,23 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockCreatePluginSetupContext = jest.fn(); +jest.mock('./plugin_context', () => ({ + createPluginSetupContext: mockCreatePluginSetupContext, +})); diff --git a/src/core/server/plugins/plugins_system.test.ts b/src/core/server/plugins/plugins_system.test.ts index 2df8b8301b0e..3202a7697bd6 100644 --- a/src/core/server/plugins/plugins_system.test.ts +++ b/src/core/server/plugins/plugins_system.test.ts @@ -17,16 +17,12 @@ * under the License. */ -import { CoreContext } from '../core_context'; - -const mockCreatePluginSetupContext = jest.fn(); -jest.mock('./plugin_context', () => ({ - createPluginSetupContext: mockCreatePluginSetupContext, -})); +import { mockCreatePluginSetupContext } from './plugins_system.test.mocks'; import { BehaviorSubject } from 'rxjs'; import { Config, ConfigService, Env, ObjectToConfigAdapter } from '../config'; import { getEnvOptions } from '../config/__mocks__/env'; +import { CoreContext } from '../core_context'; import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service.mock'; import { loggingServiceMock } from '../logging/logging_service.mock'; import { Plugin, PluginName } from './plugin'; diff --git a/src/core/server/root/index.test.mocks.ts b/src/core/server/root/index.test.mocks.ts new file mode 100644 index 000000000000..602fa2368a76 --- /dev/null +++ b/src/core/server/root/index.test.mocks.ts @@ -0,0 +1,33 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { loggingServiceMock } from '../logging/logging_service.mock'; +export const logger = loggingServiceMock.create(); +jest.doMock('../logging', () => ({ + LoggingService: jest.fn(() => logger), +})); + +import { configServiceMock } from '../config/config_service.mock'; +export const configService = configServiceMock.create(); +jest.doMock('../config/config_service', () => ({ + ConfigService: jest.fn(() => configService), +})); + +export const mockServer = { setup: jest.fn(), stop: jest.fn() }; +jest.mock('../server', () => ({ Server: jest.fn(() => mockServer) })); diff --git a/src/core/server/root/index.test.ts b/src/core/server/root/index.test.ts index b5915debfe6a..4eba2133dce2 100644 --- a/src/core/server/root/index.test.ts +++ b/src/core/server/root/index.test.ts @@ -17,20 +17,7 @@ * under the License. */ -import { loggingServiceMock } from '../logging/logging_service.mock'; -const logger = loggingServiceMock.create(); -jest.mock('../logging', () => ({ - LoggingService: jest.fn(() => logger), -})); - -import { configServiceMock } from '../config/config_service.mock'; -const configService = configServiceMock.create(); -jest.mock('../config/config_service', () => ({ - ConfigService: jest.fn(() => configService), -})); - -const mockServer = { setup: jest.fn(), stop: jest.fn() }; -jest.mock('../server', () => ({ Server: jest.fn(() => mockServer) })); +import { configService, logger, mockServer } from './index.test.mocks'; import { BehaviorSubject } from 'rxjs'; import { filter, first } from 'rxjs/operators'; diff --git a/src/core/server/server.test.ts b/src/core/server/server.test.ts index a3bfa8db21c4..cbfdbbc3bc00 100644 --- a/src/core/server/server.test.ts +++ b/src/core/server/server.test.ts @@ -16,27 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { httpServiceMock } from './http/http_service.mock'; -const httpService = httpServiceMock.create(); -jest.mock('./http/http_service', () => ({ - HttpService: jest.fn(() => httpService), -})); -const mockPluginsService = { setup: jest.fn(), stop: jest.fn() }; -jest.mock('./plugins/plugins_service', () => ({ - PluginsService: jest.fn(() => mockPluginsService), -})); - -import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; -const elasticsearchService = elasticsearchServiceMock.create(); -jest.mock('./elasticsearch/elasticsearch_service', () => ({ - ElasticsearchService: jest.fn(() => elasticsearchService), -})); - -const mockLegacyService = { setup: jest.fn(), stop: jest.fn() }; -jest.mock('./legacy/legacy_service', () => ({ - LegacyService: jest.fn(() => mockLegacyService), -})); +import { + elasticsearchService, + httpService, + mockLegacyService, + mockPluginsService, +} from './index.test.mocks'; import { BehaviorSubject } from 'rxjs'; import { Env } from './config'; diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index cda00064162f..bb450dcd006b 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -47,8 +47,8 @@ import { RemovePackageJsonDepsTask, RemoveWorkspacesTask, TranspileBabelTask, - TranspileTypescriptTask, TranspileScssTask, + TypecheckTypescriptTask, UpdateLicenseFileTask, VerifyEnvTask, VerifyExistingNodeBuildsTask, @@ -107,15 +107,14 @@ export async function buildDistributables(options) { * run platform-generic build tasks */ await run(CopySourceTask); + await run(TypecheckTypescriptTask); await run(CreateEmptyDirsAndFilesTask); await run(CreateReadmeTask); await run(TranspileBabelTask); - await run(TranspileTypescriptTask); await run(BuildPackagesTask); await run(CreatePackageJsonTask); await run(InstallDependenciesTask); await run(RemoveWorkspacesTask); - await run(CleanTypescriptTask); await run(CleanPackagesTask); await run(CreateNoticeFileTask); await run(UpdateLicenseFileTask); @@ -123,6 +122,7 @@ export async function buildDistributables(options) { await run(TranspileScssTask); await run(OptimizeBuildTask); await run(CleanClientModulesOnDLLTask); + await run(CleanTypescriptTask); await run(CleanExtraFilesFromModulesTask); await run(CleanEmptyFoldersTask); diff --git a/src/dev/build/tasks/copy_source_task.js b/src/dev/build/tasks/copy_source_task.js index 18ca6492f08c..01b31b51a060 100644 --- a/src/dev/build/tasks/copy_source_task.js +++ b/src/dev/build/tasks/copy_source_task.js @@ -28,7 +28,8 @@ export const CopySourceTask = { select: [ 'yarn.lock', 'src/**', - '!src/**/*.test.{js,ts,tsx}', + '!src/**/*.{test,test.mocks,mock}.{js,ts,tsx}', + '!src/**/mocks.ts', // special file who imports .mock files '!src/**/{__tests__,__snapshots__}/**', '!src/test_utils/**', '!src/fixtures/**', diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index ecf86d6af23e..acf4680fd6f4 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -33,7 +33,7 @@ export * from './notice_file_task'; export * from './optimize_task'; export * from './os_packages'; export * from './transpile_babel_task'; -export * from './transpile_typescript_task'; +export * from './typecheck_typescript_task'; export * from './transpile_scss_task'; export * from './verify_env_task'; export * from './write_sha_sums_task'; diff --git a/src/dev/build/tasks/transpile_babel_task.js b/src/dev/build/tasks/transpile_babel_task.js index 1ea3d8158391..c6d762be9d73 100644 --- a/src/dev/build/tasks/transpile_babel_task.js +++ b/src/dev/build/tasks/transpile_babel_task.js @@ -22,31 +22,59 @@ import vfs from 'vinyl-fs'; import { createPromiseFromStreams } from '../../../legacy/utils'; +const transpileWithBabel = async (srcGlobs, build, presets) => { + const buildRoot = build.resolvePath(); + + await createPromiseFromStreams([ + vfs.src( + srcGlobs.concat([ + '!**/*.d.ts', + '!packages/**', + '!**/node_modules/**', + '!**/bower_components/**', + '!**/__tests__/**', + ]), + { + cwd: buildRoot, + } + ), + + gulpBabel({ + babelrc: false, + presets, + }), + + vfs.dest(buildRoot), + ]); +}; + export const TranspileBabelTask = { description: 'Transpiling sources with babel', async run(config, log, build) { - await createPromiseFromStreams([ - vfs.src( - [ - '**/*.js', - '!packages/**', - '!**/public/**', - '!**/node_modules/**', - '!**/bower_components/**', - '!**/__tests__/**', - ], - { - cwd: build.resolvePath(), - } - ), + // Transpile server code + await transpileWithBabel( + [ + '**/*.{js,ts,tsx}', + '!**/public/**', + ], + build, + [ + require.resolve('@kbn/babel-preset/node_preset') + ] + ); - gulpBabel({ - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/node_preset')], - }), - - vfs.dest(build.resolvePath()), - ]); + // Transpile client code + // NOTE: For the client, as we have the optimizer, we are only + // pre-transpiling the typescript based files + await transpileWithBabel( + [ + '**/public/**/*.{ts,tsx}', + ], + build, + [ + require.resolve('@kbn/babel-preset/webpack_preset') + ] + ); }, }; diff --git a/src/dev/build/tasks/transpile_typescript_task.js b/src/dev/build/tasks/typecheck_typescript_task.js similarity index 85% rename from src/dev/build/tasks/transpile_typescript_task.js rename to src/dev/build/tasks/typecheck_typescript_task.js index 735d6c17afec..bbdc5f69be8b 100644 --- a/src/dev/build/tasks/transpile_typescript_task.js +++ b/src/dev/build/tasks/typecheck_typescript_task.js @@ -20,22 +20,13 @@ import { exec, write } from '../lib'; import { Project } from '../../typescript'; -export const TranspileTypescriptTask = { - description: 'Transpiling sources with typescript compiler', +export const TypecheckTypescriptTask = { + description: 'Typechecking sources with typescript compiler', async run(config, log, build) { // these projects are built in the build folder - const defaultProject = new Project(build.resolvePath('tsconfig.json')); const browserProject = new Project(build.resolvePath('tsconfig.browser.json')); - - // update the default config to exclude **/public/**/* files - await write(defaultProject.tsConfigPath, JSON.stringify({ - ...defaultProject.config, - exclude: [ - ...defaultProject.config.exclude, - 'src/**/public/**/*' - ] - })); + const defaultProject = new Project(build.resolvePath('tsconfig.json')); // update the browser config file to include **/public/**/* files await write(browserProject.tsConfigPath, JSON.stringify({ @@ -47,21 +38,28 @@ export const TranspileTypescriptTask = { ] })); + // update the default config to exclude **/public/**/* files + await write(defaultProject.tsConfigPath, JSON.stringify({ + ...defaultProject.config, + exclude: [ + ...defaultProject.config.exclude, + 'src/**/public/**/*' + ] + })); + const projects = [ - // Browser needs to be compiled before server code so that any shared code - // is compiled to the lowest common denominator (server's CommonJS format) - // which can be supported by both environments. browserProject.tsConfigPath, defaultProject.tsConfigPath, ]; // compile each typescript config file for (const tsConfigPath of projects) { - log.info(`Compiling`, tsConfigPath, 'project'); + log.info(`Typechecking`, tsConfigPath, 'project'); await exec( log, require.resolve('typescript/bin/tsc'), [ + '--noEmit', '--pretty', 'true', '--project', tsConfigPath, ], diff --git a/src/dev/i18n/integrate_locale_files.test.mocks.ts b/src/dev/i18n/integrate_locale_files.test.mocks.ts new file mode 100644 index 000000000000..e84ca068c067 --- /dev/null +++ b/src/dev/i18n/integrate_locale_files.test.mocks.ts @@ -0,0 +1,27 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockWriteFileAsync = jest.fn(); +export const mockMakeDirAsync = jest.fn(); +jest.mock('./utils', () => ({ + // Jest typings don't define `requireActual` for some reason. + ...(jest as any).requireActual('./utils'), + writeFileAsync: mockWriteFileAsync, + makeDirAsync: mockMakeDirAsync, +})); diff --git a/src/dev/i18n/integrate_locale_files.test.ts b/src/dev/i18n/integrate_locale_files.test.ts index 050f16f3d334..7d7d1ba74468 100644 --- a/src/dev/i18n/integrate_locale_files.test.ts +++ b/src/dev/i18n/integrate_locale_files.test.ts @@ -17,14 +17,7 @@ * under the License. */ -const mockWriteFileAsync = jest.fn(); -const mockMakeDirAsync = jest.fn(); -jest.mock('./utils', () => ({ - // Jest typings don't define `requireActual` for some reason. - ...(jest as any).requireActual('./utils'), - writeFileAsync: mockWriteFileAsync, - makeDirAsync: mockMakeDirAsync, -})); +import { mockMakeDirAsync, mockWriteFileAsync } from './integrate_locale_files.test.mocks'; import path from 'path'; import { integrateLocaleFiles, verifyMessages } from './integrate_locale_files'; diff --git a/src/dev/jest/babel_transform.js b/src/dev/jest/babel_transform.js index 7bdba8ae7fa1..0796cf859d4e 100644 --- a/src/dev/jest/babel_transform.js +++ b/src/dev/jest/babel_transform.js @@ -22,5 +22,5 @@ const babelJest = require('babel-jest'); module.exports = babelJest.createTransformer({ presets: [ require.resolve('@kbn/babel-preset/node_preset') - ] + ], }); diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 1427624f0ce9..840510815d34 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -59,11 +59,6 @@ export default { coverageReporters: [ 'html', ], - globals: { - 'ts-jest': { - skipBabel: true, - }, - }, moduleFileExtensions: [ 'js', 'json', @@ -83,8 +78,7 @@ export default { 'integration_tests/' ], transform: { - '^.+\\.js$': '/src/dev/jest/babel_transform.js', - '^.+\\.tsx?$': '/src/dev/jest/ts_transform.js', + '^.+\\.(js|tsx?)$': '/src/dev/jest/babel_transform.js', '^.+\\.txt?$': 'jest-raw-loader', '^.+\\.html?$': 'jest-raw-loader', }, diff --git a/src/dev/jest/setup/babel_polyfill.js b/src/dev/jest/setup/babel_polyfill.js index 38e1cfbcdd72..58325c1a67f9 100644 --- a/src/dev/jest/setup/babel_polyfill.js +++ b/src/dev/jest/setup/babel_polyfill.js @@ -18,6 +18,6 @@ */ // Note: In theory importing the polyfill should not be needed, as Babel should -// include the necessary polyfills when using `babel-preset-env`, but for some +// include the necessary polyfills when using `@babel/preset-env`, but for some // reason it did not work. See https://github.com/elastic/kibana/issues/14506 import '../../../setup_node_env/babel_register/polyfill'; diff --git a/src/dev/jest/ts_transform.ts b/src/dev/jest/ts_transform.ts deleted file mode 100644 index ed366bcd091a..000000000000 --- a/src/dev/jest/ts_transform.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import TsJest from 'ts-jest'; - -import { getTsProjectForAbsolutePath } from '../typescript'; - -const DEFAULT_TS_CONFIG_PATH = require.resolve('../../../tsconfig.json'); -const DEFAULT_BROWSER_TS_CONFIG_PATH = require.resolve('../../../tsconfig.browser.json'); - -function extendJestConfigJSON(jestConfigJSON: string, filePath: string) { - const jestConfig = JSON.parse(jestConfigJSON) as jest.ProjectConfig; - return JSON.stringify(extendJestConfig(jestConfig, filePath)); -} - -function extendJestConfig(jestConfig: jest.ProjectConfig, filePath: string) { - let tsConfigFile = getTsProjectForAbsolutePath(filePath).tsConfigPath; - - // swap ts config file for jest tests - if (tsConfigFile === DEFAULT_BROWSER_TS_CONFIG_PATH) { - tsConfigFile = DEFAULT_TS_CONFIG_PATH; - } - - return { - ...jestConfig, - globals: { - ...(jestConfig.globals || {}), - 'ts-jest': { - skipBabel: true, - tsConfigFile, - }, - }, - }; -} - -module.exports = { - canInstrument: true, - - process( - src: string, - filePath: jest.Path, - jestConfig: jest.ProjectConfig, - transformOptions: jest.TransformOptions - ) { - const extendedConfig = extendJestConfig(jestConfig, filePath); - return TsJest.process(src, filePath, extendedConfig, transformOptions); - }, - - getCacheKey( - src: string, - filePath: string, - jestConfigJSON: string, - transformOptions: jest.TransformOptions - ) { - const extendedConfigJSON = extendJestConfigJSON(jestConfigJSON, filePath); - return TsJest.getCacheKey!(src, filePath, extendedConfigJSON, transformOptions); - }, -}; diff --git a/src/dev/license_checker/config.js b/src/dev/license_checker/config.js index 9c6fa7767ee1..879c2147ccb1 100644 --- a/src/dev/license_checker/config.js +++ b/src/dev/license_checker/config.js @@ -105,5 +105,5 @@ export const LICENSE_OVERRIDES = { 'walk@2.3.9': ['MIT'], // TODO remove this once we upgrade past or equal to v1.0.2 - 'babel-plugin-mock-imports@0.0.5': ['MIT'] + 'babel-plugin-mock-imports@1.0.1': ['MIT'] }; diff --git a/src/dev/mocha/run_mocha_cli.js b/src/dev/mocha/run_mocha_cli.js index d24f9a06eafd..299a910127d4 100644 --- a/src/dev/mocha/run_mocha_cli.js +++ b/src/dev/mocha/run_mocha_cli.js @@ -43,7 +43,7 @@ export function runMochaCli() { // check that we aren't leaking any globals process.argv.push('--check-leaks'); // prevent globals injected from canvas plugins from triggering leak check - process.argv.push('--globals', 'core,regeneratorRuntime,_'); + process.argv.push('--globals', '__core-js_shared__,core,_, '); // ensure that mocha requires the setup_node_env script process.argv.push('--require', require.resolve('../../setup_node_env')); diff --git a/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap b/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap index fdd47c581b7f..522a12b4ec84 100644 --- a/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap +++ b/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap @@ -222,6 +222,8 @@ exports[`Inspector Data View component should render loading state 1`] = ` }, "_eventsCount": 1, "_maxListeners": undefined, + "tabular": undefined, + "tabularOptions": undefined, }, } } diff --git a/src/legacy/core_plugins/interpreter/common/types/register.js b/src/legacy/core_plugins/interpreter/common/types/register.js index 17b03f022967..582843c91f83 100644 --- a/src/legacy/core_plugins/interpreter/common/types/register.js +++ b/src/legacy/core_plugins/interpreter/common/types/register.js @@ -17,7 +17,7 @@ * under the License. */ -import 'babel-polyfill'; +import '@babel/polyfill'; import { typeSpecs } from './index'; // eslint-disable-next-line no-undef diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap b/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap index bc0bdddfdbc5..aa33eb4ab1d0 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap @@ -1125,10 +1125,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` className="euiScreenReaderOnly" > - - +

- - +

- + - + @@ -2595,7 +2592,7 @@ exports[`NewVisModal should render as expected 1`] = `

- - +

- - +

- + - + diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts new file mode 100644 index 000000000000..04c99a1547ba --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const settingsGet = jest.fn(); + +jest.doMock('ui/chrome', () => ({ + getUiSettingsClient: () => ({ + get: settingsGet, + }), +})); diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx index dd357d70f8a0..fbb3faf7b356 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx @@ -20,13 +20,7 @@ import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; -const settingsGet = jest.fn(); - -jest.mock('ui/chrome', () => ({ - getUiSettingsClient: () => ({ - get: settingsGet, - }), -})); +import { settingsGet } from './new_vis_modal.test.mocks'; import { NewVisModal } from './new_vis_modal'; diff --git a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js index 99238fcd1c9c..bed96987ac2b 100644 --- a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js +++ b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js @@ -30,7 +30,7 @@ export const createTestEntryTemplate = (defaultUiSettings) => (bundle) => ` */ // import global polyfills before everything else -import 'babel-polyfill'; +import '@babel/polyfill'; import 'custom-event-polyfill'; import 'whatwg-fetch'; import 'abortcontroller-polyfill'; diff --git a/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap b/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap index 8a0efdef7201..12492b0bb7b6 100644 --- a/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap +++ b/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap @@ -14,7 +14,7 @@ exports[`ScriptingHelpFlyout should render normally 1`] = ` , + "content": , "data-test-subj": "syntaxTab", "id": "syntax", "name": "Syntax", @@ -23,7 +23,7 @@ exports[`ScriptingHelpFlyout should render normally 1`] = ` tabs={ Array [ Object { - "content": , + "content": , "data-test-subj": "syntaxTab", "id": "syntax", "name": "Syntax", diff --git a/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap b/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap index c58cab79fdc4..0f0788999876 100644 --- a/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap +++ b/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap @@ -47,9 +47,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = ` >

{ + return { + getBasePath: () => `foo`, + getUiSettingsClient: () => { + return { + get: (key: string) => { + switch (key) { + case 'history:limit': + return 10; + default: + throw new Error(`Unexpected config key: ${key}`); + } + }, + }; + }, + }; +}); + +export const mockPersistedLog = { + add: jest.fn(), + get: jest.fn(() => ['response:200']), +}; + +export const mockPersistedLogFactory = jest.fn, any>(() => { + return mockPersistedLog; +}); + +export const mockGetAutocompleteSuggestions = jest.fn(() => Promise.resolve([])); +const mockAutocompleteProvider = jest.fn(() => mockGetAutocompleteSuggestions); +export const mockGetAutocompleteProvider = jest.fn(() => mockAutocompleteProvider); + +jest.mock('ui/chrome', () => mockChromeFactory()); +jest.mock('../../chrome', () => mockChromeFactory()); +jest.mock('ui/persisted_log', () => ({ + PersistedLog: mockPersistedLogFactory, +})); +jest.mock('../../metadata', () => ({ + metadata: { + branch: 'foo', + }, +})); +jest.mock('../../autocomplete_providers', () => ({ + getAutocompleteProvider: mockGetAutocompleteProvider, +})); + +import _ from 'lodash'; +// Using doMock to avoid hoisting so that I can override only the debounce method in lodash +jest.doMock('lodash', () => ({ + ..._, + debounce: (func: () => any) => func, +})); diff --git a/src/legacy/ui/public/query_bar/components/query_bar.test.tsx b/src/legacy/ui/public/query_bar/components/query_bar.test.tsx index fdcfb7704391..f6947574bee1 100644 --- a/src/legacy/ui/public/query_bar/components/query_bar.test.tsx +++ b/src/legacy/ui/public/query_bar/components/query_bar.test.tsx @@ -17,57 +17,12 @@ * under the License. */ -const mockChromeFactory = jest.fn(() => { - return { - getBasePath: () => `foo`, - getUiSettingsClient: () => { - return { - get: (key: string) => { - switch (key) { - case 'history:limit': - return 10; - default: - throw new Error(`Unexpected config key: ${key}`); - } - }, - }; - }, - }; -}); - -const mockPersistedLog = { - add: jest.fn(), - get: jest.fn(() => ['response:200']), -}; - -const mockPersistedLogFactory = jest.fn, any>(() => { - return mockPersistedLog; -}); - -const mockGetAutocompleteSuggestions = jest.fn(() => Promise.resolve([])); -const mockAutocompleteProvider = jest.fn(() => mockGetAutocompleteSuggestions); -const mockGetAutocompleteProvider = jest.fn(() => mockAutocompleteProvider); - -jest.mock('ui/chrome', () => mockChromeFactory()); -jest.mock('../../chrome', () => mockChromeFactory()); -jest.mock('ui/persisted_log', () => ({ - PersistedLog: mockPersistedLogFactory, -})); -jest.mock('../../metadata', () => ({ - metadata: { - branch: 'foo', - }, -})); -jest.mock('../../autocomplete_providers', () => ({ - getAutocompleteProvider: mockGetAutocompleteProvider, -})); - -import _ from 'lodash'; -// Using doMock to avoid hoisting so that I can override only the debounce method in lodash -jest.doMock('lodash', () => ({ - ..._, - debounce: (func: () => any) => func, -})); +import { + mockGetAutocompleteProvider, + mockGetAutocompleteSuggestions, + mockPersistedLog, + mockPersistedLogFactory, +} from 'ui/query_bar/components/query_bar.test.mocks'; import { EuiFieldText } from '@elastic/eui'; import React from 'react'; diff --git a/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap b/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap index 6388a57832c0..3b51c1db50d0 100644 --- a/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap +++ b/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap @@ -16,7 +16,7 @@ exports[`SuggestionsComponent Passing the index should control which suggestion onScroll={[Function]} role="listbox" > - - - - @@ -207,8 +203,7 @@ exports[`should enable saved object export option when objectId is provided 1`] aria-label="Info" content={ diff --git a/src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts b/src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts new file mode 100644 index 000000000000..815d2f09150c --- /dev/null +++ b/src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts @@ -0,0 +1,23 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const mockFatalError = jest.fn(); +jest.mock('ui/notify/fatal_error', () => ({ + fatalError: mockFatalError, +})); diff --git a/src/legacy/ui/public/utils/subscribe_with_scope.test.ts b/src/legacy/ui/public/utils/subscribe_with_scope.test.ts index a5a3312bad4b..077875c5ac6e 100644 --- a/src/legacy/ui/public/utils/subscribe_with_scope.test.ts +++ b/src/legacy/ui/public/utils/subscribe_with_scope.test.ts @@ -16,11 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -const mockFatalError = jest.fn(); -jest.mock('ui/notify/fatal_error', () => ({ - fatalError: mockFatalError, -})); +import { mockFatalError } from './subscribe_with_scope.test.mocks'; import * as Rx from 'rxjs'; import { subscribeWithScope } from './subscribe_with_scope'; diff --git a/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts b/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts index 3e7623b6c25f..ab57153755c9 100644 --- a/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts +++ b/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts @@ -20,11 +20,13 @@ import { AggParam } from '../../../agg_types'; import { AggConfig } from '../../agg_config'; -interface AggParamEditorProps { +// NOTE: we cannot export the interface with export { InterfaceName } +// as there is currently a bug on babel typescript transform plugin for it +// https://github.com/babel/babel/issues/7641 +// +export interface AggParamEditorProps { agg: AggConfig; aggParam: AggParam; value: T; setValue(value: T): void; } - -export { AggParamEditorProps }; diff --git a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts new file mode 100644 index 000000000000..6adea30c94fb --- /dev/null +++ b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts @@ -0,0 +1,67 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +jest.useFakeTimers(); + +import { EventEmitter } from 'events'; + +jest.mock('ui/notify', () => ({ + toastNotifications: jest.fn(), +})); + +jest.mock('./utils', () => ({ + queryGeohashBounds: jest.fn(), +})); + +jest.mock('./pipeline_helpers/utilities', () => ({ + getFormat: jest.fn(), + getTableAggs: jest.fn(), +})); + +export const timefilter = new EventEmitter(); +jest.doMock('../../timefilter', () => ({ timefilter })); + +jest.mock('../../inspector', () => ({ + Inspector: { + open: jest.fn(), + isAvailable: jest.fn(), + }, +})); + +export const mockDataLoaderFetch = jest.fn().mockReturnValue({ + as: 'visualization', + value: { + visType: 'histogram', + visData: {}, + visConfig: {}, + params: {}, + }, +}); +const MockDataLoader = class { + public async fetch(data: any) { + return await mockDataLoaderFetch(data); + } +}; + +jest.mock('./pipeline_data_loader', () => ({ + PipelineDataLoader: MockDataLoader, +})); +jest.mock('./visualize_data_loader', () => ({ + VisualizeDataLoader: MockDataLoader, +})); diff --git a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts index 3dc39ba7e2a9..e5a4eb122dc8 100644 --- a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts +++ b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts @@ -16,61 +16,13 @@ * specific language governing permissions and limitations * under the License. */ - -jest.useFakeTimers(); - -import { EventEmitter } from 'events'; +import { mockDataLoaderFetch, timefilter } from './embedded_visualize_handler.test.mocks'; // @ts-ignore import MockState from '../../../../../fixtures/mock_state'; import { RequestHandlerParams, Vis } from '../../vis'; import { VisResponseData } from './types'; -jest.mock('ui/notify', () => ({ - toastNotifications: jest.fn(), -})); - -jest.mock('./utils', () => ({ - queryGeohashBounds: jest.fn(), -})); - -jest.mock('./pipeline_helpers/utilities', () => ({ - getFormat: jest.fn(), - getTableAggs: jest.fn(), -})); - -const timefilter = new EventEmitter(); -jest.mock('../../timefilter', () => ({ timefilter })); - -jest.mock('../../inspector', () => ({ - Inspector: { - open: jest.fn(), - isAvailable: jest.fn(), - }, -})); - -const mockDataLoaderFetch = jest.fn().mockReturnValue({ - as: 'visualization', - value: { - visType: 'histogram', - visData: {}, - visConfig: {}, - params: {}, - }, -}); -const MockDataLoader = class { - public async fetch(data: any) { - return await mockDataLoaderFetch(data); - } -}; - -jest.mock('./pipeline_data_loader', () => ({ - PipelineDataLoader: MockDataLoader, -})); -jest.mock('./visualize_data_loader', () => ({ - VisualizeDataLoader: MockDataLoader, -})); - import { Inspector } from '../../inspector'; import { EmbeddedVisualizeHandler } from './embedded_visualize_handler'; diff --git a/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts b/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts index fe9a36a0e5a6..3617c77e42b0 100644 --- a/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts +++ b/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts @@ -31,7 +31,7 @@ import { fieldFormats } from '../../../registry/field_formats'; const config = chrome.getUiSettingsClient(); const defaultFormat = { convert: identity }; -const getConfig = (...args: any[]): any => (config.get as any)(...args); +const getConfig = (...args: any[]): any => config.get(...args); const getFieldFormat = (id: string, params: object) => { const Format = fieldFormats.byId[id]; diff --git a/src/legacy/ui/ui_bundles/app_entry_template.js b/src/legacy/ui/ui_bundles/app_entry_template.js index 2d92dc30556f..625ce5e381d2 100644 --- a/src/legacy/ui/ui_bundles/app_entry_template.js +++ b/src/legacy/ui/ui_bundles/app_entry_template.js @@ -33,7 +33,7 @@ import 'dll/set_csp_nonce'; __webpack_nonce__ = window.__kbnNonce__; // import global polyfills -import 'babel-polyfill'; +import '@babel/polyfill'; import 'custom-event-polyfill'; import 'whatwg-fetch'; import 'abortcontroller-polyfill'; diff --git a/src/optimize/base_optimizer.js b/src/optimize/base_optimizer.js index b260f57df331..bb130e386950 100644 --- a/src/optimize/base_optimizer.js +++ b/src/optimize/base_optimizer.js @@ -123,10 +123,6 @@ export default class BaseOptimizer { BABEL_PRESET_PATH ]; - const nonDistributableOnlyModules = !IS_KIBANA_DISTRIBUTABLE - ? ['ts-loader'] - : []; - threadLoader.warmup( // pool options, like passed to loader options // must match loader options to boot the correct pool @@ -134,7 +130,6 @@ export default class BaseOptimizer { [ // modules to load on the pool ...baseModules, - ...nonDistributableOnlyModules ] ); } @@ -368,7 +363,7 @@ export default class BaseOptimizer { } }, { - resource: createSourceFileResourceSelector(/\.js$/), + resource: createSourceFileResourceSelector(/\.(js|tsx?)$/), use: maybeAddCacheLoader('babel', [ { loader: 'thread-loader', @@ -394,7 +389,7 @@ export default class BaseOptimizer { }, resolve: { - extensions: ['.js', '.json'], + extensions: ['.js', '.ts', '.tsx', '.json'], mainFields: ['browser', 'browserify', 'main'], modules: [ 'webpackShims', @@ -429,47 +424,6 @@ export default class BaseOptimizer { ] }; - // when running from source transpile TypeScript automatically - const getSourceConfig = () => { - // dev/typescript is deleted from the distributable, so only require it if we actually need the source config - const { Project } = require('../dev/typescript'); - const browserProject = new Project(fromRoot('tsconfig.browser.json')); - - return { - module: { - rules: [ - { - resource: createSourceFileResourceSelector(/\.tsx?$/), - use: maybeAddCacheLoader('typescript', [ - { - loader: 'thread-loader', - options: this.getThreadLoaderPoolConfig() - }, - { - loader: 'ts-loader', - options: { - happyPackMode: true, - transpileOnly: true, - experimentalWatchApi: true, - onlyCompileBundledFiles: true, - configFile: fromRoot('tsconfig.json'), - compilerOptions: { - ...browserProject.config.compilerOptions, - sourceMap: Boolean(this.sourceMaps), - } - } - } - ]), - } - ] - }, - - resolve: { - extensions: ['.ts', '.tsx'], - }, - }; - }; - // We need to add react-addons (and a few other bits) for enzyme to work. // https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md const supportEnzymeConfig = { @@ -516,7 +470,7 @@ export default class BaseOptimizer { commonConfig, IS_KIBANA_DISTRIBUTABLE ? isDistributableConfig - : getSourceConfig(), + : {}, this.uiBundles.isDevMode() ? webpackMerge(watchingConfig, supportEnzymeConfig) : productionConfig diff --git a/src/optimize/watch/watch_cache.ts b/src/optimize/watch/watch_cache.ts index 5b594b30e9f8..2b614aae67eb 100644 --- a/src/optimize/watch/watch_cache.ts +++ b/src/optimize/watch/watch_cache.ts @@ -95,16 +95,7 @@ export class WatchCache { await del(this.statePath); // delete everything in optimize/.cache directory - // except ts-node - await del( - await globby( - [ - normalizePosixPath(this.cachePath), - `${normalizePosixPath(`!${this.cachePath}/ts-node/**`)}`, - ], - { dot: true } - ) - ); + await del(await globby([normalizePosixPath(this.cachePath)], { dot: true })); // delete some empty folder that could be left // from the previous cache path reset action diff --git a/src/setup_node_env/babel_register/index.js b/src/setup_node_env/babel_register/index.js index 44b9427ed8e3..1574be8937a2 100644 --- a/src/setup_node_env/babel_register/index.js +++ b/src/setup_node_env/babel_register/index.js @@ -17,16 +17,6 @@ * under the License. */ -// unless we are running a prebuilt/distributable version of -// kibana, automatically transpile typescript to js before babel -if (!global.__BUILT_WITH_BABEL__) { - var resolve = require('path').resolve; - require('ts-node').register({ - transpileOnly: true, - cacheDirectory: resolve(__dirname, '../../../optimize/.cache/ts-node') - }); -} - // register and polyfill need to happen in this // order and in separate files. Checkout each file // for a much more detailed explanation diff --git a/src/setup_node_env/babel_register/polyfill.js b/src/setup_node_env/babel_register/polyfill.js index e72a2eff001a..4e92583f830e 100644 --- a/src/setup_node_env/babel_register/polyfill.js +++ b/src/setup_node_env/babel_register/polyfill.js @@ -17,13 +17,13 @@ * under the License. */ -// `babel-preset-env` looks for and rewrites the following import +// `@babel/preset-env` looks for and rewrites the following import // statement into a list of import statements based on the polyfills // necessary for our target environment (the current version of node) -// but since it does that during compilation, `import 'babel-polyfill'` -// must be in a file that is loaded with `require()` AFTER `babel-register` +// but since it does that during compilation, `import '@babel/polyfill'` +// must be in a file that is loaded with `require()` AFTER `@babel/register` // is configured. // // This is why we have this single statement in it's own file and require // it from ./index.js -require('babel-polyfill'); +require('@babel/polyfill'); diff --git a/src/setup_node_env/babel_register/register.js b/src/setup_node_env/babel_register/register.js index f0898b245fb0..37e39d4685ca 100644 --- a/src/setup_node_env/babel_register/register.js +++ b/src/setup_node_env/babel_register/register.js @@ -19,13 +19,13 @@ var resolve = require('path').resolve; -// this must happen before `require('babel-register')` and can't be changed +// this must happen before `require('@babel/register')` and can't be changed // once the module has been loaded if (!process.env.BABEL_CACHE_PATH) { process.env.BABEL_CACHE_PATH = resolve(__dirname, '../../../optimize/.babelcache.json'); } -// paths that babel-register should ignore +// paths that @babel/register should ignore var ignore = [ /\/bower_components\//, /\/kbn-pm\/dist\//, @@ -48,10 +48,10 @@ var ignore = [ if (global.__BUILT_WITH_BABEL__) { // when building the Kibana source we replace the statement // `global.__BUILT_WITH_BABEL__` with the value `true` so that - // when babel-register is required for the first time by users + // when @babel/register is required for the first time by users // it will exclude kibana's `src` directory. // - // We still need babel-register for plugins though, we've been + // We still need @babel/register for plugins though, we've been // building their server code at require-time since version 4.2 // TODO: the plugin install process could transpile plugin server code... ignore.push(resolve(__dirname, '../../../src')); @@ -66,10 +66,11 @@ if (global.__BUILT_WITH_BABEL__) { // modifies all future calls to require() to automatically // compile the required source with babel -require('babel-register')({ +require('@babel/register')({ ignore, babelrc: false, presets: [ require.resolve('@kbn/babel-preset/node_preset') ], + extensions: ['.js', '.ts', '.tsx'], }); diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index bf20e8833378..ad5b2fde1acf 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -37,8 +37,7 @@ export function createJestConfig({ '**/*.test.{js,ts,tsx}' ], transform: { - '^.+\\.js$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`, - '^.+\\.tsx?$': `${kibanaDirectory}/src/dev/jest/ts_transform.js`, + '^.+\\.(js|tsx?)$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`, }, transformIgnorePatterns: [ '[/\\\\]node_modules[/\\\\].+\\.js$' diff --git a/x-pack/package.json b/x-pack/package.json index 41db035ff2f0..aaeea471cd23 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -60,10 +60,11 @@ "ansi-colors": "^3.0.5", "ansicolors": "0.3.2", "axios": "^0.18.0", - "babel-jest": "^23.6.0", - "babel-plugin-inline-react-svg": "^0.5.4", - "babel-plugin-mock-imports": "^0.0.5", - "babel-plugin-transform-react-remove-prop-types": "^0.4.14", + "babel-jest": "^24.1.0", + "babel-plugin-inline-react-svg": "^1.0.1", + "babel-plugin-mock-imports": "^1.0.1", + "babel-plugin-require-context-hook": "npm:babel-plugin-require-context-hook-babel7@^1.0.0", + "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "chalk": "^2.4.1", "chance": "1.0.10", "checksum": "0.1.1", @@ -108,13 +109,16 @@ "supertest-as-promised": "^4.0.2", "tmp": "0.0.31", "tree-kill": "^1.1.0", - "ts-loader": "^5.2.2", "typescript": "^3.3.3333", "vinyl-fs": "^3.0.2", "xml-crypto": "^0.10.1", "yargs": "4.8.1" }, "dependencies": { + "@babel/core": "^7.3.4", + "@babel/polyfill": "^7.2.5", + "@babel/register": "^7.0.0", + "@babel/runtime": "^7.3.4", "@elastic/datemath": "5.0.2", "@elastic/eui": "9.4.2", "@elastic/node-crypto": "0.1.2", @@ -140,11 +144,6 @@ "apollo-server-errors": "^2.0.2", "apollo-server-hapi": "^1.3.6", "axios": "^0.18.0", - "babel-core": "^6.26.3", - "babel-polyfill": "6.20.0", - "babel-preset-es2015": "^6.24.1", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", "base64-js": "^1.2.1", "bluebird": "3.5.3", "boom": "^7.2.0", diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx index ed5c609cb900..12198b1a870d 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx @@ -15,8 +15,6 @@ import { DiscoverErrorLink } from '../DiscoverErrorLink'; import { DiscoverSpanLink } from '../DiscoverSpanLink'; import { DiscoverTransactionLink } from '../DiscoverTransactionLink'; -// NOTE: jest.mock() is broken in TS test files (b/c of ts-jest, I think) -// but using jest's "spies can be stubbed" feature, this works: jest .spyOn(savedObjects, 'getAPMIndexPattern') .mockReturnValue( diff --git a/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx b/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx index 47cffde62612..61d2fcf02665 100644 --- a/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx @@ -4,18 +4,33 @@ * you may not use this file except in compliance with the Elastic License. */ +jest.mock('../tabConfigConst', () => { + return { + TAB_CONFIG: [ + { + key: 'testProperty', + label: 'testPropertyLabel', + required: false, + presortedKeys: ['name', 'age'] + }, + { + key: 'optionalProperty', + label: 'optionalPropertyLabel', + required: false + }, + { + key: 'requiredProperty', + label: 'requiredPropertyLabel', + required: true + } + ] + }; +}); + import * as propertyConfig from '../tabConfig'; const { getTabsFromObject, sortKeysByConfig } = propertyConfig; describe('tabConfig', () => { - beforeEach(() => { - mockPropertyConfig(); - }); - - afterEach(() => { - unMockPropertyConfig(); - }); - describe('getTabsFromObject', () => { it('should return selected and required keys only', () => { const expectedTabs = [ @@ -64,31 +79,3 @@ describe('tabConfig', () => { }); }); }); - -function mockPropertyConfig() { - // @ts-ignore - propertyConfig.TAB_CONFIG = [ - { - key: 'testProperty', - label: 'testPropertyLabel', - required: false, - presortedKeys: ['name', 'age'] - }, - { - key: 'optionalProperty', - label: 'optionalPropertyLabel', - required: false - }, - { - key: 'requiredProperty', - label: 'requiredPropertyLabel', - required: true - } - ]; -} - -const originalPropertyConfig = propertyConfig.TAB_CONFIG; -function unMockPropertyConfig() { - // @ts-ignore - propertyConfig.TAB_CONFIG = originalPropertyConfig; -} diff --git a/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts index cb9ce7f8538b..2648c2875cd8 100644 --- a/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts +++ b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts @@ -4,28 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ -import { i18n } from '@kbn/i18n'; import { get, indexBy, uniq } from 'lodash'; import { first, has } from 'lodash'; import { StringMap } from 'x-pack/plugins/apm/typings/common'; import { APMError } from 'x-pack/plugins/apm/typings/es_schemas/ui/APMError'; import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/ui/Transaction'; - -export type PropertyTabKey = - | keyof Transaction - | keyof APMError - | 'transaction.custom' - | 'error.custom'; - -export interface PropertyTab { - key: PropertyTabKey; - label: string; -} - -interface TabConfig extends PropertyTab { - required: boolean; - presortedKeys: string[]; -} +import { + PropertyTab, + PropertyTabKey, + TAB_CONFIG, + TabConfig +} from './tabConfigConst'; export function getTabsFromObject(obj: Transaction | APMError): PropertyTab[] { return TAB_CONFIG.filter( @@ -53,96 +42,4 @@ export function getCurrentTab( return selectedTab ? selectedTab : first(tabs) || {}; } -export const TAB_CONFIG: TabConfig[] = [ - { - key: 'http', - label: i18n.translate('xpack.apm.propertiesTable.tabs.httpLabel', { - defaultMessage: 'HTTP' - }), - required: false, - presortedKeys: [] - }, - { - key: 'host', - label: i18n.translate('xpack.apm.propertiesTable.tabs.hostLabel', { - defaultMessage: 'Host' - }), - required: false, - presortedKeys: ['hostname', 'architecture', 'platform'] - }, - { - key: 'service', - label: i18n.translate('xpack.apm.propertiesTable.tabs.serviceLabel', { - defaultMessage: 'Service' - }), - required: false, - presortedKeys: ['runtime', 'framework', 'version'] - }, - { - key: 'process', - label: i18n.translate('xpack.apm.propertiesTable.tabs.processLabel', { - defaultMessage: 'Process' - }), - required: false, - presortedKeys: ['pid', 'title', 'args'] - }, - { - key: 'agent', - label: i18n.translate('xpack.apm.propertiesTable.tabs.agentLabel', { - defaultMessage: 'Agent' - }), - required: false, - presortedKeys: [] - }, - { - key: 'url', - label: i18n.translate('xpack.apm.propertiesTable.tabs.urlLabel', { - defaultMessage: 'URL' - }), - required: false, - presortedKeys: [] - }, - { - key: 'container', - label: i18n.translate('xpack.apm.propertiesTable.tabs.containerLabel', { - defaultMessage: 'Container' - }), - required: false, - presortedKeys: [] - }, - { - key: 'user', - label: i18n.translate('xpack.apm.propertiesTable.tabs.userLabel', { - defaultMessage: 'User' - }), - required: true, - presortedKeys: ['id', 'username', 'email'] - }, - { - key: 'labels', - label: i18n.translate('xpack.apm.propertiesTable.tabs.labelsLabel', { - defaultMessage: 'Labels' - }), - required: true, - presortedKeys: [] - }, - { - key: 'transaction.custom', - label: i18n.translate( - 'xpack.apm.propertiesTable.tabs.transactionCustomLabel', - { - defaultMessage: 'Custom' - } - ), - required: false, - presortedKeys: [] - }, - { - key: 'error.custom', - label: i18n.translate('xpack.apm.propertiesTable.tabs.errorCustomLabel', { - defaultMessage: 'Custom' - }), - required: false, - presortedKeys: [] - } -]; +export { TAB_CONFIG, TabConfig, PropertyTab, PropertyTabKey }; diff --git a/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts new file mode 100644 index 000000000000..95c4f6da9f37 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts @@ -0,0 +1,119 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import { APMError } from 'x-pack/plugins/apm/typings/es_schemas/ui/APMError'; +import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/ui/Transaction'; + +export type PropertyTabKey = + | keyof Transaction + | keyof APMError + | 'transaction.custom' + | 'error.custom'; + +export interface PropertyTab { + key: PropertyTabKey; + label: string; +} + +export interface TabConfig extends PropertyTab { + required: boolean; + presortedKeys: string[]; +} + +export const TAB_CONFIG: TabConfig[] = [ + { + key: 'http', + label: i18n.translate('xpack.apm.propertiesTable.tabs.httpLabel', { + defaultMessage: 'HTTP' + }), + required: false, + presortedKeys: [] + }, + { + key: 'host', + label: i18n.translate('xpack.apm.propertiesTable.tabs.hostLabel', { + defaultMessage: 'Host' + }), + required: false, + presortedKeys: ['hostname', 'architecture', 'platform'] + }, + { + key: 'service', + label: i18n.translate('xpack.apm.propertiesTable.tabs.serviceLabel', { + defaultMessage: 'Service' + }), + required: false, + presortedKeys: ['runtime', 'framework', 'version'] + }, + { + key: 'process', + label: i18n.translate('xpack.apm.propertiesTable.tabs.processLabel', { + defaultMessage: 'Process' + }), + required: false, + presortedKeys: ['pid', 'title', 'args'] + }, + { + key: 'agent', + label: i18n.translate('xpack.apm.propertiesTable.tabs.agentLabel', { + defaultMessage: 'Agent' + }), + required: false, + presortedKeys: [] + }, + { + key: 'url', + label: i18n.translate('xpack.apm.propertiesTable.tabs.urlLabel', { + defaultMessage: 'URL' + }), + required: false, + presortedKeys: [] + }, + { + key: 'container', + label: i18n.translate('xpack.apm.propertiesTable.tabs.containerLabel', { + defaultMessage: 'Container' + }), + required: false, + presortedKeys: [] + }, + { + key: 'user', + label: i18n.translate('xpack.apm.propertiesTable.tabs.userLabel', { + defaultMessage: 'User' + }), + required: true, + presortedKeys: ['id', 'username', 'email'] + }, + { + key: 'labels', + label: i18n.translate('xpack.apm.propertiesTable.tabs.labelsLabel', { + defaultMessage: 'Labels' + }), + required: true, + presortedKeys: [] + }, + { + key: 'transaction.custom', + label: i18n.translate( + 'xpack.apm.propertiesTable.tabs.transactionCustomLabel', + { + defaultMessage: 'Custom' + } + ), + required: false, + presortedKeys: [] + }, + { + key: 'error.custom', + label: i18n.translate('xpack.apm.propertiesTable.tabs.errorCustomLabel', { + defaultMessage: 'Custom' + }), + required: false, + presortedKeys: [] + } +]; diff --git a/x-pack/plugins/canvas/public/components/workpad_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/index.js index adc6bae7418a..7a408de33583 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_page/index.js @@ -41,6 +41,7 @@ const mapDispatchToProps = dispatch => { }; }; +// eslint-disable-next-line const getRootElementId = (lookup, id) => { if (!lookup.has(id)) { return null; diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js index 6e93f9eb5fb4..d62fbe21fa0f 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js @@ -436,6 +436,7 @@ export const applyLocalTransforms = (shapes, transformIntents) => { return shapes.map(shapeApplyLocalTransforms(transformIntents)); }; +// eslint-disable-next-line const getUpstreamTransforms = (shapes, shape) => shape.parent ? getUpstreamTransforms(shapes, shapes.find(s => s.id === shape.parent)).concat([ diff --git a/x-pack/plugins/canvas/tasks/helpers/babelhook.js b/x-pack/plugins/canvas/tasks/helpers/babelhook.js index 4a48d09449b2..dea18db918fc 100644 --- a/x-pack/plugins/canvas/tasks/helpers/babelhook.js +++ b/x-pack/plugins/canvas/tasks/helpers/babelhook.js @@ -5,7 +5,7 @@ */ const { resolve } = require('path'); -const register = require('babel-register'); +const register = require('@babel/register'); const options = { babelrc: false, presets: [require.resolve('@kbn/babel-preset/node_preset')], diff --git a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js b/x-pack/plugins/infra/scripts/generate_types_from_graphql.js index 091e692d0bbd..caeb73c3bf79 100644 --- a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js +++ b/x-pack/plugins/infra/scripts/generate_types_from_graphql.js @@ -28,7 +28,6 @@ async function main() { config: SERVER_CONFIG_PATH, out: OUTPUT_INTROSPECTION_PATH, overwrite: true, - require: ['ts-node/register'], schema: SCHEMA_PATH, template: 'graphql-codegen-introspection-template', }, diff --git a/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap b/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap index 8b7d26d3c755..327a8dc4fee4 100644 --- a/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap +++ b/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap @@ -6,7 +6,7 @@ exports[`FormLabel Basic initialization 1`] = ` className="euiFormLabel" id="ml_aria_label_undefined" /> - @@ -20,7 +20,7 @@ exports[`FormLabel Full initialization 1`] = ` > Label Text - diff --git a/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap b/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap index 7133002e495c..869e321d4a7a 100644 --- a/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap +++ b/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap @@ -4,7 +4,7 @@ exports[`Suggestions snapshot 1`] = ` - - - + - + diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap index cf61e464fc49..d5392e1eb453 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap @@ -286,7 +286,7 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh isCollectionIntervalUpdating={true} property="xpack.monitoring.collection.interval" > - + - + @@ -608,7 +608,7 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect isCollectionIntervalUpdating={false} property="xpack.monitoring.collection.interval" > - + - + diff --git a/x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts b/x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts new file mode 100644 index 000000000000..7f1392cb2a49 --- /dev/null +++ b/x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export const mockJobQueueClient = { getInfo: jest.fn() }; +jest.mock('../lib/job_queue_client', () => ({ jobQueueClient: mockJobQueueClient })); diff --git a/x-pack/plugins/reporting/public/components/report_info_button.test.tsx b/x-pack/plugins/reporting/public/components/report_info_button.test.tsx index 93ceed0f64a0..3b9c2a848542 100644 --- a/x-pack/plugins/reporting/public/components/report_info_button.test.tsx +++ b/x-pack/plugins/reporting/public/components/report_info_button.test.tsx @@ -4,8 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -const mockJobQueueClient = { getInfo: jest.fn() }; -jest.mock('../lib/job_queue_client', () => ({ jobQueueClient: mockJobQueueClient })); +import { mockJobQueueClient } from './report_info_button.test.mocks'; import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; diff --git a/x-pack/plugins/reporting/public/components/report_listing.tsx b/x-pack/plugins/reporting/public/components/report_listing.tsx index 262362a1e5a5..56f0e382d23a 100644 --- a/x-pack/plugins/reporting/public/components/report_listing.tsx +++ b/x-pack/plugins/reporting/public/components/report_listing.tsx @@ -23,7 +23,7 @@ import { ReportErrorButton } from './report_error_button'; import { ReportInfoButton } from './report_info_button'; import { - EuiBasicTable, + EuiBasicTable as EuiBasicTableTyped, EuiButtonIcon, EuiPageContent, EuiSpacer, @@ -296,7 +296,7 @@ class ReportListingUi extends Component { }; return ( - ; } -import { EuiButton, EuiCopy, EuiForm, EuiFormRow, EuiSpacer, EuiText } from '@elastic/eui'; +import { + EuiButton, + EuiCopy as EuiCopyTyped, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiText, +} from '@elastic/eui'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import React, { Component, ReactElement } from 'react'; import { KFetchError } from 'ui/kfetch/kfetch_error'; @@ -131,7 +138,7 @@ class ReportingPanelContentUi extends Component { - @@ -143,7 +150,7 @@ class ReportingPanelContentUi extends Component { /> )} - + ); } diff --git a/x-pack/plugins/searchprofiler/README.md b/x-pack/plugins/searchprofiler/README.md index 54bbd1203235..1dec1bb4e545 100644 --- a/x-pack/plugins/searchprofiler/README.md +++ b/x-pack/plugins/searchprofiler/README.md @@ -19,7 +19,7 @@ If you have installed this somewhere other than via x-plugins, and next to the k To run the server tests, change into `x-plugins/kibana` and run: ```bash -mocha --debug --compilers js:babel/register plugins/profiler/**/__tests__/**/*.js +mocha --debug --compilers js:@babel/register plugins/profiler/**/__tests__/**/*.js ``` diff --git a/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap b/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap index 5c38e3f28c4d..19dacf984f5d 100644 --- a/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap +++ b/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap @@ -179,9 +179,7 @@ exports[`PrivilegeCalloutWarning renders without crashing 1`] = ` >

- grants full access to all - spaces. To customize privileges for individual spaces, the minimum privilege must be - either + grants full access to all spaces. To customize privileges for individual spaces, the minimum privilege must be either renders without crashing 1`] = ` >

with user profile disabling "manageSpaces" re

{ const subject = buildPrivilegeMap; it('should produce an object of the expected form', () => { - const getSavedObjectAction = sinon.fake((t: any, a: any) => { + const getSavedObjectAction = sinon.fake((t, a) => { if (!t || !isString(t)) { throw new Error('type is required and must be a string'); } diff --git a/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap b/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap index da0f3ed3558e..9b6336ad6444 100644 --- a/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap +++ b/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`removes aria-label when instructed not to announce the space name 1`] = ` - - + `; exports[`renders with a space name entirely made of whitespace 1`] = ` diff --git a/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap b/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap index 42da3769ac8e..5b3b0cede89a 100644 --- a/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap +++ b/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap @@ -9,7 +9,7 @@ exports[`AdvancedSettingsTitle renders as expected 1`] = ` - - - , - , + - , - , + - , + , ] `; diff --git a/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap b/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap index 00c49341ce0e..265dcc349e1b 100644 --- a/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap +++ b/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap @@ -6,7 +6,7 @@ exports[`NavControlPopover renders without crashing 1`] = ` button={ - - - diff --git a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap index b8a1360e4707..b21c7c1361c4 100644 --- a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap +++ b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap @@ -17,16 +17,14 @@ exports[`ChecklistFlyout renders 1`] = ` >

@@ -45,7 +43,7 @@ exports[`ChecklistFlyout renders 1`] = ` /> - diff --git a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx index a279ffa09812..d2ef6446962b 100644 --- a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx @@ -28,7 +28,7 @@ describe('ReindexProgress', () => { ); expect(wrapper).toMatchInlineSnapshot(` - { ); expect(wrapper).toMatchInlineSnapshot(` - ({ + create: jest.fn().mockReturnValue(mockClient), +})); diff --git a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts index f15927c0d6a3..9f47f51bc8cd 100644 --- a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts +++ b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts @@ -4,25 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { mockClient } from './polling_service.test.mocks'; + import { ReindexStatus, ReindexStep } from '../../../../../../common/types'; - -const mockClient = { - post: jest.fn().mockResolvedValue({ - lastCompletedStep: ReindexStep.created, - status: ReindexStatus.inProgress, - }), - get: jest.fn().mockResolvedValue({ - status: 200, - data: { - warnings: [], - reindexOp: null, - }, - }), -}; -jest.mock('axios', () => ({ - create: jest.fn().mockReturnValue(mockClient), -})); - import { ReindexPollingService } from './polling_service'; describe('ReindexPollingService', () => { diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts index a57c4da404e7..a61420eebd7d 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts @@ -7,7 +7,7 @@ import { CallCluster, CallClusterWithRequest } from 'src/legacy/core_plugins/ela import { Request, Server } from 'src/legacy/server/kbn_server'; import { SavedObjectsClient } from 'src/legacy/server/saved_objects'; -import moment = require('moment'); +import moment from 'moment'; import { XPackInfo } from 'x-pack/plugins/xpack_main/server/lib/xpack_info'; import { ReindexSavedObject, ReindexStatus } from '../../../common/types'; import { CredentialStore } from './credential_store'; diff --git a/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.mocks.ts b/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.mocks.ts new file mode 100644 index 000000000000..c1e524cb188c --- /dev/null +++ b/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.mocks.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +jest.mock('../lib/es_version_precheck'); + +export const mockAddDefaultField = jest.fn(); +jest.mock('../lib/query_default_field', () => ({ + addDefaultField: mockAddDefaultField, +})); diff --git a/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.ts index 1ce986d1bfa1..ce35eda8f9c9 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/query_default_field.test.ts @@ -4,15 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ +import { mockAddDefaultField } from './query_default_field.test.mocks'; + import { Server } from 'hapi'; -jest.mock('../lib/es_version_precheck'); - -const mockAddDefaultField = jest.fn(); -jest.mock('../lib/query_default_field', () => ({ - addDefaultField: mockAddDefaultField, -})); - import { registerQueryDefaultFieldRoutes } from './query_default_field'; const callWithRequest = jest.fn(); diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap index 717cb187623a..030b03f1c75a 100644 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap @@ -111,7 +111,7 @@ exports[`Snapshot component renders without errors 1`] = ` } } > - - + @@ -246,8 +246,8 @@ exports[`EmptyState component doesn't render child components when count is fals - - + + `; exports[`EmptyState component renders child components when count is truthy 1`] = ` @@ -265,7 +265,7 @@ exports[`EmptyState component renders child components when count is truthy 1`] `; exports[`EmptyState component renders message while loading 1`] = ` - - + - - + + `; exports[`EmptyState component renders the message when an error occurs 1`] = ` - - - - + + `; diff --git a/x-pack/plugins/uptime/scripts/infer_graphql_types.js b/x-pack/plugins/uptime/scripts/infer_graphql_types.js index c4b87c9ea933..104fd5b66b5d 100644 --- a/x-pack/plugins/uptime/scripts/infer_graphql_types.js +++ b/x-pack/plugins/uptime/scripts/infer_graphql_types.js @@ -20,7 +20,6 @@ async function main() { config: CONFIG_PATH, out: OUTPUT_INTROSPECTION_PATH, overwrite: true, - require: ['ts-node/register'], schema: SCHEMA_PATH, template: 'graphql-codegen-introspection-template', }, diff --git a/x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts new file mode 100644 index 000000000000..36f76516e188 --- /dev/null +++ b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { Readable } from 'stream'; + +jest.doMock('fs', () => ({ + createReadStream(filepath: string): Readable { + if (filepath === 'ERROR') { + throw new Error('MOCK ERROR - Invalid Path'); + } + const readableStream = new Readable(); + const streamData = filepath.split(''); + let cursor = 0; + + readableStream._read = function(size) { + const current = streamData[cursor++]; + if (typeof current === 'undefined') { + return this.push(null); + } + this.push(current); + }; + + return readableStream; + }, +})); diff --git a/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts index 5e554cd77d84..668b0d0c2108 100644 --- a/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts +++ b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts @@ -4,28 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Readable } from 'stream'; - -jest.mock('fs', () => ({ - createReadStream(filepath: string): Readable { - if (filepath === 'ERROR') { - throw new Error('MOCK ERROR - Invalid Path'); - } - const readableStream = new Readable(); - const streamData = filepath.split(''); - let cursor = 0; - - readableStream._read = function(size) { - const current = streamData[cursor++]; - if (typeof current === 'undefined') { - return this.push(null); - } - this.push(current); - }; - - return readableStream; - }, -})); +import './file_integrity.test.mocks'; import { getIntegrityHash, getIntegrityHashes } from './file_integrity'; diff --git a/x-pack/tasks/build.js b/x-pack/tasks/build.js index 82ccc9c75bd6..59033bb40c7d 100644 --- a/x-pack/tasks/build.js +++ b/x-pack/tasks/build.js @@ -34,7 +34,7 @@ export default (gulp, { buildTarget }) => { // As result of it, we need to move the transpiled js files for the correct folder // and in the end deleting the generated outDir from the intermediateBuildDirectory. // - //# TODO: This might be able to go away with the upgrade to babel 7 + //# TODO: This might be able to go away as soon as we upgrade the x-pack build to use babel7 await moveFiles( gulp, resolve(buildRoot, 'x-pack/build/plugin/kibana/x-pack/**/!(*.test).js'), diff --git a/x-pack/test/plugin_api_integration/plugins/task_manager/package.json b/x-pack/test/plugin_api_integration/plugins/task_manager/package.json index ede03a08a272..ec63c512e9cd 100644 --- a/x-pack/test/plugin_api_integration/plugins/task_manager/package.json +++ b/x-pack/test/plugin_api_integration/plugins/task_manager/package.json @@ -1,4 +1,12 @@ { "name": "sample_task_plugin", - "version": "kibana" + "version": "1.0.0", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" + } } diff --git a/x-pack/test/saved_object_api_integration/common/services/es.js b/x-pack/test/saved_object_api_integration/common/services/es.js index f5ef3be4b4bd..af188ca5e397 100644 --- a/x-pack/test/saved_object_api_integration/common/services/es.js +++ b/x-pack/test/saved_object_api_integration/common/services/es.js @@ -8,9 +8,8 @@ import { format as formatUrl } from 'url'; import elasticsearch from 'elasticsearch'; import shieldPlugin from '../../../../server/lib/esjs_shield_plugin'; -import { TestInvoker } from '../lib/types'; -export function EsProvider({ getService }: TestInvoker) { +export function EsProvider({ getService }) { const config = getService('config'); return new elasticsearch.Client({ diff --git a/x-pack/test_utils/jest/config.js b/x-pack/test_utils/jest/config.js index 014c3793c585..e460c705f293 100644 --- a/x-pack/test_utils/jest/config.js +++ b/x-pack/test_utils/jest/config.js @@ -31,11 +31,6 @@ export default { coverageReporters: [ 'html', ], - globals: { - 'ts-jest': { - skipBabel: true, - }, - }, moduleFileExtensions: [ 'js', 'json', @@ -55,8 +50,7 @@ export default { 'integration_tests/' ], transform: { - '^.+\\.js$': '/../src/dev/jest/babel_transform.js', - '^.+\\.tsx?$': '/../src/dev/jest/ts_transform.js', + '^.+\\.(js|tsx?)$': '/../src/dev/jest/babel_transform.js', '^.+\\.txt?$': 'jest-raw-loader', '^.+\\.html?$': 'jest-raw-loader', }, diff --git a/yarn.lock b/yarn.lock index 93c50e796389..c14b0fe61db6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,7 +26,7 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0", "@babel/core@^7.3.4": +"@babel/core@7.3.4", "@babel/core@^7.1.0", "@babel/core@^7.3.4": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.3.4.tgz#921a5a13746c21e32445bf0798680e9d11a6530b" integrity sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA== @@ -250,7 +250,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.3.4": +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.2.2", "@babel/parser@^7.3.4": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== @@ -555,6 +555,16 @@ dependencies: regenerator-transform "^0.13.4" +"@babel/plugin-transform-runtime@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.3.4.tgz#57805ac8c1798d102ecd75c03b024a5b3ea9b431" + integrity sha512-PaoARuztAdd5MgeVjAxnIDAIUet5KpogqaefQvPOmPYCxYoaPhautxDh3aO8a4xHsKgT/b9gSxR0BKK1MIewPA== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + resolve "^1.8.1" + semver "^5.5.1" + "@babel/plugin-transform-shorthand-properties@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" @@ -609,6 +619,14 @@ "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" +"@babel/polyfill@7.2.5", "@babel/polyfill@^7.2.5": + version "7.2.5" + resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d" + integrity sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug== + dependencies: + core-js "^2.5.7" + regenerator-runtime "^0.12.0" + "@babel/preset-env@^7.3.4": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.3.4.tgz#887cf38b6d23c82f19b5135298bdb160062e33e1" @@ -677,6 +695,19 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-typescript" "^7.3.2" +"@babel/register@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827" + integrity sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g== + dependencies: + core-js "^2.5.7" + find-cache-dir "^1.0.0" + home-or-tmp "^3.0.0" + lodash "^4.17.10" + mkdirp "^0.5.1" + pirates "^4.0.0" + source-map-support "^0.5.9" + "@babel/runtime@7.0.0-beta.54": version "7.0.0-beta.54" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0-beta.54.tgz#39ebb42723fe7ca4b3e1b00e967e80138d47cadf" @@ -692,6 +723,13 @@ dependencies: regenerator-runtime "^0.12.0" +"@babel/runtime@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83" + integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g== + dependencies: + regenerator-runtime "^0.12.0" + "@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" @@ -1090,45 +1128,45 @@ resolved "https://registry.yarnpkg.com/@types/async/-/async-2.0.49.tgz#92e33d13f74c895cb9a7f38ba97db8431ed14bc0" integrity sha512-Benr3i5odUkvpFkOpzGqrltGdbSs+EVCkEBGXbuR7uT0VzhXKIkhem6PDzHdx5EonA+rfbB3QvP6aDOw5+zp5Q== -"@types/babel-core@^6.25.5": - version "6.25.5" - resolved "https://registry.yarnpkg.com/@types/babel-core/-/babel-core-6.25.5.tgz#7598b1287c2cb5a8e9150d60e4d4a8f2dbe29982" - integrity sha512-pecvyMrc46zY0AFYXVZWNmm/gekr7f32OBYCd9baOiIpOTFtNN0ormeWpJaG7p+MEzncUvNtJdYql94dZYZGsw== - dependencies: - "@types/babel-generator" "*" - "@types/babel-template" "*" - "@types/babel-traverse" "*" - "@types/babel-types" "*" - "@types/babylon" "*" - -"@types/babel-generator@*": - version "6.25.2" - resolved "https://registry.yarnpkg.com/@types/babel-generator/-/babel-generator-6.25.2.tgz#fa13653ec2d34a4037be9c34dec32ae75bea04cc" - integrity sha512-W7PQkeDlYOqJblfNeqZARwj4W8nO+ZhQQZksU8+wbaKuHeUdIVUAdREO/Qb0FfNr3CY5Sq1gNtqsyFeZfS3iSw== - dependencies: - "@types/babel-types" "*" - -"@types/babel-template@*": - version "6.25.1" - resolved "https://registry.yarnpkg.com/@types/babel-template/-/babel-template-6.25.1.tgz#03e23a893c16bab2ec00200ab51feccf488cae78" - integrity sha512-teJYxh35PbBaf9OY6YwLSQ7pRiWRnHCHmlqwfVSfexOsqHUf6hpNZ4FG9PfgnpBM1VRzRJVQF3SqqOtkcNrBZQ== - dependencies: - "@types/babel-types" "*" - "@types/babylon" "*" - -"@types/babel-traverse@*": - version "6.25.4" - resolved "https://registry.yarnpkg.com/@types/babel-traverse/-/babel-traverse-6.25.4.tgz#269af6a25c80419b635c8fa29ae42b0d5ce2418c" - integrity sha512-+/670NaZE7qPvdh8EtGds32/2uHFKE5JeS+7ePH6nGwF8Wj8r671/RkTiJQP2k22nFntWEb9xQ11MFj7xEqI0g== - dependencies: - "@types/babel-types" "*" - "@types/babel-types@*", "@types/babel-types@^7.0.0": version "7.0.4" resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.4.tgz#bfd5b0d0d1ba13e351dff65b6e52783b816826c8" integrity sha512-WiZhq3SVJHFRgRYLXvpf65XnV6ipVHhnNaNvE8yCimejrGglkg38kEj0JcizqwSHxmPSjcTlig/6JouxLGEhGw== -"@types/babylon@*", "@types/babylon@6.16.3", "@types/babylon@^6.16.2": +"@types/babel__core@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" + integrity sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/babylon@6.16.3", "@types/babylon@^6.16.2": version "6.16.3" resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.3.tgz#c2937813a89fcb5e79a00062fc4a8b143e7237bb" integrity sha512-lyJ8sW1PbY3uwuvpOBZ9zMYKshMnQpXmeDHh8dj9j2nJm/xrW0FgB5gLSYOArj5X0IfaXnmhFoJnhS4KbqIMug== @@ -1295,10 +1333,10 @@ "@types/cheerio" "*" "@types/react" "*" -"@types/eslint@^4.16.2": - version "4.16.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.2.tgz#30f4f026019eb78a6ef12f276b75cd16ea2afb27" - integrity sha512-gCqhoFlyLic8Ux1OQt9cjlPbXk/dS7zPpofazBkie6SWCl+e1IEZBgLqyakm27nh0/uSZYW2TqkBusV9fLmztw== +"@types/eslint@^4.16.6": + version "4.16.6" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.6.tgz#96d4ecddbea618ab0b55eaf0dffedf387129b06c" + integrity sha512-GL7tGJig55FeclpOytU7nCCqtR143jBoC7AUdH0DO9xBSIFiNNUFCY/S3KNWsHeQJuU3hjw/OC1+kRTFNXqUZQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -2258,19 +2296,17 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn-jsx@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" - integrity sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw== - dependencies: - acorn "^5.0.3" +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== acorn-walk@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.0.1.tgz#c7827bdbb8e21aa97b609adfa225400d9ae348ba" integrity sha512-PqVQ8c6a3kyqdsUZlC7nljp3FFuxipBRHKu+7C1h8QygBFlzTaDX5HD383jej3Peed+1aDG8HwkfB1Z1HMNPkw== -acorn@5.X, acorn@^5.0.3, acorn@^5.5.0, acorn@^5.6.0, acorn@^5.6.2, acorn@^5.7.1: +acorn@5.X, acorn@^5.0.3, acorn@^5.5.0, acorn@^5.6.2, acorn@^5.7.1: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== @@ -2295,6 +2331,11 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg== +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + address@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" @@ -2356,7 +2397,7 @@ ajv-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" integrity sha1-MU3QpLM2j609/NxU7eYXG4htrzw= -ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: +ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= @@ -2379,7 +2420,7 @@ ajv@^5.0.0, ajv@^5.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.0.1, ajv@^6.1.0, ajv@^6.5.3, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.5.5: version "6.5.5" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.5.tgz#cf97cdade71c6399a92c6d6c4177381291b781a1" integrity sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg== @@ -2389,6 +2430,16 @@ ajv@^6.0.1, ajv@^6.1.0, ajv@^6.5.3, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.9.1: + version "6.9.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b" + integrity sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -2503,6 +2554,11 @@ ansi-escapes@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" integrity sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ== +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -3250,7 +3306,7 @@ axios@^0.18.0: follow-redirects "^1.3.0" is-buffer "^1.1.5" -axobject-query@^2.0.1: +axobject-query@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== @@ -3262,28 +3318,6 @@ b64@4.x.x: resolved "https://registry.yarnpkg.com/b64/-/b64-4.0.0.tgz#c37f587f0a383c7019e821120e8c3f58f0d22772" integrity sha512-EhmUQodKB0sdzPPrbIWbGqA5cQeTWxYrAgNeeT1rLZWtD3tbNTnphz8J4vkXI3cPgBNlXBjzEbzDzq0Nwi4f9A== -babel-cli@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= - dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" - babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -3293,60 +3327,10 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@6.26.3, babel-core@^6.26.3: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-core@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" - integrity sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g= - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.0" - debug "^2.6.8" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.7" - slash "^1.0.0" - source-map "^0.5.6" - -babel-eslint@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-9.0.0.tgz#7d9445f81ed9f60aff38115f838970df9f2b6220" - integrity sha512-itv1MwE3TMbY0QtNfeL7wzak1mV47Uy+n6HtSOO4Xd7rvmO+tsGQSgyOEEgo6Y2vHZKZphaoelNeSVj4vkLA1g== +babel-eslint@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" + integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== dependencies: "@babel/code-frame" "^7.0.0" "@babel/parser" "^7.0.0" @@ -3369,150 +3353,6 @@ babel-generator@^6.18.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-generator@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" - integrity sha1-rBriAHC3n248odMmlhMFN3TyDcU= - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.6" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-builder-react-jsx@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" - integrity sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - esutils "^2.0.2" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-jest@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" - integrity sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew== - dependencies: - babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^23.2.0" - babel-jest@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.1.0.tgz#441e23ef75ded3bd547e300ac3194cef87b55190" @@ -3523,14 +3363,15 @@ babel-jest@^24.1.0: chalk "^2.4.2" slash "^2.0.0" -babel-loader@7.1.5, babel-loader@^7.1.5: - version "7.1.5" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.5.tgz#e3ee0cd7394aa557e013b02d3e492bfd07aa6d68" - integrity sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw== +babel-loader@8.0.5, babel-loader@^8.0.5: + version "8.0.5" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" + integrity sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw== dependencies: - find-cache-dir "^1.0.0" + find-cache-dir "^2.0.0" loader-utils "^1.0.2" mkdirp "^0.5.1" + util.promisify "^1.0.0" babel-messages@^6.23.0: version "6.23.0" @@ -3539,40 +3380,24 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-add-module-exports@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" - integrity sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU= +babel-plugin-add-module-exports@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-1.0.0.tgz#72b5424d941a336c6a35357f373d8b8366263031" + integrity sha512-m0sMxPL4FaN2K69GQgaRJa4Ny15qKSdoknIcpN+gz+NaJlAW9pge/povs13tPYsKDboflrEQC+/3kfIsONBTaw== + optionalDependencies: + chokidar "^2.0.4" -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= +babel-plugin-inline-react-svg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-inline-react-svg/-/babel-plugin-inline-react-svg-1.0.1.tgz#1457edae1035a12b3c5026ef28a1239edc71d2a2" + integrity sha512-vTsG/L2cUN4XRJdJ1scYXMSBlgAxkZm/tgo1Lo/FulbPADztEtVOPUNuNDeEoRHZCz9RC0ZHXdVSJ/GaqahF/Q== dependencies: - babel-runtime "^6.22.0" - -babel-plugin-inline-react-svg@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/babel-plugin-inline-react-svg/-/babel-plugin-inline-react-svg-0.5.4.tgz#bc818f351cd9d78f5b3bfa7cc1da5f83e7b4010a" - integrity sha512-Pr/J5kicFEpIvwooR3mytJWXfyGXoP4gp4QzTdN0jLoa7lU2OJVyhHMm17ekA3okxwbLaQehSc0kV/UVrj343w== - dependencies: - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babylon "^6.18.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/parser" "^7.0.0" lodash.isplainobject "^4.0.6" resolve "^1.8.1" svgo "^0.7.2" -babel-plugin-istanbul@^4.1.6: - version "4.1.6" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" - integrity sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ== - dependencies: - babel-plugin-syntax-object-rest-spread "^6.13.0" - find-up "^2.1.0" - istanbul-lib-instrument "^1.10.1" - test-exclude "^4.2.1" - babel-plugin-istanbul@^5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz#7981590f1956d75d67630ba46f0c22493588c893" @@ -3582,88 +3407,20 @@ babel-plugin-istanbul@^5.1.0: istanbul-lib-instrument "^3.0.0" test-exclude "^5.0.0" -babel-plugin-jest-hoist@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" - integrity sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc= - babel-plugin-jest-hoist@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" integrity sha512-gljYrZz8w1b6fJzKcsfKsipSru2DU2DmQ39aB6nV3xQ0DDv3zpIzKGortA5gknrhNnPN8DweaEgrnZdmbGmhnw== -babel-plugin-mock-imports@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/babel-plugin-mock-imports/-/babel-plugin-mock-imports-0.0.5.tgz#caa865f017d8972fe47772e0fb57f2924e5ce3c5" - integrity sha1-yqhl8BfYly/kd3Lg+1fykk5c48U= +babel-plugin-mock-imports@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-mock-imports/-/babel-plugin-mock-imports-1.0.1.tgz#1476ed4de911347d344fc81caab4beced80804b1" + integrity sha512-Nu4unCGKeqOfLlfnLPnv/pEHancdAGTqFqyArZ27gsKIiKxeZvMr87IHB8BxhMu3Bfc8fA8bx7hWt32aZbEwpQ== -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= - -babel-plugin-syntax-async-generators@^6.5.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - integrity sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= - -babel-plugin-syntax-class-properties@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" - integrity sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= - -babel-plugin-syntax-flow@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" - integrity sha1-TDqyCiryaqIM0lmVw5jE63AxDI0= - -babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= - -babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= - -babel-plugin-transform-async-generator-functions@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" - integrity sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-class-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" - integrity sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= - dependencies: - babel-helper-function-name "^6.24.1" - babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" +"babel-plugin-require-context-hook@npm:babel-plugin-require-context-hook-babel7@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-require-context-hook-babel7/-/babel-plugin-require-context-hook-babel7-1.0.0.tgz#1273d4cee7e343d0860966653759a45d727e815d" + integrity sha512-kez0BAN/cQoyO1Yu1nre1bQSYZEF93Fg7VQiBHFfMWuaZTy7vJSTT4FY68FwHTYG53Nyt0A7vpSObSVxwweQeQ== babel-plugin-transform-define@^1.3.1: version "1.3.1" @@ -3673,290 +3430,17 @@ babel-plugin-transform-define@^1.3.1: lodash "^4.17.11" traverse "0.6.6" -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= - dependencies: - babel-runtime "^6.22.0" +babel-plugin-transform-react-remove-prop-types@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" + integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= - dependencies: - babel-runtime "^6.22.0" +babel-plugin-typescript-strip-namespaces@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-typescript-strip-namespaces/-/babel-plugin-typescript-strip-namespaces-1.1.1.tgz#160433b17e424b57cf72e3b4d8f08195ad28d7fd" + integrity sha512-dVB9caEANbEVwUylL8g3lsYU5JjaXE2KNIVLib3KVcGJF32QunxvQqP6kf+lzW/fyDed/zWD/e/hdyimyc/79Q== -babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" - integrity sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo= - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-flow-strip-types@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" - integrity sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988= - dependencies: - babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= - dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.26.0" - -babel-plugin-transform-react-display-name@^6.23.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" - integrity sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx-self@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" - integrity sha1-322AqdomEqEh5t3XVYvL7PBuY24= - dependencies: - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx-source@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" - integrity sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY= - dependencies: - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" - integrity sha1-hAoCjn30YN/DotKfDA2R9jduZqM= - dependencies: - babel-helper-builder-react-jsx "^6.24.1" - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-react-remove-prop-types@^0.4.14: - version "0.4.15" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.15.tgz#7ba830e77276a0e788cd58ea527b5f70396e12a7" - integrity sha512-bFxxYdkZBwTjTgtZEPTLqu9g8Ajz8x8uEP/O1iVuaZIz2RuxJ2gtx0EXDJRonC++KGsgsW/4Hqvk4KViEtE2nw== - -babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-runtime@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee" - integrity sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-polyfill@6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.20.0.tgz#de4a371006139e20990aac0be367d398331204e7" - integrity sha1-3ko3EAYTniCZCqwL42fTmDMSBOc= - dependencies: - babel-runtime "^6.20.0" - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-polyfill@6.26.0, babel-polyfill@^6.26.0: +babel-polyfill@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= @@ -3965,87 +3449,6 @@ babel-polyfill@6.26.0, babel-polyfill@^6.26.0: core-js "^2.5.0" regenerator-runtime "^0.10.5" -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" - -babel-preset-es2015@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - integrity sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" - -babel-preset-flow@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" - integrity sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0= - dependencies: - babel-plugin-transform-flow-strip-types "^6.22.0" - -babel-preset-jest@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" - integrity sha1-jsegOhOPABoaj7HoETZSvxpV2kY= - dependencies: - babel-plugin-jest-hoist "^23.2.0" - babel-plugin-syntax-object-rest-spread "^6.13.0" - babel-preset-jest@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz#83bc564fdcd4903641af65ec63f2f5de6b04132e" @@ -4054,43 +3457,7 @@ babel-preset-jest@^24.1.0: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" babel-plugin-jest-hoist "^24.1.0" -babel-preset-react@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" - integrity sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A= - dependencies: - babel-plugin-syntax-jsx "^6.3.13" - babel-plugin-transform-react-display-name "^6.23.0" - babel-plugin-transform-react-jsx "^6.24.1" - babel-plugin-transform-react-jsx-self "^6.22.0" - babel-plugin-transform-react-jsx-source "^6.22.0" - babel-preset-flow "^6.23.0" - -babel-preset-stage-3@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" - integrity sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-generator-functions "^6.24.1" - babel-plugin-transform-async-to-generator "^6.24.1" - babel-plugin-transform-exponentiation-operator "^6.24.1" - babel-plugin-transform-object-rest-spread "^6.22.0" - -babel-register@6.26.0, babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= @@ -4098,7 +3465,7 @@ babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runti core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: +babel-template@^6.16.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= @@ -4109,7 +3476,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: +babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= @@ -4133,7 +3500,7 @@ babel-types@7.0.0-beta.3: lodash "^4.2.0" to-fast-properties "^2.0.0" -babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: +babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= @@ -4143,13 +3510,6 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26 lodash "^4.17.4" to-fast-properties "^1.0.3" -"babel7-plugin-add-module-exports@npm:babel-plugin-add-module-exports@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-1.0.0.tgz#72b5424d941a336c6a35357f373d8b8366263031" - integrity sha512-m0sMxPL4FaN2K69GQgaRJa4Ny15qKSdoknIcpN+gz+NaJlAW9pge/povs13tPYsKDboflrEQC+/3kfIsONBTaw== - optionalDependencies: - chokidar "^2.0.4" - babylon@7.0.0-beta.47: version "7.0.0-beta.47" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.47.tgz#6d1fa44f0abec41ab7c780481e62fd9aafbdea80" @@ -4648,14 +4008,6 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^3.2.6: - version "3.2.8" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== - dependencies: - caniuse-lite "^1.0.30000844" - electron-to-chromium "^1.3.47" - browserslist@^4.0.1, browserslist@^4.3.4: version "4.4.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.4.1.tgz#42e828954b6b29a7a53e352277be429478a69062" @@ -4722,7 +4074,7 @@ buffer-fill@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= -buffer-from@^1.0.0, buffer-from@^1.1.0: +buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -5005,7 +4357,7 @@ caniuse-db@^1.0.30000539, caniuse-db@^1.0.30000597: resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000813.tgz#e0a1c603f8880ad787b2a35652b2733f32a5e29a" integrity sha1-4KHGA/iICteHsqNWUrJzPzKl4po= -caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000872, caniuse-lite@^1.0.30000929: +caniuse-lite@^1.0.30000872, caniuse-lite@^1.0.30000929: version "1.0.30000932" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000932.tgz#d01763e9ce77810962ca7391ff827b5949ce4272" integrity sha512-4bghJFItvzz8m0T3lLZbacmEY9X1Z2AtIzTr7s7byqZIOumASfr4ynDx7rtm0J85nDmx8vsgR6vnaSoeU8Oh0A== @@ -5227,6 +4579,11 @@ chardet@^0.5.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.5.0.tgz#fe3ac73c00c3d865ffcc02a0682e2c20b6a06029" integrity sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g== +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + checksum@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/checksum/-/checksum-0.1.1.tgz#dc6527d4c90be8560dbd1ed4cecf3297d528e9e9" @@ -5284,22 +4641,6 @@ chokidar@1.6.0: optionalDependencies: fsevents "^1.0.0" -chokidar@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.3, chokidar@^2.0.4: version "2.1.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.2.tgz#9c23ea40b01638439e0513864d362aeacc5ad058" @@ -5609,11 +4950,6 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" -closest-file-data@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/closest-file-data/-/closest-file-data-0.1.4.tgz#975f87c132f299d24a0375b9f63ca3fb88f72b3a" - integrity sha1-l1+HwTLymdJKA3W59jyj+4j3Kzo= - cmd-shim@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" @@ -6098,13 +5434,6 @@ convert-source-map@1.X, convert-source-map@^1.1.0, convert-source-map@^1.4.0, co resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" integrity sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU= -convert-source-map@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - convex-hull@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/convex-hull/-/convex-hull-1.0.3.tgz#20a3aa6ce87f4adea2ff7d17971c9fc1c67e1fff" @@ -6950,7 +6279,7 @@ debug@3.X, debug@^3.1.0, debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -7375,6 +6704,13 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + doctypes@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" @@ -7638,11 +6974,6 @@ electron-to-chromium@^1.3.103: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.108.tgz#2e79a6fcaa4b3e7c75abf871505bda8e268c910e" integrity sha512-/QI4hMpAh48a1Sea6PALGv+kuVne9A2EWGd8HrWHMdYhIzGtbhVVHh6heL5fAzGaDnZuPyrlWJRl8WPm4RyiQQ== -electron-to-chromium@^1.3.47: - version "1.3.82" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.82.tgz#7d13ae4437d2a783de3f4efba96b186c540b67b1" - integrity sha512-NI4nB2IWGcU4JVT1AE8kBb/dFor4zjLHMLsOROPahppeHrR0FG5uslxMmkp/thO1MvPjM2xhlKoY29/I60s0ew== - elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -7668,10 +6999,10 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" -emoji-regex@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2" - integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ== +emoji-regex@^7.0.1, emoji-regex@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== emojis-list@^2.0.0: version "2.1.0" @@ -7756,7 +7087,7 @@ engine.io@~3.2.0: engine.io-parser "~2.1.0" ws "~3.3.1" -enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: +enhanced-resolve@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== @@ -8094,14 +7425,14 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz#2c26d2cdcfa3a05f0642cd7e6e4ef3316cdabfa2" - integrity sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w== +eslint-config-prettier@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.1.0.tgz#181364895899fff9fd3605fecb5c4f20e7d5f395" + integrity sha512-zILwX9/Ocz4SV2vX7ox85AsrAgXV3f2o2gpIicdMIOra48WYqgUnWNH/cR/iHtmD2Vb3dLSC3LiEJnS05Gkw7w== dependencies: get-stdin "^6.0.0" -eslint-import-resolver-node@^0.3.1, eslint-import-resolver-node@^0.3.2: +eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== @@ -8125,62 +7456,62 @@ eslint-import-resolver-webpack@^0.10.1: resolve "^1.4.0" semver "^5.3.0" -eslint-module-utils@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" - integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= +eslint-module-utils@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz#546178dab5e046c8b562bbb50705e2456d7bda49" + integrity sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w== dependencies: debug "^2.6.8" - pkg-dir "^1.0.0" + pkg-dir "^2.0.0" -eslint-plugin-babel@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.2.0.tgz#3041a0c26aa3ca4a0e0f2aa11591f0396790d981" - integrity sha512-9pNH/e214SN3r2nEwwTLRI27jUN4+nuLMv1+qxfDv8Za9cJ3F+aPkNinYiVeUmAmiEtOttbS32yuwRG2DREvJg== +eslint-plugin-babel@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" + integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w== dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-import@^2.14.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" - integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== +eslint-plugin-import@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" + integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== dependencies: contains-path "^0.1.0" - debug "^2.6.8" + debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.2.0" - has "^1.0.1" - lodash "^4.17.4" - minimatch "^3.0.3" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.3.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" read-pkg-up "^2.0.0" - resolve "^1.6.0" + resolve "^1.9.0" -eslint-plugin-jest@^21.26.2: - version "21.27.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.27.2.tgz#2a795b7c3b5e707df48a953d651042bd01d7b0a8" - integrity sha512-0E4OIgBJVlAmf1KfYFtZ3gYxgUzC5Eb3Jzmrc9ikI1OY+/cM8Kh72Ti7KfpeHNeD3HJNf9SmEfmvQLIz44Hrhw== +eslint-plugin-jest@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.3.0.tgz#a10f10dedfc92def774ec9bb5bfbd2fb8e1c96d2" + integrity sha512-P1mYVRNlOEoO5T9yTqOfucjOYf1ktmJ26NjwjH8sxpCFQa6IhBGr5TpKl3hcAAT29hOsRJVuMWmTsHoUVo9FoA== -eslint-plugin-jsx-a11y@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.2.tgz#69bca4890b36dcf0fe16dd2129d2d88b98f33f88" - integrity sha512-7gSSmwb3A+fQwtw0arguwMdOdzmKUgnUcbSNlo+GjKLAQFuC2EZxWqG9XHRI8VscBJD5a8raz3RuxQNFW+XJbw== +eslint-plugin-jsx-a11y@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c" + integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w== dependencies: aria-query "^3.0.0" array-includes "^3.0.3" ast-types-flow "^0.0.7" - axobject-query "^2.0.1" + axobject-query "^2.0.2" damerau-levenshtein "^1.0.4" - emoji-regex "^6.5.1" + emoji-regex "^7.0.2" has "^1.0.3" jsx-ast-utils "^2.0.1" -eslint-plugin-mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.2.0.tgz#d8786d9fff8cb8b5f6e4b61e40395d6568a5c4e2" - integrity sha512-4VTX/qIoxUFRnXLNm6bEhEJyfGnGagmQzV4TWXKzkZgIYyP2FSubEdCjEFTyS/dGwSVRWCWGX7jO7BK8R0kppg== +eslint-plugin-mocha@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.3.0.tgz#cf3eb18ae0e44e433aef7159637095a7cb19b15b" + integrity sha512-3uwlJVLijjEmBeNyH60nzqgA1gacUWLUmcKV8PIGNvj1kwP/CTgAWQHn2ayyJVwziX+KETkr9opNwT1qD/RZ5A== dependencies: - ramda "^0.25.0" + ramda "^0.26.1" eslint-plugin-no-unsanitized@^3.0.2: version "3.0.2" @@ -8200,24 +7531,25 @@ eslint-plugin-prettier@^2.2.0: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-plugin-prettier@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz#71998c60aedfa2141f7bfcbf9d1c459bf98b4fad" - integrity sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og== +eslint-plugin-prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" + integrity sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ== dependencies: - fast-diff "^1.1.1" - jest-docblock "^21.0.0" + prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.11.1: - version "7.11.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz#c01a7af6f17519457d6116aa94fc6d2ccad5443c" - integrity sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw== +eslint-plugin-react@^7.12.4: + version "7.12.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c" + integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ== dependencies: array-includes "^3.0.3" doctrine "^2.1.0" has "^1.0.3" jsx-ast-utils "^2.0.1" + object.fromentries "^2.0.0" prop-types "^15.6.2" + resolve "^1.9.0" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -8240,6 +7572,14 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.2.tgz#5f10cd6cabb1965bf479fa65745673439e21cb0e" + integrity sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-utils@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" @@ -8289,48 +7629,46 @@ eslint@^2.7.0: text-table "~0.2.0" user-home "^2.0.0" -eslint@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.0.tgz#b6f7806041af01f71b3f1895cbb20971ea4b6223" - integrity sha512-/eVYs9VVVboX286mBK7bbKnO1yamUy2UCRjiY6MryhQL2PaaXCExsCQ2aO83OeYRhU2eCU/FMFP+tVMoOrzNrA== +eslint@^5.15.1: + version "5.15.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.15.1.tgz#8266b089fd5391e0009a047050795b1d73664524" + integrity sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" + ajv "^6.9.1" chalk "^2.1.0" cross-spawn "^6.0.5" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^4.0.0" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.2" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^4.0.0" + espree "^5.0.1" esquery "^1.0.1" esutils "^2.0.2" - file-entry-cache "^2.0.0" + file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob "^7.1.2" globals "^11.7.0" ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.1.0" - is-resolvable "^1.1.0" + inquirer "^6.2.2" js-yaml "^3.12.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.5" + lodash "^4.17.11" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" - regexpp "^2.0.0" - require-uncached "^1.0.3" + regexpp "^2.0.1" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" - table "^4.0.3" + table "^5.2.3" text-table "^0.2.0" esm@^3.0.84: @@ -8346,13 +7684,14 @@ espree@^3.1.6: acorn "^5.5.0" acorn-jsx "^3.0.0" -espree@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" - integrity sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg== +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== dependencies: - acorn "^5.6.0" - acorn-jsx "^4.1.1" + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" @@ -8772,6 +8111,15 @@ external-editor@^3.0.0: iconv-lite "^0.4.22" tmp "^0.0.33" +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -8885,6 +8233,11 @@ fast-diff@^1.1.1: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-glob@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.0.4.tgz#a4b9f49e36175f5ef1a3456f580226a6e7abcc9e" @@ -9019,13 +8372,12 @@ file-entry-cache@^1.1.1: flat-cache "^1.2.1" object-assign "^4.0.1" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^2.0.1" file-loader@2.0.0, file-loader@^2.0.0: version "2.0.0" @@ -9270,6 +8622,15 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + flatted@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" @@ -9475,15 +8836,6 @@ fs-extra@5.0.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" - integrity sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" @@ -9517,7 +8869,7 @@ fs-mkdirp-stream@^1.0.0: graceful-fs "^4.1.11" through2 "^2.0.3" -fs-readdir-recursive@^1.0.0, fs-readdir-recursive@^1.1.0: +fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== @@ -10465,10 +9817,10 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -grunt-babel@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/grunt-babel/-/grunt-babel-7.0.0.tgz#13c90c01f154dec214e0eeb5d66ac7c70cedf2d3" - integrity sha512-AFilvH/iPbnIYhL4Wx36AJQCaVEvK55xh0tujAt1DIM5tuxYxRsgUPEpwijBU147B+as/ssGuY9/6JYfTiAWpw== +grunt-babel@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/grunt-babel/-/grunt-babel-8.0.0.tgz#92ef63aafadf938c488dc2f926ac9846e0c93d1b" + integrity sha512-WuiZFvGzcyzlEoPIcY1snI234ydDWeWWV5bpnB7PZsOLHcDsxWKnrR1rMWEUsbdVPPjvIirwFNsuo4CbJmsdFQ== grunt-cli@^1.2.0, grunt-cli@~1.2.0: version "1.2.0" @@ -10587,13 +9939,13 @@ grunt@1.0.3: path-is-absolute "~1.0.0" rimraf "~2.6.2" -gulp-babel@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-7.0.1.tgz#b9c8e29fa376b36c57989db820fc1c1715bb47cb" - integrity sha512-UqHS3AdxZyJCRxqnAX603Dj3k/Wx6hzcgmav3QcxvsIFq3Y8ZkU7iXd0O+JwD5ivqCc6o0r1S7tCB/xxLnuSNw== +gulp-babel@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0.tgz#e0da96f4f2ec4a88dd3a3030f476e38ab2126d87" + integrity sha512-oomaIqDXxFkg7lbpBou/gnUkX51/Y/M2ZfSjL2hdqXTAlSWZcgZtd2o0cOH0r/eE8LWD0+Q/PsLsr2DKOoqToQ== dependencies: plugin-error "^1.0.1" - replace-ext "0.0.1" + replace-ext "^1.0.0" through2 "^2.0.0" vinyl-sourcemaps-apply "^0.2.0" @@ -11079,13 +10431,10 @@ hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0, hoist-non-react- resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" +home-or-tmp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" + integrity sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs= homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: version "1.0.1" @@ -11276,7 +10625,7 @@ icalendar@0.7.1: resolved "https://registry.yarnpkg.com/icalendar/-/icalendar-0.7.1.tgz#d0d3486795f8f1c5cf4f8cafac081b4b4e7a32ae" integrity sha1-0NNIZ5X48cXPT4yvrAgbS056Mq4= -iconv-lite@0.4, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.22, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.22, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -11368,6 +10717,14 @@ import-cwd@^2.0.0: dependencies: import-from "^2.1.0" +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -11604,23 +10961,23 @@ inquirer@^6.0.0: strip-ansi "^4.0.0" through "^2.3.6" -inquirer@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" - integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg== +inquirer@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" + integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" + ansi-escapes "^3.2.0" + chalk "^2.4.2" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^3.0.0" + external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.17.10" + lodash "^4.17.11" mute-stream "0.0.7" run-async "^2.2.0" - rxjs "^6.1.0" + rxjs "^6.4.0" string-width "^2.1.0" - strip-ansi "^4.0.0" + strip-ansi "^5.0.0" through "^2.3.6" insane@2.5.0: @@ -12205,7 +11562,7 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" -is-resolvable@^1.0.0, is-resolvable@^1.1.0: +is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== @@ -12401,7 +11758,7 @@ istanbul-instrumenter-loader@3.0.1: loader-utils "^1.1.0" schema-utils "^0.3.0" -istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: +istanbul-lib-coverage@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== @@ -12418,19 +11775,6 @@ istanbul-lib-hook@^2.0.3: dependencies: append-transform "^1.0.0" -istanbul-lib-instrument@^1.10.1: - version "1.10.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" - integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== - dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.18.0" - istanbul-lib-coverage "^1.2.1" - semver "^5.3.0" - istanbul-lib-instrument@^1.7.3: version "1.10.1" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" @@ -13165,7 +12509,7 @@ json3@3.3.2, json3@^3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= -json5@^0.5.0, json5@^0.5.1: +json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= @@ -14415,11 +13759,6 @@ make-dir@^1.0.0, make-dir@^1.3.0: dependencies: pify "^3.0.0" -make-error@^1.1.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" - integrity sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g== - make-iterator@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.0.tgz#57bef5dc85d23923ba23767324d8e8f8f3d9694b" @@ -14689,7 +14028,7 @@ micromatch@3.1.5: snapdragon "^0.8.1" to-regex "^3.0.1" -micromatch@^2.1.5, micromatch@^2.3.11: +micromatch@^2.1.5: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= @@ -16049,7 +15388,7 @@ os-shim@^0.1.2: resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" integrity sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc= -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= @@ -16070,15 +15409,6 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" - output-file-sync@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-2.0.1.tgz#f53118282f5f553c2799541792b723a4c71430c0" @@ -16277,6 +15607,13 @@ param-case@2.1.x, param-case@^2.1.0: dependencies: no-case "^2.2.0" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" @@ -16463,7 +15800,7 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1, path-is-absolute@~1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= @@ -16488,6 +15825,11 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-root-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" @@ -16665,13 +16007,6 @@ pixelmatch@4.0.2, pixelmatch@^4.0.0: dependencies: pngjs "^3.0.0" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -16748,11 +16083,6 @@ pluralize@^1.2.1: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" integrity sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU= -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - pn@^1.0.0, pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -16936,6 +16266,13 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + prettier@1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" @@ -16964,7 +16301,7 @@ pretty-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -private@^0.1.6, private@^0.1.7, private@^0.1.8, private@~0.1.5: +private@^0.1.6, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -17427,10 +16764,10 @@ railroad-diagrams@^1.0.0: resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234= -ramda@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9" - integrity sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ== +ramda@^0.26.1: + version "0.26.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" + integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== randexp@0.4.6: version "0.4.6" @@ -18312,7 +17649,7 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@^0.10.0, regenerator-runtime@^0.10.5: +regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= @@ -18327,15 +17664,6 @@ regenerator-runtime@^0.12.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" - regenerator-transform@^0.13.4: version "0.13.4" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.4.tgz#18f6763cf1382c69c36df76c6ce122cc694284fb" @@ -18374,10 +17702,10 @@ regexp-tree@^0.1.0: colors "^1.1.2" yargs "^12.0.5" -regexpp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" - integrity sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA== +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpu-core@^1.0.0: version "1.0.0" @@ -18388,15 +17716,6 @@ regexpu-core@^1.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - regexpu-core@^4.1.3, regexpu-core@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" @@ -18694,7 +18013,7 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-uncached@^1.0.2, require-uncached@^1.0.3: +require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= @@ -18795,7 +18114,7 @@ resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7: dependencies: path-parse "^1.0.5" -resolve@^1.3.2, resolve@^1.4.0, resolve@^1.6.0, resolve@^1.8.1: +resolve@^1.3.2, resolve@^1.4.0, resolve@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== @@ -18809,6 +18128,13 @@ resolve@^1.5.0, resolve@^1.7.1: dependencies: path-parse "^1.0.5" +resolve@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + responselike@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -18875,18 +18201,18 @@ rimraf@2.4.3: dependencies: glob "^5.0.14" -rimraf@~2.2.6: - version "2.2.8" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" - integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= - -rimraf@~2.6.2: +rimraf@2.6.3, rimraf@~2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +rimraf@~2.2.6: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" @@ -19037,6 +18363,13 @@ rxjs@^6.2.1: dependencies: tslib "^1.9.0" +rxjs@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" + integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -19601,11 +18934,13 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" slide@^1.1.5, slide@~1.1.3: @@ -19754,13 +19089,6 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - source-map-support@^0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" @@ -19777,6 +19105,14 @@ source-map-support@^0.5.6, source-map-support@~0.5.6: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@^0.5.9: + version "0.5.10" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" + integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" @@ -20200,6 +19536,15 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.0.0.tgz#5a1690a57cc78211fffd9bf24bbe24d090604eb1" + integrity sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.0.0" + string.prototype.trim@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" @@ -20588,17 +19933,15 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -table@^4.0.3: - version "4.0.3" - resolved "http://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" - integrity sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" tabtab@^1.3.2: version "1.3.2" @@ -20770,17 +20113,6 @@ terser@^3.8.1: source-map "~0.6.1" source-map-support "~0.5.6" -test-exclude@^4.2.1: - version "4.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" - integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - test-exclude@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" @@ -21230,46 +20562,11 @@ trunc-text@1.0.2: resolved "https://registry.yarnpkg.com/trunc-text/-/trunc-text-1.0.2.tgz#b582bb3ddea9c9adc25017d737c48ebdd2157406" integrity sha1-tYK7Pd6pya3CUBfXN8SOvdIVdAY= -ts-jest@^23.1.4: - version "23.1.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.1.4.tgz#66ac1d8d3fbf8f9a98432b11aa377aa850664b2b" - integrity sha512-9rCSxbWfoZxxeXnSoEIzRNr9hDIQ8iEJAWmSRsWhDHDT8OeuGfURhJQUE8jtJlkyEygs6rngH8RYtHz9cfjmEA== - dependencies: - closest-file-data "^0.1.4" - fs-extra "6.0.1" - json5 "^0.5.0" - lodash "^4.17.10" - -ts-loader@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-5.2.2.tgz#a707849b08ca754cc46f5c7053e79fe1c84caf0e" - integrity sha512-vM/TrEKXBqRYq5yLatsXyKFnYSpv53klmGtrILGlNqcMsxPVi8+e4yr1Agbu9oMZepx/4szDVn5QpFo83IQdQg== - dependencies: - chalk "^2.3.0" - enhanced-resolve "^4.0.0" - loader-utils "^1.0.2" - micromatch "^3.1.4" - semver "^5.0.1" - ts-log@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.1.3.tgz#9e30aca1baffe7693a2e4142b8f07ecb01cb8340" integrity sha512-VIk9+hzE80UjhJcSANst8LGRBpfNh32y9d3LVDMtEqcEb1x0hB71IO0aObNcLJ5VpK5tKeF9uI4pwEco03SkwA== -ts-node@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" - integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== - dependencies: - arrify "^1.0.0" - buffer-from "^1.1.0" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.5.6" - yn "^2.0.0" - tslib@1.9.3, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.2, tslib@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -22377,7 +21674,7 @@ v8-compile-cache@^2.0.2: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c" integrity sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw== -v8flags@^2.0.2, v8flags@^2.1.1: +v8flags@^2.0.2: version "2.1.1" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= @@ -23394,6 +22691,13 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -23883,11 +23187,6 @@ yeoman-generator@1.1.1: user-home "^2.0.0" yeoman-environment "^1.1.0" -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" - integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= - yo@2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/yo/-/yo-2.0.5.tgz#2f747f5d279ab777e0167b0aa63d7b607507d73d"