Frontend: Enable TS IsolatedModules (#95586)

* chore(typescript): enable isolatedModules

* chore(frontend): fix ts errors related to isolated modules
This commit is contained in:
Jack Westbrook 2024-10-31 14:00:32 +01:00 committed by GitHub
parent 7619d9cb11
commit 2bcc46c338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 33 additions and 26 deletions

View File

@ -26,7 +26,7 @@ import {
SortOrder, SortOrder,
} from './richHistoryTypes'; } from './richHistoryTypes';
export { RichHistorySearchFilters, RichHistorySettings, SortOrder }; export { type RichHistorySearchFilters, type RichHistorySettings, SortOrder };
/* /*
* Add queries to rich history. Save only queries within the retention period, or that are starred. * Add queries to rich history. Save only queries within the retention period, or that are starred.

View File

@ -1,4 +1,4 @@
export { HistorySrv, historySrv, RevisionsModel } from './HistorySrv'; export { HistorySrv, historySrv, type RevisionsModel } from './HistorySrv';
export { VersionHistoryTable } from './VersionHistoryTable'; export { VersionHistoryTable } from './VersionHistoryTable';
export { VersionHistoryHeader } from './VersionHistoryHeader'; export { VersionHistoryHeader } from './VersionHistoryHeader';
export { VersionsHistoryButtons } from './VersionHistoryButtons'; export { VersionsHistoryButtons } from './VersionHistoryButtons';

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
export { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace'; export type { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace';
export { SpanBarOptions, SpanBarOptionsData } from '../settings/SpanBarSettings'; export type { SpanBarOptions, SpanBarOptionsData } from '../settings/SpanBarSettings';
export { default as TTraceTimeline } from './TTraceTimeline'; export type { default as TTraceTimeline } from './TTraceTimeline';
export { default as TNil } from './TNil'; export type { default as TNil } from './TNil';
export { SpanLinkFunc, SpanLinkDef } from './links'; export type { SpanLinkFunc, SpanLinkDef } from './links';

View File

@ -10,7 +10,7 @@ import {
VariableHide, VariableHide,
TypedVariableModel, TypedVariableModel,
} from '@grafana/data'; } from '@grafana/data';
export { BaseVariableModel as VariableModel } from '@grafana/data'; export type { BaseVariableModel as VariableModel } from '@grafana/data';
import { TemplateSrv } from '@grafana/runtime'; import { TemplateSrv } from '@grafana/runtime';
import { NEW_VARIABLE_ID } from './constants'; import { NEW_VARIABLE_ID } from './constants';

View File

@ -1,4 +1,4 @@
export { export type {
GrafanaTemplateVariableQueryType, GrafanaTemplateVariableQueryType,
UnknownQuery, UnknownQuery,
AppInsightsMetricNameQuery, AppInsightsMetricNameQuery,

View File

@ -5,14 +5,14 @@ import {
} from './dataquery.gen'; } from './dataquery.gen';
export { export {
QueryEditorPropertyType, QueryEditorPropertyType,
QueryEditorProperty, type QueryEditorProperty,
QueryEditorPropertyExpression, type QueryEditorPropertyExpression,
QueryEditorGroupByExpression, type QueryEditorGroupByExpression,
QueryEditorFunctionExpression, type QueryEditorFunctionExpression,
QueryEditorFunctionParameterExpression, type QueryEditorFunctionParameterExpression,
QueryEditorArrayExpression, type QueryEditorArrayExpression,
QueryEditorExpressionType, QueryEditorExpressionType,
QueryEditorExpression, type QueryEditorExpression,
} from './dataquery.gen'; } from './dataquery.gen';
export interface QueryEditorOperator<T extends QueryEditorOperatorValueType> extends QueryEditorOperatorBase { export interface QueryEditorOperator<T extends QueryEditorOperatorValueType> extends QueryEditorOperatorBase {

View File

@ -19,7 +19,7 @@ import {
} from './dataquery.gen'; } from './dataquery.gen';
export * from './dataquery.gen'; export * from './dataquery.gen';
export { ElasticsearchDataQuery as ElasticsearchQuery } from './dataquery.gen'; export type { ElasticsearchDataQuery as ElasticsearchQuery } from './dataquery.gen';
// We want to extend the settings of the Logs query with additional properties that // We want to extend the settings of the Logs query with additional properties that
// are not part of the schema. This is a workaround, because exporting LogsSettings // are not part of the schema. This is a workaround, because exporting LogsSettings

View File

@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
export { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace'; export type { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace';

View File

@ -33,7 +33,7 @@ export enum LokiVisualQueryOperationCategory {
Formats = 'Formats', Formats = 'Formats',
LineFilters = 'Line filters', LineFilters = 'Line filters',
LabelFilters = 'Label filters', LabelFilters = 'Label filters',
BinaryOps = BINARY_OPERATIONS_KEY, BinaryOps = `${BINARY_OPERATIONS_KEY}`,
} }
export enum LokiOperationId { export enum LokiOperationId {

View File

@ -28,12 +28,12 @@ export const defaultOptions: Partial<Options> = {
}; };
export { export {
Options, type Options,
CandlestickColors, type CandlestickColors,
defaultCandlestickColors, defaultCandlestickColors,
CandleStyle, CandleStyle,
ColorStrategy, ColorStrategy,
VizDisplayMode, VizDisplayMode,
CandlestickFieldMap, type CandlestickFieldMap,
FieldConfig, type FieldConfig,
}; };

View File

@ -53,4 +53,10 @@ export interface MapLayerState<TConfig = unknown> extends LayerElement {
mouseEvents: Subject<FeatureLike | undefined>; mouseEvents: Subject<FeatureLike | undefined>;
} }
export { Options, MapViewConfig, TooltipOptions, TooltipMode, defaultMapViewConfig } from './panelcfg.gen'; export {
type Options,
type MapViewConfig,
type TooltipOptions,
TooltipMode,
defaultMapViewConfig,
} from './panelcfg.gen';

View File

@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
import { DataFrame } from '@grafana/data'; import { DataFrame } from '@grafana/data';
export { Options } from './panelcfg.gen'; export type { Options } from './panelcfg.gen';
type onClickFilterLabelType = (key: string, value: string, frame?: DataFrame) => void; type onClickFilterLabelType = (key: string, value: string, frame?: DataFrame) => void;
type onClickFilterOutLabelType = (key: string, value: string, frame?: DataFrame) => void; type onClickFilterOutLabelType = (key: string, value: string, frame?: DataFrame) => void;

View File

@ -2,7 +2,7 @@ import { SimulationNodeDatum, SimulationLinkDatum } from 'd3-force';
import { DataFrame, Field, IconName } from '@grafana/data'; import { DataFrame, Field, IconName } from '@grafana/data';
export { Options as NodeGraphOptions, ArcOption } from './panelcfg.gen'; export type { Options as NodeGraphOptions, ArcOption } from './panelcfg.gen';
export type NodeDatum = SimulationNodeDatum & { export type NodeDatum = SimulationNodeDatum & {
id: string; id: string;

View File

@ -9,6 +9,7 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"useUnknownInCatchVariables": true, "useUnknownInCatchVariables": true,
"incremental": true, "incremental": true,
"isolatedModules": true,
"tsBuildInfoFile": "./tsconfig.tsbuildinfo", "tsBuildInfoFile": "./tsconfig.tsbuildinfo",
"paths": { "paths": {
"@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"] "@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"]