From 51942eb0cafcc6e013d7de021511ec349199f229 Mon Sep 17 00:00:00 2001 From: Mahmoud Shahrokni Date: Thu, 28 May 2026 16:15:14 +0200 Subject: [PATCH] [ENHANCEMENT] remove core dependency Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni Signed-off-by: Mahmoud Shahrokni --- barchart/package.json | 6 +- barchart/src/BarChartBase.tsx | 10 +- .../src/BarChartOptionsEditorSettings.tsx | 10 +- barchart/src/BarChartPanel.tsx | 4 +- barchart/src/bar-chart-model.ts | 6 +- barchart/src/tresholds.ts | 2 +- clickhouse/package.json | 11 +- .../click-house-datasource-types.ts | 3 +- clickhouse/src/model/click-house-client.ts | 2 +- .../src/model/click-house-data-types.ts | 2 +- .../click-house-log-query-types.ts | 2 +- .../get-click-house-log-data.ts | 2 +- .../log-query-plugin-interface.ts | 2 +- .../click-house-query-types.test.ts | 2 +- .../click-house-query-types.ts | 2 +- .../get-click-house-data.ts | 2 +- datasourcevariable/package.json | 5 +- flamechart/package.json | 6 +- .../src/components/CustomBreadcrumb.tsx | 2 +- flamechart/src/components/FlameChart.tsx | 2 +- flamechart/src/components/FlameChartPanel.tsx | 2 +- flamechart/src/components/SeriesChart.tsx | 2 +- flamechart/src/components/TableChart.tsx | 3 +- flamechart/src/flame-chart-model.ts | 2 +- flamechart/src/utils/data-transform.test.ts | 2 +- flamechart/src/utils/data-transform.ts | 2 +- flamechart/src/utils/format.ts | 5 +- gaugechart/package.json | 6 +- gaugechart/src/GaugeChartBase.tsx | 3 +- .../src/GaugeChartOptionsEditorSettings.tsx | 2 +- gaugechart/src/GaugeChartPanel.tsx | 6 +- gaugechart/src/gauge-chart-model.ts | 5 +- gaugechart/src/thresholds.ts | 2 +- greptimedb/package.json | 9 +- .../greptimedb-datasource-types.ts | 4 +- .../src/model/greptimedb-client.test.ts | 10 +- greptimedb/src/model/greptimedb-client.ts | 2 +- .../get-greptimedb-log-data.ts | 2 +- .../greptimedb-log-query-types.test.ts | 3 +- .../greptimedb-log-query-types.ts | 2 +- .../log-query-plugin-interface.ts | 2 +- .../queries/greptimedb-query-data-model.ts | 2 +- .../greptimedb-query-types.test.ts | 2 +- .../greptimedb-query-types.ts | 2 +- .../get-greptimedb-trace-data.ts | 4 +- .../greptimedb-trace-query-types.ts | 2 +- .../greptimedb-trace-query.test.ts | 2 +- heatmapchart/package.json | 6 +- heatmapchart/rsbuild.config.ts | 2 +- heatmapchart/src/components/HeatMapChart.tsx | 4 +- .../src/components/HeatMapChartPanel.tsx | 2 +- heatmapchart/src/components/HeatMapTooltip.ts | 3 +- heatmapchart/src/heat-map-chart-model.ts | 3 +- heatmapchart/src/utils/data-transform.ts | 3 +- heatmapchart/src/utils/thresholds.ts | 3 +- histogramchart/package.json | 6 +- histogramchart/rsbuild.config.ts | 2 +- .../src/components/HistogramChart.tsx | 4 +- .../src/components/HistogramChartPanel.tsx | 2 +- histogramchart/src/histogram-chart-model.ts | 3 +- histogramchart/src/utils/thresholds.ts | 3 +- jaeger/package.json | 11 +- jaeger/src/model/jaeger-client.ts | 2 +- jaeger/src/model/jaeger-selectors.ts | 2 +- jaeger/src/plugins/get-trace-data.test.ts | 2 +- jaeger/src/plugins/get-trace-data.ts | 4 +- jaeger/src/plugins/jaeger-datasource-types.ts | 2 +- jest.shared.ts | 2 +- logstable/package.json | 8 +- logstable/rsbuild.config.ts | 2 +- .../src/components/LogRow/LogDetailsTable.tsx | 2 +- .../src/components/LogRow/LogRow.test.tsx | 2 +- logstable/src/components/LogRow/LogRow.tsx | 2 +- logstable/src/components/LogsList.tsx | 2 +- .../src/components/VirtualizedLogsList.tsx | 2 +- logstable/src/components/hooks/useSeverity.ts | 2 +- logstable/src/components/utils.ts | 2 +- logstable/src/model.ts | 3 +- logstable/src/utils/copyHelpers.test.ts | 2 +- logstable/src/utils/copyHelpers.ts | 2 +- loki/package.json | 10 +- loki/src/components/logql-extension.ts | 2 +- .../loki-datasource/loki-datasource-types.ts | 2 +- loki/src/model/loki-client.test.ts | 2 +- loki/src/model/loki-client.ts | 2 +- loki/src/model/loki-data-types.ts | 2 +- loki/src/model/loki-selectors.ts | 2 +- .../loki-log-query/get-loki-log-data.ts | 2 +- .../log-query-plugin-interface.ts | 2 +- .../loki-log-query/loki-log-query-types.ts | 2 +- .../get-loki-time-series-data.ts | 2 +- .../loki-time-series-query-types.test.ts | 2 +- .../loki-time-series-query-types.ts | 2 +- markdown/package.json | 6 +- markdown/src/markdown-panel-model.ts | 2 +- package-lock.json | 508 +++++++++++------- package.json | 11 +- piechart/package.json | 6 +- piechart/src/PieChartBase.tsx | 3 +- .../src/PieChartOptionsEditorSettings.tsx | 4 +- piechart/src/PieChartPanel.tsx | 5 +- piechart/src/pie-chart-model.ts | 6 +- piechart/src/utils.ts | 10 +- prometheus/package.json | 11 +- prometheus/src/components/TreeNode.tsx | 3 +- prometheus/src/components/promql/format.tsx | 13 +- prometheus/src/components/promql/serialize.ts | 12 +- prometheus/src/components/query.ts | 3 +- prometheus/src/explore/PrometheusExplorer.tsx | 2 +- .../PrometheusMetricsFinder.tsx | 2 +- .../display/list/MetricList.tsx | 2 +- .../filter/FilterInputs.tsx | 2 +- .../filter/FinderFilters.tsx | 3 +- .../overview/MetricOverview.tsx | 3 +- .../overview/tabs/JobTab.tsx | 2 +- .../overview/tabs/OverviewTab.tsx | 2 +- .../overview/tabs/SimilarTab.tsx | 2 +- .../explore/PrometheusMetricsFinder/types.ts | 2 +- .../explore/PrometheusMetricsFinder/utils.ts | 3 +- prometheus/src/model/api-types.ts | 2 +- prometheus/src/model/prometheus-client.ts | 2 +- prometheus/src/model/prometheus-selectors.ts | 2 +- prometheus/src/model/time.ts | 2 +- .../plugins/PrometheusDatasourceEditor.tsx | 2 +- prometheus/src/plugins/interpolation.ts | 2 +- .../src/plugins/prometheus-datasource.tsx | 3 +- .../get-time-series-data.ts | 6 +- .../plugin.test.ts | 2 +- .../query-editor-model.ts | 2 +- .../replace-prom-builtin-variables.ts | 6 +- .../time-series-query-model.ts | 3 +- prometheus/src/plugins/types.ts | 2 +- pyroscope/package.json | 11 +- pyroscope/src/explore/PyroscopeExplorer.tsx | 2 +- pyroscope/src/model/pyroscope-client.ts | 2 +- pyroscope/src/model/pyroscope-selectors.ts | 2 +- .../plugins/pyroscope-datasource-types.tsx | 2 +- .../get-profile-data.ts | 2 +- pyroscope/src/utils/use-query.ts | 3 +- scatterchart/package.json | 6 +- scatterchart/src/ScatterChartPanel.test.tsx | 2 +- scatterchart/src/ScatterChartPanel.tsx | 2 +- scatterchart/src/Scatterplot.tsx | 3 +- scatterchart/src/mock-trace-data.ts | 2 +- scatterchart/src/scatter-chart-model.ts | 2 +- splunk/package.json | 6 +- .../splunk-datasource-types.ts | 2 +- splunk/src/model/splunk-client.ts | 2 +- .../splunk-log-query/get-splunk-log-data.ts | 2 +- .../log-query-plugin-interface.ts | 2 +- .../splunk-log-query-types.ts | 2 +- .../get-splunk-time-series-data.ts | 2 +- .../splunk-time-series-query-types.ts | 2 +- statchart/package.json | 6 +- statchart/src/StatChartBase.test.tsx | 4 +- statchart/src/StatChartBase.tsx | 3 +- .../src/StatChartOptionsEditorSettings.tsx | 2 +- statchart/src/StatChartPanel.tsx | 11 +- statchart/src/StatChartValueMappingEditor.tsx | 3 +- statchart/src/stat-chart-model.ts | 6 +- statchart/src/utils/calculate-value.ts | 3 +- statchart/src/utils/data-transform.test.ts | 3 +- .../src/utils/format-stat-chart-value.ts | 2 +- statchart/src/utils/get-color.ts | 3 +- staticlistvariable/package.json | 5 +- statushistorychart/package.json | 6 +- .../src/StatusHistoryChartBase.tsx | 2 +- statushistorychart/src/StatusHistoryPanel.tsx | 2 +- .../src/StatusHistoryValueMappingEditor.tsx | 3 +- .../src/status-history-model.ts | 2 +- .../src/utils/data-transform.test.ts | 2 +- .../src/utils/data-transform.ts | 4 +- statushistorychart/src/utils/get-timescale.ts | 3 +- table/package.json | 8 +- table/rsbuild.config.ts | 2 +- table/src/TableExportAction.test.ts | 2 +- table/src/TableExportAction.tsx | 4 +- .../components/ColumnsEditor/ColumnEditor.tsx | 2 +- .../EmbeddedPanelOptionsEditor.tsx | 2 +- table/src/components/EmbeddedPanel.tsx | 2 +- table/src/components/TablePanel.test.tsx | 25 +- table/src/components/TablePanel.tsx | 12 +- .../src/components/TableTransformsEditor.tsx | 3 +- table/src/models/table-model.ts | 4 +- table/src/table-data-utils.ts | 4 +- table/src/test/mock-query-results.ts | 2 +- tempo/package.json | 11 +- tempo/src/components/TraceQLEditor.tsx | 2 +- tempo/src/components/TraceQLExtension.ts | 2 +- tempo/src/explore/TempoExplorer.tsx | 2 +- tempo/src/model/api-types.ts | 3 +- tempo/src/model/tempo-client.ts | 3 +- tempo/src/model/tempo-selectors.ts | 2 +- tempo/src/plugins/plugin.test.ts | 2 +- tempo/src/plugins/tempo-datasource-types.tsx | 2 +- .../tempo-trace-query/get-trace-data.test.ts | 2 +- .../tempo-trace-query/get-trace-data.ts | 3 +- tempo/src/test/mock-data.ts | 2 +- timeserieschart/package.json | 6 +- timeserieschart/src/QuerySettingsEditor.tsx | 3 +- timeserieschart/src/TimeSeriesChartBase.tsx | 5 +- .../src/TimeSeriesChartPanel.test.tsx | 2 +- timeserieschart/src/TimeSeriesChartPanel.tsx | 18 +- .../src/test/mock-query-results.ts | 2 +- .../src/time-series-chart-model.ts | 3 +- timeserieschart/src/utils/data-transform.ts | 11 +- timeseriestable/package.json | 8 +- timeseriestable/rsbuild.config.ts | 2 +- .../src/TimeSeriesTablePanel.test.tsx | 2 +- timeseriestable/src/TimeSeriesTablePanel.tsx | 2 +- timeseriestable/src/components/DataTable.tsx | 2 +- .../src/components/EmbeddedPanel.tsx | 2 +- timeseriestable/src/components/SeriesName.tsx | 2 +- .../src/test/mock-query-results.ts | 2 +- tracetable/package.json | 6 +- tracetable/src/DataTable.tsx | 18 +- tracetable/src/TraceTablePanel.test.tsx | 3 +- tracetable/src/TraceTablePanel.tsx | 2 +- tracetable/src/test/mock-trace-data.ts | 2 +- tracingganttchart/package.json | 6 +- tracingganttchart/src/PanelActions.test.ts | 2 +- tracingganttchart/src/PanelActions.tsx | 3 +- .../DetailPane/Attributes.test.tsx | 2 +- .../DetailPane/Attributes.tsx | 8 +- .../DetailPane/SpanEvents.test.tsx | 3 +- .../DetailPane/SpanLinks.test.tsx | 2 +- .../GanttTable/GanttTable.test.tsx | 2 +- .../GanttTable/SpanDuration.test.tsx | 2 +- .../GanttTable/SpanName.test.tsx | 2 +- .../src/TracingGanttChart/Search.test.tsx | 2 +- .../src/TracingGanttChart/Search.tsx | 2 +- .../src/TracingGanttChart/Ticks.test.tsx | 2 +- .../TracingGanttChart/TraceHeaderBar.test.tsx | 2 +- .../TracingGanttChart/TracingGanttChart.tsx | 2 +- .../src/TracingGanttChart/trace.test.ts | 2 +- .../src/TracingGanttChart/trace.ts | 4 +- .../src/TracingGanttChart/utils.ts | 2 +- .../src/TracingGanttChartPanel.tsx | 2 +- tracingganttchart/src/test/convert/jaeger.ts | 4 +- victorialogs/package.json | 10 +- .../victorialogs-datasource/types.ts | 2 +- victorialogs/src/model/selectors.ts | 2 +- .../victorialogs-log-query/interface.ts | 2 +- .../queries/victorialogs-log-query/query.ts | 2 +- .../queries/victorialogs-log-query/types.ts | 2 +- .../victorialogs-time-series-query/query.ts | 2 +- .../types.test.ts | 4 +- .../victorialogs-time-series-query/types.ts | 2 +- victorialogs/src/variables/utils.ts | 3 +- 249 files changed, 795 insertions(+), 612 deletions(-) diff --git a/barchart/package.json b/barchart/package.json index d4b9328d0..2f2bd4043 100644 --- a/barchart/package.json +++ b/barchart/package.json @@ -27,9 +27,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/barchart/src/BarChartBase.tsx b/barchart/src/BarChartBase.tsx index 6931efb73..5836a769f 100644 --- a/barchart/src/BarChartBase.tsx +++ b/barchart/src/BarChartBase.tsx @@ -12,8 +12,14 @@ // limitations under the License. import { ReactElement, useMemo } from 'react'; -import { EChart, ModeOption, getFormattedAxis, useChartsTheme } from '@perses-dev/components'; -import { FormatOptions, formatValue } from '@perses-dev/core'; +import { + EChart, + FormatOptions, + ModeOption, + formatValue, + getFormattedAxis, + useChartsTheme, +} from '@perses-dev/components'; import { use, EChartsCoreOption } from 'echarts/core'; import { BarChart as EChartsBarChart } from 'echarts/charts'; import { GridComponent, DatasetComponent, TitleComponent, TooltipComponent, LegendComponent } from 'echarts/components'; diff --git a/barchart/src/BarChartOptionsEditorSettings.tsx b/barchart/src/BarChartOptionsEditorSettings.tsx index bac2beba6..27edaf3a3 100644 --- a/barchart/src/BarChartOptionsEditorSettings.tsx +++ b/barchart/src/BarChartOptionsEditorSettings.tsx @@ -24,6 +24,8 @@ import { import { FormatControls, FormatControlsProps, + FormatOptions, + isPercentUnit, ModeOption, ModeSelector, ModeSelectorProps, @@ -34,8 +36,12 @@ import { SortSelector, SortSelectorProps, } from '@perses-dev/components'; -import { CalculationType, DEFAULT_CALCULATION, FormatOptions, isPercentUnit } from '@perses-dev/core'; -import { CalculationSelector, CalculationSelectorProps } from '@perses-dev/plugin-system'; +import { + CalculationSelector, + CalculationSelectorProps, + CalculationType, + DEFAULT_CALCULATION, +} from '@perses-dev/plugin-system'; import { produce } from 'immer'; import merge from 'lodash/merge'; import { MouseEventHandler, ReactElement } from 'react'; diff --git a/barchart/src/BarChartPanel.tsx b/barchart/src/BarChartPanel.tsx index a84d743b0..07a40a4ce 100644 --- a/barchart/src/BarChartPanel.tsx +++ b/barchart/src/BarChartPanel.tsx @@ -14,8 +14,8 @@ import { useChartsTheme } from '@perses-dev/components'; import { Box } from '@mui/material'; import { ReactElement, useMemo } from 'react'; -import { CalculationType, CalculationsMap, TimeSeriesData } from '@perses-dev/core'; -import { PanelProps } from '@perses-dev/plugin-system'; +import { CalculationsMap, CalculationType, PanelProps } from '@perses-dev/plugin-system'; +import { TimeSeriesData } from '@perses-dev/spec'; import { BarChartOptions } from './bar-chart-model'; import { calculatePercentages, sortSeriesData } from './utils'; import { BarChartBase, BarChartData, StackedBarChartData, StackedBarChartSeries } from './BarChartBase'; diff --git a/barchart/src/bar-chart-model.ts b/barchart/src/bar-chart-model.ts index 385b3a02d..f3cbe7bef 100644 --- a/barchart/src/bar-chart-model.ts +++ b/barchart/src/bar-chart-model.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ModeOption, SortOption } from '@perses-dev/components'; -import { CalculationType, DEFAULT_CALCULATION, Definition, FormatOptions } from '@perses-dev/core'; -import { OptionsEditorProps } from '@perses-dev/plugin-system'; +import { FormatOptions, ModeOption, SortOption } from '@perses-dev/components'; +import { CalculationType, DEFAULT_CALCULATION, OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; export const DEFAULT_FORMAT: FormatOptions = { unit: 'decimal', shortValues: true }; export const DEFAULT_SORT: SortOption = 'desc'; diff --git a/barchart/src/tresholds.ts b/barchart/src/tresholds.ts index d49ce8920..6b7292b4b 100644 --- a/barchart/src/tresholds.ts +++ b/barchart/src/tresholds.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { StepOptions, ThresholdColorPalette, ThresholdOptions, FormatOptions } from '@perses-dev/core'; +import { FormatOptions, StepOptions, ThresholdColorPalette, ThresholdOptions } from '@perses-dev/components'; import zip from 'lodash/zip'; export type GaugeColorStop = [number, string]; diff --git a/clickhouse/package.json b/clickhouse/package.json index 99cd9399a..a083ec066 100644 --- a/clickhouse/package.json +++ b/clickhouse/package.json @@ -19,11 +19,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/clickhouse/src/datasources/click-house-datasource/click-house-datasource-types.ts b/clickhouse/src/datasources/click-house-datasource/click-house-datasource-types.ts index 486138bb4..782adbafd 100644 --- a/clickhouse/src/datasources/click-house-datasource/click-house-datasource-types.ts +++ b/clickhouse/src/datasources/click-house-datasource/click-house-datasource-types.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy, RequestHeaders } from '@perses-dev/core'; +import { RequestHeaders } from '@perses-dev/client'; import { DatasourceClient } from '@perses-dev/plugin-system'; +import { HTTPProxy } from '@perses-dev/spec'; export interface ClickHouseDatasourceSpec { directUrl?: string; diff --git a/clickhouse/src/model/click-house-client.ts b/clickhouse/src/model/click-house-client.ts index 363611957..c818a6f8a 100644 --- a/clickhouse/src/model/click-house-client.ts +++ b/clickhouse/src/model/click-house-client.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { RequestHeaders } from '@perses-dev/core'; +import { RequestHeaders } from '@perses-dev/client'; export interface ClickHouseQueryParams { query: string; diff --git a/clickhouse/src/model/click-house-data-types.ts b/clickhouse/src/model/click-house-data-types.ts index f3b71e886..931eab13a 100644 --- a/clickhouse/src/model/click-house-data-types.ts +++ b/clickhouse/src/model/click-house-data-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, TimeSeriesData } from '@perses-dev/core'; +import { LogData, TimeSeriesData } from '@perses-dev/spec'; export interface ClickHouseTimeSeriesData extends TimeSeriesData { logs?: LogData; diff --git a/clickhouse/src/queries/click-house-log-query/click-house-log-query-types.ts b/clickhouse/src/queries/click-house-log-query/click-house-log-query-types.ts index 44399b97e..56621f585 100644 --- a/clickhouse/src/queries/click-house-log-query/click-house-log-query-types.ts +++ b/clickhouse/src/queries/click-house-log-query/click-house-log-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface ClickHouseLogQuerySpec { query: string; diff --git a/clickhouse/src/queries/click-house-log-query/get-click-house-log-data.ts b/clickhouse/src/queries/click-house-log-query/get-click-house-log-data.ts index 5ea71ec56..07c7b9997 100644 --- a/clickhouse/src/queries/click-house-log-query/get-click-house-log-data.ts +++ b/clickhouse/src/queries/click-house-log-query/get-click-house-log-data.ts @@ -12,7 +12,7 @@ // limitations under the License. import { replaceVariables } from '@perses-dev/plugin-system'; -import { LogEntry, LogData } from '@perses-dev/core'; +import { LogData, LogEntry } from '@perses-dev/spec'; import { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client'; import { DEFAULT_DATASOURCE } from '../constants'; import { ClickHouseLogQuerySpec } from './click-house-log-query-types'; diff --git a/clickhouse/src/queries/click-house-log-query/log-query-plugin-interface.ts b/clickhouse/src/queries/click-house-log-query/log-query-plugin-interface.ts index 3ae031699..1722f2e42 100644 --- a/clickhouse/src/queries/click-house-log-query/log-query-plugin-interface.ts +++ b/clickhouse/src/queries/click-house-log-query/log-query-plugin-interface.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange, UnknownSpec, LogData } from '@perses-dev/core'; import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec'; export interface LogQueryResult { logs: LogData; diff --git a/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.test.ts b/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.test.ts index ca1e9f809..9ecff6f12 100644 --- a/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.test.ts +++ b/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.test.ts @@ -12,11 +12,11 @@ // limitations under the License. // TODO: This should be fixed globally in the test setup -import { DatasourceSpec } from '@perses-dev/core'; jest.mock('echarts/core'); import { TimeSeriesQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { ClickHouseDatasource, ClickHouseDatasourceSpec } from '../../datasources'; import { ClickHouseQueryResponse } from '../../model/click-house-client'; import { ClickHouseTimeSeriesQuery } from './ClickHouseQuery'; diff --git a/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.ts b/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.ts index 18fc04376..2e74bd7b1 100644 --- a/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.ts +++ b/clickhouse/src/queries/click-house-time-series-query/click-house-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface ClickHouseTimeSeriesQuerySpec { query: string; diff --git a/clickhouse/src/queries/click-house-time-series-query/get-click-house-data.ts b/clickhouse/src/queries/click-house-time-series-query/get-click-house-data.ts index ec21523f8..4178a48a3 100644 --- a/clickhouse/src/queries/click-house-time-series-query/get-click-house-data.ts +++ b/clickhouse/src/queries/click-house-time-series-query/get-click-house-data.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeries } from '@perses-dev/core'; import { TimeSeriesQueryPlugin, replaceVariables } from '@perses-dev/plugin-system'; +import { TimeSeries } from '@perses-dev/spec'; import { DEFAULT_DATASOURCE } from '../constants'; import { TimeSeriesEntry } from '../../model/click-house-data-types'; import { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client'; diff --git a/datasourcevariable/package.json b/datasourcevariable/package.json index c17c631ea..eee5a9d6e 100644 --- a/datasourcevariable/package.json +++ b/datasourcevariable/package.json @@ -27,9 +27,8 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/flamechart/package.json b/flamechart/package.json index ac8b8331a..f8eec6c9b 100644 --- a/flamechart/package.json +++ b/flamechart/package.json @@ -30,9 +30,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-table": "^8.20.5", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/flamechart/src/components/CustomBreadcrumb.tsx b/flamechart/src/components/CustomBreadcrumb.tsx index f91b8e669..5f9bac4cb 100644 --- a/flamechart/src/components/CustomBreadcrumb.tsx +++ b/flamechart/src/components/CustomBreadcrumb.tsx @@ -18,7 +18,7 @@ import EyeIcon from 'mdi-material-ui/EyeOutline'; import CloseIcon from 'mdi-material-ui/Close'; import Chip from '@mui/material/Chip'; import { emphasize, styled } from '@mui/material/styles'; -import { formatValue } from '@perses-dev/core'; +import { formatValue } from '@perses-dev/components'; export interface CustomBreadcrumbProps { totalValue: string; diff --git a/flamechart/src/components/FlameChart.tsx b/flamechart/src/components/FlameChart.tsx index 06e50db9d..626bef656 100644 --- a/flamechart/src/components/FlameChart.tsx +++ b/flamechart/src/components/FlameChart.tsx @@ -19,12 +19,12 @@ import { } from 'echarts'; import { Stack, Box, Menu, MenuItem, Divider, useTheme } from '@mui/material'; import { ReactElement, useState, useMemo, MouseEvent } from 'react'; -import { ProfileData } from '@perses-dev/core'; import { useChartsTheme, EChart, MouseEventsParameters } from '@perses-dev/components'; import RefreshIcon from 'mdi-material-ui/Refresh'; import EyeIcon from 'mdi-material-ui/EyeOutline'; import ContentCopyIcon from 'mdi-material-ui/ContentCopy'; import { EChartsCoreOption } from 'echarts/core'; +import { ProfileData } from '@perses-dev/spec'; import { buildSamples, findTotalSampleByName } from '../utils/data-transform'; import { generateTooltip } from '../utils/tooltip'; import { FlameChartSample as Sample } from '../utils/data-model'; diff --git a/flamechart/src/components/FlameChartPanel.tsx b/flamechart/src/components/FlameChartPanel.tsx index db1042578..179ab7ac0 100644 --- a/flamechart/src/components/FlameChartPanel.tsx +++ b/flamechart/src/components/FlameChartPanel.tsx @@ -15,8 +15,8 @@ import { TitleComponentOption } from 'echarts'; import { useChartsTheme } from '@perses-dev/components'; import { Stack, Typography, SxProps, useMediaQuery, useTheme } from '@mui/material'; import { FC, useState, useEffect, useMemo } from 'react'; -import { ProfileData, StackTrace } from '@perses-dev/core'; import { PanelProps } from '@perses-dev/plugin-system'; +import { ProfileData, StackTrace } from '@perses-dev/spec'; import { FlameChartOptions } from '../flame-chart-model'; import { filterStackTraceById, getMaxDepth } from '../utils/data-transform'; import { FlameChart } from './FlameChart'; diff --git a/flamechart/src/components/SeriesChart.tsx b/flamechart/src/components/SeriesChart.tsx index 8e32c2ded..30b3b3c3c 100644 --- a/flamechart/src/components/SeriesChart.tsx +++ b/flamechart/src/components/SeriesChart.tsx @@ -13,12 +13,12 @@ import { ReactElement, useMemo, useRef } from 'react'; import { Stack, useTheme } from '@mui/material'; -import { ProfileData, Timeline } from '@perses-dev/core'; import { useChartsTheme, EChart, ZoomEventData, OnEventsType, enableDataZoom } from '@perses-dev/components'; import { useTimeRange } from '@perses-dev/plugin-system'; import type { EChartsCoreOption, LineSeriesOption } from 'echarts'; import { ECharts as EChartsInstance } from 'echarts/core'; import { CallbackDataParams } from 'echarts/types/dist/shared'; +import { ProfileData, Timeline } from '@perses-dev/spec'; import { formatItemValue } from '../utils/format'; import { getSeriesTooltip } from '../utils/series-tooltip'; import { SeriesSample } from '../utils/data-model'; diff --git a/flamechart/src/components/TableChart.tsx b/flamechart/src/components/TableChart.tsx index 9478a9a8c..63b149e9b 100644 --- a/flamechart/src/components/TableChart.tsx +++ b/flamechart/src/components/TableChart.tsx @@ -13,9 +13,10 @@ import { ReactElement, useMemo, useState } from 'react'; import { Stack, useTheme, Link } from '@mui/material'; -import { ProfileData } from '@perses-dev/core'; + import { Table, TableColumnConfig } from '@perses-dev/components'; import { SortingState } from '@tanstack/react-table'; +import { ProfileData } from '@perses-dev/spec'; import { tableRecursionJson } from '../utils/data-transform'; import { TableChartSample } from '../utils/data-model'; import { formatItemValue } from '../utils/format'; diff --git a/flamechart/src/flame-chart-model.ts b/flamechart/src/flame-chart-model.ts index c9af2cc51..a561fffdb 100644 --- a/flamechart/src/flame-chart-model.ts +++ b/flamechart/src/flame-chart-model.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition } from '@perses-dev/core'; import { OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; /** * The schema for a FlameChart panel. diff --git a/flamechart/src/utils/data-transform.test.ts b/flamechart/src/utils/data-transform.test.ts index 2a111af85..f17324534 100644 --- a/flamechart/src/utils/data-transform.test.ts +++ b/flamechart/src/utils/data-transform.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { StackTrace } from '@perses-dev/core'; +import { StackTrace } from '@perses-dev/spec'; import { FlameChartSample as Sample } from './data-model'; import { filterStackTraceById, buildSamples } from './data-transform'; import { getSpanColor } from './palette-gen'; diff --git a/flamechart/src/utils/data-transform.ts b/flamechart/src/utils/data-transform.ts index c13d6edb4..5059f6625 100644 --- a/flamechart/src/utils/data-transform.ts +++ b/flamechart/src/utils/data-transform.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ProfileMetaData, StackTrace } from '@perses-dev/core'; +import { ProfileMetaData, StackTrace } from '@perses-dev/spec'; import { FlameChartSample as Sample, TableChartSample } from './data-model'; import { getSpanColor } from './palette-gen'; import { formatItemValue } from './format'; diff --git a/flamechart/src/utils/format.ts b/flamechart/src/utils/format.ts index 5f6515ad9..fd1464b1b 100644 --- a/flamechart/src/utils/format.ts +++ b/flamechart/src/utils/format.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { msToPrometheusDuration, formatDuration, formatValue } from '@perses-dev/core'; +import { formatValue } from '@perses-dev/components'; +import { convertTimeToDuration, formatDuration } from '@perses-dev/spec'; export function formatNanoDuration(value: number): string { // The value to format is in nanoseconds @@ -20,7 +21,7 @@ export function formatNanoDuration(value: number): string { } else if (value < 1_000_000) { return formatValue(value / 1_000, { unit: 'decimal', decimalPlaces: 2, shortValues: true }) + 'μs'; } else { - return formatDuration(msToPrometheusDuration(value / 1_000_000)); + return formatDuration(convertTimeToDuration(value / 1_000_000)); } } diff --git a/gaugechart/package.json b/gaugechart/package.json index ce80bc2b5..b33f2e62c 100644 --- a/gaugechart/package.json +++ b/gaugechart/package.json @@ -27,9 +27,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/gaugechart/src/GaugeChartBase.tsx b/gaugechart/src/GaugeChartBase.tsx index 3f19fe2ae..d56a5752f 100644 --- a/gaugechart/src/GaugeChartBase.tsx +++ b/gaugechart/src/GaugeChartBase.tsx @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { EChart, useChartsTheme, useDeepMemo } from '@perses-dev/components'; -import { formatValue, FormatOptions } from '@perses-dev/core'; +import { EChart, FormatOptions, formatValue, useChartsTheme, useDeepMemo } from '@perses-dev/components'; import { use, EChartsCoreOption } from 'echarts/core'; import { GaugeChart as EChartsGaugeChart, GaugeSeriesOption } from 'echarts/charts'; import { GridComponent, TitleComponent, TooltipComponent } from 'echarts/components'; diff --git a/gaugechart/src/GaugeChartOptionsEditorSettings.tsx b/gaugechart/src/GaugeChartOptionsEditorSettings.tsx index 6e8fd7b56..b52b5ea89 100644 --- a/gaugechart/src/GaugeChartOptionsEditorSettings.tsx +++ b/gaugechart/src/GaugeChartOptionsEditorSettings.tsx @@ -19,9 +19,9 @@ import { OptionsEditorControl, OptionsEditorGrid, OptionsEditorGroup, + ThresholdOptions, ThresholdsEditor, } from '@perses-dev/components'; -import { ThresholdOptions } from '@perses-dev/core'; import { CalculationSelector, CalculationSelectorProps } from '@perses-dev/plugin-system'; import { produce } from 'immer'; import merge from 'lodash/merge'; diff --git a/gaugechart/src/GaugeChartPanel.tsx b/gaugechart/src/GaugeChartPanel.tsx index ac9b0fd90..3ee76faea 100644 --- a/gaugechart/src/GaugeChartPanel.tsx +++ b/gaugechart/src/GaugeChartPanel.tsx @@ -12,12 +12,12 @@ // limitations under the License. import { Box, Skeleton, Stack } from '@mui/material'; -import { useChartsTheme } from '@perses-dev/components'; -import { CalculationsMap, DEFAULT_CALCULATION, FormatOptions, formatValue, TimeSeriesData } from '@perses-dev/core'; -import { PanelProps } from '@perses-dev/plugin-system'; +import { FormatOptions, formatValue, useChartsTheme } from '@perses-dev/components'; +import { CalculationsMap, DEFAULT_CALCULATION, PanelProps } from '@perses-dev/plugin-system'; import type { GaugeSeriesOption } from 'echarts'; import merge from 'lodash/merge'; import { ReactElement, useMemo } from 'react'; +import { TimeSeriesData } from '@perses-dev/spec'; import { DEFAULT_FORMAT, DEFAULT_MAX_PERCENT, diff --git a/gaugechart/src/gauge-chart-model.ts b/gaugechart/src/gauge-chart-model.ts index 53cce09a0..d76e1853d 100644 --- a/gaugechart/src/gauge-chart-model.ts +++ b/gaugechart/src/gauge-chart-model.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CalculationType, Definition, ThresholdOptions, FormatOptions } from '@perses-dev/core'; -import { OptionsEditorProps } from '@perses-dev/plugin-system'; +import { FormatOptions, ThresholdOptions } from '@perses-dev/components'; +import { CalculationType, OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; export const DEFAULT_FORMAT: FormatOptions = { unit: 'percent-decimal' }; export const DEFAULT_MAX_PERCENT = 100; diff --git a/gaugechart/src/thresholds.ts b/gaugechart/src/thresholds.ts index 1b2dca3a5..2d636ca92 100644 --- a/gaugechart/src/thresholds.ts +++ b/gaugechart/src/thresholds.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { StepOptions, ThresholdColorPalette, ThresholdOptions, FormatOptions } from '@perses-dev/core'; +import { FormatOptions, StepOptions, ThresholdColorPalette, ThresholdOptions } from '@perses-dev/components'; import zip from 'lodash/zip'; export type GaugeColorStop = [number, string]; diff --git a/greptimedb/package.json b/greptimedb/package.json index 071c2fd7f..699139cf9 100644 --- a/greptimedb/package.json +++ b/greptimedb/package.json @@ -19,10 +19,11 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/greptimedb/src/datasources/greptimedb-datasource/greptimedb-datasource-types.ts b/greptimedb/src/datasources/greptimedb-datasource/greptimedb-datasource-types.ts index b38c03c8f..46d0ab282 100644 --- a/greptimedb/src/datasources/greptimedb-datasource/greptimedb-datasource-types.ts +++ b/greptimedb/src/datasources/greptimedb-datasource/greptimedb-datasource-types.ts @@ -11,8 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy, RequestHeaders } from '@perses-dev/core'; import { DatasourceClient } from '@perses-dev/plugin-system'; + +import { RequestHeaders } from '@perses-dev/client'; +import { HTTPProxy } from '@perses-dev/spec'; import { GreptimeDBResponseData } from '../../model/greptimedb-data-types'; export interface GreptimeDBDatasourceSpec { diff --git a/greptimedb/src/model/greptimedb-client.test.ts b/greptimedb/src/model/greptimedb-client.test.ts index 43a237465..7a10c7222 100644 --- a/greptimedb/src/model/greptimedb-client.test.ts +++ b/greptimedb/src/model/greptimedb-client.test.ts @@ -11,17 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch } from '@perses-dev/core'; import { greptimedbQuery } from './greptimedb-client'; -jest.mock('@perses-dev/core', () => { - const actual = jest.requireActual('@perses-dev/core'); - return { - ...actual, - fetch: jest.fn(), - }; -}); - +global.fetch = jest.fn(); const mockFetch = fetch as jest.MockedFunction; const queryOptions = { datasourceUrl: 'http://greptimedb.test' }; diff --git a/greptimedb/src/model/greptimedb-client.ts b/greptimedb/src/model/greptimedb-client.ts index 32038e7fd..e5eb67b09 100644 --- a/greptimedb/src/model/greptimedb-client.ts +++ b/greptimedb/src/model/greptimedb-client.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch, RequestHeaders } from '@perses-dev/core'; +import { RequestHeaders } from '@perses-dev/client'; import { GreptimeDBDatasourceResponse, GreptimeDBQueryRequestParameters } from '../datasources/greptimedb-datasource'; import { GreptimeDBResponseData } from './greptimedb-data-types'; diff --git a/greptimedb/src/queries/greptimedb-log-query/get-greptimedb-log-data.ts b/greptimedb/src/queries/greptimedb-log-query/get-greptimedb-log-data.ts index 37f4526fa..a8b948f1e 100644 --- a/greptimedb/src/queries/greptimedb-log-query/get-greptimedb-log-data.ts +++ b/greptimedb/src/queries/greptimedb-log-query/get-greptimedb-log-data.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, LogEntry } from '@perses-dev/core'; +import { LogData, LogEntry } from '@perses-dev/spec'; import { GreptimeDBClient, GreptimeDBQueryResponse } from '../../model/greptimedb-client'; import { DEFAULT_DATASOURCE } from '../constants'; import { diff --git a/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.test.ts b/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.test.ts index 60e855611..f58b66429 100644 --- a/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.test.ts +++ b/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.test.ts @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSpec } from '@perses-dev/core'; - +import { DatasourceSpec } from '@perses-dev/spec'; import { GreptimeDBDatasource, GreptimeDBDatasourceSpec } from '../../datasources'; import { GreptimeDBQueryResponse } from '../../model/greptimedb-client'; import { GreptimeDBLogQuery } from './GreptimeDBLogQuery'; diff --git a/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.ts b/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.ts index b36ff1b1d..75b939fa2 100644 --- a/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.ts +++ b/greptimedb/src/queries/greptimedb-log-query/greptimedb-log-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface GreptimeDBLogQuerySpec { query: string; diff --git a/greptimedb/src/queries/greptimedb-log-query/log-query-plugin-interface.ts b/greptimedb/src/queries/greptimedb-log-query/log-query-plugin-interface.ts index 08c5a9a7a..bf911b159 100644 --- a/greptimedb/src/queries/greptimedb-log-query/log-query-plugin-interface.ts +++ b/greptimedb/src/queries/greptimedb-log-query/log-query-plugin-interface.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/core'; import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec'; export interface LogQueryResult { logs: LogData; diff --git a/greptimedb/src/queries/greptimedb-query-data-model.ts b/greptimedb/src/queries/greptimedb-query-data-model.ts index b4a939939..ae492b686 100644 --- a/greptimedb/src/queries/greptimedb-query-data-model.ts +++ b/greptimedb/src/queries/greptimedb-query-data-model.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange } from '@perses-dev/core'; import { replaceVariables, VariableStateMap } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange } from '@perses-dev/spec'; import { GreptimeDBColumnSchema, GreptimeDBRecords, GreptimeDBResponseData } from '../model/greptimedb-data-types'; export type { GreptimeDBColumnSchema, GreptimeDBRecords, GreptimeDBResponseData }; diff --git a/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.test.ts b/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.test.ts index 68af3d716..4ed391e3d 100644 --- a/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.test.ts +++ b/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.test.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSpec } from '@perses-dev/core'; import { TimeSeriesQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { GreptimeDBDatasource, GreptimeDBDatasourceSpec } from '../../datasources'; import { GreptimeDBQueryResponse } from '../../model/greptimedb-client'; import { GreptimeDBTimeSeriesQuery } from './GreptimeDBQuery'; diff --git a/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.ts b/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.ts index 41df73337..cb7d69e3c 100644 --- a/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.ts +++ b/greptimedb/src/queries/greptimedb-time-series-query/greptimedb-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface GreptimeDBTimeSeriesQuerySpec { query: string; diff --git a/greptimedb/src/queries/greptimedb-trace-query/get-greptimedb-trace-data.ts b/greptimedb/src/queries/greptimedb-trace-query/get-greptimedb-trace-data.ts index a38f4619b..6e4c8914a 100644 --- a/greptimedb/src/queries/greptimedb-trace-query/get-greptimedb-trace-data.ts +++ b/greptimedb/src/queries/greptimedb-trace-query/get-greptimedb-trace-data.ts @@ -11,8 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { otlpcommonv1, otlptracev1, TraceSearchResult } from '@perses-dev/core'; import { replaceVariables, TraceQueryPlugin } from '@perses-dev/plugin-system'; +import { TraceSearchResult } from '@perses-dev/spec'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; +import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; import { GreptimeDBClient, GreptimeDBQueryResponse } from '../../model/greptimedb-client'; import { DEFAULT_DATASOURCE } from '../constants'; import { diff --git a/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query-types.ts b/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query-types.ts index 48ba23521..1e51ee2b8 100644 --- a/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query-types.ts +++ b/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface GreptimeDBTraceQuerySpec { query: string; diff --git a/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query.test.ts b/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query.test.ts index ae53701a2..987c33c5c 100644 --- a/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query.test.ts +++ b/greptimedb/src/queries/greptimedb-trace-query/greptimedb-trace-query.test.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSpec } from '@perses-dev/core'; import { TraceQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { GreptimeDBDatasource, GreptimeDBDatasourceSpec } from '../../datasources'; import { GreptimeDBQueryResponse } from '../../model/greptimedb-client'; import { GreptimeDBTraceQuery } from './GreptimeDBTraceQuery'; diff --git a/heatmapchart/package.json b/heatmapchart/package.json index 3c30e3569..506b9dc83 100644 --- a/heatmapchart/package.json +++ b/heatmapchart/package.json @@ -24,9 +24,9 @@ "module": "lib/index.js", "types": "lib/index.d.ts", "peerDependencies": { - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "echarts": "5.5.0", "lodash": "^4.17.21", "react": "^17.0.2 || ^18.0.0", diff --git a/heatmapchart/rsbuild.config.ts b/heatmapchart/rsbuild.config.ts index b06ec8145..920658ca0 100644 --- a/heatmapchart/rsbuild.config.ts +++ b/heatmapchart/rsbuild.config.ts @@ -29,7 +29,7 @@ export default createConfigForPlugin({ 'react-dom': { requiredVersion: '18.2.0', singleton: true }, echarts: { singleton: true }, lodash: { singleton: true }, - '@perses-dev/core': { singleton: true }, + '@perses-dev/spec': { singleton: true }, '@perses-dev/components': { singleton: true }, '@perses-dev/plugin-system': { singleton: true }, immer: { singleton: true }, diff --git a/heatmapchart/src/components/HeatMapChart.tsx b/heatmapchart/src/components/HeatMapChart.tsx index cf1ac5a37..a52cf9dc4 100644 --- a/heatmapchart/src/components/HeatMapChart.tsx +++ b/heatmapchart/src/components/HeatMapChart.tsx @@ -12,13 +12,13 @@ // limitations under the License. import { ReactElement, useMemo } from 'react'; -import { formatValue, FormatOptions, TimeScale } from '@perses-dev/core'; -import { EChart, useChartsTheme, useTimeZone } from '@perses-dev/components'; +import { EChart, FormatOptions, formatValue, useChartsTheme, useTimeZone } from '@perses-dev/components'; import { use, EChartsCoreOption } from 'echarts/core'; import { CustomChart } from 'echarts/charts'; import type { CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams } from 'echarts'; import { useTheme } from '@mui/material'; import { CustomSeriesRenderItemReturn } from 'echarts/types/dist/echarts'; +import { TimeScale } from '@perses-dev/spec'; import { LOG_BASE } from '../heat-map-chart-model'; import { getFormattedHeatmapAxisLabel } from '../utils'; import { generateTooltipHTML } from './HeatMapTooltip'; diff --git a/heatmapchart/src/components/HeatMapChartPanel.tsx b/heatmapchart/src/components/HeatMapChartPanel.tsx index 6111334e2..4c8ec7751 100644 --- a/heatmapchart/src/components/HeatMapChartPanel.tsx +++ b/heatmapchart/src/components/HeatMapChartPanel.tsx @@ -12,10 +12,10 @@ // limitations under the License. import { Stack, Typography } from '@mui/material'; -import { TimeScale, TimeSeries, TimeSeriesData } from '@perses-dev/core'; import { PanelProps } from '@perses-dev/plugin-system'; import merge from 'lodash/merge'; import { ReactElement, useMemo } from 'react'; +import { TimeScale, TimeSeries, TimeSeriesData } from '@perses-dev/spec'; import { DEFAULT_FORMAT, HeatMapChartOptions, LOG_BASE } from '../heat-map-chart-model'; import { generateCompleteTimestamps, getCommonTimeScaleForQueries } from '../utils'; import { HeatMapChart, HeatMapDataItem } from './HeatMapChart'; diff --git a/heatmapchart/src/components/HeatMapTooltip.ts b/heatmapchart/src/components/HeatMapTooltip.ts index e429e0a9d..d6bac4a0e 100644 --- a/heatmapchart/src/components/HeatMapTooltip.ts +++ b/heatmapchart/src/components/HeatMapTooltip.ts @@ -12,8 +12,7 @@ // limitations under the License. import { css, Theme } from '@mui/material'; -import { getDateAndTime } from '@perses-dev/components'; -import { FormatOptions, formatValue } from '@perses-dev/core'; +import { FormatOptions, formatValue, getDateAndTime } from '@perses-dev/components'; import { HeatMapData } from './HeatMapChart'; interface CustomTooltipProps { diff --git a/heatmapchart/src/heat-map-chart-model.ts b/heatmapchart/src/heat-map-chart-model.ts index 0ea2ed714..d828f5a8e 100644 --- a/heatmapchart/src/heat-map-chart-model.ts +++ b/heatmapchart/src/heat-map-chart-model.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition, FormatOptions } from '@perses-dev/core'; +import { FormatOptions } from '@perses-dev/components'; import { OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; export const DEFAULT_FORMAT: FormatOptions = { unit: 'decimal' }; export const DEFAULT_MIN_PERCENT = 0; diff --git a/heatmapchart/src/utils/data-transform.ts b/heatmapchart/src/utils/data-transform.ts index 3ad73762f..79e039eb2 100644 --- a/heatmapchart/src/utils/data-transform.ts +++ b/heatmapchart/src/utils/data-transform.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { getCommonTimeScale, TimeScale, TimeSeriesData } from '@perses-dev/core'; +import { getCommonTimeScale } from '@perses-dev/components'; import { PanelData } from '@perses-dev/plugin-system'; +import { TimeScale, TimeSeriesData } from '@perses-dev/spec'; export function getCommonTimeScaleForQueries(queries: Array>): TimeScale | undefined { const seriesData = queries.map((query) => query.data); diff --git a/heatmapchart/src/utils/thresholds.ts b/heatmapchart/src/utils/thresholds.ts index cd2900125..334101fbc 100644 --- a/heatmapchart/src/utils/thresholds.ts +++ b/heatmapchart/src/utils/thresholds.ts @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ThresholdOptions } from '@perses-dev/core'; -import { PersesChartsTheme } from '@perses-dev/components'; +import { PersesChartsTheme, ThresholdOptions } from '@perses-dev/components'; export function getColorFromThresholds( value: number, diff --git a/histogramchart/package.json b/histogramchart/package.json index 51d203e5f..b490a245c 100644 --- a/histogramchart/package.json +++ b/histogramchart/package.json @@ -24,9 +24,9 @@ "module": "lib/index.js", "types": "lib/index.d.ts", "peerDependencies": { - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "echarts": "5.5.0", "lodash": "^4.17.21", "react": "^17.0.2 || ^18.0.0", diff --git a/histogramchart/rsbuild.config.ts b/histogramchart/rsbuild.config.ts index 256822210..f5c41edbf 100644 --- a/histogramchart/rsbuild.config.ts +++ b/histogramchart/rsbuild.config.ts @@ -29,7 +29,7 @@ export default createConfigForPlugin({ 'react-dom': { requiredVersion: '18.2.0', singleton: true }, echarts: { singleton: true }, lodash: { singleton: true }, - '@perses-dev/core': { singleton: true }, + '@perses-dev/spec': { singleton: true }, '@perses-dev/components': { singleton: true }, '@perses-dev/plugin-system': { singleton: true }, immer: { singleton: true }, diff --git a/histogramchart/src/components/HistogramChart.tsx b/histogramchart/src/components/HistogramChart.tsx index 3cdfb550e..5266389c6 100644 --- a/histogramchart/src/components/HistogramChart.tsx +++ b/histogramchart/src/components/HistogramChart.tsx @@ -12,12 +12,12 @@ // limitations under the License. import { ReactElement, useMemo } from 'react'; -import { FormatOptions, BucketTuple, ThresholdOptions } from '@perses-dev/core'; -import { EChart, getFormattedAxis, useChartsTheme } from '@perses-dev/components'; +import { EChart, FormatOptions, getFormattedAxis, ThresholdOptions, useChartsTheme } from '@perses-dev/components'; import { use, EChartsCoreOption } from 'echarts/core'; import { CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams } from 'echarts'; import { CustomChart } from 'echarts/charts'; import { CustomSeriesRenderItemReturn } from 'echarts/types/dist/echarts'; +import { BucketTuple } from '@perses-dev/spec'; import { getColorFromThresholds } from '../utils'; import { LOG_BASE } from '../histogram-chart-model'; diff --git a/histogramchart/src/components/HistogramChartPanel.tsx b/histogramchart/src/components/HistogramChartPanel.tsx index af131b89e..c4f1483ac 100644 --- a/histogramchart/src/components/HistogramChartPanel.tsx +++ b/histogramchart/src/components/HistogramChartPanel.tsx @@ -12,11 +12,11 @@ // limitations under the License. import { Box, Stack, Typography } from '@mui/material'; -import { TimeSeriesData } from '@perses-dev/core'; import { PanelProps } from '@perses-dev/plugin-system'; import merge from 'lodash/merge'; import { ReactElement, useMemo } from 'react'; import { useChartsTheme } from '@perses-dev/components'; +import { TimeSeriesData } from '@perses-dev/spec'; import { DEFAULT_FORMAT, DEFAULT_THRESHOLDS, HistogramChartOptions } from '../histogram-chart-model'; import { HistogramChart, HistogramChartData } from './HistogramChart'; diff --git a/histogramchart/src/histogram-chart-model.ts b/histogramchart/src/histogram-chart-model.ts index e52e1211d..e33475d93 100644 --- a/histogramchart/src/histogram-chart-model.ts +++ b/histogramchart/src/histogram-chart-model.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition, FormatOptions, ThresholdOptions } from '@perses-dev/core'; +import { FormatOptions, ThresholdOptions } from '@perses-dev/components'; import { OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; export const DEFAULT_FORMAT: FormatOptions = { unit: 'decimal' }; export const DEFAULT_THRESHOLDS: ThresholdOptions = { defaultColor: '#56b4e9' }; diff --git a/histogramchart/src/utils/thresholds.ts b/histogramchart/src/utils/thresholds.ts index cd2900125..334101fbc 100644 --- a/histogramchart/src/utils/thresholds.ts +++ b/histogramchart/src/utils/thresholds.ts @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ThresholdOptions } from '@perses-dev/core'; -import { PersesChartsTheme } from '@perses-dev/components'; +import { PersesChartsTheme, ThresholdOptions } from '@perses-dev/components'; export function getColorFromThresholds( value: number, diff --git a/jaeger/package.json b/jaeger/package.json index 21e3efb87..f41ff81ab 100644 --- a/jaeger/package.json +++ b/jaeger/package.json @@ -27,11 +27,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/jaeger/src/model/jaeger-client.ts b/jaeger/src/model/jaeger-client.ts index d0ae4b2fc..676ad06f1 100644 --- a/jaeger/src/model/jaeger-client.ts +++ b/jaeger/src/model/jaeger-client.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch, RequestHeaders } from '@perses-dev/core'; import { DatasourceClient } from '@perses-dev/plugin-system'; +import { RequestHeaders } from '@perses-dev/client'; import { JaegerApiResponse, JaegerOperation, JaegerSearchRequestParameters, JaegerTrace } from './api-types'; interface JaegerClientOptions { diff --git a/jaeger/src/model/jaeger-selectors.ts b/jaeger/src/model/jaeger-selectors.ts index 9ed121304..d239d2646 100644 --- a/jaeger/src/model/jaeger-selectors.ts +++ b/jaeger/src/model/jaeger-selectors.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { DatasourceSelectValue, isVariableDatasource } from '@perses-dev/plugin-system'; +import { DatasourceSelector } from '@perses-dev/spec'; export const JAEGER_DATASOURCE_KIND = 'JaegerDatasource' as const; diff --git a/jaeger/src/plugins/get-trace-data.test.ts b/jaeger/src/plugins/get-trace-data.test.ts index 9ae0fad1f..4848f90ff 100644 --- a/jaeger/src/plugins/get-trace-data.test.ts +++ b/jaeger/src/plugins/get-trace-data.test.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSpec } from '@perses-dev/core'; import { replaceVariables, TraceQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { JaegerClient } from '../model'; import { JaegerDatasource } from './jaeger-datasource'; import { getTraceData, jaegerTraceToOTLP } from './get-trace-data'; diff --git a/jaeger/src/plugins/get-trace-data.ts b/jaeger/src/plugins/get-trace-data.ts index 2f638344f..31537969c 100644 --- a/jaeger/src/plugins/get-trace-data.ts +++ b/jaeger/src/plugins/get-trace-data.ts @@ -11,13 +11,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange, Notice, otlpcommonv1, otlptracev1, TraceSearchResult } from '@perses-dev/core'; import { datasourceSelectValueToSelector, replaceVariables, TraceQueryPlugin, VariableStateMap, } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange, Notice, TraceSearchResult } from '@perses-dev/spec'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; +import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; import { DEFAULT_JAEGER, DEFAULT_SEARCH_LIMIT, diff --git a/jaeger/src/plugins/jaeger-datasource-types.ts b/jaeger/src/plugins/jaeger-datasource-types.ts index d82d7dc4c..03ca9538a 100644 --- a/jaeger/src/plugins/jaeger-datasource-types.ts +++ b/jaeger/src/plugins/jaeger-datasource-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy } from '@perses-dev/core'; +import { HTTPProxy } from '@perses-dev/spec'; export interface JaegerDatasourceSpec { directUrl?: string; diff --git a/jest.shared.ts b/jest.shared.ts index e6bd72d7e..a09696422 100644 --- a/jest.shared.ts +++ b/jest.shared.ts @@ -31,7 +31,7 @@ const config: Config.InitialOptions = { // Configure Jest to handle stylesheets '\\.(css|less)$': '/../stylesMock.js', }, - transformIgnorePatterns: ['node_modules/(?!(lodash-es|yaml))'], + transformIgnorePatterns: ['node_modules/(?!(lodash-es|yaml|@perses-dev))'], transform: { // This does not do type-checking and assumes that's happening elsewhere for TS test files (e.g. as part of the // build process) diff --git a/logstable/package.json b/logstable/package.json index 8b29c4810..b31fa0ede 100644 --- a/logstable/package.json +++ b/logstable/package.json @@ -31,10 +31,10 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", - "@perses-dev/dashboards": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/logstable/rsbuild.config.ts b/logstable/rsbuild.config.ts index ac94600f9..a275f6295 100644 --- a/logstable/rsbuild.config.ts +++ b/logstable/rsbuild.config.ts @@ -31,7 +31,7 @@ export default createConfigForPlugin({ 'date-fns': { singleton: true }, 'date-fns-tz': { singleton: true }, lodash: { singleton: true }, - '@perses-dev/core': { singleton: true }, + '@perses-dev/spec': { singleton: true }, '@perses-dev/components': { singleton: true }, '@perses-dev/dashboards': { singleton: true }, '@perses-dev/plugin-system': { singleton: true }, diff --git a/logstable/src/components/LogRow/LogDetailsTable.tsx b/logstable/src/components/LogRow/LogDetailsTable.tsx index 56df58dfb..01d457b33 100644 --- a/logstable/src/components/LogRow/LogDetailsTable.tsx +++ b/logstable/src/components/LogRow/LogDetailsTable.tsx @@ -13,8 +13,8 @@ import React, { useMemo } from 'react'; import { Table, TableBody, TableRow, TableCell, useTheme, alpha } from '@mui/material'; -import { Labels } from '@perses-dev/core'; import './ansiColors.css'; +import { Labels } from '@perses-dev/spec'; import { ansiToSanitizedHtml } from '../../utils/ansi'; const AnsiValue: React.FC<{ value: string }> = ({ value }) => { diff --git a/logstable/src/components/LogRow/LogRow.test.tsx b/logstable/src/components/LogRow/LogRow.test.tsx index 8fbc80572..8b12498b8 100644 --- a/logstable/src/components/LogRow/LogRow.test.tsx +++ b/logstable/src/components/LogRow/LogRow.test.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { render, screen, waitFor, fireEvent, RenderResult } from '@testing-library/react'; -import { LogEntry } from '@perses-dev/core'; +import { LogEntry } from '@perses-dev/spec'; import { LogRow } from './LogRow'; // Mock clipboard API diff --git a/logstable/src/components/LogRow/LogRow.tsx b/logstable/src/components/LogRow/LogRow.tsx index b1753227f..09447c6d4 100644 --- a/logstable/src/components/LogRow/LogRow.tsx +++ b/logstable/src/components/LogRow/LogRow.tsx @@ -22,7 +22,6 @@ import { Tooltip, useTheme, } from '@mui/material'; -import { LogEntry } from '@perses-dev/core'; import Check from 'mdi-material-ui/Check'; import ChevronDown from 'mdi-material-ui/ChevronDown'; import ChevronRight from 'mdi-material-ui/ChevronRight'; @@ -30,6 +29,7 @@ import CodeJson from 'mdi-material-ui/CodeJson'; import ContentCopy from 'mdi-material-ui/ContentCopy'; import FormatQuoteClose from 'mdi-material-ui/FormatQuoteClose'; import React, { memo, ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { LogEntry } from '@perses-dev/spec'; import { ansiToSanitizedHtml } from '../../utils/ansi'; import { formatLogAsJson, formatLogEntry, formatLogMessage } from '../../utils/copyHelpers'; import { useSeverityColor } from '../hooks/useSeverity'; diff --git a/logstable/src/components/LogsList.tsx b/logstable/src/components/LogsList.tsx index 9aa9df587..bfce700aa 100644 --- a/logstable/src/components/LogsList.tsx +++ b/logstable/src/components/LogsList.tsx @@ -12,7 +12,7 @@ // limitations under the License. import React from 'react'; -import { LogEntry } from '@perses-dev/core'; +import { LogEntry } from '@perses-dev/spec'; import { LogsTableOptions } from '../model'; import { EmptyLogsState } from './EmptyLogsState'; import { useExpandedRows } from './hooks/useExpandedRows'; diff --git a/logstable/src/components/VirtualizedLogsList.tsx b/logstable/src/components/VirtualizedLogsList.tsx index 9317f2a1b..cdb749b9a 100644 --- a/logstable/src/components/VirtualizedLogsList.tsx +++ b/logstable/src/components/VirtualizedLogsList.tsx @@ -15,10 +15,10 @@ import React, { useCallback, useState, useEffect, useRef, ReactNode } from 'reac import { Box, useTheme, Popover, Button, ButtonGroup, IconButton } from '@mui/material'; import CloseIcon from 'mdi-material-ui/Close'; import { Virtuoso } from 'react-virtuoso'; -import { LogEntry } from '@perses-dev/core'; import { useSelection } from '@perses-dev/components'; import { formatForDisplay, useSelectionItemActions } from '@perses-dev/dashboards'; import { ActionOptions, useAllVariableValues } from '@perses-dev/plugin-system'; +import { LogEntry } from '@perses-dev/spec'; import { formatLogEntries, formatLogMessage } from '../utils/copyHelpers'; import { LogsTableOptions } from '../model'; import { LogRow } from './LogRow'; diff --git a/logstable/src/components/hooks/useSeverity.ts b/logstable/src/components/hooks/useSeverity.ts index 2c0fb6125..14a6562fe 100644 --- a/logstable/src/components/hooks/useSeverity.ts +++ b/logstable/src/components/hooks/useSeverity.ts @@ -12,7 +12,7 @@ // limitations under the License. import { useTheme } from '@mui/material'; -import { LogEntry } from '@perses-dev/core'; +import { LogEntry } from '@perses-dev/spec'; import { getSeverity } from '../utils'; export const useSeverityColor = (log?: LogEntry): string => { diff --git a/logstable/src/components/utils.ts b/logstable/src/components/utils.ts index 99e57c61c..1f7996153 100644 --- a/logstable/src/components/utils.ts +++ b/logstable/src/components/utils.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogEntry } from '@perses-dev/core'; +import { LogEntry } from '@perses-dev/spec'; export type Severity = 'critical' | 'error' | 'warning' | 'info' | 'debug' | 'trace' | 'unknown' | 'other'; diff --git a/logstable/src/model.ts b/logstable/src/model.ts index fb07adc6a..5db2fb156 100644 --- a/logstable/src/model.ts +++ b/logstable/src/model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, ThresholdOptions } from '@perses-dev/core'; +import { ThresholdOptions } from '@perses-dev/components'; import { PanelProps, LegendSpecOptions, @@ -19,6 +19,7 @@ import { OptionsEditorProps, ActionOptions, } from '@perses-dev/plugin-system'; +import { LogData } from '@perses-dev/spec'; export type LogsTableProps = PanelProps; diff --git a/logstable/src/utils/copyHelpers.test.ts b/logstable/src/utils/copyHelpers.test.ts index 97b7ba5d7..e3025b389 100644 --- a/logstable/src/utils/copyHelpers.test.ts +++ b/logstable/src/utils/copyHelpers.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogEntry } from '@perses-dev/core'; +import { LogEntry } from '@perses-dev/spec'; import { formatTimestamp, formatLabels, diff --git a/logstable/src/utils/copyHelpers.ts b/logstable/src/utils/copyHelpers.ts index 7134ebc81..8b8f07b11 100644 --- a/logstable/src/utils/copyHelpers.ts +++ b/logstable/src/utils/copyHelpers.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogEntry } from '@perses-dev/core'; +import { LogEntry } from '@perses-dev/spec'; import { stripAnsi } from './ansi'; /** diff --git a/loki/package.json b/loki/package.json index 03160e354..0539e2d09 100644 --- a/loki/package.json +++ b/loki/package.json @@ -22,11 +22,11 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/loki/src/components/logql-extension.ts b/loki/src/components/logql-extension.ts index 296425015..44a642004 100644 --- a/loki/src/components/logql-extension.ts +++ b/loki/src/components/logql-extension.ts @@ -15,7 +15,7 @@ import { LRLanguage } from '@codemirror/language'; import { parser } from '@grafana/lezer-logql'; import { CompletionContext } from '@codemirror/autocomplete'; import { Extension } from '@uiw/react-codemirror'; -import { AbsoluteTimeRange } from '@perses-dev/core'; +import { AbsoluteTimeRange } from '@perses-dev/spec'; import { LokiClient } from '../model'; import { logqlHighlight } from './logql-highlight'; import { complete } from './complete'; diff --git a/loki/src/datasources/loki-datasource/loki-datasource-types.ts b/loki/src/datasources/loki-datasource/loki-datasource-types.ts index f82b098f4..2cee492c4 100644 --- a/loki/src/datasources/loki-datasource/loki-datasource-types.ts +++ b/loki/src/datasources/loki-datasource/loki-datasource-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy } from '@perses-dev/core'; +import { HTTPProxy } from '@perses-dev/spec'; export interface LokiDatasourceSpec { directUrl?: string; diff --git a/loki/src/model/loki-client.test.ts b/loki/src/model/loki-client.test.ts index a97dca157..592865e7d 100644 --- a/loki/src/model/loki-client.test.ts +++ b/loki/src/model/loki-client.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange } from '@perses-dev/core'; +import { AbsoluteTimeRange } from '@perses-dev/spec'; import { toUnixSeconds, getLokiTimeRange, labels, labelValues } from './loki-client'; // Mock global fetch for labels/labelValues tests diff --git a/loki/src/model/loki-client.ts b/loki/src/model/loki-client.ts index 800bd25a4..cd7869fe1 100644 --- a/loki/src/model/loki-client.ts +++ b/loki/src/model/loki-client.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange } from '@perses-dev/core'; +import { AbsoluteTimeRange } from '@perses-dev/spec'; import { LokiQueryResponse, LokiQueryRangeResponse, diff --git a/loki/src/model/loki-data-types.ts b/loki/src/model/loki-data-types.ts index 5382ecfa6..0daa42880 100644 --- a/loki/src/model/loki-data-types.ts +++ b/loki/src/model/loki-data-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, AbsoluteTimeRange, TimeSeries, TimeSeriesData, TimeSeriesMetadata } from '@perses-dev/core'; +import { AbsoluteTimeRange, LogData, TimeSeries, TimeSeriesData, TimeSeriesMetadata } from '@perses-dev/spec'; export interface LokiTimeSeriesData extends TimeSeriesData { logs?: LogData; diff --git a/loki/src/model/loki-selectors.ts b/loki/src/model/loki-selectors.ts index d23d1d1f4..a476dadf8 100644 --- a/loki/src/model/loki-selectors.ts +++ b/loki/src/model/loki-selectors.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { DatasourceSelectValue, isVariableDatasource } from '@perses-dev/plugin-system'; +import { DatasourceSelector } from '@perses-dev/spec'; export const LOKI_DATASOURCE_KIND = 'LokiDatasource' as const; diff --git a/loki/src/queries/loki-log-query/get-loki-log-data.ts b/loki/src/queries/loki-log-query/get-loki-log-data.ts index 1f5fa2f5f..3c1df646a 100644 --- a/loki/src/queries/loki-log-query/get-loki-log-data.ts +++ b/loki/src/queries/loki-log-query/get-loki-log-data.ts @@ -12,7 +12,7 @@ // limitations under the License. import { replaceVariables } from '@perses-dev/plugin-system'; -import { LogEntry, LogData } from '@perses-dev/core'; +import { LogData, LogEntry } from '@perses-dev/spec'; import { LokiStreamResult } from '../../model/loki-client-types'; import { LokiClient } from '../../model/loki-client'; import { DEFAULT_DATASOURCE } from '../constants'; diff --git a/loki/src/queries/loki-log-query/log-query-plugin-interface.ts b/loki/src/queries/loki-log-query/log-query-plugin-interface.ts index e67d21167..4bc5bb3ec 100644 --- a/loki/src/queries/loki-log-query/log-query-plugin-interface.ts +++ b/loki/src/queries/loki-log-query/log-query-plugin-interface.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, AbsoluteTimeRange, UnknownSpec } from '@perses-dev/core'; import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec'; export interface LogQueryResult { logs: LogData; diff --git a/loki/src/queries/loki-log-query/loki-log-query-types.ts b/loki/src/queries/loki-log-query/loki-log-query-types.ts index 08a771cd1..2f9b88117 100644 --- a/loki/src/queries/loki-log-query/loki-log-query-types.ts +++ b/loki/src/queries/loki-log-query/loki-log-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; import { LokiQueryRangeStreamsResponse } from '../../model/loki-client-types'; export interface LokiLogQuerySpec { diff --git a/loki/src/queries/loki-time-series-query/get-loki-time-series-data.ts b/loki/src/queries/loki-time-series-query/get-loki-time-series-data.ts index 57523354a..d005279b6 100644 --- a/loki/src/queries/loki-time-series-query/get-loki-time-series-data.ts +++ b/loki/src/queries/loki-time-series-query/get-loki-time-series-data.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DurationString, TimeSeries, parseDurationString } from '@perses-dev/core'; import { TimeSeriesQueryPlugin, replaceVariables } from '@perses-dev/plugin-system'; import { milliseconds } from 'date-fns'; +import { DurationString, parseDurationString, TimeSeries } from '@perses-dev/spec'; import { LokiClient } from '../../model/loki-client'; import { LokiMatrixResult } from '../../model/loki-client-types'; import { DEFAULT_DATASOURCE } from '../constants'; diff --git a/loki/src/queries/loki-time-series-query/loki-time-series-query-types.test.ts b/loki/src/queries/loki-time-series-query/loki-time-series-query-types.test.ts index 608288274..9a7ae4c2a 100644 --- a/loki/src/queries/loki-time-series-query/loki-time-series-query-types.test.ts +++ b/loki/src/queries/loki-time-series-query/loki-time-series-query-types.test.ts @@ -12,11 +12,11 @@ // limitations under the License. // TODO: This should be fixed globally in the test setup -import { DatasourceSpec } from '@perses-dev/core'; jest.mock('echarts/core'); import { TimeSeriesQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { LokiQueryRangeMatrixResponse, LokiQueryRangeResponse } from '../../model/loki-client-types'; import { LokiDatasource } from '../../datasources/loki-datasource'; import { LokiDatasourceSpec } from '../../datasources/loki-datasource/loki-datasource-types'; diff --git a/loki/src/queries/loki-time-series-query/loki-time-series-query-types.ts b/loki/src/queries/loki-time-series-query/loki-time-series-query-types.ts index fc82d58f0..918d9a56b 100644 --- a/loki/src/queries/loki-time-series-query/loki-time-series-query-types.ts +++ b/loki/src/queries/loki-time-series-query/loki-time-series-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; import { LokiQueryRangeMatrixResponse } from '../../model/loki-client-types'; export interface LokiTimeSeriesQuerySpec { diff --git a/markdown/package.json b/markdown/package.json index 8568065ee..9a2bec77a 100644 --- a/markdown/package.json +++ b/markdown/package.json @@ -31,9 +31,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/markdown/src/markdown-panel-model.ts b/markdown/src/markdown-panel-model.ts index 09211ba9e..42135ec4f 100644 --- a/markdown/src/markdown-panel-model.ts +++ b/markdown/src/markdown-panel-model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition } from '@perses-dev/core'; +import { Definition } from '@perses-dev/spec'; /** * The schema for a Markdown panel. diff --git a/package-lock.json b/package-lock.json index f24460d3f..87ef46373 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,11 +39,12 @@ ], "devDependencies": { "@module-federation/rsbuild-plugin": "^2.3.3", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@rsbuild/core": "^1.6.7", "@rsbuild/plugin-react": "^1.4.2", "@swc/cli": "^0.8.1", @@ -92,9 +93,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -112,11 +113,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -136,9 +138,8 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -166,9 +167,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-table": "^8.20.5", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -187,9 +188,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -207,10 +208,11 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -227,9 +229,9 @@ "name": "@perses-dev/heatmap-chart-plugin", "version": "0.4.1", "peerDependencies": { - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "echarts": "5.5.0", "immer": "^10.1.1", "lodash": "^4.17.21", @@ -241,9 +243,9 @@ "name": "@perses-dev/histogram-chart-plugin", "version": "0.11.1", "peerDependencies": { - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "echarts": "5.5.0", "immer": "^10.1.1", "lodash": "^4.17.21", @@ -258,11 +260,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -286,10 +289,10 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -309,11 +312,11 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -337,9 +340,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -3869,10 +3872,76 @@ "resolved": "clickhouse", "link": true }, + "node_modules/@perses-dev/client": { + "version": "0.54.0-beta.3", + "resolved": "https://registry.npmjs.org/@perses-dev/client/-/client-0.54.0-beta.3.tgz", + "integrity": "sha512-3CYwMmW3emz8Bgw45FuT5lrvImr8hoGcdLOidrtdIS6k7P1cljuLTKaTOHe9r8W5bKjji1kedaRCPtCH1Xlowg==", + "license": "Apache-2.0", + "dependencies": { + "@perses-dev/spec": "0.2.0-beta.0", + "zod": "^3.21.4" + } + }, + "node_modules/@perses-dev/client/node_modules/@perses-dev/spec": { + "version": "0.2.0-beta.0", + "resolved": "https://registry.npmjs.org/@perses-dev/spec/-/spec-0.2.0-beta.0.tgz", + "integrity": "sha512-9qT3ofOjBcO7okudC9Rz8t8ugNcTscYincvvmyFtZ/9oHrkDTiJPcRHLZYoCPE6r70OEj27JpvCqWCCil5yA1Q==", + "license": "Apache-2.0", + "dependencies": { + "date-fns": "^4.1.0", + "mathjs": "^15.1.1", + "zod": "^3.21.4" + } + }, + "node_modules/@perses-dev/client/node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/@perses-dev/client/node_modules/mathjs": { + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-15.2.0.tgz", + "integrity": "sha512-UAQzSVob9rNLdGpqcFMYmSu9dkuLYy7Lr2hBEQS5SHQdknA9VppJz3cy2KkpMzTODunad6V6cNv+5kOLsePLow==", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.26.10", + "complex.js": "^2.2.5", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "^5.2.1", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.2.1" + }, + "bin": { + "mathjs": "bin/cli.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@perses-dev/client/node_modules/typed-function": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.2.tgz", + "integrity": "sha512-VwaXim9Gp1bngi/q3do8hgttYn2uC3MoT/gfuMWylnj1IeZBUAyPddHZlo1K05BDoj8DYPpMdiHqH1dDYdJf2A==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, "node_modules/@perses-dev/components": { - "version": "0.54.0-beta.1", - "resolved": "https://registry.npmjs.org/@perses-dev/components/-/components-0.54.0-beta.1.tgz", - "integrity": "sha512-xssaITVuj6ay/4FaT3HsTeIPwqKZ9P81TejAJbiXr0tH4eSh9p2BAYp7LkbHgAtLecLr3TsLo4C4iGc3iJhnqw==", + "version": "0.54.0-beta.3", + "resolved": "https://registry.npmjs.org/@perses-dev/components/-/components-0.54.0-beta.3.tgz", + "integrity": "sha512-x5VBt2EyK6/XVpSmQQYyK155iITd5NGTAyckKxCMtCbAPhjj+kTc4xgcFvoo2ZOLsmnog36Gx3x17/5gyicqKg==", "license": "Apache-2.0", "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "^1.4.0", @@ -3881,7 +3950,7 @@ "@date-fns/tz": "^1.4.1", "@fontsource/inter": "^5.0.0", "@mui/x-date-pickers": "^7.23.1", - "@perses-dev/core": "0.53.0", + "@perses-dev/client": "0.54.0-beta.3", "@perses-dev/spec": "0.2.0-beta.0", "@tanstack/match-sorter-utils": "^8.19.4", "@tanstack/react-table": "^8.20.5", @@ -3893,6 +3962,7 @@ "mathjs": "^10.6.4", "mdi-material-ui": "^7.9.2", "notistack": "^3.0.2", + "numbro": "^2.3.6", "react-colorful": "^5.6.1", "react-error-boundary": "^3.1.4", "react-hook-form": "^7.51.3", @@ -3907,23 +3977,66 @@ "react-dom": "^17.0.2 || ^18.0.0" } }, - "node_modules/@perses-dev/components/node_modules/@perses-dev/core": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@perses-dev/core/-/core-0.53.0.tgz", - "integrity": "sha512-mOs+lNXo4Cy8RvFD1dhPQuXp7+57njEVbF5e3iNrqbgxmmEcP2SdAaNASWB7ki4IgFiJuZwqLH56SlqARWN7hw==", + "node_modules/@perses-dev/components/node_modules/@perses-dev/spec": { + "version": "0.2.0-beta.0", + "resolved": "https://registry.npmjs.org/@perses-dev/spec/-/spec-0.2.0-beta.0.tgz", + "integrity": "sha512-9qT3ofOjBcO7okudC9Rz8t8ugNcTscYincvvmyFtZ/9oHrkDTiJPcRHLZYoCPE6r70OEj27JpvCqWCCil5yA1Q==", "license": "Apache-2.0", "dependencies": { "date-fns": "^4.1.0", - "lodash": "^4.17.21", - "mathjs": "^10.6.4", - "numbro": "^2.3.6", + "mathjs": "^15.1.1", "zod": "^3.21.4" } }, + "node_modules/@perses-dev/components/node_modules/@perses-dev/spec/node_modules/mathjs": { + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-15.2.0.tgz", + "integrity": "sha512-UAQzSVob9rNLdGpqcFMYmSu9dkuLYy7Lr2hBEQS5SHQdknA9VppJz3cy2KkpMzTODunad6V6cNv+5kOLsePLow==", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.26.10", + "complex.js": "^2.2.5", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "^5.2.1", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.2.1" + }, + "bin": { + "mathjs": "bin/cli.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@perses-dev/components/node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/@perses-dev/components/node_modules/typed-function": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.2.tgz", + "integrity": "sha512-VwaXim9Gp1bngi/q3do8hgttYn2uC3MoT/gfuMWylnj1IeZBUAyPddHZlo1K05BDoj8DYPpMdiHqH1dDYdJf2A==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, "node_modules/@perses-dev/core": { - "version": "0.53.1", - "resolved": "https://registry.npmjs.org/@perses-dev/core/-/core-0.53.1.tgz", - "integrity": "sha512-pYH1XyJ4myu42wJjTwLJ7jz5u82ye1prqIeCkuh3lGUjxLx9kjeZlM4KjjWamudfc2xereh+1V/dNPKt0B8x9w==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@perses-dev/core/-/core-0.53.0.tgz", + "integrity": "sha512-mOs+lNXo4Cy8RvFD1dhPQuXp7+57njEVbF5e3iNrqbgxmmEcP2SdAaNASWB7ki4IgFiJuZwqLH56SlqARWN7hw==", "license": "Apache-2.0", "dependencies": { "date-fns": "^4.1.0", @@ -3934,18 +4047,15 @@ } }, "node_modules/@perses-dev/dashboards": { - "version": "0.54.0-beta.1", - "resolved": "https://registry.npmjs.org/@perses-dev/dashboards/-/dashboards-0.54.0-beta.1.tgz", - "integrity": "sha512-PizFiH50yj+iQtKr8wJb7KRKElXwlgKQPP/Q85Z/GNHGCVj/iVM1+K4us7jzgs0+M4oD4SH7KdwwhunrmT+1Og==", + "version": "0.54.0-beta.3", + "resolved": "https://registry.npmjs.org/@perses-dev/dashboards/-/dashboards-0.54.0-beta.3.tgz", + "integrity": "sha512-c18evB+7+W7tLmLLiW6l61xJMLeOqCbwlmJSRkkmBvqknCSBYyiq17Zw+SOXWJE8JTLbirKJq5GTQ1VXNFp7Vg==", "license": "Apache-2.0", "dependencies": { - "@perses-dev/components": "0.54.0-beta.1", - "@perses-dev/core": "0.53.0", - "@perses-dev/plugin-system": "0.54.0-beta.1", + "@perses-dev/components": "0.54.0-beta.3", + "@perses-dev/plugin-system": "0.54.0-beta.3", "@perses-dev/spec": "0.2.0-beta.0", "@tanstack/react-hotkeys": "^0.9.1", - "@types/react-grid-layout": "^1.3.2", - "date-fns": "^4.1.0", "immer": "^10.1.1", "mdi-material-ui": "^7.9.2", "react-grid-layout": "^1.3.4", @@ -3964,48 +4074,81 @@ "react-dom": "^17.0.2 || ^18.0.0" } }, - "node_modules/@perses-dev/dashboards/node_modules/@perses-dev/core": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@perses-dev/core/-/core-0.53.0.tgz", - "integrity": "sha512-mOs+lNXo4Cy8RvFD1dhPQuXp7+57njEVbF5e3iNrqbgxmmEcP2SdAaNASWB7ki4IgFiJuZwqLH56SlqARWN7hw==", + "node_modules/@perses-dev/dashboards/node_modules/@perses-dev/spec": { + "version": "0.2.0-beta.0", + "resolved": "https://registry.npmjs.org/@perses-dev/spec/-/spec-0.2.0-beta.0.tgz", + "integrity": "sha512-9qT3ofOjBcO7okudC9Rz8t8ugNcTscYincvvmyFtZ/9oHrkDTiJPcRHLZYoCPE6r70OEj27JpvCqWCCil5yA1Q==", "license": "Apache-2.0", "dependencies": { "date-fns": "^4.1.0", - "lodash": "^4.17.21", - "mathjs": "^10.6.4", - "numbro": "^2.3.6", + "mathjs": "^15.1.1", "zod": "^3.21.4" } }, + "node_modules/@perses-dev/dashboards/node_modules/@perses-dev/spec/node_modules/mathjs": { + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-15.2.0.tgz", + "integrity": "sha512-UAQzSVob9rNLdGpqcFMYmSu9dkuLYy7Lr2hBEQS5SHQdknA9VppJz3cy2KkpMzTODunad6V6cNv+5kOLsePLow==", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.26.10", + "complex.js": "^2.2.5", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "^5.2.1", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.2.1" + }, + "bin": { + "mathjs": "bin/cli.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@perses-dev/dashboards/node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/@perses-dev/dashboards/node_modules/typed-function": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.2.tgz", + "integrity": "sha512-VwaXim9Gp1bngi/q3do8hgttYn2uC3MoT/gfuMWylnj1IeZBUAyPddHZlo1K05BDoj8DYPpMdiHqH1dDYdJf2A==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, "node_modules/@perses-dev/datasource-variable-plugin": { "resolved": "datasourcevariable", "link": true }, "node_modules/@perses-dev/explore": { - "version": "0.54.0-beta.1", - "resolved": "https://registry.npmjs.org/@perses-dev/explore/-/explore-0.54.0-beta.1.tgz", - "integrity": "sha512-aPHAbTzrIgIv9w1LUOmzi7DZRB/aXiZQNaml7FeQztCViqekpTKDnfe8fA9xI+PGhZz0j/3f1SAS9Uxkos4gTA==", + "version": "0.54.0-beta.3", + "resolved": "https://registry.npmjs.org/@perses-dev/explore/-/explore-0.54.0-beta.3.tgz", + "integrity": "sha512-WcBYYShjSKbtOefdCp4U1Gdl+YDwGXKFJ2stqbdTUHENLy5ERm57bMQUrHizzhFCnD34lLjEbKk2aQT33o8hbA==", "license": "Apache-2.0", "dependencies": { "@nexucis/fuzzy": "^0.5.1", - "@perses-dev/components": "0.54.0-beta.1", - "@perses-dev/core": "0.53.0", - "@perses-dev/dashboards": "0.54.0-beta.1", - "@perses-dev/plugin-system": "0.54.0-beta.1", - "@types/react-grid-layout": "^1.3.2", - "date-fns": "^4.1.0", - "immer": "^10.1.1", + "@perses-dev/components": "0.54.0-beta.3", + "@perses-dev/dashboards": "0.54.0-beta.3", + "@perses-dev/plugin-system": "0.54.0-beta.3", "mdi-material-ui": "^7.9.2", "qs": "^6.14.0", - "react-grid-layout": "^1.3.4", - "react-hook-form": "^7.46.1", - "react-intersection-observer": "^9.4.0", "react-virtuoso": "^4.12.2", - "use-immer": "^0.11.0", "use-query-params": "^2.2.1", - "use-resize-observer": "^9.0.0", - "zod": "^3.25.76", - "zustand": "^4.3.3" + "use-resize-observer": "^9.0.0" }, "peerDependencies": { "@mui/material": "^6.1.10", @@ -4014,19 +4157,6 @@ "react-dom": "^17.0.2 || ^18.0.0" } }, - "node_modules/@perses-dev/explore/node_modules/@perses-dev/core": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@perses-dev/core/-/core-0.53.0.tgz", - "integrity": "sha512-mOs+lNXo4Cy8RvFD1dhPQuXp7+57njEVbF5e3iNrqbgxmmEcP2SdAaNASWB7ki4IgFiJuZwqLH56SlqARWN7hw==", - "license": "Apache-2.0", - "dependencies": { - "date-fns": "^4.1.0", - "lodash": "^4.17.21", - "mathjs": "^10.6.4", - "numbro": "^2.3.6", - "zod": "^3.21.4" - } - }, "node_modules/@perses-dev/flame-chart-plugin": { "resolved": "flamechart", "link": true @@ -4068,20 +4198,21 @@ "link": true }, "node_modules/@perses-dev/plugin-system": { - "version": "0.54.0-beta.1", - "resolved": "https://registry.npmjs.org/@perses-dev/plugin-system/-/plugin-system-0.54.0-beta.1.tgz", - "integrity": "sha512-7l2yjvlyWn0a4LsxntefqoRM9VlZRx4qfH/uN7XNIbI3ycsMnjSlSvshknXcUr3/ukwMPv2jbah3Z1M9hYEEBQ==", + "version": "0.54.0-beta.3", + "resolved": "https://registry.npmjs.org/@perses-dev/plugin-system/-/plugin-system-0.54.0-beta.3.tgz", + "integrity": "sha512-TaghRXusCcY9y9jU4aCzUr7+PpDl/gQ5KGFkcOCpCGLnN+dcm9bjxUhoa1725ZwYYaaCGD8Db+NcUsrQa6vHUg==", "license": "Apache-2.0", "dependencies": { "@module-federation/enhanced": "^2.3.3", - "@perses-dev/components": "0.54.0-beta.1", + "@perses-dev/client": "0.54.0-beta.3", + "@perses-dev/components": "0.54.0-beta.3", "@perses-dev/core": "0.53.0", - "@perses-dev/spec": "0.2.0-beta.0", + "@perses-dev/spec": "0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "immer": "^10.1.1", "react-hook-form": "^7.46.1", - "use-immer": "^0.11.0", + "semver": "^7.8.0", "use-query-params": "^2.2.1", "zod": "^3.25.76" }, @@ -4095,17 +4226,16 @@ "react-dom": "^17.0.2 || ^18.0.0" } }, - "node_modules/@perses-dev/plugin-system/node_modules/@perses-dev/core": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@perses-dev/core/-/core-0.53.0.tgz", - "integrity": "sha512-mOs+lNXo4Cy8RvFD1dhPQuXp7+57njEVbF5e3iNrqbgxmmEcP2SdAaNASWB7ki4IgFiJuZwqLH56SlqARWN7hw==", - "license": "Apache-2.0", - "dependencies": { - "date-fns": "^4.1.0", - "lodash": "^4.17.21", - "mathjs": "^10.6.4", - "numbro": "^2.3.6", - "zod": "^3.21.4" + "node_modules/@perses-dev/plugin-system/node_modules/semver": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.1.tgz", + "integrity": "sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/@perses-dev/plugins-e2e": { @@ -4125,9 +4255,9 @@ "link": true }, "node_modules/@perses-dev/spec": { - "version": "0.2.0-beta.0", - "resolved": "https://registry.npmjs.org/@perses-dev/spec/-/spec-0.2.0-beta.0.tgz", - "integrity": "sha512-9qT3ofOjBcO7okudC9Rz8t8ugNcTscYincvvmyFtZ/9oHrkDTiJPcRHLZYoCPE6r70OEj27JpvCqWCCil5yA1Q==", + "version": "0.2.0-beta.2", + "resolved": "https://registry.npmjs.org/@perses-dev/spec/-/spec-0.2.0-beta.2.tgz", + "integrity": "sha512-l+T+h3o1DIYNmn8pMX8goshssTfTa1FSiIAp395qlIFu+B/ZsUbeHZGT4tujCcQw1tHGF+MTENyDOTLt4bQVYw==", "license": "Apache-2.0", "dependencies": { "date-fns": "^4.1.0", @@ -5876,6 +6006,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz", "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -5891,15 +6022,6 @@ "@types/react": "^18.0.0" } }, - "node_modules/@types/react-grid-layout": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@types/react-grid-layout/-/react-grid-layout-1.3.6.tgz", - "integrity": "sha512-Cw7+sb3yyjtmxwwJiXtEXcu5h4cgs+sCGkHwHXsFmPyV30bf14LeD/fa2LwQovuD2HWxCcjIdNhDlcYGj95qGA==", - "license": "MIT", - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/react-transition-group": { "version": "4.4.12", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", @@ -17251,9 +17373,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17281,11 +17403,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -17350,11 +17473,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "@uiw/react-codemirror": "^4.19.1", "date-fns": "^4.1.0", @@ -17381,9 +17505,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17398,9 +17522,9 @@ "version": "0.1.0", "devDependencies": {}, "peerDependencies": { - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "immer": "^10.1.1", "react": "^17.0.2 || ^18.0.0" } @@ -17418,9 +17542,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17441,9 +17565,8 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17460,9 +17583,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17480,10 +17603,10 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-table": "^8.20.5", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", @@ -17506,11 +17629,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "@uiw/react-codemirror": "^4.25.3", "date-fns": "^4.1.0", @@ -17534,9 +17658,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17554,10 +17678,10 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17580,9 +17704,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17606,9 +17730,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", @@ -17628,11 +17752,11 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/package.json b/package.json index 01faec20e..1c3d4f0ce 100644 --- a/package.json +++ b/package.json @@ -47,11 +47,12 @@ }, "devDependencies": { "@module-federation/rsbuild-plugin": "^2.3.3", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@rsbuild/core": "^1.6.7", "@rsbuild/plugin-react": "^1.4.2", "@swc/cli": "^0.8.1", diff --git a/piechart/package.json b/piechart/package.json index 8632dcd2b..a3d57e071 100644 --- a/piechart/package.json +++ b/piechart/package.json @@ -27,9 +27,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/piechart/src/PieChartBase.tsx b/piechart/src/PieChartBase.tsx index 0884f497f..42386b69a 100644 --- a/piechart/src/PieChartBase.tsx +++ b/piechart/src/PieChartBase.tsx @@ -17,8 +17,7 @@ import { DatasetComponent, GridComponent, LegendComponent, TitleComponent, Toolt import { CanvasRenderer } from 'echarts/renderers'; import { Box, useTheme } from '@mui/material'; import { ReactElement } from 'react'; -import { EChart, ModeOption, useChartsTheme } from '@perses-dev/components'; -import { FormatOptions } from '@perses-dev/core'; +import { EChart, FormatOptions, ModeOption, useChartsTheme } from '@perses-dev/components'; import { getLabelFormatter, getTooltipFormatter } from './utils'; use([ diff --git a/piechart/src/PieChartOptionsEditorSettings.tsx b/piechart/src/PieChartOptionsEditorSettings.tsx index 788a6f1de..3194a56df 100644 --- a/piechart/src/PieChartOptionsEditorSettings.tsx +++ b/piechart/src/PieChartOptionsEditorSettings.tsx @@ -15,6 +15,7 @@ import merge from 'lodash/merge'; import { CalculationSelector, CalculationSelectorProps, + CalculationType, LegendOptionsEditor, LegendOptionsEditorProps, } from '@perses-dev/plugin-system'; @@ -34,8 +35,9 @@ import { SortOption, OptionsEditorControl, useChartsTheme, + FormatOptions, + isPercentUnit, } from '@perses-dev/components'; -import { CalculationType, isPercentUnit, FormatOptions } from '@perses-dev/core'; import { Button, FormControl, diff --git a/piechart/src/PieChartPanel.tsx b/piechart/src/PieChartPanel.tsx index 349ee402a..f60e66547 100644 --- a/piechart/src/PieChartPanel.tsx +++ b/piechart/src/PieChartPanel.tsx @@ -15,15 +15,16 @@ import { Box } from '@mui/material'; import { ChartInstance, ContentWithLegend, + DEFAULT_LEGEND, LegendProps, SelectedLegendItemState, useChartsTheme, useId, } from '@perses-dev/components'; -import { CalculationsMap, CalculationType, DEFAULT_LEGEND, TimeSeriesData } from '@perses-dev/core'; -import { PanelProps, validateLegendSpec } from '@perses-dev/plugin-system'; +import { CalculationsMap, CalculationType, PanelProps, validateLegendSpec } from '@perses-dev/plugin-system'; import merge from 'lodash/merge'; import { ReactElement, useMemo, useRef, useState } from 'react'; +import { TimeSeriesData } from '@perses-dev/spec'; import { PieChartOptions } from './pie-chart-model'; import { PieChartLegendMapper, PieChartListLegendMapper, PieChartTableLegendMapper, sortSeriesData } from './utils'; import { getSeriesColor } from './colors'; diff --git a/piechart/src/pie-chart-model.ts b/piechart/src/pie-chart-model.ts index 8839f7ea7..4752113fc 100644 --- a/piechart/src/pie-chart-model.ts +++ b/piechart/src/pie-chart-model.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ModeOption, SortOption } from '@perses-dev/components'; -import { CalculationType, DEFAULT_CALCULATION, Definition, FormatOptions } from '@perses-dev/core'; -import { LegendSpecOptions, OptionsEditorProps } from '@perses-dev/plugin-system'; +import { FormatOptions, ModeOption, SortOption } from '@perses-dev/components'; +import { CalculationType, DEFAULT_CALCULATION, LegendSpecOptions, OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; export const DEFAULT_FORMAT: FormatOptions = { unit: 'decimal', shortValues: true }; export const DEFAULT_SORT: SortOption = 'desc'; diff --git a/piechart/src/utils.ts b/piechart/src/utils.ts index cf7b91f5e..388223454 100644 --- a/piechart/src/utils.ts +++ b/piechart/src/utils.ts @@ -11,8 +11,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LegendItem, ModeOption, SortOption, TableColumnConfig } from '@perses-dev/components'; -import { FormatOptions, formatValue } from '@perses-dev/core'; +import { + FormatOptions, + formatValue, + LegendItem, + ModeOption, + SortOption, + TableColumnConfig, +} from '@perses-dev/components'; import { format } from 'echarts'; import { comparisonLegends, ComparisonValues, LegendValue } from '@perses-dev/plugin-system'; import { PieChartData } from './PieChartBase'; diff --git a/prometheus/package.json b/prometheus/package.json index 24546399a..467b33afb 100644 --- a/prometheus/package.json +++ b/prometheus/package.json @@ -34,11 +34,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/prometheus/src/components/TreeNode.tsx b/prometheus/src/components/TreeNode.tsx index 1325fb0fe..1b2748505 100644 --- a/prometheus/src/components/TreeNode.tsx +++ b/prometheus/src/components/TreeNode.tsx @@ -17,7 +17,8 @@ import { Box, CircularProgress, List, ListItem, Stack, Tooltip, Typography, useT import CircleIcon from 'mdi-material-ui/Circle'; import { ReactElement, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react'; import AlertCircle from 'mdi-material-ui/AlertCircle'; -import { StatusError } from '@perses-dev/core'; + +import { StatusError } from '@perses-dev/client'; import { PrometheusDatasourceSelector } from '../model'; import ASTNode, { nodeType } from './promql/ast'; import { escapeString, getNodeChildren } from './promql/utils'; diff --git a/prometheus/src/components/promql/format.tsx b/prometheus/src/components/promql/format.tsx index ff8ff8f4a..c8bdcd849 100644 --- a/prometheus/src/components/promql/format.tsx +++ b/prometheus/src/components/promql/format.tsx @@ -15,7 +15,8 @@ import React, { ReactElement, ReactNode } from 'react'; import { styled } from '@mui/material'; -import { formatDuration, msToPrometheusDuration } from '@perses-dev/core'; + +import { convertTimeToDuration, formatDuration } from '@perses-dev/spec'; import ASTNode, { VectorSelector, matchType, @@ -102,13 +103,13 @@ const formatAtAndOffset = (timestamp: number | null, startOrEnd: StartOrEnd, off <> {' '} offset{' '} - {formatDuration(msToPrometheusDuration(offset))} + {formatDuration(convertTimeToDuration(offset))} ) : ( <> {' '} offset{' '} - -{formatDuration(msToPrometheusDuration(-offset))} + -{formatDuration(convertTimeToDuration(-offset))} )} @@ -138,7 +139,7 @@ const formatSelector = (node: VectorSelector | MatrixSelector): ReactElement => )} {node.type === nodeType.matrixSelector && ( <> - [{formatDuration(msToPrometheusDuration(node.range))}] + [{formatDuration(convertTimeToDuration(node.range))}] )} {formatAtAndOffset(node.timestamp, node.startOrEnd, node.offset)} @@ -193,8 +194,8 @@ const formatNodeInternal = (node: ASTNode, showChildren: boolean, maxDepth?: num return ( <> {showChildren && formatNode(node.expr, showChildren, childMaxDepth)}[ - {formatDuration(msToPrometheusDuration(node.range))}: - {node.step !== 0 && {formatDuration(msToPrometheusDuration(node.step))}}] + {formatDuration(convertTimeToDuration(node.range))}: + {node.step !== 0 && {formatDuration(convertTimeToDuration(node.step))}}] {formatAtAndOffset(node.timestamp, node.startOrEnd, node.offset)} ); diff --git a/prometheus/src/components/promql/serialize.ts b/prometheus/src/components/promql/serialize.ts index 0440fa405..b94c8e414 100644 --- a/prometheus/src/components/promql/serialize.ts +++ b/prometheus/src/components/promql/serialize.ts @@ -13,7 +13,7 @@ // Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/promql/serialize.ts -import { formatDuration, msToPrometheusDuration } from '@perses-dev/core'; +import { convertTimeToDuration, formatDuration } from '@perses-dev/spec'; import ASTNode, { VectorSelector, matchType, @@ -29,8 +29,8 @@ const serializeAtAndOffset = (timestamp: number | null, startOrEnd: StartOrEnd, offset === 0 ? '' : offset > 0 - ? ` offset ${formatDuration(msToPrometheusDuration(offset))}` - : ` offset -${formatDuration(msToPrometheusDuration(-offset))}` + ? ` offset ${formatDuration(convertTimeToDuration(offset))}` + : ` offset -${formatDuration(convertTimeToDuration(-offset))}` }`; const serializeSelector = (node: VectorSelector | MatrixSelector): string => { @@ -38,7 +38,7 @@ const serializeSelector = (node: VectorSelector | MatrixSelector): string => { .filter((m) => !(m.name === '__name__' && m.type === matchType.equal && m.value === node.name)) .map((m) => `${m.name}${m.type}"${escapeString(m.value)}"`); - const range = node.type === nodeType.matrixSelector ? `[${formatDuration(msToPrometheusDuration(node.range))}]` : ''; + const range = node.type === nodeType.matrixSelector ? `[${formatDuration(convertTimeToDuration(node.range))}]` : ''; const atAndOffset = serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset); return `${node.name}${matchers.length > 0 ? `{${matchers.join(',')}}` : ''}${range}${atAndOffset}`; @@ -67,8 +67,8 @@ const serializeNode = (node: ASTNode, indent = 0, pretty = false, initialIndent }${serializeNode(node.expr, childIndent, pretty)}${childListSeparator}${ind})`; case nodeType.subquery: - return `${initialInd}${serializeNode(node.expr, indent, pretty)}[${formatDuration(msToPrometheusDuration(node.range))}:${ - node.step !== 0 ? formatDuration(msToPrometheusDuration(node.step)) : '' + return `${initialInd}${serializeNode(node.expr, indent, pretty)}[${formatDuration(convertTimeToDuration(node.range))}:${ + node.step !== 0 ? formatDuration(convertTimeToDuration(node.step)) : '' }]${serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset)}`; case nodeType.parenExpr: diff --git a/prometheus/src/components/query.ts b/prometheus/src/components/query.ts index 795502064..8a0eb858f 100644 --- a/prometheus/src/components/query.ts +++ b/prometheus/src/components/query.ts @@ -12,8 +12,9 @@ // limitations under the License. import { useDatasourceClient } from '@perses-dev/plugin-system'; -import { DatasourceSelector, StatusError } from '@perses-dev/core'; import { useQuery, UseQueryResult } from '@tanstack/react-query'; +import { DatasourceSelector } from '@perses-dev/spec'; +import { StatusError } from '@perses-dev/client'; import { InstantQueryRequestParameters, MonitoredInstantQueryResponse, diff --git a/prometheus/src/explore/PrometheusExplorer.tsx b/prometheus/src/explore/PrometheusExplorer.tsx index e6836c2b5..fbf4e87bb 100644 --- a/prometheus/src/explore/PrometheusExplorer.tsx +++ b/prometheus/src/explore/PrometheusExplorer.tsx @@ -11,13 +11,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { QueryDefinition } from '@perses-dev/core'; import { Box, Stack, Tab, Tabs } from '@mui/material'; import { DataQueriesProvider, MultiQueryEditor, useSuggestedStepMs } from '@perses-dev/plugin-system'; import { useExplorerManagerContext } from '@perses-dev/explore'; import useResizeObserver from 'use-resize-observer'; import { Panel } from '@perses-dev/dashboards'; import { ReactElement, useState } from 'react'; +import { QueryDefinition } from '@perses-dev/spec'; import { DEFAULT_PROM } from '../model/prometheus-selectors'; import { FinderQueryParams } from './PrometheusMetricsFinder/types'; import { PrometheusMetricsFinder } from './PrometheusMetricsFinder'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.tsx b/prometheus/src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.tsx index 90151b39d..8b72ac640 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.tsx @@ -27,13 +27,13 @@ import { useTheme, } from '@mui/material'; import { Fuzzy, FuzzyMatchingInterval } from '@nexucis/fuzzy'; -import { DatasourceSelector } from '@perses-dev/core'; import { useExplorerQueryParams } from '@perses-dev/explore'; import ArrowLeftIcon from 'mdi-material-ui/ArrowLeft'; import CogIcon from 'mdi-material-ui/Cog'; import Magnify from 'mdi-material-ui/Magnify'; import { MouseEvent, ReactElement, useMemo, useState } from 'react'; import { Link as RouterLink } from 'react-router-dom'; +import { DatasourceSelector } from '@perses-dev/spec'; import { DEFAULT_PROM } from '../../model'; import { MetricList } from './display/list/MetricList'; import { FinderFilters } from './filter/FinderFilters'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/display/list/MetricList.tsx b/prometheus/src/explore/PrometheusMetricsFinder/display/list/MetricList.tsx index fe7860ec1..ccb3ff260 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/display/list/MetricList.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/display/list/MetricList.tsx @@ -13,12 +13,12 @@ import { Button, Divider, Skeleton, Stack, StackProps, TableCell, Typography } from '@mui/material'; import { Fuzzy, FuzzyMatchingInterval } from '@nexucis/fuzzy'; -import { DatasourceSelector } from '@perses-dev/core'; import { useExplorerQueryParams } from '@perses-dev/explore'; import CompassIcon from 'mdi-material-ui/Compass'; import { ReactElement, ReactNode, useMemo } from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { TableVirtuoso } from 'react-virtuoso'; +import { DatasourceSelector } from '@perses-dev/spec'; import { LabelFilter } from '../../types'; import { useMetricMetadata } from '../../utils'; import { MetricChip } from '../MetricChip'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/filter/FilterInputs.tsx b/prometheus/src/explore/PrometheusMetricsFinder/filter/FilterInputs.tsx index ab4c0bf7e..d26afd2cc 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/filter/FilterInputs.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/filter/FilterInputs.tsx @@ -33,8 +33,8 @@ import { TextField, } from '@mui/material'; import DeleteIcon from 'mdi-material-ui/Delete'; -import { DatasourceSelector } from '@perses-dev/core'; import { Virtuoso } from 'react-virtuoso'; +import { DatasourceSelector } from '@perses-dev/spec'; import { LabelFilter, Operator } from '../types'; import { useLabels, useLabelValues } from '../utils'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/filter/FinderFilters.tsx b/prometheus/src/explore/PrometheusMetricsFinder/filter/FinderFilters.tsx index 43c6c6e42..80060b2e9 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/filter/FinderFilters.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/filter/FinderFilters.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { Button, FormControl, Stack, StackProps } from '@mui/material'; -import { DatasourceSelector } from '@perses-dev/core'; + import { DatasourceSelect, DatasourceSelectValue, @@ -21,6 +21,7 @@ import { } from '@perses-dev/plugin-system'; import PlusIcon from 'mdi-material-ui/Plus'; import { ReactElement } from 'react'; +import { DatasourceSelector } from '@perses-dev/spec'; import { PROM_DATASOURCE_KIND } from '../../../model/prometheus-selectors'; import { LabelFilter } from '../types'; import { LabelFilterInput } from './FilterInputs'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/overview/MetricOverview.tsx b/prometheus/src/explore/PrometheusMetricsFinder/overview/MetricOverview.tsx index b00baf86b..de817c098 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/overview/MetricOverview.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/overview/MetricOverview.tsx @@ -13,11 +13,12 @@ import { Checkbox, FormControlLabel, Skeleton, Stack, StackProps, Tab, Tabs, Tooltip } from '@mui/material'; import { ReactElement, useMemo, useState } from 'react'; -import { DatasourceSelector, Definition, QueryDefinition, UnknownSpec } from '@perses-dev/core'; + import { Panel } from '@perses-dev/dashboards'; import useResizeObserver from 'use-resize-observer'; import { DataQueriesProvider, useSuggestedStepMs } from '@perses-dev/plugin-system'; import HelpCircleOutlineIcon from 'mdi-material-ui/HelpCircleOutline'; +import { DatasourceSelector, Definition, QueryDefinition, UnknownSpec } from '@perses-dev/spec'; import { computeFilterExpr, LabelFilter } from '../types'; import { useMetricMetadata } from '../utils'; import { OverviewTab } from './tabs/OverviewTab'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/JobTab.tsx b/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/JobTab.tsx index b8abf196d..03bd9dceb 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/JobTab.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/JobTab.tsx @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { CircularProgress, FormControl, @@ -23,6 +22,7 @@ import { Typography, } from '@mui/material'; import { ReactElement, useMemo, useState } from 'react'; +import { DatasourceSelector } from '@perses-dev/spec'; import { MetricList } from '../../display/list/MetricList'; import { LabelFilter } from '../../types'; import { useLabelValues } from '../../utils'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.tsx b/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.tsx index 6e9fdc570..ea1534f24 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.tsx @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { ReactElement, useMemo, useState } from 'react'; import { Autocomplete, @@ -35,6 +34,7 @@ import PlusIcon from 'mdi-material-ui/Plus'; import CheckIcon from 'mdi-material-ui/Check'; import CloseIcon from 'mdi-material-ui/Close'; import { ErrorAlert } from '@perses-dev/components'; +import { DatasourceSelector } from '@perses-dev/spec'; import { LabelFilter, LabelValueCounter, Operator } from '../../types'; import { ListboxComponent } from '../../filter/FilterInputs'; import { useMetricMetadata, useSeriesStates } from '../../utils'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.tsx b/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.tsx index 5b8d76736..158be7232 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.tsx +++ b/prometheus/src/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.tsx @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { CircularProgress, Stack, StackProps } from '@mui/material'; import { ReactElement, useMemo } from 'react'; +import { DatasourceSelector } from '@perses-dev/spec'; import { MetricList } from '../../display/list/MetricList'; import { LabelFilter } from '../../types'; import { useLabelValues } from '../../utils'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/types.ts b/prometheus/src/explore/PrometheusMetricsFinder/types.ts index fba17d527..bda314440 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/types.ts +++ b/prometheus/src/explore/PrometheusMetricsFinder/types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export type Operator = '=' | '!=' | '=~' | '!~'; diff --git a/prometheus/src/explore/PrometheusMetricsFinder/utils.ts b/prometheus/src/explore/PrometheusMetricsFinder/utils.ts index 85b60e28a..bad1c6bcd 100644 --- a/prometheus/src/explore/PrometheusMetricsFinder/utils.ts +++ b/prometheus/src/explore/PrometheusMetricsFinder/utils.ts @@ -11,10 +11,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector, StatusError } from '@perses-dev/core'; import { useDatasourceClient, useTimeRange } from '@perses-dev/plugin-system'; import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { useMemo } from 'react'; +import { DatasourceSelector } from '@perses-dev/spec'; +import { StatusError } from '@perses-dev/client'; import { LabelNamesRequestParameters, LabelValuesRequestParameters, diff --git a/prometheus/src/model/api-types.ts b/prometheus/src/model/api-types.ts index ea6a00e37..31b4a069b 100644 --- a/prometheus/src/model/api-types.ts +++ b/prometheus/src/model/api-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DurationString } from '@perses-dev/core'; +import { DurationString } from '@perses-dev/spec'; import ASTNode from '../components/promql/ast'; // Just reuse dashboard model's type and re-export diff --git a/prometheus/src/model/prometheus-client.ts b/prometheus/src/model/prometheus-client.ts index 82d7aaf75..bc2ce34df 100644 --- a/prometheus/src/model/prometheus-client.ts +++ b/prometheus/src/model/prometheus-client.ts @@ -12,8 +12,8 @@ // limitations under the License. import { QueryParamValues } from '@perses-dev/components'; -import { fetch, fetchJson, RequestHeaders } from '@perses-dev/core'; import { DatasourceClient } from '@perses-dev/plugin-system'; +import { fetchJson, RequestHeaders } from '@perses-dev/client'; import { InstantQueryRequestParameters, InstantQueryResponse, diff --git a/prometheus/src/model/prometheus-selectors.ts b/prometheus/src/model/prometheus-selectors.ts index 7f35f5c4a..b8161c0e1 100644 --- a/prometheus/src/model/prometheus-selectors.ts +++ b/prometheus/src/model/prometheus-selectors.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { DatasourceSelectValue, isVariableDatasource } from '@perses-dev/plugin-system'; +import { DatasourceSelector } from '@perses-dev/spec'; export const PROM_DATASOURCE_KIND = 'PrometheusDatasource' as const; diff --git a/prometheus/src/model/time.ts b/prometheus/src/model/time.ts index 163b82272..cbb9e70f1 100644 --- a/prometheus/src/model/time.ts +++ b/prometheus/src/model/time.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange, DurationString, parseDurationString } from '@perses-dev/core'; import { milliseconds, getUnixTime } from 'date-fns'; +import { AbsoluteTimeRange, DurationString, parseDurationString } from '@perses-dev/spec'; import { UnixTimestampSeconds } from './api-types'; export interface PrometheusTimeRange { diff --git a/prometheus/src/plugins/PrometheusDatasourceEditor.tsx b/prometheus/src/plugins/PrometheusDatasourceEditor.tsx index 676fd26ab..f19340e99 100644 --- a/prometheus/src/plugins/PrometheusDatasourceEditor.tsx +++ b/prometheus/src/plugins/PrometheusDatasourceEditor.tsx @@ -13,11 +13,11 @@ import { Box, IconButton, TextField, Typography } from '@mui/material'; import { QueryParamValues } from '@perses-dev/components'; -import { DurationString } from '@perses-dev/core'; import { HTTPSettingsEditor } from '@perses-dev/plugin-system'; import MinusIcon from 'mdi-material-ui/Minus'; import PlusIcon from 'mdi-material-ui/Plus'; import { ReactElement, useRef, useState } from 'react'; +import { DurationString } from '@perses-dev/spec'; import { DEFAULT_SCRAPE_INTERVAL, PrometheusDatasourceSpec } from './types'; interface QueryParamEntry { diff --git a/prometheus/src/plugins/interpolation.ts b/prometheus/src/plugins/interpolation.ts index 0c4f6d89f..eee851875 100644 --- a/prometheus/src/plugins/interpolation.ts +++ b/prometheus/src/plugins/interpolation.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector, DatasourceSpec } from '@perses-dev/core'; import { interpolateHeaders, interpolateQueryParams, VariableStateMap } from '@perses-dev/components'; import { DatasourceStore } from '@perses-dev/plugin-system'; +import { DatasourceSelector, DatasourceSpec } from '@perses-dev/spec'; import { ClientRequestOptions, PrometheusClient } from '../model'; import { PrometheusDatasourceSpec } from './types'; diff --git a/prometheus/src/plugins/prometheus-datasource.tsx b/prometheus/src/plugins/prometheus-datasource.tsx index dabe20e4e..53fc53293 100644 --- a/prometheus/src/plugins/prometheus-datasource.tsx +++ b/prometheus/src/plugins/prometheus-datasource.tsx @@ -12,8 +12,9 @@ // limitations under the License. import { QueryParamValues } from '@perses-dev/components'; -import { BuiltinVariableDefinition, RequestHeaders } from '@perses-dev/core'; import { DatasourcePlugin } from '@perses-dev/plugin-system'; +import { BuiltinVariableDefinition } from '@perses-dev/spec'; +import { RequestHeaders } from '@perses-dev/client'; import { ClientRequestOptions, healthCheck, diff --git a/prometheus/src/plugins/prometheus-time-series-query/get-time-series-data.ts b/prometheus/src/plugins/prometheus-time-series-query/get-time-series-data.ts index 5b3903d0d..6b480ade2 100644 --- a/prometheus/src/plugins/prometheus-time-series-query/get-time-series-data.ts +++ b/prometheus/src/plugins/prometheus-time-series-query/get-time-series-data.ts @@ -11,6 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { TimeSeriesQueryPlugin, datasourceSelectValueToSelector, replaceVariables } from '@perses-dev/plugin-system'; +import { fromUnixTime, milliseconds } from 'date-fns'; import { DatasourceSpec, DurationString, @@ -18,9 +20,7 @@ import { parseDurationString, TimeSeries, TimeSeriesData, -} from '@perses-dev/core'; -import { TimeSeriesQueryPlugin, datasourceSelectValueToSelector, replaceVariables } from '@perses-dev/plugin-system'; -import { fromUnixTime, milliseconds } from 'date-fns'; +} from '@perses-dev/spec'; import { parseValueTuple, PrometheusClient, diff --git a/prometheus/src/plugins/prometheus-time-series-query/plugin.test.ts b/prometheus/src/plugins/prometheus-time-series-query/plugin.test.ts index f0e7dfa9f..5d9d469da 100644 --- a/prometheus/src/plugins/prometheus-time-series-query/plugin.test.ts +++ b/prometheus/src/plugins/prometheus-time-series-query/plugin.test.ts @@ -12,11 +12,11 @@ // limitations under the License. // TODO: This should be fixed globally in the test setup -import { DatasourceSpec } from '@perses-dev/core'; jest.mock('echarts/core'); import { TimeSeriesQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { RangeQueryResponse } from '../../model'; import { PrometheusDatasource } from '../prometheus-datasource'; import { PrometheusDatasourceSpec } from '../types'; diff --git a/prometheus/src/plugins/prometheus-time-series-query/query-editor-model.ts b/prometheus/src/plugins/prometheus-time-series-query/query-editor-model.ts index 43f68ba71..e7581ab10 100644 --- a/prometheus/src/plugins/prometheus-time-series-query/query-editor-model.ts +++ b/prometheus/src/plugins/prometheus-time-series-query/query-editor-model.ts @@ -14,7 +14,7 @@ import { useState } from 'react'; import { produce } from 'immer'; import { OptionsEditorProps } from '@perses-dev/plugin-system'; -import { DurationString } from '@perses-dev/core'; +import { DurationString } from '@perses-dev/spec'; import { PrometheusTimeSeriesQuerySpec } from './time-series-query-model'; export type PrometheusTimeSeriesQueryEditorProps = OptionsEditorProps; diff --git a/prometheus/src/plugins/prometheus-time-series-query/replace-prom-builtin-variables.ts b/prometheus/src/plugins/prometheus-time-series-query/replace-prom-builtin-variables.ts index e083f6b57..c05cecacc 100644 --- a/prometheus/src/plugins/prometheus-time-series-query/replace-prom-builtin-variables.ts +++ b/prometheus/src/plugins/prometheus-time-series-query/replace-prom-builtin-variables.ts @@ -12,7 +12,7 @@ // limitations under the License. import { replaceVariable } from '@perses-dev/plugin-system'; -import { formatDuration, msToPrometheusDuration } from '@perses-dev/core'; +import { convertTimeToDuration, formatDuration } from '@perses-dev/spec'; /* * Replace variable placeholders in a PromQL query @@ -25,7 +25,7 @@ import { formatDuration, msToPrometheusDuration } from '@perses-dev/core'; */ export function replacePromBuiltinVariables(query: string, minStepMs: number, intervalMs: number): string { let updatedQuery = replaceVariable(query, '__interval_ms', intervalMs.toString()); - updatedQuery = replaceVariable(updatedQuery, '__interval', formatDuration(msToPrometheusDuration(intervalMs))); + updatedQuery = replaceVariable(updatedQuery, '__interval', formatDuration(convertTimeToDuration(intervalMs))); // The $__rate_interval variable is meant to be used with the rate() promQL function. // It is defined as max($__interval + Min step, 4 * Min step) @@ -33,7 +33,7 @@ export function replacePromBuiltinVariables(query: string, minStepMs: number, in updatedQuery = replaceVariable( updatedQuery, '__rate_interval', - formatDuration(msToPrometheusDuration(rateIntervalMs)) + formatDuration(convertTimeToDuration(rateIntervalMs)) ); return updatedQuery; diff --git a/prometheus/src/plugins/prometheus-time-series-query/time-series-query-model.ts b/prometheus/src/plugins/prometheus-time-series-query/time-series-query-model.ts index 8b150bf30..8dc68f213 100644 --- a/prometheus/src/plugins/prometheus-time-series-query/time-series-query-model.ts +++ b/prometheus/src/plugins/prometheus-time-series-query/time-series-query-model.ts @@ -11,10 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DurationString } from '@perses-dev/core'; import { DatasourceSelectValue } from '@perses-dev/plugin-system'; +import { DurationString } from '@perses-dev/spec'; import { PrometheusDatasourceSelector } from '../../model'; - /** * The spec/options for the PrometheusTimeSeriesQuery plugin. */ diff --git a/prometheus/src/plugins/types.ts b/prometheus/src/plugins/types.ts index 992af4d22..5e9b5e56a 100644 --- a/prometheus/src/plugins/types.ts +++ b/prometheus/src/plugins/types.ts @@ -12,8 +12,8 @@ // limitations under the License. import { QueryParamValues } from '@perses-dev/components'; -import { DurationString, HTTPProxy } from '@perses-dev/core'; import { DatasourceSelectValue } from '@perses-dev/plugin-system'; +import { DurationString, HTTPProxy } from '@perses-dev/spec'; import { PrometheusDatasourceSelector } from '../model'; export const DEFAULT_SCRAPE_INTERVAL: DurationString = '1m'; diff --git a/pyroscope/package.json b/pyroscope/package.json index 71ce09c6f..40f7cab66 100644 --- a/pyroscope/package.json +++ b/pyroscope/package.json @@ -31,11 +31,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/explore": "^0.54.0-beta.3", "@tanstack/react-query": "^4.39.1", "@uiw/react-codemirror": "^4.19.1", "date-fns": "^4.1.0", diff --git a/pyroscope/src/explore/PyroscopeExplorer.tsx b/pyroscope/src/explore/PyroscopeExplorer.tsx index 71fbda571..6f0f1788a 100644 --- a/pyroscope/src/explore/PyroscopeExplorer.tsx +++ b/pyroscope/src/explore/PyroscopeExplorer.tsx @@ -15,8 +15,8 @@ import { Box, Stack } from '@mui/material'; import { ReactElement, useState } from 'react'; import { DataQueriesProvider, MultiQueryEditor } from '@perses-dev/plugin-system'; import { Panel } from '@perses-dev/dashboards'; -import { QueryDefinition } from '@perses-dev/core'; import { useExplorerManagerContext } from '@perses-dev/explore'; +import { QueryDefinition } from '@perses-dev/spec'; interface ProfilesExplorerQueryParams { queries?: QueryDefinition[]; diff --git a/pyroscope/src/model/pyroscope-client.ts b/pyroscope/src/model/pyroscope-client.ts index 249bd790e..ec4fa06bb 100644 --- a/pyroscope/src/model/pyroscope-client.ts +++ b/pyroscope/src/model/pyroscope-client.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch, RequestHeaders } from '@perses-dev/core'; import { DatasourceClient } from '@perses-dev/plugin-system'; +import { RequestHeaders } from '@perses-dev/client'; import { SearchProfilesParameters, SearchProfilesResponse, diff --git a/pyroscope/src/model/pyroscope-selectors.ts b/pyroscope/src/model/pyroscope-selectors.ts index e957ca5b4..b2a68091f 100644 --- a/pyroscope/src/model/pyroscope-selectors.ts +++ b/pyroscope/src/model/pyroscope-selectors.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export const PYROSCOPE_DATASOURCE_KIND = 'PyroscopeDatasource' as const; diff --git a/pyroscope/src/plugins/pyroscope-datasource-types.tsx b/pyroscope/src/plugins/pyroscope-datasource-types.tsx index 775cf54ae..a364afc41 100644 --- a/pyroscope/src/plugins/pyroscope-datasource-types.tsx +++ b/pyroscope/src/plugins/pyroscope-datasource-types.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy } from '@perses-dev/core'; +import { HTTPProxy } from '@perses-dev/spec'; export interface PyroscopeDatasourceSpec { directUrl?: string; diff --git a/pyroscope/src/plugins/pyroscope-profile-query/get-profile-data.ts b/pyroscope/src/plugins/pyroscope-profile-query/get-profile-data.ts index ee691a8ce..1b4656115 100644 --- a/pyroscope/src/plugins/pyroscope-profile-query/get-profile-data.ts +++ b/pyroscope/src/plugins/pyroscope-profile-query/get-profile-data.ts @@ -12,8 +12,8 @@ // limitations under the License. import { ProfileQueryPlugin } from '@perses-dev/plugin-system'; -import { AbsoluteTimeRange, StackTrace, ProfileData } from '@perses-dev/core'; import { getUnixTime } from 'date-fns'; +import { AbsoluteTimeRange, ProfileData, StackTrace } from '@perses-dev/spec'; import { PyroscopeProfileQuerySpec, PYROSCOPE_DATASOURCE_KIND, PyroscopeDatasourceSelector } from '../../model'; import { PyroscopeClient } from '../../model/pyroscope-client'; import { SearchProfilesParameters, SearchProfilesResponse } from '../../model/api-types'; diff --git a/pyroscope/src/utils/use-query.ts b/pyroscope/src/utils/use-query.ts index 75b9941d4..23f24d9fe 100644 --- a/pyroscope/src/utils/use-query.ts +++ b/pyroscope/src/utils/use-query.ts @@ -12,9 +12,10 @@ // limitations under the License. import { useDatasourceClient, useTimeRange } from '@perses-dev/plugin-system'; -import { DatasourceSelector, StatusError } from '@perses-dev/core'; import { useQuery, UseQueryResult } from '@tanstack/react-query'; +import { DatasourceSelector } from '@perses-dev/spec'; +import { StatusError } from '@perses-dev/client'; import { SearchLabelNamesResponse, SearchLabelValuesResponse, diff --git a/scatterchart/package.json b/scatterchart/package.json index 600f754d0..b1b276bb9 100644 --- a/scatterchart/package.json +++ b/scatterchart/package.json @@ -30,9 +30,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/scatterchart/src/ScatterChartPanel.test.tsx b/scatterchart/src/ScatterChartPanel.test.tsx index 6dfcccd1f..5ed74c06a 100644 --- a/scatterchart/src/ScatterChartPanel.test.tsx +++ b/scatterchart/src/ScatterChartPanel.test.tsx @@ -12,12 +12,12 @@ // limitations under the License. import { PanelData, ReactRouterProvider, TimeRangeProviderBasic } from '@perses-dev/plugin-system'; -import { TraceData } from '@perses-dev/core'; import { screen, render } from '@testing-library/react'; import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; import { MemoryRouter } from 'react-router-dom'; import { VariableProvider } from '@perses-dev/dashboards'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { TraceData } from '@perses-dev/spec'; import { MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT, MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT_EMPTY } from './mock-trace-data'; import { getSymbolSize, ScatterChartPanel, ScatterChartPanelProps } from './ScatterChartPanel'; diff --git a/scatterchart/src/ScatterChartPanel.tsx b/scatterchart/src/ScatterChartPanel.tsx index c4e70f872..8c6a07f73 100644 --- a/scatterchart/src/ScatterChartPanel.tsx +++ b/scatterchart/src/ScatterChartPanel.tsx @@ -13,9 +13,9 @@ import { PanelProps } from '@perses-dev/plugin-system'; import { ReactElement, useMemo } from 'react'; -import { TraceData, TraceSearchResult } from '@perses-dev/core'; import { EChartsOption, SeriesOption } from 'echarts'; import { NoDataOverlay, useChartsTheme } from '@perses-dev/components'; +import { TraceData, TraceSearchResult } from '@perses-dev/spec'; import { Scatterplot } from './Scatterplot'; import { ScatterChartOptions } from './scatter-chart-model'; diff --git a/scatterchart/src/Scatterplot.tsx b/scatterchart/src/Scatterplot.tsx index 0de185741..b49d187ab 100644 --- a/scatterchart/src/Scatterplot.tsx +++ b/scatterchart/src/Scatterplot.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { ReactElement, useMemo } from 'react'; -import { EChart, OnEventsType, useChartsTheme } from '@perses-dev/components'; +import { EChart, formatValue, OnEventsType, useChartsTheme } from '@perses-dev/components'; import { use, EChartsCoreOption } from 'echarts/core'; import { ScatterChart as EChartsScatterChart } from 'echarts/charts'; import { @@ -25,7 +25,6 @@ import { } from 'echarts/components'; import { CanvasRenderer } from 'echarts/renderers'; import { EChartsOption, ScatterSeriesOption } from 'echarts'; -import { formatValue } from '@perses-dev/core'; import { replaceVariablesInString, useAllVariableValues, diff --git a/scatterchart/src/mock-trace-data.ts b/scatterchart/src/mock-trace-data.ts index 67530f435..362241309 100644 --- a/scatterchart/src/mock-trace-data.ts +++ b/scatterchart/src/mock-trace-data.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TraceData } from '@perses-dev/core'; +import { TraceData } from '@perses-dev/spec'; /** * Mock data we get from getTraceData() in @perses/tempo-plugin. diff --git a/scatterchart/src/scatter-chart-model.ts b/scatterchart/src/scatter-chart-model.ts index 8025c33f0..bf37198ab 100644 --- a/scatterchart/src/scatter-chart-model.ts +++ b/scatterchart/src/scatter-chart-model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { UnknownSpec, QueryDefinition } from '@perses-dev/core'; +import { QueryDefinition, UnknownSpec } from '@perses-dev/spec'; export type TraceQueryDefinition = QueryDefinition<'TraceQuery', PluginSpec>; diff --git a/splunk/package.json b/splunk/package.json index 1e16ef8fc..0f369f79d 100644 --- a/splunk/package.json +++ b/splunk/package.json @@ -25,9 +25,9 @@ "types": "lib/index.d.ts", "dependencies": {}, "peerDependencies": { - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "immer": "^10.1.1", "react": "^17.0.2 || ^18.0.0" }, diff --git a/splunk/src/datasources/splunk-datasource/splunk-datasource-types.ts b/splunk/src/datasources/splunk-datasource/splunk-datasource-types.ts index 21ae0141d..87d8ceed0 100644 --- a/splunk/src/datasources/splunk-datasource/splunk-datasource-types.ts +++ b/splunk/src/datasources/splunk-datasource/splunk-datasource-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy } from '@perses-dev/core'; +import { HTTPProxy } from '@perses-dev/spec'; export interface SplunkDatasourceSpec { directUrl?: string; diff --git a/splunk/src/model/splunk-client.ts b/splunk/src/model/splunk-client.ts index d5bc8cd58..e0db9b3f5 100644 --- a/splunk/src/model/splunk-client.ts +++ b/splunk/src/model/splunk-client.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch, fetchJson } from '@perses-dev/core'; +import { fetchJson } from '@perses-dev/client'; import { SplunkJobCreateResponse, SplunkJobStatusResponse, diff --git a/splunk/src/queries/splunk-log-query/get-splunk-log-data.ts b/splunk/src/queries/splunk-log-query/get-splunk-log-data.ts index 3f0d5536e..e10cf16bc 100644 --- a/splunk/src/queries/splunk-log-query/get-splunk-log-data.ts +++ b/splunk/src/queries/splunk-log-query/get-splunk-log-data.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogEntry, LogData, HTTPAllowedEndpoint } from '@perses-dev/core'; import { replaceVariables } from '@perses-dev/plugin-system'; +import { HTTPAllowedEndpoint, LogData, LogEntry } from '@perses-dev/spec'; import { SplunkClient } from '../../model/splunk-client'; import { SplunkDatasourceSpec } from '../../datasources/splunk-datasource/splunk-datasource-types'; import { DEFAULT_DATASOURCE } from '../constants'; diff --git a/splunk/src/queries/splunk-log-query/log-query-plugin-interface.ts b/splunk/src/queries/splunk-log-query/log-query-plugin-interface.ts index b9964e943..add4b175b 100644 --- a/splunk/src/queries/splunk-log-query/log-query-plugin-interface.ts +++ b/splunk/src/queries/splunk-log-query/log-query-plugin-interface.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, AbsoluteTimeRange, UnknownSpec } from '@perses-dev/core'; import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec'; export interface LogQueryResult { logs: LogData; diff --git a/splunk/src/queries/splunk-log-query/splunk-log-query-types.ts b/splunk/src/queries/splunk-log-query/splunk-log-query-types.ts index 6eff1783c..b0544bca5 100644 --- a/splunk/src/queries/splunk-log-query/splunk-log-query-types.ts +++ b/splunk/src/queries/splunk-log-query/splunk-log-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; import { SplunkLogResults } from '../../model/splunk-client-types'; export interface SplunkLogQuerySpec { diff --git a/splunk/src/queries/splunk-time-series-query/get-splunk-time-series-data.ts b/splunk/src/queries/splunk-time-series-query/get-splunk-time-series-data.ts index 32a6a5ebd..a3b88e5fe 100644 --- a/splunk/src/queries/splunk-time-series-query/get-splunk-time-series-data.ts +++ b/splunk/src/queries/splunk-time-series-query/get-splunk-time-series-data.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeries, HTTPAllowedEndpoint } from '@perses-dev/core'; import { TimeSeriesQueryPlugin, replaceVariables } from '@perses-dev/plugin-system'; +import { HTTPAllowedEndpoint, TimeSeries } from '@perses-dev/spec'; import { SplunkClient } from '../../model/splunk-client'; import { SplunkDatasourceSpec } from '../../datasources/splunk-datasource/splunk-datasource-types'; import { DEFAULT_DATASOURCE } from '../constants'; diff --git a/splunk/src/queries/splunk-time-series-query/splunk-time-series-query-types.ts b/splunk/src/queries/splunk-time-series-query/splunk-time-series-query-types.ts index 639f1471a..e535cd09f 100644 --- a/splunk/src/queries/splunk-time-series-query/splunk-time-series-query-types.ts +++ b/splunk/src/queries/splunk-time-series-query/splunk-time-series-query-types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; import { SplunkTimeSeriesResults } from '../../model/splunk-client-types'; export interface SplunkTimeSeriesQuerySpec { diff --git a/statchart/package.json b/statchart/package.json index 3a0b84eeb..a17b53a8a 100644 --- a/statchart/package.json +++ b/statchart/package.json @@ -27,9 +27,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/statchart/src/StatChartBase.test.tsx b/statchart/src/StatChartBase.test.tsx index 1ce8a13cd..84897e6b4 100644 --- a/statchart/src/StatChartBase.test.tsx +++ b/statchart/src/StatChartBase.test.tsx @@ -12,8 +12,8 @@ // limitations under the License. import { render, screen } from '@testing-library/react'; -import { FormatOptions } from '@perses-dev/core'; -import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; + +import { ChartsProvider, FormatOptions, testChartsTheme } from '@perses-dev/components'; import { StatChartBase, StatChartData } from './StatChartBase'; jest.mock('./utils/calculate-font-size', () => ({ diff --git a/statchart/src/StatChartBase.tsx b/statchart/src/StatChartBase.tsx index 57efc90fe..461a87204 100644 --- a/statchart/src/StatChartBase.tsx +++ b/statchart/src/StatChartBase.tsx @@ -12,14 +12,13 @@ // limitations under the License. import { FC, ReactNode, useMemo } from 'react'; -import { FormatOptions } from '@perses-dev/core'; import { Box, Typography, styled, useTheme } from '@mui/material'; import merge from 'lodash/merge'; import { use, EChartsCoreOption } from 'echarts/core'; import { LineChart as EChartsLineChart, LineSeriesOption } from 'echarts/charts'; import { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components'; import { CanvasRenderer } from 'echarts/renderers'; -import { EChart, FontSizeOption, GraphSeries, useChartsTheme } from '@perses-dev/components'; +import { EChart, FontSizeOption, FormatOptions, GraphSeries, useChartsTheme } from '@perses-dev/components'; import chroma from 'chroma-js'; import { useOptimalFontSize } from './utils/calculate-font-size'; import { formatStatChartValue } from './utils/format-stat-chart-value'; diff --git a/statchart/src/StatChartOptionsEditorSettings.tsx b/statchart/src/StatChartOptionsEditorSettings.tsx index ff34d4594..1126a8846 100644 --- a/statchart/src/StatChartOptionsEditorSettings.tsx +++ b/statchart/src/StatChartOptionsEditorSettings.tsx @@ -18,6 +18,7 @@ import { FontSizeSelectorProps, FormatControls, FormatControlsProps, + FormatOptions, OptionsEditorColumn, OptionsEditorControl, OptionsEditorGrid, @@ -26,7 +27,6 @@ import { ThresholdsEditor, ThresholdsEditorProps, } from '@perses-dev/components'; -import { FormatOptions } from '@perses-dev/core'; import { CalculationSelector, CalculationSelectorProps, diff --git a/statchart/src/StatChartPanel.tsx b/statchart/src/StatChartPanel.tsx index 359137d7e..030734b77 100644 --- a/statchart/src/StatChartPanel.tsx +++ b/statchart/src/StatChartPanel.tsx @@ -12,11 +12,18 @@ // limitations under the License. import { TitleComponentOption } from 'echarts'; -import { useChartsTheme, GraphSeries, PersesChartsTheme } from '@perses-dev/components'; +import { + useChartsTheme, + GraphSeries, + PersesChartsTheme, + ValueMapping, + applyValueMapping, + createRegexFromString, +} from '@perses-dev/components'; import { Stack, Typography, SxProps } from '@mui/material'; import { FC, useMemo } from 'react'; -import { applyValueMapping, Labels, createRegexFromString, TimeSeriesData, ValueMapping } from '@perses-dev/core'; import { PanelProps, PanelData } from '@perses-dev/plugin-system'; +import { Labels, TimeSeriesData } from '@perses-dev/spec'; import { StatChartOptions } from './stat-chart-model'; import { convertSparkline } from './utils/data-transform'; import { calculateValue } from './utils/calculate-value'; diff --git a/statchart/src/StatChartValueMappingEditor.tsx b/statchart/src/StatChartValueMappingEditor.tsx index 7c266c4d7..e5cfae356 100644 --- a/statchart/src/StatChartValueMappingEditor.tsx +++ b/statchart/src/StatChartValueMappingEditor.tsx @@ -12,8 +12,7 @@ // limitations under the License. import { OptionsEditorProps } from '@perses-dev/plugin-system'; -import { ValueMapping } from '@perses-dev/core'; -import { ValueMappingsEditor } from '@perses-dev/components'; +import { ValueMapping, ValueMappingsEditor } from '@perses-dev/components'; import { FC } from 'react'; import { StatChartOptions } from './stat-chart-model'; diff --git a/statchart/src/stat-chart-model.ts b/statchart/src/stat-chart-model.ts index a44d20bdf..b7ff3ff61 100644 --- a/statchart/src/stat-chart-model.ts +++ b/statchart/src/stat-chart-model.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FontSizeOption } from '@perses-dev/components'; -import { CalculationType, Definition, FormatOptions, ThresholdOptions, ValueMapping } from '@perses-dev/core'; -import { OptionsEditorProps } from '@perses-dev/plugin-system'; +import { FontSizeOption, FormatOptions, ThresholdOptions, ValueMapping } from '@perses-dev/components'; +import { CalculationType, OptionsEditorProps } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; /** * The schema for a StatChart panel. diff --git a/statchart/src/utils/calculate-value.ts b/statchart/src/utils/calculate-value.ts index 5b92a7e4c..a6322bc6c 100644 --- a/statchart/src/utils/calculate-value.ts +++ b/statchart/src/utils/calculate-value.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CalculationsMap, CalculationType, DEFAULT_CALCULATION, TimeSeries } from '@perses-dev/core'; +import { CalculationsMap, CalculationType, DEFAULT_CALCULATION } from '@perses-dev/plugin-system'; +import { TimeSeries } from '@perses-dev/spec'; export const calculateValue = ( calculation: CalculationType, diff --git a/statchart/src/utils/data-transform.test.ts b/statchart/src/utils/data-transform.test.ts index e3a6f94b6..6d11e2696 100644 --- a/statchart/src/utils/data-transform.test.ts +++ b/statchart/src/utils/data-transform.test.ts @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { testChartsTheme } from '@perses-dev/components'; -import { ThresholdOptions } from '@perses-dev/core'; +import { testChartsTheme, ThresholdOptions } from '@perses-dev/components'; import { LineSeriesOption } from 'echarts'; import { StatChartOptions, StatChartSparklineOptions } from '../stat-chart-model'; import { convertSparkline } from './data-transform'; diff --git a/statchart/src/utils/format-stat-chart-value.ts b/statchart/src/utils/format-stat-chart-value.ts index a250c0367..f921725dc 100644 --- a/statchart/src/utils/format-stat-chart-value.ts +++ b/statchart/src/utils/format-stat-chart-value.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FormatOptions, formatValue } from '@perses-dev/core'; +import { FormatOptions, formatValue } from '@perses-dev/components'; export const formatStatChartValue = (value?: string | number | null, format?: FormatOptions): string => { if (value === null) { diff --git a/statchart/src/utils/get-color.ts b/statchart/src/utils/get-color.ts index b0f4f59cb..892ff12ef 100644 --- a/statchart/src/utils/get-color.ts +++ b/statchart/src/utils/get-color.ts @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { PersesChartsTheme } from '@perses-dev/components'; -import { applyValueMapping, ThresholdOptions, ValueMapping } from '@perses-dev/core'; +import { applyValueMapping, PersesChartsTheme, ThresholdOptions, ValueMapping } from '@perses-dev/components'; import { StatChartOptions } from '../stat-chart-model'; type StatChartValue = number | string | null; diff --git a/staticlistvariable/package.json b/staticlistvariable/package.json index 3b320a21c..d406d9e76 100644 --- a/staticlistvariable/package.json +++ b/staticlistvariable/package.json @@ -30,9 +30,8 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/statushistorychart/package.json b/statushistorychart/package.json index 07fca8871..fda497b17 100644 --- a/statushistorychart/package.json +++ b/statushistorychart/package.json @@ -27,9 +27,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/statushistorychart/src/StatusHistoryChartBase.tsx b/statushistorychart/src/StatusHistoryChartBase.tsx index e8bb3075e..115a1e756 100644 --- a/statushistorychart/src/StatusHistoryChartBase.tsx +++ b/statushistorychart/src/StatusHistoryChartBase.tsx @@ -23,10 +23,10 @@ import { } from 'echarts/components'; import { use } from 'echarts/core'; import { CanvasRenderer } from 'echarts/renderers'; -import { TimeScale } from '@perses-dev/core'; import { EChartsCoreOption, TitleComponentOption } from 'echarts'; import { FC } from 'react'; import { EChart, useChartsTheme, useTimeZone } from '@perses-dev/components'; +import { TimeScale } from '@perses-dev/spec'; import { getFormattedStatusHistoryAxisLabel } from './utils/get-formatted-axis-label'; import { generateTooltipHTML } from './StatusHistoryTooltip'; diff --git a/statushistorychart/src/StatusHistoryPanel.tsx b/statushistorychart/src/StatusHistoryPanel.tsx index 1445e4bf3..1a2ab2b85 100644 --- a/statushistorychart/src/StatusHistoryPanel.tsx +++ b/statushistorychart/src/StatusHistoryPanel.tsx @@ -16,7 +16,7 @@ import { ContentWithLegend, useChartsTheme } from '@perses-dev/components'; import { PanelProps, validateLegendSpec } from '@perses-dev/plugin-system'; import { merge } from 'lodash'; import { ReactElement, useMemo } from 'react'; -import { TimeSeriesData } from '@perses-dev/core'; +import { TimeSeriesData } from '@perses-dev/spec'; import { useStatusHistoryDataModel } from './utils/data-transform'; import { StatusHistoryChartOptions } from './status-history-model.js'; import { StatusHistoryChartBase } from './StatusHistoryChartBase'; diff --git a/statushistorychart/src/StatusHistoryValueMappingEditor.tsx b/statushistorychart/src/StatusHistoryValueMappingEditor.tsx index 4b1477dff..08ab60a50 100644 --- a/statushistorychart/src/StatusHistoryValueMappingEditor.tsx +++ b/statushistorychart/src/StatusHistoryValueMappingEditor.tsx @@ -12,8 +12,7 @@ // limitations under the License. import { OptionsEditorProps } from '@perses-dev/plugin-system'; -import { ValueMapping } from '@perses-dev/core'; -import { ValueMappingsEditor } from '@perses-dev/components'; +import { ValueMapping, ValueMappingsEditor } from '@perses-dev/components'; import { FC } from 'react'; import { StatusHistoryChartOptions } from './status-history-model'; diff --git a/statushistorychart/src/status-history-model.ts b/statushistorychart/src/status-history-model.ts index b63d5bbd7..ab3fba84b 100644 --- a/statushistorychart/src/status-history-model.ts +++ b/statushistorychart/src/status-history-model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ValueMapping } from '@perses-dev/core'; +import { ValueMapping } from '@perses-dev/components'; import { LegendSpecOptions, OptionsEditorProps } from '@perses-dev/plugin-system'; export function createInitialStatusHistoryChartOptions(): Record { diff --git a/statushistorychart/src/utils/data-transform.test.ts b/statushistorychart/src/utils/data-transform.test.ts index c3f8e5c3b..7fd75235e 100644 --- a/statushistorychart/src/utils/data-transform.test.ts +++ b/statushistorychart/src/utils/data-transform.test.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesData } from '@perses-dev/core'; import { PanelData } from '@perses-dev/plugin-system'; import { renderHook } from '@testing-library/react'; +import { TimeSeriesData } from '@perses-dev/spec'; import { useStatusHistoryDataModel } from './data-transform'; describe('useStatusHistoryDataModel', () => { diff --git a/statushistorychart/src/utils/data-transform.ts b/statushistorychart/src/utils/data-transform.ts index 97072116e..f8b8ab42d 100644 --- a/statushistorychart/src/utils/data-transform.ts +++ b/statushistorychart/src/utils/data-transform.ts @@ -11,10 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LegendItem } from '@perses-dev/components'; -import { applyValueMapping, TimeScale, TimeSeriesData } from '@perses-dev/core'; +import { applyValueMapping, LegendItem } from '@perses-dev/components'; import { PanelData } from '@perses-dev/plugin-system'; import { useMemo } from 'react'; +import { TimeScale, TimeSeriesData } from '@perses-dev/spec'; import { StatusHistoryChartOptions } from '../status-history-model'; import { StatusHistoryDataItem } from '../StatusHistoryChartBase'; import { FALLBACK_COLOR, getColorsForValues } from './get-color'; diff --git a/statushistorychart/src/utils/get-timescale.ts b/statushistorychart/src/utils/get-timescale.ts index 3a4ea8af3..a6bac4e97 100644 --- a/statushistorychart/src/utils/get-timescale.ts +++ b/statushistorychart/src/utils/get-timescale.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { getCommonTimeScale, TimeScale, TimeSeriesData } from '@perses-dev/core'; +import { getCommonTimeScale } from '@perses-dev/components'; import { PanelData } from '@perses-dev/plugin-system'; +import { TimeScale, TimeSeriesData } from '@perses-dev/spec'; export function getCommonTimeScaleForQueries(queries: Array>): TimeScale | undefined { const seriesData = queries.map((query) => query.data); diff --git a/table/package.json b/table/package.json index 3ae373561..8ca7bb47d 100644 --- a/table/package.json +++ b/table/package.json @@ -27,10 +27,10 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", - "@perses-dev/dashboards": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", "@tanstack/react-table": "^8.20.5", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/table/rsbuild.config.ts b/table/rsbuild.config.ts index e14b86ce3..8f57fa01f 100644 --- a/table/rsbuild.config.ts +++ b/table/rsbuild.config.ts @@ -31,7 +31,7 @@ export default createConfigForPlugin({ 'date-fns': { singleton: true }, 'date-fns-tz': { singleton: true }, lodash: { singleton: true }, - '@perses-dev/core': { singleton: true }, + '@perses-dev/spec': { singleton: true }, '@perses-dev/components': { singleton: true }, '@perses-dev/plugin-system': { singleton: true }, '@perses-dev/dashboards': { singleton: true }, diff --git a/table/src/TableExportAction.test.ts b/table/src/TableExportAction.test.ts index 0d75b894a..522dd3348 100644 --- a/table/src/TableExportAction.test.ts +++ b/table/src/TableExportAction.test.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesData } from '@perses-dev/core'; import { PanelData } from '@perses-dev/plugin-system'; +import { TimeSeriesData } from '@perses-dev/spec'; import { TableOptions } from './models'; import { buildTableData } from './TableExportAction'; diff --git a/table/src/TableExportAction.tsx b/table/src/TableExportAction.tsx index 31d3d7300..4bbea6d42 100644 --- a/table/src/TableExportAction.tsx +++ b/table/src/TableExportAction.tsx @@ -13,10 +13,10 @@ import React, { useCallback, useMemo } from 'react'; import { escapeCsvValue, PanelData, sanitizeFilename } from '@perses-dev/plugin-system'; -import { InfoTooltip } from '@perses-dev/components'; +import { InfoTooltip, transformData } from '@perses-dev/components'; import { IconButton } from '@mui/material'; import DownloadIcon from 'mdi-material-ui/Download'; -import { TimeSeriesData, transformData } from '@perses-dev/core'; +import { TimeSeriesData } from '@perses-dev/spec'; import { TableProps } from './components'; import type { TableOptions } from './models'; import { buildRawTableData } from './table-data-utils'; diff --git a/table/src/components/ColumnsEditor/ColumnEditor.tsx b/table/src/components/ColumnsEditor/ColumnEditor.tsx index 765799c1b..9e5fdd2cf 100644 --- a/table/src/components/ColumnsEditor/ColumnEditor.tsx +++ b/table/src/components/ColumnsEditor/ColumnEditor.tsx @@ -16,13 +16,13 @@ import { ReactElement, useState } from 'react'; import { AlignSelector, FormatControls, + FormatOptions, OptionsEditorColumn, OptionsEditorControl, OptionsEditorGrid, OptionsEditorGroup, SortSelectorButtons, } from '@perses-dev/components'; -import { FormatOptions } from '@perses-dev/core'; import { PluginKindSelect } from '@perses-dev/plugin-system'; import { ColumnSettings } from '../../models'; diff --git a/table/src/components/ColumnsEditor/EmbeddedPanelOptionsEditor.tsx b/table/src/components/ColumnsEditor/EmbeddedPanelOptionsEditor.tsx index 4cec59d21..00a4fd6b0 100644 --- a/table/src/components/ColumnsEditor/EmbeddedPanelOptionsEditor.tsx +++ b/table/src/components/ColumnsEditor/EmbeddedPanelOptionsEditor.tsx @@ -12,8 +12,8 @@ // limitations under the License. import { CircularProgress, Stack, Typography } from '@mui/material'; -import { UnknownSpec } from '@perses-dev/core'; import { OptionsEditorTabs, PanelPlugin, usePlugin } from '@perses-dev/plugin-system'; +import { UnknownSpec } from '@perses-dev/spec'; import merge from 'lodash/merge'; import { ReactElement, useEffect, useMemo, useRef } from 'react'; diff --git a/table/src/components/EmbeddedPanel.tsx b/table/src/components/EmbeddedPanel.tsx index eee82fb96..33d8bbcb6 100644 --- a/table/src/components/EmbeddedPanel.tsx +++ b/table/src/components/EmbeddedPanel.tsx @@ -12,11 +12,11 @@ // limitations under the License. import { PanelData } from '@perses-dev/plugin-system'; -import { QueryDataType, UnknownSpec } from '@perses-dev/core'; import { PanelPluginLoader } from '@perses-dev/dashboards'; import useResizeObserver from 'use-resize-observer'; import { ErrorAlert, ErrorBoundary } from '@perses-dev/components'; import { ReactElement } from 'react'; +import { QueryDataType, UnknownSpec } from '@perses-dev/spec'; interface EmbeddedPanelProps { kind: string; diff --git a/table/src/components/TablePanel.test.tsx b/table/src/components/TablePanel.test.tsx index 5618695d9..c1925d744 100644 --- a/table/src/components/TablePanel.test.tsx +++ b/table/src/components/TablePanel.test.tsx @@ -12,7 +12,6 @@ // limitations under the License. import { ChartsProvider, ItemActionsProvider, SelectionProvider, testChartsTheme } from '@perses-dev/components'; -import { TimeSeriesData } from '@perses-dev/core'; import { dynamicImportPluginLoader, PluginLoader, @@ -24,7 +23,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { render, screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { VirtuosoMockContext } from 'react-virtuoso'; -import * as packagejson from '../../package.json'; +import { TimeSeriesData } from '@perses-dev/spec'; import { TableOptions, TimeSeriesTableProps } from '../models'; import { MOCK_TIME_SERIES_DATA_MULTIVALUE, @@ -167,15 +166,29 @@ describe('TablePanel', () => { }); const pluginResource = { kind: 'PluginModule', - metadata: { name: 'Table Panel' }, + metadata: { name: 'Table', version: '0.1.0' }, spec: { - plugins: packagejson.perses.plugins, + plugins: [ + { + kind: 'Panel', + spec: { + name: 'Table', + display: { + name: 'Table', + description: '', + }, + }, + }, + ], }, }; + const testPluginLoader: PluginLoader = dynamicImportPluginLoader([ - { resource: pluginResource as PluginModuleResource, importPlugin: () => import('../Table') }, + { + resource: pluginResource as PluginModuleResource, + importPlugin: () => import('../Table').then((m) => ({ 'Panel:Table::0.1.0': m.Table })), + }, ]); - render( diff --git a/table/src/components/TablePanel.tsx b/table/src/components/TablePanel.tsx index 51ffdb5e1..4941ddef1 100644 --- a/table/src/components/TablePanel.tsx +++ b/table/src/components/TablePanel.tsx @@ -12,11 +12,18 @@ // limitations under the License. import { Box, Theme, Typography, useTheme } from '@mui/material'; -import { Table, TableCellConfigs, TableColumnConfig, useSelection } from '@perses-dev/components'; -import { CalculationsMap, formatValue, QueryDataType, TimeSeriesData, transformData } from '@perses-dev/core'; +import { + formatValue, + Table, + TableCellConfigs, + TableColumnConfig, + transformData, + useSelection, +} from '@perses-dev/components'; import { useSelectionItemActions } from '@perses-dev/dashboards'; import { ActionOptions, + CalculationsMap, PanelData, PanelProps, replaceVariablesInString, @@ -25,6 +32,7 @@ import { } from '@perses-dev/plugin-system'; import { ColumnFiltersState, PaginationState, RowSelectionState, SortingState } from '@tanstack/react-table'; import { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { QueryDataType, TimeSeriesData } from '@perses-dev/spec'; import { CellSettings, ColumnSettings, evaluateConditionalFormatting, TableOptions } from '../models'; import { buildRawTableData, getTablePanelQueryMode } from '../table-data-utils'; import { EmbeddedPanel } from './EmbeddedPanel'; diff --git a/table/src/components/TableTransformsEditor.tsx b/table/src/components/TableTransformsEditor.tsx index 0b16503ea..a42ed66da 100644 --- a/table/src/components/TableTransformsEditor.tsx +++ b/table/src/components/TableTransformsEditor.tsx @@ -11,8 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TransformsEditor } from '@perses-dev/components'; -import { Transform } from '@perses-dev/core'; +import { Transform, TransformsEditor } from '@perses-dev/components'; import { ReactElement } from 'react'; import { TableSettingsEditorProps } from '../models'; diff --git a/table/src/models/table-model.ts b/table/src/models/table-model.ts index 54ff238d5..b61533b73 100644 --- a/table/src/models/table-model.ts +++ b/table/src/models/table-model.ts @@ -11,11 +11,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition, FormatOptions, Transform, UnknownSpec } from '@perses-dev/core'; -import { TableDensity, TableCellConfig } from '@perses-dev/components'; +import { TableDensity, TableCellConfig, FormatOptions, Transform } from '@perses-dev/components'; import { ActionOptions, OptionsEditorProps, SelectionOptions } from '@perses-dev/plugin-system'; import React from 'react'; import { TextField, Stack, MenuItem, Typography } from '@mui/material'; +import { Definition, UnknownSpec } from '@perses-dev/spec'; export interface ColumnSettings { name: string; diff --git a/table/src/table-data-utils.ts b/table/src/table-data-utils.ts index a19ea8534..f81869ef1 100644 --- a/table/src/table-data-utils.ts +++ b/table/src/table-data-utils.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Labels, TimeSeries, TimeSeriesData } from '@perses-dev/core'; -import { PanelData } from '@perses-dev/plugin-system'; +import { Labels, PanelData } from '@perses-dev/plugin-system'; +import { TimeSeries, TimeSeriesData } from '@perses-dev/spec'; import { TableOptions } from './models'; /** diff --git a/table/src/test/mock-query-results.ts b/table/src/test/mock-query-results.ts index 59df8a8a8..479031aa2 100644 --- a/table/src/test/mock-query-results.ts +++ b/table/src/test/mock-query-results.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesData } from '@perses-dev/core'; +import { TimeSeriesData } from '@perses-dev/spec'; export const MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE = [ { diff --git a/tempo/package.json b/tempo/package.json index df3b81240..9197c237d 100644 --- a/tempo/package.json +++ b/tempo/package.json @@ -32,11 +32,12 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/client": "^0.54.0-beta.3", "@tanstack/react-query": "^4.39.1", "@uiw/react-codemirror": "^4.25.3", "date-fns": "^4.1.0", diff --git a/tempo/src/components/TraceQLEditor.tsx b/tempo/src/components/TraceQLEditor.tsx index 7da9771bf..f4b7f93a3 100644 --- a/tempo/src/components/TraceQLEditor.tsx +++ b/tempo/src/components/TraceQLEditor.tsx @@ -14,8 +14,8 @@ import { ReactElement, useMemo } from 'react'; import { InputLabel, Stack, useTheme } from '@mui/material'; import CodeMirror, { EditorView, ReactCodeMirrorProps } from '@uiw/react-codemirror'; -import { isValidTraceId } from '@perses-dev/core'; import { useTimeRange } from '@perses-dev/plugin-system'; +import { isValidTraceId } from '@perses-dev/spec'; import { TempoClient } from '../model'; import { TraceQLExtension } from './TraceQLExtension'; diff --git a/tempo/src/components/TraceQLExtension.ts b/tempo/src/components/TraceQLExtension.ts index d2deeddbe..54cf5c8c7 100644 --- a/tempo/src/components/TraceQLExtension.ts +++ b/tempo/src/components/TraceQLExtension.ts @@ -15,7 +15,7 @@ import { LRLanguage } from '@codemirror/language'; import { parser } from '@grafana/lezer-traceql'; import { CompletionContext } from '@codemirror/autocomplete'; import { Extension } from '@uiw/react-codemirror'; -import { AbsoluteTimeRange } from '@perses-dev/core'; +import { AbsoluteTimeRange } from '@perses-dev/spec'; import { TempoClient } from '../model/tempo-client'; import { traceQLHighlight } from './highlight'; import { complete } from './complete'; diff --git a/tempo/src/explore/TempoExplorer.tsx b/tempo/src/explore/TempoExplorer.tsx index af5e26f86..c8ce01003 100644 --- a/tempo/src/explore/TempoExplorer.tsx +++ b/tempo/src/explore/TempoExplorer.tsx @@ -13,11 +13,11 @@ import { Box, Stack } from '@mui/material'; import { ErrorAlert, ErrorBoundary, LoadingOverlay, NoDataOverlay } from '@perses-dev/components'; -import { QueryDefinition, isValidTraceId } from '@perses-dev/core'; import { Panel } from '@perses-dev/dashboards'; import { useExplorerManagerContext } from '@perses-dev/explore'; import { DataQueriesProvider, MultiQueryEditor, useDataQueries } from '@perses-dev/plugin-system'; import { ReactElement, useState } from 'react'; +import { isValidTraceId, QueryDefinition } from '@perses-dev/spec'; import { TempoTraceQuerySpec } from '../model'; import { ClosableAlert } from '../components/ClosableAlert'; import { linkToSpan, linkToTrace } from './links'; diff --git a/tempo/src/model/api-types.ts b/tempo/src/model/api-types.ts index 88b0d8996..9ce22f426 100644 --- a/tempo/src/model/api-types.ts +++ b/tempo/src/model/api-types.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { otlpcommonv1, otlptracev1 } from '@perses-dev/core'; +import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; /** * Request parameters of Tempo HTTP API endpoint GET /api/search diff --git a/tempo/src/model/tempo-client.ts b/tempo/src/model/tempo-client.ts index 62f49fd0b..1f8a93df7 100644 --- a/tempo/src/model/tempo-client.ts +++ b/tempo/src/model/tempo-client.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch, otlptracev1, RequestHeaders } from '@perses-dev/core'; import { DatasourceClient } from '@perses-dev/plugin-system'; +import { RequestHeaders } from '@perses-dev/client'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import { QueryRequestParameters, SearchRequestParameters, diff --git a/tempo/src/model/tempo-selectors.ts b/tempo/src/model/tempo-selectors.ts index 72dc1701d..a32e2b561 100644 --- a/tempo/src/model/tempo-selectors.ts +++ b/tempo/src/model/tempo-selectors.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { DatasourceSelectValue, isVariableDatasource } from '@perses-dev/plugin-system'; +import { DatasourceSelector } from '@perses-dev/spec'; export const TEMPO_DATASOURCE_KIND = 'TempoDatasource' as const; diff --git a/tempo/src/plugins/plugin.test.ts b/tempo/src/plugins/plugin.test.ts index 0cafa2fe0..6d4ad9fd6 100644 --- a/tempo/src/plugins/plugin.test.ts +++ b/tempo/src/plugins/plugin.test.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSpec } from '@perses-dev/core'; import { TraceQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { MOCK_SEARCH_RESPONSE_VPARQUET4, MOCK_TRACE_DATA_SEARCHRESULT, MOCK_TRACE_RESPONSE_SMALL } from '../test'; import { TempoDatasourceSpec } from './tempo-datasource-types'; import { TempoDatasource } from './tempo-datasource'; diff --git a/tempo/src/plugins/tempo-datasource-types.tsx b/tempo/src/plugins/tempo-datasource-types.tsx index b87041dad..bbd710495 100644 --- a/tempo/src/plugins/tempo-datasource-types.tsx +++ b/tempo/src/plugins/tempo-datasource-types.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy } from '@perses-dev/core'; +import { HTTPProxy } from '@perses-dev/spec'; export interface TempoDatasourceSpec { directUrl?: string; diff --git a/tempo/src/plugins/tempo-trace-query/get-trace-data.test.ts b/tempo/src/plugins/tempo-trace-query/get-trace-data.test.ts index 2062a4278..863b9a670 100644 --- a/tempo/src/plugins/tempo-trace-query/get-trace-data.test.ts +++ b/tempo/src/plugins/tempo-trace-query/get-trace-data.test.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSpec } from '@perses-dev/core'; import { TraceQueryContext, replaceVariables } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { TempoDatasourceSpec } from '../tempo-datasource-types'; import { TempoDatasource } from '../tempo-datasource'; import { DEFAULT_SEARCH_LIMIT, SearchResponse } from '../../model/api-types'; diff --git a/tempo/src/plugins/tempo-trace-query/get-trace-data.ts b/tempo/src/plugins/tempo-trace-query/get-trace-data.ts index c606511b1..15f6b353a 100644 --- a/tempo/src/plugins/tempo-trace-query/get-trace-data.ts +++ b/tempo/src/plugins/tempo-trace-query/get-trace-data.ts @@ -11,9 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange, isValidTraceId, Notice, otlptracev1, TraceSearchResult } from '@perses-dev/core'; import { datasourceSelectValueToSelector, replaceVariables, TraceQueryPlugin } from '@perses-dev/plugin-system'; import { getUnixTime } from 'date-fns'; +import { AbsoluteTimeRange, isValidTraceId, Notice, TraceSearchResult } from '@perses-dev/spec'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector, diff --git a/tempo/src/test/mock-data.ts b/tempo/src/test/mock-data.ts index 9abf4cf8f..80643dd35 100644 --- a/tempo/src/test/mock-data.ts +++ b/tempo/src/test/mock-data.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TraceData } from '@perses-dev/core'; +import { TraceData } from '@perses-dev/spec'; import { QueryResponse, SearchResponse } from '../model/api-types'; export const MOCK_TRACE_RESPONSE: QueryResponse = { diff --git a/timeserieschart/package.json b/timeserieschart/package.json index 169ff6365..c420486cd 100644 --- a/timeserieschart/package.json +++ b/timeserieschart/package.json @@ -30,9 +30,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/timeserieschart/src/QuerySettingsEditor.tsx b/timeserieschart/src/QuerySettingsEditor.tsx index a57c58316..9de8b8d3a 100644 --- a/timeserieschart/src/QuerySettingsEditor.tsx +++ b/timeserieschart/src/QuerySettingsEditor.tsx @@ -25,8 +25,7 @@ import { Typography, useTheme, } from '@mui/material'; -import { FormatControls, OptionsColorPicker } from '@perses-dev/components'; -import { FormatOptions } from '@perses-dev/core'; +import { FormatControls, FormatOptions, OptionsColorPicker } from '@perses-dev/components'; import React, { ReactElement, useEffect, useMemo, useRef, useState } from 'react'; import DeleteIcon from 'mdi-material-ui/DeleteOutline'; import AddIcon from 'mdi-material-ui/Plus'; diff --git a/timeserieschart/src/TimeSeriesChartBase.tsx b/timeserieschart/src/TimeSeriesChartBase.tsx index 6702d597e..b1f759a23 100644 --- a/timeserieschart/src/TimeSeriesChartBase.tsx +++ b/timeserieschart/src/TimeSeriesChartBase.tsx @@ -15,7 +15,7 @@ import { forwardRef, MouseEvent, useCallback, useEffect, useImperativeHandle, us import { Box } from '@mui/material'; import merge from 'lodash/merge'; import isEqual from 'lodash/isEqual'; -import { getCommonTimeScale, TimeScale, FormatOptions, TimeSeries } from '@perses-dev/core'; + import type { EChartsCoreOption, GridComponentOption, @@ -46,7 +46,9 @@ import { DEFAULT_TOOLTIP_CONFIG, EChart, enableDataZoom, + FormatOptions, getClosestTimestamp, + getCommonTimeScale, getFormattedAxis, getPointInGrid, OnEventsType, @@ -59,6 +61,7 @@ import { ZoomEventData, } from '@perses-dev/components'; import { DatasetOption } from 'echarts/types/dist/shared'; +import { TimeScale, TimeSeries } from '@perses-dev/spec'; import { createTimezoneAwareAxisFormatter } from './utils/timezone-formatter'; use([ diff --git a/timeserieschart/src/TimeSeriesChartPanel.test.tsx b/timeserieschart/src/TimeSeriesChartPanel.test.tsx index 68f9e8cd6..c5f534d92 100644 --- a/timeserieschart/src/TimeSeriesChartPanel.test.tsx +++ b/timeserieschart/src/TimeSeriesChartPanel.test.tsx @@ -14,9 +14,9 @@ import { screen, render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; -import { TimeRangeValue, toAbsoluteTimeRange } from '@perses-dev/core'; import { TimeRangeContext } from '@perses-dev/plugin-system'; import { VirtuosoMockContext } from 'react-virtuoso'; +import { TimeRangeValue, toAbsoluteTimeRange } from '@perses-dev/spec'; import { MOCK_TIME_SERIES_DATA_MULTIVALUE } from './test/mock-query-results'; import { TimeSeriesChartPanel, TimeSeriesChartProps } from './TimeSeriesChartPanel'; diff --git a/timeserieschart/src/TimeSeriesChartPanel.tsx b/timeserieschart/src/TimeSeriesChartPanel.tsx index a87bc57d7..e3e6b511c 100644 --- a/timeserieschart/src/TimeSeriesChartPanel.tsx +++ b/timeserieschart/src/TimeSeriesChartPanel.tsx @@ -15,23 +15,14 @@ import { ReactElement, useMemo, useRef, useState } from 'react'; import { Box, useTheme } from '@mui/material'; import type { GridComponentOption } from 'echarts'; import merge from 'lodash/merge'; -import { - getTimeSeriesValues, - DEFAULT_LEGEND, - getCalculations, - formatValue, - StepOptions, - TimeSeries, - TimeSeriesValueTuple, - TimeSeriesData, - CalculationType, -} from '@perses-dev/core'; import { LEGEND_VALUE_CONFIG, PanelProps, useTimeRange, validateLegendSpec, legendValues, + getCalculations, + CalculationType, } from '@perses-dev/plugin-system'; import { ChartInstance, @@ -48,7 +39,12 @@ import { DEFAULT_TOOLTIP_CONFIG, TimeChartSeriesMapping, getFormattedMultipleYAxes, + DEFAULT_LEGEND, + StepOptions, + formatValue, + getTimeSeriesValues, } from '@perses-dev/components'; +import { TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec'; import { TimeSeriesChartOptions, DEFAULT_FORMAT, diff --git a/timeserieschart/src/test/mock-query-results.ts b/timeserieschart/src/test/mock-query-results.ts index 9e63c4453..6324cb06b 100644 --- a/timeserieschart/src/test/mock-query-results.ts +++ b/timeserieschart/src/test/mock-query-results.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesData } from '@perses-dev/core'; +import { TimeSeriesData } from '@perses-dev/spec'; export const MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE = [ { diff --git a/timeserieschart/src/time-series-chart-model.ts b/timeserieschart/src/time-series-chart-model.ts index 6920f407f..d0458b541 100644 --- a/timeserieschart/src/time-series-chart-model.ts +++ b/timeserieschart/src/time-series-chart-model.ts @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition, ThresholdOptions, FormatOptions } from '@perses-dev/core'; +import { FormatOptions, ThresholdOptions } from '@perses-dev/components'; import { OptionsEditorProps, LegendSpecOptions } from '@perses-dev/plugin-system'; +import { Definition } from '@perses-dev/spec'; /** * Line style options for time series charts. diff --git a/timeserieschart/src/utils/data-transform.ts b/timeserieschart/src/utils/data-transform.ts index da609e6ec..4048737aa 100644 --- a/timeserieschart/src/utils/data-transform.ts +++ b/timeserieschart/src/utils/data-transform.ts @@ -13,22 +13,17 @@ import type { YAXisComponentOption } from 'echarts'; import { LineSeriesOption, BarSeriesOption } from 'echarts/charts'; -import { - StepOptions, - TimeScale, - TimeSeries, - TimeSeriesValueTuple, - getCommonTimeScale, - TimeSeriesData, -} from '@perses-dev/core'; import { OPTIMIZED_MODE_SERIES_LIMIT, LegacyTimeSeries, EChartsDataFormat, EChartsValues, TimeSeriesOption, + StepOptions, + getCommonTimeScale, } from '@perses-dev/components'; import { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system'; +import { TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec'; import { DEFAULT_AREA_OPACITY, DEFAULT_CONNECT_NULLS, diff --git a/timeseriestable/package.json b/timeseriestable/package.json index 4bd53ba54..1b692d959 100644 --- a/timeseriestable/package.json +++ b/timeseriestable/package.json @@ -27,10 +27,10 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", - "@perses-dev/dashboards": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/timeseriestable/rsbuild.config.ts b/timeseriestable/rsbuild.config.ts index 05e4cf54f..1153c618b 100644 --- a/timeseriestable/rsbuild.config.ts +++ b/timeseriestable/rsbuild.config.ts @@ -31,7 +31,7 @@ export default createConfigForPlugin({ 'date-fns': { singleton: true }, 'date-fns-tz': { singleton: true }, lodash: { singleton: true }, - '@perses-dev/core': { singleton: true }, + '@perses-dev/spec': { singleton: true }, '@perses-dev/components': { singleton: true }, '@perses-dev/dashboards': { singleton: true }, '@perses-dev/plugin-system': { singleton: true }, diff --git a/timeseriestable/src/TimeSeriesTablePanel.test.tsx b/timeseriestable/src/TimeSeriesTablePanel.test.tsx index b324ab251..2c389e06e 100644 --- a/timeseriestable/src/TimeSeriesTablePanel.test.tsx +++ b/timeseriestable/src/TimeSeriesTablePanel.test.tsx @@ -18,12 +18,12 @@ import { SnackbarProvider, testChartsTheme, } from '@perses-dev/components'; -import { TimeSeriesData } from '@perses-dev/core'; import { VariableProvider } from '@perses-dev/dashboards'; import { TimeRangeProviderBasic, WebhookAction } from '@perses-dev/plugin-system'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { TimeSeriesData } from '@perses-dev/spec'; import { TimeSeriesTableOptions } from './model'; import { MOCK_TIME_SERIES_DATA_MULTIVALUE, diff --git a/timeseriestable/src/TimeSeriesTablePanel.tsx b/timeseriestable/src/TimeSeriesTablePanel.tsx index d8531526c..3251ef3a5 100644 --- a/timeseriestable/src/TimeSeriesTablePanel.tsx +++ b/timeseriestable/src/TimeSeriesTablePanel.tsx @@ -15,8 +15,8 @@ import { Box } from '@mui/material'; import { useChartsTheme } from '@perses-dev/components'; import { ReactElement } from 'react'; import { PanelProps } from '@perses-dev/plugin-system'; -import { TimeSeriesData } from '@perses-dev/core'; +import { TimeSeriesData } from '@perses-dev/spec'; import { TimeSeriesTableOptions } from './model'; import { DataTable } from './components'; diff --git a/timeseriestable/src/components/DataTable.tsx b/timeseriestable/src/components/DataTable.tsx index fc675b4e7..3e51d38c6 100644 --- a/timeseriestable/src/components/DataTable.tsx +++ b/timeseriestable/src/components/DataTable.tsx @@ -24,10 +24,10 @@ import { Typography, } from '@mui/material'; import { useSelection } from '@perses-dev/components'; -import { BucketTuple, HistogramValue, TimeSeries, TimeSeriesData, TimeSeriesHistogramTuple } from '@perses-dev/core'; import { useSelectionItemActions } from '@perses-dev/dashboards'; import { ActionOptions, PanelData, useAllVariableValues } from '@perses-dev/plugin-system'; import { ReactElement, ReactNode, useCallback, useMemo } from 'react'; +import { BucketTuple, HistogramValue, TimeSeries, TimeSeriesData, TimeSeriesHistogramTuple } from '@perses-dev/spec'; import { TimeSeriesTableOptions } from '../model'; import { EmbeddedPanel } from './EmbeddedPanel'; import { SeriesName } from './SeriesName'; diff --git a/timeseriestable/src/components/EmbeddedPanel.tsx b/timeseriestable/src/components/EmbeddedPanel.tsx index eee82fb96..33d8bbcb6 100644 --- a/timeseriestable/src/components/EmbeddedPanel.tsx +++ b/timeseriestable/src/components/EmbeddedPanel.tsx @@ -12,11 +12,11 @@ // limitations under the License. import { PanelData } from '@perses-dev/plugin-system'; -import { QueryDataType, UnknownSpec } from '@perses-dev/core'; import { PanelPluginLoader } from '@perses-dev/dashboards'; import useResizeObserver from 'use-resize-observer'; import { ErrorAlert, ErrorBoundary } from '@perses-dev/components'; import { ReactElement } from 'react'; +import { QueryDataType, UnknownSpec } from '@perses-dev/spec'; interface EmbeddedPanelProps { kind: string; diff --git a/timeseriestable/src/components/SeriesName.tsx b/timeseriestable/src/components/SeriesName.tsx index 207d6d5de..dd102c024 100644 --- a/timeseriestable/src/components/SeriesName.tsx +++ b/timeseriestable/src/components/SeriesName.tsx @@ -11,10 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Labels } from '@perses-dev/core'; import { ReactElement, MouseEvent } from 'react'; import { useSnackbar } from '@perses-dev/components'; import { Typography } from '@mui/material'; +import { Labels } from '@perses-dev/spec'; interface SeriesNameProps { name: string; diff --git a/timeseriestable/src/test/mock-query-results.ts b/timeseriestable/src/test/mock-query-results.ts index 59df8a8a8..479031aa2 100644 --- a/timeseriestable/src/test/mock-query-results.ts +++ b/timeseriestable/src/test/mock-query-results.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesData } from '@perses-dev/core'; +import { TimeSeriesData } from '@perses-dev/spec'; export const MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE = [ { diff --git a/tracetable/package.json b/tracetable/package.json index d778de88e..ce9b26112 100644 --- a/tracetable/package.json +++ b/tracetable/package.json @@ -30,9 +30,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/tracetable/src/DataTable.tsx b/tracetable/src/DataTable.tsx index 8541fe749..0d9bd0349 100644 --- a/tracetable/src/DataTable.tsx +++ b/tracetable/src/DataTable.tsx @@ -12,20 +12,20 @@ // limitations under the License. import { Avatar, Box, Chip, Link, Tooltip, Typography, useTheme } from '@mui/material'; -import { - QueryDefinition, - ServiceStats, - TraceData, - TraceSearchResult, - formatDuration, - msToPrometheusDuration, -} from '@perses-dev/core'; import { PanelData, replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system'; import { useSelectionItemActions } from '@perses-dev/dashboards'; import InformationIcon from 'mdi-material-ui/Information'; import { useChartsTheme, useSelection } from '@perses-dev/components'; import { DataGrid, GridColDef, GridRowSelectionModel } from '@mui/x-data-grid'; import { ReactElement, ReactNode, useCallback, useMemo } from 'react'; +import { + convertTimeToDuration, + formatDuration, + QueryDefinition, + ServiceStats, + TraceData, + TraceSearchResult, +} from '@perses-dev/spec'; import { getServiceColor } from './utils/utils'; import { TraceTableOptions } from './trace-table-model'; @@ -194,7 +194,7 @@ export function DataTable(props: DataTableProps): ReactElement { display: 'flex', renderCell: ({ row }): ReactElement => ( - {row.durationMs < 1 ? '<1ms' : formatDuration(msToPrometheusDuration(row.durationMs))} + {row.durationMs < 1 ? '<1ms' : formatDuration(convertTimeToDuration(row.durationMs))} ), }, diff --git a/tracetable/src/TraceTablePanel.test.tsx b/tracetable/src/TraceTablePanel.test.tsx index 7636be192..a09235d69 100644 --- a/tracetable/src/TraceTablePanel.test.tsx +++ b/tracetable/src/TraceTablePanel.test.tsx @@ -12,12 +12,12 @@ // limitations under the License. import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; -import { TraceData } from '@perses-dev/core'; import { PanelData, ReactRouterProvider, TimeRangeProviderBasic } from '@perses-dev/plugin-system'; import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { VariableProvider } from '@perses-dev/dashboards'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { TraceData } from '@perses-dev/spec'; import { MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT } from './test/mock-trace-data'; import { TraceTablePanel, TraceTablePanelProps } from './TraceTablePanel'; @@ -62,6 +62,7 @@ describe('TraceTablePanel', () => { expect(lastRow).toHaveTextContent('13 spans'); // span count expect(lastRow).toHaveTextContent('2 errors'); // span count expect(lastRow).toHaveTextContent('100ms'); // duration + // TODO IMPORTANT: https://github.com/perses/perses/issues/4090 expect(lastRow).toHaveTextContent('December 18, 2023 at 4:07:25 PM'); // start time }); }); diff --git a/tracetable/src/TraceTablePanel.tsx b/tracetable/src/TraceTablePanel.tsx index dcb3c2ba1..5fa38a99e 100644 --- a/tracetable/src/TraceTablePanel.tsx +++ b/tracetable/src/TraceTablePanel.tsx @@ -14,8 +14,8 @@ import { PanelProps } from '@perses-dev/plugin-system'; import { Box } from '@mui/material'; import { NoDataOverlay, useChartsTheme } from '@perses-dev/components'; -import { TraceData } from '@perses-dev/core'; import { ReactElement } from 'react'; +import { TraceData } from '@perses-dev/spec'; import { DataTable } from './DataTable'; import { TraceTableOptions } from './trace-table-model'; diff --git a/tracetable/src/test/mock-trace-data.ts b/tracetable/src/test/mock-trace-data.ts index 6b88a47ed..e57bce4ac 100644 --- a/tracetable/src/test/mock-trace-data.ts +++ b/tracetable/src/test/mock-trace-data.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TraceData } from '@perses-dev/core'; +import { TraceData } from '@perses-dev/spec'; /** * Mock data we get from getTraceData() in @perses/tempo-plugin. diff --git a/tracingganttchart/package.json b/tracingganttchart/package.json index 32c2ddcd0..d4ecebd2f 100644 --- a/tracingganttchart/package.json +++ b/tracingganttchart/package.json @@ -31,9 +31,9 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "echarts": "5.5.0", diff --git a/tracingganttchart/src/PanelActions.test.ts b/tracingganttchart/src/PanelActions.test.ts index 7d3bf0ce3..1d384b28a 100644 --- a/tracingganttchart/src/PanelActions.test.ts +++ b/tracingganttchart/src/PanelActions.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as otlpTrace from './test/traces/example_otlp.json'; import { getFilename } from './PanelActions'; diff --git a/tracingganttchart/src/PanelActions.tsx b/tracingganttchart/src/PanelActions.tsx index af2bf9f24..c5f9cdbf8 100644 --- a/tracingganttchart/src/PanelActions.tsx +++ b/tracingganttchart/src/PanelActions.tsx @@ -12,10 +12,11 @@ // limitations under the License. import { InfoTooltip } from '@perses-dev/components'; -import { otlptracev1 } from '@perses-dev/core'; + import DownloadIcon from 'mdi-material-ui/DownloadOutline'; import { ReactElement, useCallback } from 'react'; import { HeaderIconButton } from '@perses-dev/dashboards'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import { TracingGanttChartPanelProps } from './TracingGanttChartPanel'; export function DownloadTraceAction(props: TracingGanttChartPanelProps): ReactElement | null { diff --git a/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.test.tsx b/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.test.tsx index 2190dc05c..d46b28b84 100644 --- a/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.test.tsx @@ -14,10 +14,10 @@ import { render, RenderResult } from '@testing-library/react'; import { screen } from '@testing-library/dom'; import { MemoryRouter } from 'react-router-dom'; -import { otlptracev1 } from '@perses-dev/core'; import { VariableProvider } from '@perses-dev/dashboards'; import { ReactRouterProvider, TimeRangeProviderBasic } from '@perses-dev/plugin-system'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../../test/traces/example_otlp.json'; import { getTraceModel } from '../trace'; import { CustomLinks } from '../../gantt-chart-model'; diff --git a/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.tsx b/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.tsx index bc8e7981d..bde5662e0 100644 --- a/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.tsx +++ b/tracingganttchart/src/TracingGanttChart/DetailPane/Attributes.tsx @@ -13,8 +13,8 @@ import { ReactElement, useMemo } from 'react'; import { Divider, Link, List, ListItem, ListItemText } from '@mui/material'; -import { otlpcommonv1 } from '@perses-dev/core'; import { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system'; +import * as oltpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; import { Span, Trace } from '../trace'; import { formatDuration } from '../utils'; import { CustomLinks } from '../../gantt-chart-model'; @@ -78,7 +78,7 @@ export function TraceAttributes(props: TraceAttributesProps): ReactElement { export interface AttributeListProps { customLinks?: CustomLinks; - attributes: otlpcommonv1.KeyValue[]; + attributes: oltpcommonv1.KeyValue[]; } export function AttributeList(props: AttributeListProps): ReactElement { @@ -93,7 +93,7 @@ export function AttributeList(props: AttributeListProps): ReactElement { interface AttributeItemsProps { customLinks?: CustomLinks; - attributes: otlpcommonv1.KeyValue[]; + attributes: oltpcommonv1.KeyValue[]; } export function AttributeItems(props: AttributeItemsProps): ReactElement { @@ -168,7 +168,7 @@ export function AttributeItem(props: AttributeItemProps): ReactElement { ); } -export function renderAttributeValue(value: otlpcommonv1.AnyValue): string { +export function renderAttributeValue(value: oltpcommonv1.AnyValue): string { if ('stringValue' in value) return value.stringValue || ''; if ('intValue' in value) return value.intValue; if ('doubleValue' in value) return String(value.doubleValue); diff --git a/tracingganttchart/src/TracingGanttChart/DetailPane/SpanEvents.test.tsx b/tracingganttchart/src/TracingGanttChart/DetailPane/SpanEvents.test.tsx index 740bf3399..f649b1716 100644 --- a/tracingganttchart/src/TracingGanttChart/DetailPane/SpanEvents.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/DetailPane/SpanEvents.test.tsx @@ -13,11 +13,12 @@ import { fireEvent, screen } from '@testing-library/dom'; import { render, RenderResult } from '@testing-library/react'; -import { otlptracev1 } from '@perses-dev/core'; + import { VariableProvider } from '@perses-dev/dashboards'; import { ReactRouterProvider, TimeRangeProviderBasic } from '@perses-dev/plugin-system'; import { MemoryRouter } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../../test/traces/example_otlp.json'; import { getTraceModel } from '../trace'; import { SpanEventList, SpanEventListProps } from './SpanEvents'; diff --git a/tracingganttchart/src/TracingGanttChart/DetailPane/SpanLinks.test.tsx b/tracingganttchart/src/TracingGanttChart/DetailPane/SpanLinks.test.tsx index 63c976f33..2dc8d7f60 100644 --- a/tracingganttchart/src/TracingGanttChart/DetailPane/SpanLinks.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/DetailPane/SpanLinks.test.tsx @@ -13,11 +13,11 @@ import { screen } from '@testing-library/dom'; import { render, RenderResult } from '@testing-library/react'; -import { otlptracev1 } from '@perses-dev/core'; import { MemoryRouter } from 'react-router-dom'; import { VariableProvider } from '@perses-dev/dashboards'; import { ReactRouterProvider, TimeRangeProviderBasic } from '@perses-dev/plugin-system'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import { CustomLinks } from '../../gantt-chart-model'; import { getTraceModel } from '../trace'; import * as exampleTrace from '../../test/traces/example_otlp.json'; diff --git a/tracingganttchart/src/TracingGanttChart/GanttTable/GanttTable.test.tsx b/tracingganttchart/src/TracingGanttChart/GanttTable/GanttTable.test.tsx index 52d3c839d..b9ed96541 100644 --- a/tracingganttchart/src/TracingGanttChart/GanttTable/GanttTable.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/GanttTable/GanttTable.test.tsx @@ -15,7 +15,7 @@ import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; import { fireEvent, screen } from '@testing-library/dom'; import { render, RenderResult } from '@testing-library/react'; import { VirtuosoMockContext } from 'react-virtuoso'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../../test/traces/example_otlp.json'; import { getTraceModel } from '../trace'; import { GanttTable, GanttTableProps } from './GanttTable'; diff --git a/tracingganttchart/src/TracingGanttChart/GanttTable/SpanDuration.test.tsx b/tracingganttchart/src/TracingGanttChart/GanttTable/SpanDuration.test.tsx index 1d342f7b0..ce36a318c 100644 --- a/tracingganttchart/src/TracingGanttChart/GanttTable/SpanDuration.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/GanttTable/SpanDuration.test.tsx @@ -14,7 +14,7 @@ import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; import { screen } from '@testing-library/dom'; import { render, RenderResult } from '@testing-library/react'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../../test/traces/example_otlp.json'; import { getTraceModel } from '../trace'; import { GanttTableProvider } from './GanttTableProvider'; diff --git a/tracingganttchart/src/TracingGanttChart/GanttTable/SpanName.test.tsx b/tracingganttchart/src/TracingGanttChart/GanttTable/SpanName.test.tsx index 529b79311..3e534dac9 100644 --- a/tracingganttchart/src/TracingGanttChart/GanttTable/SpanName.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/GanttTable/SpanName.test.tsx @@ -13,7 +13,7 @@ import { screen } from '@testing-library/dom'; import { render, RenderResult } from '@testing-library/react'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../../test/traces/example_otlp.json'; import { getTraceModel } from '../trace'; import { SpanName, SpanNameProps } from './SpanName'; diff --git a/tracingganttchart/src/TracingGanttChart/Search.test.tsx b/tracingganttchart/src/TracingGanttChart/Search.test.tsx index 2225c43b2..a09664608 100644 --- a/tracingganttchart/src/TracingGanttChart/Search.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/Search.test.tsx @@ -15,7 +15,7 @@ import { ChartsProvider, testChartsTheme } from '@perses-dev/components'; import { fireEvent, screen } from '@testing-library/dom'; import { render, renderHook, act, RenderResult } from '@testing-library/react'; import { ReactElement } from 'react'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../test/traces/example_otlp.json'; import { getTraceModel } from './trace'; import { SearchBar, useSpanSearch } from './Search'; diff --git a/tracingganttchart/src/TracingGanttChart/Search.tsx b/tracingganttchart/src/TracingGanttChart/Search.tsx index 8611c039c..39e796684 100644 --- a/tracingganttchart/src/TracingGanttChart/Search.tsx +++ b/tracingganttchart/src/TracingGanttChart/Search.tsx @@ -16,7 +16,7 @@ import ChevronUp from 'mdi-material-ui/ChevronUp'; import ChevronDown from 'mdi-material-ui/ChevronDown'; import Close from 'mdi-material-ui/Close'; import { ReactElement, useCallback, useMemo, useState } from 'react'; -import { otlpcommonv1 } from '@perses-dev/core'; +import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; import { renderAttributeValue } from './DetailPane/Attributes'; import { Span, Trace, forEachSpan } from './trace'; diff --git a/tracingganttchart/src/TracingGanttChart/Ticks.test.tsx b/tracingganttchart/src/TracingGanttChart/Ticks.test.tsx index 7da69dc1e..218aef63c 100644 --- a/tracingganttchart/src/TracingGanttChart/Ticks.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/Ticks.test.tsx @@ -13,7 +13,7 @@ import { screen } from '@testing-library/dom'; import { render, RenderResult } from '@testing-library/react'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as otlpTrace from '../test/traces/example_otlp.json'; import { TicksHeader, TicksHeaderProps } from './Ticks'; import { getTraceModel } from './trace'; diff --git a/tracingganttchart/src/TracingGanttChart/TraceHeaderBar.test.tsx b/tracingganttchart/src/TracingGanttChart/TraceHeaderBar.test.tsx index 877648b5b..ac5150e0a 100644 --- a/tracingganttchart/src/TracingGanttChart/TraceHeaderBar.test.tsx +++ b/tracingganttchart/src/TracingGanttChart/TraceHeaderBar.test.tsx @@ -14,7 +14,7 @@ import { render, RenderResult } from '@testing-library/react'; import { screen } from '@testing-library/dom'; import { MemoryRouter } from 'react-router-dom'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../test/traces/example_otlp.json'; import { getTraceModel } from './trace'; import { TraceHeaderBar, TraceHeaderBarProps } from './TraceHeaderBar'; diff --git a/tracingganttchart/src/TracingGanttChart/TracingGanttChart.tsx b/tracingganttchart/src/TracingGanttChart/TracingGanttChart.tsx index ffd6aad8a..aa2f8bca7 100644 --- a/tracingganttchart/src/TracingGanttChart/TracingGanttChart.tsx +++ b/tracingganttchart/src/TracingGanttChart/TracingGanttChart.tsx @@ -13,7 +13,7 @@ import { ReactElement, useMemo, useRef, useState } from 'react'; import { Box, Stack } from '@mui/material'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import { CustomLinks, TracingGanttChartOptions } from '../gantt-chart-model'; import { MiniGanttChart } from './MiniGanttChart/MiniGanttChart'; import { DetailPane } from './DetailPane/DetailPane'; diff --git a/tracingganttchart/src/TracingGanttChart/trace.test.ts b/tracingganttchart/src/TracingGanttChart/trace.test.ts index 6b929d738..812f64848 100644 --- a/tracingganttchart/src/TracingGanttChart/trace.test.ts +++ b/tracingganttchart/src/TracingGanttChart/trace.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import * as exampleTrace from '../test/traces/example_otlp.json'; import * as missingRootSpanTrace from '../test/traces/pushbytes_no_root_span_otlp.json'; import * as incompleteTrace from '../test/traces/pushbytes_incomplete_otlp.json'; diff --git a/tracingganttchart/src/TracingGanttChart/trace.ts b/tracingganttchart/src/TracingGanttChart/trace.ts index ea406a5cd..0e00c722c 100644 --- a/tracingganttchart/src/TracingGanttChart/trace.ts +++ b/tracingganttchart/src/TracingGanttChart/trace.ts @@ -11,7 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { otlpcommonv1, otlpresourcev1, otlptracev1 } from '@perses-dev/core'; +import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; +import * as otlpresourcev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/resource/v1/resource'; import { sortedIndexBy } from 'lodash'; /** holds the trace and computed properties required for the Gantt chart */ diff --git a/tracingganttchart/src/TracingGanttChart/utils.ts b/tracingganttchart/src/TracingGanttChart/utils.ts index cf02cf93d..11a64f52a 100644 --- a/tracingganttchart/src/TracingGanttChart/utils.ts +++ b/tracingganttchart/src/TracingGanttChart/utils.ts @@ -13,7 +13,7 @@ import { PersesChartsTheme } from '@perses-dev/components'; import { Theme } from '@mui/material'; -import { otlptracev1 } from '@perses-dev/core'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; import { getConsistentCategoricalColor, getConsistentColor } from './palette'; import { Span } from './trace'; diff --git a/tracingganttchart/src/TracingGanttChartPanel.tsx b/tracingganttchart/src/TracingGanttChartPanel.tsx index 144468a69..e034b4e81 100644 --- a/tracingganttchart/src/TracingGanttChartPanel.tsx +++ b/tracingganttchart/src/TracingGanttChartPanel.tsx @@ -15,7 +15,7 @@ import { PanelProps } from '@perses-dev/plugin-system'; import { NoDataOverlay, TextOverlay, useChartsTheme } from '@perses-dev/components'; import { Box } from '@mui/material'; import { ReactElement } from 'react'; -import { TraceData } from '@perses-dev/core'; +import { TraceData } from '@perses-dev/spec'; import { CustomLinks, TracingGanttChartOptions } from './gantt-chart-model'; import { TracingGanttChart } from './TracingGanttChart/TracingGanttChart'; diff --git a/tracingganttchart/src/test/convert/jaeger.ts b/tracingganttchart/src/test/convert/jaeger.ts index 09fb0cc4a..e4383a32b 100644 --- a/tracingganttchart/src/test/convert/jaeger.ts +++ b/tracingganttchart/src/test/convert/jaeger.ts @@ -11,7 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { otlpcommonv1, otlpresourcev1, otlptracev1 } from '@perses-dev/core'; +import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common'; +import * as otlpresourcev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/resource/v1/resource'; +import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace'; // the following Jaeger data types and parsing function should eventually be moved to a Jaeger data source plugin diff --git a/victorialogs/package.json b/victorialogs/package.json index 2375ae574..f6cac2460 100644 --- a/victorialogs/package.json +++ b/victorialogs/package.json @@ -22,11 +22,11 @@ "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@hookform/resolvers": "^3.2.0", - "@perses-dev/components": "^0.54.0-beta.1", - "@perses-dev/core": "^0.53.0", - "@perses-dev/dashboards": "^0.54.0-beta.1", - "@perses-dev/explore": "^0.54.0-beta.1", - "@perses-dev/plugin-system": "^0.54.0-beta.1", + "@perses-dev/components": "^0.54.0-beta.3", + "@perses-dev/dashboards": "^0.54.0-beta.3", + "@perses-dev/spec": "^0.2.0-beta.2", + "@perses-dev/explore": "^0.54.0-beta.3", + "@perses-dev/plugin-system": "^0.54.0-beta.3", "@tanstack/react-query": "^4.39.1", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", diff --git a/victorialogs/src/datasources/victorialogs-datasource/types.ts b/victorialogs/src/datasources/victorialogs-datasource/types.ts index e2e342c26..b27e21b85 100644 --- a/victorialogs/src/datasources/victorialogs-datasource/types.ts +++ b/victorialogs/src/datasources/victorialogs-datasource/types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HTTPProxy } from '@perses-dev/core'; +import { HTTPProxy } from '@perses-dev/spec'; export interface VictoriaLogsDatasourceSpec { directUrl?: string; diff --git a/victorialogs/src/model/selectors.ts b/victorialogs/src/model/selectors.ts index f7f8950fe..50d0341fd 100644 --- a/victorialogs/src/model/selectors.ts +++ b/victorialogs/src/model/selectors.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; import { DatasourceSelectValue, isVariableDatasource } from '@perses-dev/plugin-system'; +import { DatasourceSelector } from '@perses-dev/spec'; export const VICTORIALOGS_DATASOURCE_KIND = 'VictoriaLogsDatasource' as const; diff --git a/victorialogs/src/queries/victorialogs-log-query/interface.ts b/victorialogs/src/queries/victorialogs-log-query/interface.ts index e67d21167..4bc5bb3ec 100644 --- a/victorialogs/src/queries/victorialogs-log-query/interface.ts +++ b/victorialogs/src/queries/victorialogs-log-query/interface.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, AbsoluteTimeRange, UnknownSpec } from '@perses-dev/core'; import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system'; +import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec'; export interface LogQueryResult { logs: LogData; diff --git a/victorialogs/src/queries/victorialogs-log-query/query.ts b/victorialogs/src/queries/victorialogs-log-query/query.ts index 9551f1935..12711df21 100644 --- a/victorialogs/src/queries/victorialogs-log-query/query.ts +++ b/victorialogs/src/queries/victorialogs-log-query/query.ts @@ -12,7 +12,7 @@ // limitations under the License. import { replaceVariables } from '@perses-dev/plugin-system'; -import { LogEntry, LogData } from '@perses-dev/core'; +import { LogData, LogEntry } from '@perses-dev/spec'; import { VictoriaLogsStreamQueryRangeResponse } from '../../model/types'; import { VictoriaLogsClient } from '../../model/client'; import { DEFAULT_DATASOURCE } from '../constants'; diff --git a/victorialogs/src/queries/victorialogs-log-query/types.ts b/victorialogs/src/queries/victorialogs-log-query/types.ts index ad2df3b78..fdefaec85 100644 --- a/victorialogs/src/queries/victorialogs-log-query/types.ts +++ b/victorialogs/src/queries/victorialogs-log-query/types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface VictoriaLogsLogQuerySpec { query: string; diff --git a/victorialogs/src/queries/victorialogs-time-series-query/query.ts b/victorialogs/src/queries/victorialogs-time-series-query/query.ts index 0f62ada05..4656bca3a 100644 --- a/victorialogs/src/queries/victorialogs-time-series-query/query.ts +++ b/victorialogs/src/queries/victorialogs-time-series-query/query.ts @@ -11,9 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeries, DurationString, parseDurationString } from '@perses-dev/core'; import { TimeSeriesQueryPlugin, replaceVariables } from '@perses-dev/plugin-system'; import { milliseconds } from 'date-fns'; +import { DurationString, parseDurationString, TimeSeries } from '@perses-dev/spec'; import { VictoriaLogsClient } from '../../model/client'; import { VictoriaLogsStatsQueryRangeResponse } from '../../model/types'; import { DEFAULT_DATASOURCE } from '../constants'; diff --git a/victorialogs/src/queries/victorialogs-time-series-query/types.test.ts b/victorialogs/src/queries/victorialogs-time-series-query/types.test.ts index 59cfe1404..7cf9b0a03 100644 --- a/victorialogs/src/queries/victorialogs-time-series-query/types.test.ts +++ b/victorialogs/src/queries/victorialogs-time-series-query/types.test.ts @@ -11,12 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -// TODO: This should be fixed globally in the test setup -import { DatasourceSpec } from '@perses-dev/core'; - jest.mock('echarts/core'); import { TimeSeriesQueryContext } from '@perses-dev/plugin-system'; +import { DatasourceSpec } from '@perses-dev/spec'; import { VictoriaLogsStatsQueryRangeResponse } from '../../model/types'; import { VictoriaLogsDatasource } from '../../datasources/victorialogs-datasource'; import { VictoriaLogsDatasourceSpec } from '../../datasources/victorialogs-datasource/types'; diff --git a/victorialogs/src/queries/victorialogs-time-series-query/types.ts b/victorialogs/src/queries/victorialogs-time-series-query/types.ts index 0f9c1254a..9a6e72cd6 100644 --- a/victorialogs/src/queries/victorialogs-time-series-query/types.ts +++ b/victorialogs/src/queries/victorialogs-time-series-query/types.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector } from '@perses-dev/core'; +import { DatasourceSelector } from '@perses-dev/spec'; export interface VictoriaLogsTimeSeriesQuerySpec { query: string; diff --git a/victorialogs/src/variables/utils.ts b/victorialogs/src/variables/utils.ts index 216615e9d..a88ca3daf 100644 --- a/victorialogs/src/variables/utils.ts +++ b/victorialogs/src/variables/utils.ts @@ -12,8 +12,9 @@ // limitations under the License. import { VariableOption, useDatasourceClient, useTimeRange } from '@perses-dev/plugin-system'; -import { AbsoluteTimeRange, DatasourceSelector, StatusError } from '@perses-dev/core'; import { useQuery, UseQueryResult } from '@tanstack/react-query'; +import { AbsoluteTimeRange, DatasourceSelector } from '@perses-dev/spec'; +import { StatusError } from '@perses-dev/client'; import { VictoriaLogsClient, VictoriaLogsFieldItem,