Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript project references for Observability plugin #89320

Merged
merged 14 commits into from
Feb 2, 2021
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface IndexDocumentResponse {
result: string;
}

interface GetResponse {
export interface GetResponse {
_id: string;
_index: string;
_source: Annotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { PromiseValueType } from '../../../apm/typings/common';
import type { UnwrapPromise } from '@kbn/utility-types';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!


export function unwrapEsResponse<T extends Promise<{ body: any }>>(
responsePromise: T
): Promise<PromiseValueType<T>['body']> {
): Promise<UnwrapPromise<T>['body']> {
return responsePromise.then((res) => res.body);
}
22 changes: 22 additions & 0 deletions x-pack/plugins/observability/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["common/**/*", "public/**/*", "server/**/*", "typings/**/*"],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../alerts/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../translations/tsconfig.json" }
]
}
1 change: 1 addition & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
{ "path": "../plugins/cloud/tsconfig.json" },
{ "path": "../plugins/saved_objects_tagging/tsconfig.json" },
{ "path": "../plugins/global_search_bar/tsconfig.json" },
{ "path": "../plugins/observability/tsconfig.json" },
{ "path": "../plugins/ingest_pipelines/tsconfig.json" },
{ "path": "../plugins/license_management/tsconfig.json" },
{ "path": "../plugins/painless_lab/tsconfig.json" },
Expand Down
8 changes: 5 additions & 3 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"plugins/maps/**/*",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been alphabetized and some duplicates have been removed.

"plugins/maps_file_upload/**/*",
"plugins/maps_legacy_licensing/**/*",
"plugins/observability/**/*",
"plugins/reporting/**/*",
"plugins/searchprofiler/**/*",
"plugins/security_solution/cypress/**/*",
Expand Down Expand Up @@ -107,6 +108,7 @@
{ "path": "./plugins/licensing/tsconfig.json" },
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/observability/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
Expand All @@ -117,9 +119,9 @@
{ "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/stack_alerts/tsconfig.json"},
{ "path": "./plugins/ingest_pipelines/tsconfig.json"},
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/stack_alerts/tsconfig.json" },
{ "path": "./plugins/ingest_pipelines/tsconfig.json" },
{ "path": "./plugins/license_management/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
Expand Down
23 changes: 7 additions & 16 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"include": [],
"references": [
{ "path": "./plugins/actions/tsconfig.json"},
{ "path": "./plugins/alerts/tsconfig.json"},
{ "path": "./plugins/actions/tsconfig.json" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these files have more changes than necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were duplicates, which weren't breaking anything but weren't necessary.

{ "path": "./plugins/alerts/tsconfig.json" },
{ "path": "./plugins/beats_management/tsconfig.json" },
{ "path": "./plugins/canvas/tsconfig.json" },
{ "path": "./plugins/cloud/tsconfig.json" },
Expand All @@ -13,40 +13,31 @@
{ "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" },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been alphabetized and some duplicates have been removed.

{ "path": "./plugins/global_search/tsconfig.json" },
{ "path": "./plugins/graph/tsconfig.json" },
{ "path": "./plugins/ingest_pipelines/tsconfig.json" },
{ "path": "./plugins/lens/tsconfig.json" },
{ "path": "./plugins/license_management/tsconfig.json" },
{ "path": "./plugins/licensing/tsconfig.json" },
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/observability/tsconfig.json" },
{ "path": "./plugins/reporting/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
{ "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/spaces/tsconfig.json" },
{ "path": "./plugins/security/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" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
{ "path": "./plugins/global_search_bar/tsconfig.json" },
{ "path": "./plugins/ingest_pipelines/tsconfig.json" },
{ "path": "./plugins/license_management/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "./plugins/watcher/tsconfig.json" }
]
Expand Down