Skip to content

Commit a735a9f

Browse files
Spencerspalgerelasticmachine
authored
[bin/kibana-plugin] support KP plugins instead (#74604)
* [cli/kibana-plugin] support KP plugins instead * fix some Logger imports from cli/kibana_keystore Co-authored-by: spalger <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent 981fdda commit a735a9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+481
-995
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@
276276
"url-loader": "2.2.0",
277277
"uuid": "3.3.2",
278278
"val-loader": "^1.1.1",
279-
"validate-npm-package-name": "2.2.2",
280279
"vega": "^5.13.0",
281280
"vega-lite": "^4.13.1",
282281
"vega-schema-url-parser": "^1.1.0",

packages/kbn-pm/dist/index.js

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ __webpack_require__.r(__webpack_exports__);
9797
/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(511);
9898
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["buildProductionProjects"]; });
9999

100-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; });
101-
102100
/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145);
103101
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getProjects", function() { return _utils_projects__WEBPACK_IMPORTED_MODULE_2__["getProjects"]; });
104102

@@ -59477,9 +59475,6 @@ __webpack_require__.r(__webpack_exports__);
5947759475
/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(512);
5947859476
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _build_production_projects__WEBPACK_IMPORTED_MODULE_0__["buildProductionProjects"]; });
5947959477

59480-
/* harmony import */ var _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(748);
59481-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; });
59482-
5948359478
/*
5948459479
* Licensed to Elasticsearch B.V. under one or more contributor
5948559480
* license agreements. See the NOTICE file distributed with
@@ -59500,7 +59495,6 @@ __webpack_require__.r(__webpack_exports__);
5950059495
*/
5950159496

5950259497

59503-
5950459498
/***/ }),
5950559499
/* 512 */
5950659500
/***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -90331,71 +90325,5 @@ NestedError.prototype.name = 'NestedError';
9033190325
module.exports = NestedError;
9033290326

9033390327

90334-
/***/ }),
90335-
/* 748 */
90336-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
90337-
90338-
"use strict";
90339-
__webpack_require__.r(__webpack_exports__);
90340-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return prepareExternalProjectDependencies; });
90341-
/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(164);
90342-
/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(163);
90343-
/*
90344-
* Licensed to Elasticsearch B.V. under one or more contributor
90345-
* license agreements. See the NOTICE file distributed with
90346-
* this work for additional information regarding copyright
90347-
* ownership. Elasticsearch B.V. licenses this file to you under
90348-
* the Apache License, Version 2.0 (the "License"); you may
90349-
* not use this file except in compliance with the License.
90350-
* You may obtain a copy of the License at
90351-
*
90352-
* http://www.apache.org/licenses/LICENSE-2.0
90353-
*
90354-
* Unless required by applicable law or agreed to in writing,
90355-
* software distributed under the License is distributed on an
90356-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
90357-
* KIND, either express or implied. See the License for the
90358-
* specific language governing permissions and limitations
90359-
* under the License.
90360-
*/
90361-
90362-
90363-
/**
90364-
* All external projects are located within `./plugins/{plugin}` relative
90365-
* to the Kibana root directory or `../kibana-extra/{plugin}` relative
90366-
* to Kibana itself.
90367-
*/
90368-
90369-
const isKibanaDep = depVersion => // For ../kibana-extra/ directory (legacy only)
90370-
depVersion.includes('../../kibana/packages/') || // For plugins/ directory
90371-
depVersion.includes('../../packages/');
90372-
/**
90373-
* This prepares the dependencies for an _external_ project.
90374-
*/
90375-
90376-
90377-
async function prepareExternalProjectDependencies(projectPath) {
90378-
const project = await _utils_project__WEBPACK_IMPORTED_MODULE_1__["Project"].fromPath(projectPath);
90379-
90380-
if (!project.hasDependencies()) {
90381-
return;
90382-
}
90383-
90384-
const deps = project.allDependencies;
90385-
90386-
for (const depName of Object.keys(deps)) {
90387-
const depVersion = deps[depName]; // Kibana currently only supports `link:` dependencies on Kibana's own
90388-
// packages, as these are packaged into the `node_modules` folder when
90389-
// Kibana is built, so we don't need to take any action to enable
90390-
// `require(...)` to resolve for these packages.
90391-
90392-
if (Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_0__["isLinkDependency"])(depVersion) && !isKibanaDep(depVersion)) {
90393-
// For non-Kibana packages we need to set up symlinks during the
90394-
// installation process, but this is not something we support yet.
90395-
throw new Error('This plugin is using `link:` dependencies for non-Kibana packages');
90396-
}
90397-
}
90398-
}
90399-
9040090328
/***/ })
9040190329
/******/ ]);

packages/kbn-pm/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
export { run } from './cli';
21-
export { buildProductionProjects, prepareExternalProjectDependencies } from './production';
21+
export { buildProductionProjects } from './production';
2222
export { getProjects } from './utils/projects';
2323
export { Project } from './utils/project';
2424
export { copyWorkspacePackages } from './utils/workspaces';

packages/kbn-pm/src/production/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@
1818
*/
1919

2020
export { buildProductionProjects } from './build_production_projects';
21-
export { prepareExternalProjectDependencies } from './prepare_project_dependencies';

packages/kbn-pm/src/production/prepare_project_dependencies.test.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

packages/kbn-pm/src/production/prepare_project_dependencies.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/cli_keystore/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import Logger from '../cli_plugin/lib/logger';
20+
import { Logger } from '../cli_plugin/lib/logger';
2121
import { confirm, question } from '../legacy/server/utils';
2222
import { createPromiseFromStreams, createConcatStream } from '../legacy/utils';
2323

src/cli_keystore/add.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { PassThrough } from 'stream';
4141

4242
import { Keystore } from '../legacy/server/keystore';
4343
import { add } from './add';
44-
import Logger from '../cli_plugin/lib/logger';
44+
import { Logger } from '../cli_plugin/lib/logger';
4545
import * as prompt from '../legacy/server/utils/prompt';
4646

4747
describe('Kibana keystore', () => {

src/cli_keystore/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import Logger from '../cli_plugin/lib/logger';
20+
import { Logger } from '../cli_plugin/lib/logger';
2121
import { confirm } from '../legacy/server/utils';
2222

2323
export async function create(keystore, command, options) {

src/cli_keystore/create.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import sinon from 'sinon';
4040

4141
import { Keystore } from '../legacy/server/keystore';
4242
import { create } from './create';
43-
import Logger from '../cli_plugin/lib/logger';
43+
import { Logger } from '../cli_plugin/lib/logger';
4444
import * as prompt from '../legacy/server/utils/prompt';
4545

4646
describe('Kibana keystore', () => {

0 commit comments

Comments
 (0)