Skip to content

Commit

Permalink
migrate more core-owned plugins to tsproject ref (#89975)
Browse files Browse the repository at this point in the history
* migrate more plugins to tsproject ref

* revert changes for xpack_legacy

* fix IT
  • Loading branch information
pgayvallet authored Feb 2, 2021
1 parent 7fa30ba commit 762abea
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import { resolve } from 'path';
import execa from 'execa';
import expect from '@kbn/expect';
import shell from 'shelljs';

const ROOT_DIR = resolve(__dirname, '../../../../..');
Expand Down Expand Up @@ -38,11 +37,14 @@ describe('Team Assignment', () => {
describe(`when the codeowners file contains #CC#`, () => {
it(`should strip the prefix and still drill down through the fs`, async () => {
const { stdout } = await execa('grep', ['tre', teamAssignmentsPath], { cwd: ROOT_DIR });
expect(stdout).to.be(`x-pack/plugins/code/jest.config.js kibana-tre
x-pack/plugins/code/server/config.ts kibana-tre
x-pack/plugins/code/server/index.ts kibana-tre
x-pack/plugins/code/server/plugin.test.ts kibana-tre
x-pack/plugins/code/server/plugin.ts kibana-tre`);
const lines = stdout.split('\n').filter((line) => !line.includes('/target'));
expect(lines).toEqual([
'x-pack/plugins/code/jest.config.js kibana-tre',
'x-pack/plugins/code/server/config.ts kibana-tre',
'x-pack/plugins/code/server/index.ts kibana-tre',
'x-pack/plugins/code/server/plugin.test.ts kibana-tre',
'x-pack/plugins/code/server/plugin.ts kibana-tre',
]);
});
});
});
23 changes: 23 additions & 0 deletions src/plugins/kibana_overview/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"public/**/*",
"common/**/*",
],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../../plugins/navigation/tsconfig.json" },
{ "path": "../../plugins/data/tsconfig.json" },
{ "path": "../../plugins/home/tsconfig.json" },
{ "path": "../../plugins/newsfeed/tsconfig.json" },
{ "path": "../../plugins/usage_collection/tsconfig.json" },
{ "path": "../../plugins/kibana_react/tsconfig.json" },
]
}
1 change: 1 addition & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
{ "path": "../src/plugins/expressions/tsconfig.json" },
{ "path": "../src/plugins/home/tsconfig.json" },
{ "path": "../src/plugins/inspector/tsconfig.json" },
{ "path": "../src/plugins/kibana_overview/tsconfig.json" },
{ "path": "../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "../src/plugins/kibana_utils/tsconfig.json" },
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"src/plugins/input_control_vis/**/*",
"src/plugins/inspector/**/*",
"src/plugins/kibana_legacy/**/*",
"src/plugins/kibana_overview/**/*",
"src/plugins/kibana_react/**/*",
"src/plugins/kibana_usage_collection/**/*",
"src/plugins/kibana_utils/**/*",
Expand Down Expand Up @@ -84,6 +85,7 @@
{ "path": "./src/plugins/home/tsconfig.json" },
{ "path": "./src/plugins/inspector/tsconfig.json" },
{ "path": "./src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "./src/plugins/kibana_overview/tsconfig.json" },
{ "path": "./src/plugins/kibana_react/tsconfig.json" },
{ "path": "./src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "./src/plugins/kibana_utils/tsconfig.json" },
Expand Down
1 change: 1 addition & 0 deletions tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{ "path": "./src/plugins/home/tsconfig.json" },
{ "path": "./src/plugins/inspector/tsconfig.json" },
{ "path": "./src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "./src/plugins/kibana_overview/tsconfig.json" },
{ "path": "./src/plugins/kibana_react/tsconfig.json" },
{ "path": "./src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "./src/plugins/kibana_utils/tsconfig.json" },
Expand Down
16 changes: 16 additions & 0 deletions x-pack/plugins/code/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"server/**/*"
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
]
}
2 changes: 2 additions & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
{ "path": "../../src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "../../src/plugins/expressions/tsconfig.json" },
{ "path": "../../src/plugins/home/tsconfig.json" },
{ "path": "../../src/plugins/kibana_overview/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "../../src/plugins/kibana_utils/tsconfig.json" },
Expand All @@ -40,6 +41,7 @@

{ "path": "../plugins/actions/tsconfig.json" },
{ "path": "../plugins/alerts/tsconfig.json" },
{ "path": "../plugins/code/tsconfig.json" },
{ "path": "../plugins/console_extensions/tsconfig.json" },
{ "path": "../plugins/data_enhanced/tsconfig.json" },
{ "path": "../plugins/enterprise_search/tsconfig.json" },
Expand Down
3 changes: 3 additions & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"plugins/apm/scripts/**/*",
"plugins/canvas/**/*",
"plugins/console_extensions/**/*",
"plugins/code/**/*",
"plugins/data_enhanced/**/*",
"plugins/discover_enhanced/**/*",
"plugins/dashboard_enhanced/**/*",
Expand Down Expand Up @@ -67,6 +68,7 @@
{ "path": "../src/plugins/home/tsconfig.json" },
{ "path": "../src/plugins/inspector/tsconfig.json" },
{ "path": "../src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "../src/plugins/kibana_overview/tsconfig.json" },
{ "path": "../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "../src/plugins/kibana_utils/tsconfig.json" },
Expand All @@ -92,6 +94,7 @@
{ "path": "./plugins/beats_management/tsconfig.json" },
{ "path": "./plugins/canvas/tsconfig.json" },
{ "path": "./plugins/cloud/tsconfig.json" },
{ "path": "./plugins/code/tsconfig.json" },
{ "path": "./plugins/console_extensions/tsconfig.json" },
{ "path": "./plugins/data_enhanced/tsconfig.json" },
{ "path": "./plugins/discover_enhanced/tsconfig.json" },
Expand Down
13 changes: 7 additions & 6 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"include": [],
"references": [
{ "path": "./plugins/actions/tsconfig.json"},
{ "path": "./plugins/alerts/tsconfig.json"},
{ "path": "./plugins/actions/tsconfig.json" },
{ "path": "./plugins/alerts/tsconfig.json" },
{ "path": "./plugins/beats_management/tsconfig.json" },
{ "path": "./plugins/canvas/tsconfig.json" },
{ "path": "./plugins/cloud/tsconfig.json" },
{ "path": "./plugins/code/tsconfig.json" },
{ "path": "./plugins/console_extensions/tsconfig.json" },
{ "path": "./plugins/dashboard_enhanced/tsconfig.json" },
{ "path": "./plugins/data_enhanced/tsconfig.json" },
{ "path": "./plugins/discover_enhanced/tsconfig.json" },
{ "path": "./plugins/embeddable_enhanced/tsconfig.json" },
{ "path": "./plugins/encrypted_saved_objects/tsconfig.json" },
{ "path": "./plugins/enterprise_search/tsconfig.json" },
{ "path": "./plugins/event_log/tsconfig.json"},
{ "path": "./plugins/event_log/tsconfig.json" },
{ "path": "./plugins/features/tsconfig.json" },
{ "path": "./plugins/global_search_bar/tsconfig.json" },
{ "path": "./plugins/global_search_providers/tsconfig.json" },
Expand All @@ -31,14 +32,14 @@
{ "path": "./plugins/searchprofiler/tsconfig.json" },
{ "path": "./plugins/security/tsconfig.json" },
{ "path": "./plugins/spaces/tsconfig.json" },
{ "path": "./plugins/stack_alerts/tsconfig.json"},
{ "path": "./plugins/stack_alerts/tsconfig.json" },
{ "path": "./plugins/task_manager/tsconfig.json" },
{ "path": "./plugins/telemetry_collection_xpack/tsconfig.json" },
{ "path": "./plugins/translations/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json"},
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/spaces/tsconfig.json" },
{ "path": "./plugins/security/tsconfig.json" },
{ "path": "./plugins/stack_alerts/tsconfig.json"},
{ "path": "./plugins/stack_alerts/tsconfig.json" },
{ "path": "./plugins/encrypted_saved_objects/tsconfig.json" },
{ "path": "./plugins/beats_management/tsconfig.json" },
{ "path": "./plugins/cloud/tsconfig.json" },
Expand Down

0 comments on commit 762abea

Please sign in to comment.