From 9b1ef48bf53b797c7d0ce1957d72d85fee6c74ed Mon Sep 17 00:00:00 2001 From: db <77755322+diehbria@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:32:04 -0800 Subject: [PATCH] fix(typescript): re-enables typescript for component package tests * This reverts commit fc5e7a9dc43729ddb6e3590f8d42f30cda522ebb. * fixes regressed typescript type in testing-ground --- packages/components/src/components.d.ts | 52 +++++++++++++++++++ .../testing/testing-ground/testing-ground.tsx | 2 +- packages/components/tsconfig.json | 16 ++---- 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/packages/components/src/components.d.ts b/packages/components/src/components.d.ts index f7f2527d6..34f857b51 100644 --- a/packages/components/src/components.d.ts +++ b/packages/components/src/components.d.ts @@ -83,6 +83,8 @@ export namespace Components { "widgetId": string; "wrapLines": boolean; } + interface IotResourceExplorerDemo { + } interface IotScatterChart { "alarms"?: AlarmsConfig; "annotations": Annotations; @@ -144,6 +146,8 @@ export namespace Components { "viewport": Viewport; "widgetId": string; } + interface IotTestRoutes { + } interface IotTimeSeriesConnector { "annotations": Annotations; "assignDefaultColors": boolean | undefined; @@ -171,9 +175,13 @@ export namespace Components { "sortingDisabled": boolean; "wrapLines": boolean; } + interface IotTreeTableDemo { + } interface IotWebglContext { "viewFrame": HTMLElement | Window | undefined; } + interface TestingGroundAppKit { + } } declare global { interface HTMLIotBarChartElement extends Components.IotBarChart, HTMLStencilElement { @@ -206,6 +214,12 @@ declare global { prototype: HTMLIotResourceExplorerElement; new (): HTMLIotResourceExplorerElement; }; + interface HTMLIotResourceExplorerDemoElement extends Components.IotResourceExplorerDemo, HTMLStencilElement { + } + var HTMLIotResourceExplorerDemoElement: { + prototype: HTMLIotResourceExplorerDemoElement; + new (): HTMLIotResourceExplorerDemoElement; + }; interface HTMLIotScatterChartElement extends Components.IotScatterChart, HTMLStencilElement { } var HTMLIotScatterChartElement: { @@ -230,6 +244,12 @@ declare global { prototype: HTMLIotTableElement; new (): HTMLIotTableElement; }; + interface HTMLIotTestRoutesElement extends Components.IotTestRoutes, HTMLStencilElement { + } + var HTMLIotTestRoutesElement: { + prototype: HTMLIotTestRoutesElement; + new (): HTMLIotTestRoutesElement; + }; interface HTMLIotTimeSeriesConnectorElement extends Components.IotTimeSeriesConnector, HTMLStencilElement { } var HTMLIotTimeSeriesConnectorElement: { @@ -242,25 +262,41 @@ declare global { prototype: HTMLIotTreeTableElement; new (): HTMLIotTreeTableElement; }; + interface HTMLIotTreeTableDemoElement extends Components.IotTreeTableDemo, HTMLStencilElement { + } + var HTMLIotTreeTableDemoElement: { + prototype: HTMLIotTreeTableDemoElement; + new (): HTMLIotTreeTableDemoElement; + }; interface HTMLIotWebglContextElement extends Components.IotWebglContext, HTMLStencilElement { } var HTMLIotWebglContextElement: { prototype: HTMLIotWebglContextElement; new (): HTMLIotWebglContextElement; }; + interface HTMLTestingGroundAppKitElement extends Components.TestingGroundAppKit, HTMLStencilElement { + } + var HTMLTestingGroundAppKitElement: { + prototype: HTMLTestingGroundAppKitElement; + new (): HTMLTestingGroundAppKitElement; + }; interface HTMLElementTagNameMap { "iot-bar-chart": HTMLIotBarChartElement; "iot-kpi": HTMLIotKpiElement; "iot-line-chart": HTMLIotLineChartElement; "iot-react-table": HTMLIotReactTableElement; "iot-resource-explorer": HTMLIotResourceExplorerElement; + "iot-resource-explorer-demo": HTMLIotResourceExplorerDemoElement; "iot-scatter-chart": HTMLIotScatterChartElement; "iot-status-grid": HTMLIotStatusGridElement; "iot-status-timeline": HTMLIotStatusTimelineElement; "iot-table": HTMLIotTableElement; + "iot-test-routes": HTMLIotTestRoutesElement; "iot-time-series-connector": HTMLIotTimeSeriesConnectorElement; "iot-tree-table": HTMLIotTreeTableElement; + "iot-tree-table-demo": HTMLIotTreeTableDemoElement; "iot-webgl-context": HTMLIotWebglContextElement; + "testing-ground-app-kit": HTMLTestingGroundAppKitElement; } } declare namespace LocalJSX { @@ -333,6 +369,8 @@ declare namespace LocalJSX { "widgetId"?: string; "wrapLines"?: boolean; } + interface IotResourceExplorerDemo { + } interface IotScatterChart { "alarms"?: AlarmsConfig; "annotations"?: Annotations; @@ -394,6 +432,8 @@ declare namespace LocalJSX { "viewport": Viewport; "widgetId"?: string; } + interface IotTestRoutes { + } interface IotTimeSeriesConnector { "annotations"?: Annotations; "assignDefaultColors"?: boolean | undefined; @@ -421,22 +461,30 @@ declare namespace LocalJSX { "sortingDisabled"?: boolean; "wrapLines"?: boolean; } + interface IotTreeTableDemo { + } interface IotWebglContext { "viewFrame"?: HTMLElement | Window | undefined; } + interface TestingGroundAppKit { + } interface IntrinsicElements { "iot-bar-chart": IotBarChart; "iot-kpi": IotKpi; "iot-line-chart": IotLineChart; "iot-react-table": IotReactTable; "iot-resource-explorer": IotResourceExplorer; + "iot-resource-explorer-demo": IotResourceExplorerDemo; "iot-scatter-chart": IotScatterChart; "iot-status-grid": IotStatusGrid; "iot-status-timeline": IotStatusTimeline; "iot-table": IotTable; + "iot-test-routes": IotTestRoutes; "iot-time-series-connector": IotTimeSeriesConnector; "iot-tree-table": IotTreeTable; + "iot-tree-table-demo": IotTreeTableDemo; "iot-webgl-context": IotWebglContext; + "testing-ground-app-kit": TestingGroundAppKit; } } export { LocalJSX as JSX }; @@ -448,13 +496,17 @@ declare module "@stencil/core" { "iot-line-chart": LocalJSX.IotLineChart & JSXBase.HTMLAttributes; "iot-react-table": LocalJSX.IotReactTable & JSXBase.HTMLAttributes; "iot-resource-explorer": LocalJSX.IotResourceExplorer & JSXBase.HTMLAttributes; + "iot-resource-explorer-demo": LocalJSX.IotResourceExplorerDemo & JSXBase.HTMLAttributes; "iot-scatter-chart": LocalJSX.IotScatterChart & JSXBase.HTMLAttributes; "iot-status-grid": LocalJSX.IotStatusGrid & JSXBase.HTMLAttributes; "iot-status-timeline": LocalJSX.IotStatusTimeline & JSXBase.HTMLAttributes; "iot-table": LocalJSX.IotTable & JSXBase.HTMLAttributes; + "iot-test-routes": LocalJSX.IotTestRoutes & JSXBase.HTMLAttributes; "iot-time-series-connector": LocalJSX.IotTimeSeriesConnector & JSXBase.HTMLAttributes; "iot-tree-table": LocalJSX.IotTreeTable & JSXBase.HTMLAttributes; + "iot-tree-table-demo": LocalJSX.IotTreeTableDemo & JSXBase.HTMLAttributes; "iot-webgl-context": LocalJSX.IotWebglContext & JSXBase.HTMLAttributes; + "testing-ground-app-kit": LocalJSX.TestingGroundAppKit & JSXBase.HTMLAttributes; } } } diff --git a/packages/components/src/testing/testing-ground/testing-ground.tsx b/packages/components/src/testing/testing-ground/testing-ground.tsx index 4312beada..a8d06d70e 100755 --- a/packages/components/src/testing/testing-ground/testing-ground.tsx +++ b/packages/components/src/testing/testing-ground/testing-ground.tsx @@ -186,7 +186,7 @@ export class TestingGround { const { query } = initialize({ awsCredentials: getEnvCredentials(), awsRegion: 'us-west-2', - settings: { batchDuration: undefined, legacyAPI: false }, + settings: { batchDuration: undefined }, }); this.query = query; } diff --git a/packages/components/tsconfig.json b/packages/components/tsconfig.json index 8e1259ec6..799321c92 100755 --- a/packages/components/tsconfig.json +++ b/packages/components/tsconfig.json @@ -4,10 +4,7 @@ "allowUnreachableCode": false, "declaration": false, "experimentalDecorators": true, - "lib": [ - "dom", - "es2019" - ], + "lib": ["dom", "es2019"], "moduleResolution": "node", "module": "esnext", "target": "es2017", @@ -20,13 +17,6 @@ "skipLibCheck": true, "resolveJsonModule": true }, - "include": [ - "src", - "types/jsx.d.ts", - "cypress" - ], - "exclude": [ - "node_modules", - "src/testing" - ] + "include": ["src", "types/jsx.d.ts", "cypress"], + "exclude": ["node_modules"] }