Skip to content

Commit

Permalink
[Presentation Team] Migrate to Typescript Project References (#86019)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
clintandrewhall and kibanamachine authored Jan 31, 2021
1 parent 841ab70 commit af337ce
Show file tree
Hide file tree
Showing 32 changed files with 190 additions and 75 deletions.
21 changes: 21 additions & 0 deletions src/plugins/input_control_vis/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"public/**/*",
"server/**/*",
],
"references": [
{ "path": "../kibana_react/tsconfig.json" },
{ "path": "../data/tsconfig.json"},
{ "path": "../expressions/tsconfig.json" },
{ "path": "../visualizations/tsconfig.json" },
{ "path": "../vis_default_editor/tsconfig.json" },
]
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"src/plugins/es_ui_shared/**/*",
"src/plugins/expressions/**/*",
"src/plugins/home/**/*",
"src/plugins/input_control_vis/**/*",
"src/plugins/inspector/**/*",
"src/plugins/kibana_legacy/**/*",
"src/plugins/kibana_react/**/*",
Expand Down
11 changes: 5 additions & 6 deletions tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
"include": [],
"references": [
{ "path": "./src/core/tsconfig.json" },
{ "path": "./src/plugins/telemetry_management_section/tsconfig.json" },
{ "path": "./src/plugins/advanced_settings/tsconfig.json" },
{ "path": "./src/plugins/apm_oss/tsconfig.json" },
{ "path": "./src/plugins/bfetch/tsconfig.json" },
{ "path": "./src/plugins/charts/tsconfig.json" },
{ "path": "./src/plugins/console/tsconfig.json" },
{ "path": "./src/plugins/dashboard/tsconfig.json" },
{ "path": "./src/plugins/data/tsconfig.json" },
{ "path": "./src/plugins/dev_tools/tsconfig.json" },
{ "path": "./src/plugins/discover/tsconfig.json" },
{ "path": "./src/plugins/embeddable/tsconfig.json" },
{ "path": "./src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "./src/plugins/expressions/tsconfig.json" },
{ "path": "./src/plugins/home/tsconfig.json" },
{ "path": "./src/plugins/dashboard/tsconfig.json" },
{ "path": "./src/plugins/dev_tools/tsconfig.json" },
{ "path": "./src/plugins/inspector/tsconfig.json" },
{ "path": "./src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "./src/plugins/kibana_react/tsconfig.json" },
Expand All @@ -26,16 +24,17 @@
{ "path": "./src/plugins/maps_legacy/tsconfig.json" },
{ "path": "./src/plugins/navigation/tsconfig.json" },
{ "path": "./src/plugins/newsfeed/tsconfig.json" },
{ "path": "./src/plugins/presentation_util/tsconfig.json" },
{ "path": "./src/plugins/region_map/tsconfig.json" },
{ "path": "./src/plugins/saved_objects/tsconfig.json" },
{ "path": "./src/plugins/saved_objects_management/tsconfig.json" },
{ "path": "./src/plugins/saved_objects_tagging_oss/tsconfig.json" },
{ "path": "./src/plugins/presentation_util/tsconfig.json" },
{ "path": "./src/plugins/saved_objects/tsconfig.json" },
{ "path": "./src/plugins/security_oss/tsconfig.json" },
{ "path": "./src/plugins/share/tsconfig.json" },
{ "path": "./src/plugins/spaces_oss/tsconfig.json" },
{ "path": "./src/plugins/telemetry/tsconfig.json" },
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/telemetry_management_section/tsconfig.json" },
{ "path": "./src/plugins/telemetry/tsconfig.json" },
{ "path": "./src/plugins/tile_map/tsconfig.json" },
{ "path": "./src/plugins/timelion/tsconfig.json" },
{ "path": "./src/plugins/ui_actions/tsconfig.json" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
*/

import { cloneDeep } from 'lodash';
// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import ci from './ci.json';
import { DemoRows } from './demo_rows_types';
// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import shirts from './shirts.json';
import { getFunctionErrors } from '../../../../i18n';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Popover } from '../../../public/components/popover';
import { RendererStrings } from '../../../i18n';
import { RendererFactory } from '../../../types';

interface Config {
export interface Config {
error: Error;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { RendererStrings } from '../../../../i18n';

const { dropdownFilter: strings } = RendererStrings;

interface Config {
export interface Config {
/** The column to use within the exactly function */
column: string;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { RendererFactory, Style, Datatable } from '../../types';

const { dropdownFilter: strings } = RendererStrings;

interface TableArguments {
export interface TableArguments {
font?: Style;
paginate: boolean;
perPage: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WorkpadPage } from '../../../components/workpad_page';
import { Link } from '../../../components/link';
import { CanvasWorkpad } from '../../../../types';

interface Props {
export interface Props {
workpad: CanvasWorkpad;
selectedPageIndex: number;
initializeWorkpad: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { WorkpadManager } from '../../../components/workpad_manager';
// @ts-expect-error untyped local
import { setDocTitle } from '../../../lib/doc_title';

interface Props {
export interface Props {
onLoad: () => void;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface ResolvedArgs {
[keys: string]: any;
}

interface ElementsLoadedTelemetryProps extends PropsFromRedux {
export interface ElementsLoadedTelemetryProps extends PropsFromRedux {
workpad: Workpad;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ComponentStrings } from '../../../i18n';

const { Asset: strings } = ComponentStrings;

interface Props {
export interface Props {
/** The asset to be rendered */
asset: AssetType;
/** The function to execute when the user clicks 'Create' */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { ComponentStrings } from '../../../i18n';

const { AssetManager: strings } = ComponentStrings;

interface Props {
export interface Props {
/** The assets to display within the modal */
assets: AssetType[];
/** Function to invoke when the modal is closed */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EuiConfirmModal, EuiOverlayMask } from '@elastic/eui';
import PropTypes from 'prop-types';
import React, { FunctionComponent } from 'react';

interface Props {
export interface Props {
isOpen: boolean;
title?: string;
message: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DomPreview } from '../dom_preview';
import { PageControls } from './page_controls';
import { CanvasPage } from '../../../types';

interface Props {
export interface Props {
isWriteable: boolean;
page: Pick<CanvasPage, 'id' | 'style'>;
height: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const { Toolbar: strings } = ComponentStrings;

type TrayType = 'pageManager' | 'expression';

interface Props {
export interface Props {
isWriteable: boolean;
selectedElement?: CanvasElement;
selectedPageNumber: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { ComponentStrings } from '../../../i18n';

const { WorkpadConfig: strings } = ComponentStrings;

interface Props {
export interface Props {
size: {
height: number;
width: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ToolTipShortcut } from '../../tool_tip_shortcut';
import { ComponentStrings } from '../../../../i18n';
const { WorkpadHeaderRefreshControlSettings: strings } = ComponentStrings;

interface Props {
export interface Props {
doRefresh: MouseEventHandler<HTMLButtonElement>;
inFlight: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/functions/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ExpressionValueFilter } from '../../types';
import { getFunctionHelp } from '../../i18n';
import { InitializeArguments } from '.';

interface Arguments {
export interface Arguments {
group: string[];
ungrouped: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/functions/pie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface Pie {
options: PieOptions;
}

interface Arguments {
export interface Arguments {
palette: PaletteOutput;
seriesStyle: SeriesStyle[];
radius: number | 'auto';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/functions/plot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getTickHash } from './get_tick_hash';
import { getFunctionHelp } from '../../../i18n';
import { AxisConfig, PointSeries, Render, SeriesStyle, Legend } from '../../../types';

interface Arguments {
export interface Arguments {
seriesStyle: SeriesStyle[];
defaultStyle: SeriesStyle;
palette: PaletteOutput;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/functions/timelion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Datatable, ExpressionValueFilter } from '../../types';
import { getFunctionHelp } from '../../i18n';
import { InitializeArguments } from './';

interface Arguments {
export interface Arguments {
query: string;
interval: string;
from: string;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/functions/to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ExpressionFunctionDefinition } from 'src/plugins/expressions/public';
import { getFunctionHelp, getFunctionErrors } from '../../i18n';
import { InitializeArguments } from '.';

interface Arguments {
export interface Arguments {
type: string[];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { I18nProvider } from '@kbn/i18n/react';
import { ErrorBoundary } from '../components/enhance/error_boundary';
import { ArgumentHandlers } from '../../types/arguments';

interface Props {
export interface Props {
renderError: Function;
}

Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/canvas/server/sample_data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import ecommerceSavedObjects from './ecommerce_saved_objects.json';
// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import flightsSavedObjects from './flights_saved_objects.json';
// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import webLogsSavedObjects from './web_logs_saved_objects.json';
import { loadSampleData } from './load_sample_data';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/shareable_runtime/context/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export enum CanvasShareableActions {
SET_TOOLBAR_AUTOHIDE = 'SET_TOOLBAR_AUTOHIDE',
}

interface FluxAction<T, P> {
export interface FluxAction<T, P> {
type: T;
payload: P;
}
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/canvas/shareable_runtime/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
* you may not use this file except in compliance with the Elastic License.
*/

// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import hello from './workpads/hello.json';
// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import austin from './workpads/austin.json';
// @ts-ignore this file is too large for TypeScript, so it is excluded from our project config
import test from './workpads/test.json';

export * from './utils';
Expand Down
52 changes: 52 additions & 0 deletions x-pack/plugins/canvas/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"../../../typings/**/*",
"__fixtures__/**/*",
"canvas_plugin_src/**/*",
"common/**/*",
"i18n/**/*",
"public/**/*",
"server/**/*",
"shareable_runtime/**/*",
"storybook/**/*",
"tasks/mocks/*",
"types/**/*",
"**/*.json",
],
"exclude": [
// these files are too large and upset tsc, so we exclude them
"server/sample_data/*.json",
"canvas_plugin_src/functions/server/demodata/*.json",
"shareable_runtime/test/workpads/*.json",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/bfetch/tsconfig.json"},
{ "path": "../../../src/plugins/charts/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json"},
{ "path": "../../../src/plugins/discover/tsconfig.json" },
{ "path": "../../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../../src/plugins/expressions/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
{ "path": "../../../src/plugins/inspector/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../../../src/plugins/saved_objects/tsconfig.json" },
{ "path": "../../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../../../src/plugins/visualizations/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../lens/tsconfig.json" },
{ "path": "../maps/tsconfig.json" },
{ "path": "../reporting/tsconfig.json" },
]
}
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/types/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type ExpressionType =
| Style
| Range;

interface ExpressionRenderable {
export interface ExpressionRenderable {
state: 'ready' | 'pending';
value: Render<ExpressionType> | null;
error: null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ReportDocument } from '../../lib/store';
import { TaskRunResult } from '../../lib/tasks';
import { ExportTypeDefinition } from '../../types';

interface ErrorFromPayload {
export interface ErrorFromPayload {
message: string;
}

Expand Down
31 changes: 31 additions & 0 deletions x-pack/plugins/reporting/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"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/discover/tsconfig.json" },
{ "path": "../../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
{ "path": "../../../src/plugins/share/tsconfig.json" },
{ "path": "../../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../security/tsconfig.json" },
{ "path": "../spaces/tsconfig.json" },
]
}
Loading

0 comments on commit af337ce

Please sign in to comment.