diff --git a/components/package.json b/components/package.json index 20bb8b8..5bb8927 100644 --- a/components/package.json +++ b/components/package.json @@ -35,6 +35,7 @@ "@fontsource/lato": "^4.5.10", "@mui/x-date-pickers": "^7.23.1", "@perses-dev/core": "0.53.0", + "@perses-dev/spec": "0.2.0-beta.0", "@tanstack/react-table": "^8.20.5", "@uiw/react-codemirror": "^4.19.1", "date-fns": "^4.1.0", diff --git a/components/src/ContentWithLegend/ContentWithLegend.tsx b/components/src/ContentWithLegend/ContentWithLegend.tsx index 4b40934..0bd70b7 100644 --- a/components/src/ContentWithLegend/ContentWithLegend.tsx +++ b/components/src/ContentWithLegend/ContentWithLegend.tsx @@ -13,7 +13,7 @@ import { ReactElement } from 'react'; import { Box, useTheme } from '@mui/material'; -import { getLegendSize } from '@perses-dev/core'; +import { getLegendSize } from '@perses-dev/core'; // TODO import { Legend } from '../Legend'; import { ContentWithLegendProps, getContentWithLegendLayout } from './model/content-with-legend-model'; diff --git a/components/src/ContentWithLegend/model/content-with-legend-model.test.ts b/components/src/ContentWithLegend/model/content-with-legend-model.test.ts index b1ba71d..e022306 100644 --- a/components/src/ContentWithLegend/model/content-with-legend-model.test.ts +++ b/components/src/ContentWithLegend/model/content-with-legend-model.test.ts @@ -12,7 +12,7 @@ // limitations under the License. import { createTheme } from '@mui/material'; -import { legendModes, legendSizes } from '@perses-dev/core'; +import { legendModes, legendSizes } from '@perses-dev/core'; // TODO import * as table from '../../Table'; import { ContentWithLegendLayoutOpts, diff --git a/components/src/ContentWithLegend/model/content-with-legend-model.ts b/components/src/ContentWithLegend/model/content-with-legend-model.ts index d70415b..06c2cdd 100644 --- a/components/src/ContentWithLegend/model/content-with-legend-model.ts +++ b/components/src/ContentWithLegend/model/content-with-legend-model.ts @@ -12,7 +12,7 @@ // limitations under the License. import { Theme } from '@mui/material'; -import { LegendPositions, getLegendMode, LegendSize } from '@perses-dev/core'; +import { LegendPositions, getLegendMode, LegendSize } from '@perses-dev/core'; //TODO import { LegendProps } from '../../Legend'; import { getTableCellLayout } from '../../Table'; diff --git a/components/src/FormEditor/FormActions.tsx b/components/src/FormEditor/FormActions.tsx index 859a3d8..1fabbc7 100644 --- a/components/src/FormEditor/FormActions.tsx +++ b/components/src/FormEditor/FormActions.tsx @@ -13,7 +13,7 @@ import { Button, Divider, Stack, StackProps } from '@mui/material'; import { ReactElement } from 'react'; -import { Action } from '@perses-dev/core'; +import { Action } from '@perses-dev/core'; // TODO the internal permission system of Perses should not be in a shared library export interface FormActionsProps extends StackProps { action: Action; diff --git a/components/src/FormatControls/FormatControls.test.tsx b/components/src/FormatControls/FormatControls.test.tsx index 8bb3618..793f4c1 100644 --- a/components/src/FormatControls/FormatControls.test.tsx +++ b/components/src/FormatControls/FormatControls.test.tsx @@ -13,7 +13,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { FormatOptions } from '@perses-dev/core'; +import { FormatOptions } from '@perses-dev/core'; // TODO import { FormatControls } from './FormatControls'; describe('FormatControls', () => { diff --git a/components/src/FormatControls/FormatControls.tsx b/components/src/FormatControls/FormatControls.tsx index 7c1b2a6..7a9faac 100644 --- a/components/src/FormatControls/FormatControls.tsx +++ b/components/src/FormatControls/FormatControls.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Switch, SwitchProps } from '@mui/material'; -import { FormatOptions, isUnitWithDecimalPlaces, isUnitWithShortValues, shouldShortenValues } from '@perses-dev/core'; +import { FormatOptions, isUnitWithDecimalPlaces, isUnitWithShortValues, shouldShortenValues } from '@perses-dev/core'; // TODO import { ReactElement } from 'react'; import { OptionsEditorControl } from '../OptionsEditorLayout'; import { SettingsAutocomplete } from '../SettingsAutocomplete'; diff --git a/components/src/FormatControls/UnitSelector.tsx b/components/src/FormatControls/UnitSelector.tsx index 5bf83e6..481b4b4 100644 --- a/components/src/FormatControls/UnitSelector.tsx +++ b/components/src/FormatControls/UnitSelector.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FormatOptions, UNIT_CONFIG, UnitConfig } from '@perses-dev/core'; +import { FormatOptions, UNIT_CONFIG, UnitConfig } from '@perses-dev/core'; // TODO import { ReactElement } from 'react'; import { SettingsAutocomplete } from '../SettingsAutocomplete'; diff --git a/components/src/Legend/Legend.tsx b/components/src/Legend/Legend.tsx index ff45904..644bdd2 100644 --- a/components/src/Legend/Legend.tsx +++ b/components/src/Legend/Legend.tsx @@ -14,7 +14,7 @@ import { Box } from '@mui/material'; import { produce } from 'immer'; import { ReactElement, ReactNode } from 'react'; -import { getLegendMode } from '@perses-dev/core'; +import { getLegendMode } from '@perses-dev/core'; // TODO import { ListLegend } from './ListLegend'; import { CompactLegend } from './CompactLegend'; import { TableLegend, TableLegendProps } from './TableLegend'; diff --git a/components/src/Legend/legend-model.ts b/components/src/Legend/legend-model.ts index 24c03e5..0bbe36b 100644 --- a/components/src/Legend/legend-model.ts +++ b/components/src/Legend/legend-model.ts @@ -12,7 +12,7 @@ // limitations under the License. import { MouseEventHandler } from 'react'; -import { LegendOptionsBase } from '@perses-dev/core'; +import { LegendOptionsBase } from '@perses-dev/core'; // TODO // This file contains legend-related model code specific to the legend component. // See the `core` package for common/shared legend model code and the diff --git a/components/src/LinksEditor/LinksEditor.tsx b/components/src/LinksEditor/LinksEditor.tsx index 742d0bb..9ce02ec 100644 --- a/components/src/LinksEditor/LinksEditor.tsx +++ b/components/src/LinksEditor/LinksEditor.tsx @@ -16,7 +16,7 @@ import { Divider, IconButton, Stack, Typography } from '@mui/material'; import { Controller, useFieldArray, Control } from 'react-hook-form'; import PlusIcon from 'mdi-material-ui/Plus'; import MinusIcon from 'mdi-material-ui/Minus'; -import { PanelEditorValues } from '@perses-dev/core'; +import { PanelEditorValues } from '@perses-dev/spec'; import { LinkEditorForm } from './LinkEditorForm'; export interface LinksEditorProps extends HTMLAttributes { diff --git a/components/src/RefreshIntervalPicker/RefreshIntervalPicker.tsx b/components/src/RefreshIntervalPicker/RefreshIntervalPicker.tsx index ccb3aa2..7ae4ba9 100644 --- a/components/src/RefreshIntervalPicker/RefreshIntervalPicker.tsx +++ b/components/src/RefreshIntervalPicker/RefreshIntervalPicker.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { Box, FormControl, MenuItem, Select } from '@mui/material'; -import { DurationString } from '@perses-dev/core'; +import { DurationString } from '@perses-dev/spec'; import { ReactElement, useMemo } from 'react'; import { TimeOption } from '../model'; diff --git a/components/src/Table/model/table-model.ts b/components/src/Table/model/table-model.ts index e2aa3b5..69516c6 100644 --- a/components/src/Table/model/table-model.ts +++ b/components/src/Table/model/table-model.ts @@ -12,7 +12,7 @@ // limitations under the License. import { Theme } from '@mui/material'; -import { Link } from '@perses-dev/core'; +import { Link } from '@perses-dev/spec'; import { AccessorKeyColumnDef, CellContext, diff --git a/components/src/ThresholdsEditor/ThresholdInput.tsx b/components/src/ThresholdsEditor/ThresholdInput.tsx index 81e866e..63f096e 100644 --- a/components/src/ThresholdsEditor/ThresholdInput.tsx +++ b/components/src/ThresholdsEditor/ThresholdInput.tsx @@ -14,7 +14,7 @@ import { ReactElement, RefObject, useState } from 'react'; import { Stack, FormLabel, TextField, IconButton, Box } from '@mui/material'; import DeleteIcon from 'mdi-material-ui/DeleteOutline'; -import { ThresholdOptions } from '@perses-dev/core'; +import { ThresholdOptions } from '@perses-dev/core'; // TODO import { OptionsColorPicker } from '../ColorPicker/OptionsColorPicker'; export interface ThresholdInputProps { diff --git a/components/src/ThresholdsEditor/ThresholdsEditor.test.tsx b/components/src/ThresholdsEditor/ThresholdsEditor.test.tsx index 8732afb..1a4488b 100644 --- a/components/src/ThresholdsEditor/ThresholdsEditor.test.tsx +++ b/components/src/ThresholdsEditor/ThresholdsEditor.test.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ThresholdOptions } from '@perses-dev/core'; +import { ThresholdOptions } from '@perses-dev/core'; // TODO import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { produce } from 'immer'; diff --git a/components/src/ThresholdsEditor/ThresholdsEditor.tsx b/components/src/ThresholdsEditor/ThresholdsEditor.tsx index d5aae72..dcc3231 100644 --- a/components/src/ThresholdsEditor/ThresholdsEditor.tsx +++ b/components/src/ThresholdsEditor/ThresholdsEditor.tsx @@ -16,7 +16,7 @@ import { produce } from 'immer'; import { IconButton, ToggleButton, ToggleButtonGroup, Typography } from '@mui/material'; import PlusIcon from 'mdi-material-ui/Plus'; import { Stack } from '@mui/system'; -import { ThresholdOptions } from '@perses-dev/core'; +import { ThresholdOptions } from '@perses-dev/core'; // TODO import { useChartsTheme } from '../context/ChartsProvider'; import { OptionsEditorControl, OptionsEditorGroup } from '../OptionsEditorLayout'; import { InfoTooltip } from '../InfoTooltip'; diff --git a/components/src/TimeRangeSelector/DateTimeRangePicker.tsx b/components/src/TimeRangeSelector/DateTimeRangePicker.tsx index 848ea80..43cad90 100644 --- a/components/src/TimeRangeSelector/DateTimeRangePicker.tsx +++ b/components/src/TimeRangeSelector/DateTimeRangePicker.tsx @@ -15,7 +15,7 @@ import { ReactElement, useState } from 'react'; import { Box, Stack, Typography, Button } from '@mui/material'; import { DateTimeField, LocalizationProvider, StaticDateTimePicker } from '@mui/x-date-pickers'; import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'; -import { AbsoluteTimeRange } from '@perses-dev/core'; +import { AbsoluteTimeRange } from '@perses-dev/spec'; import { TZDate } from '@date-fns/tz'; import { ErrorBoundary } from '../ErrorBoundary'; import { ErrorAlert } from '../ErrorAlert'; diff --git a/components/src/TimeRangeSelector/TimeRangeSelector.tsx b/components/src/TimeRangeSelector/TimeRangeSelector.tsx index 83cc6d7..d38e94c 100644 --- a/components/src/TimeRangeSelector/TimeRangeSelector.tsx +++ b/components/src/TimeRangeSelector/TimeRangeSelector.tsx @@ -14,7 +14,7 @@ import { Box, MenuItem, Popover, Select, IconButton, TextField } from '@mui/material'; import Calendar from 'mdi-material-ui/Calendar'; import EarthIcon from 'mdi-material-ui/Earth'; -import { TimeRangeValue, isRelativeTimeRange, AbsoluteTimeRange, toAbsoluteTimeRange } from '@perses-dev/core'; +import { TimeRangeValue, isRelativeTimeRange, AbsoluteTimeRange, toAbsoluteTimeRange } from '@perses-dev/spec'; import { ReactElement, useMemo, useRef, useState } from 'react'; import { useTimeZone } from '../context'; import { TimeZoneOption, getTimeZoneOptions } from '../model/timeZoneOption'; diff --git a/components/src/TimeRangeSelector/utils.ts b/components/src/TimeRangeSelector/utils.ts index 982693a..1b88a4e 100644 --- a/components/src/TimeRangeSelector/utils.ts +++ b/components/src/TimeRangeSelector/utils.ts @@ -12,7 +12,7 @@ // limitations under the License. import { isBefore, isValid } from 'date-fns'; -import { AbsoluteTimeRange, isRelativeTimeRange, TimeRangeValue } from '@perses-dev/core'; +import { AbsoluteTimeRange, isRelativeTimeRange, TimeRangeValue } from '@perses-dev/spec'; import { formatWithTimeZone } from '../utils'; export const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss'; diff --git a/components/src/TimeSeriesTooltip/TimeChartTooltip.tsx b/components/src/TimeSeriesTooltip/TimeChartTooltip.tsx index a0b13e7..3f77527 100644 --- a/components/src/TimeSeriesTooltip/TimeChartTooltip.tsx +++ b/components/src/TimeSeriesTooltip/TimeChartTooltip.tsx @@ -14,7 +14,8 @@ import { memo, MutableRefObject, useRef, useState } from 'react'; import { Box, Portal, Stack } from '@mui/material'; import { ECharts as EChartsInstance } from 'echarts/core'; -import { FormatOptions, TimeSeries } from '@perses-dev/core'; +import { FormatOptions } from '@perses-dev/core'; // TODO +import { TimeSeries } from '@perses-dev/spec'; import useResizeObserver from 'use-resize-observer'; import { TimeChartSeriesMapping } from '../model'; import { CursorCoordinates, useMousePosition } from './tooltip-model'; diff --git a/components/src/TimeSeriesTooltip/nearby-series.test.ts b/components/src/TimeSeriesTooltip/nearby-series.test.ts index 73644db..b01f653 100644 --- a/components/src/TimeSeriesTooltip/nearby-series.test.ts +++ b/components/src/TimeSeriesTooltip/nearby-series.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FormatOptions } from '@perses-dev/core'; +import { FormatOptions } from '@perses-dev/core'; // TODO import { EChartsDataFormat } from '../model'; import { legacyCheckforNearbySeries, getYBuffer, isWithinPercentageRange } from './nearby-series'; diff --git a/components/src/TimeSeriesTooltip/nearby-series.ts b/components/src/TimeSeriesTooltip/nearby-series.ts index 1ae42cb..306f17f 100644 --- a/components/src/TimeSeriesTooltip/nearby-series.ts +++ b/components/src/TimeSeriesTooltip/nearby-series.ts @@ -13,7 +13,7 @@ import { ECharts as EChartsInstance } from 'echarts/core'; import { LineSeriesOption } from 'echarts/charts'; -import { formatValue, TimeSeriesValueTuple, FormatOptions, TimeSeries } from '@perses-dev/core'; +import { formatValue, TimeSeriesValueTuple, FormatOptions, TimeSeries } from '@perses-dev/core'; // TODO import { EChartsDataFormat, OPTIMIZED_MODE_SERIES_LIMIT, TimeChartSeriesMapping, DatapointInfo } from '../model'; import { batchDispatchNearbySeriesActions, getPointInGrid, getClosestTimestamp } from '../utils'; import { CursorCoordinates, CursorData, EMPTY_TOOLTIP_DATA } from './tooltip-model'; diff --git a/components/src/TransformsEditor/TransformEditor.tsx b/components/src/TransformsEditor/TransformEditor.tsx index 919a323..c7f470e 100644 --- a/components/src/TransformsEditor/TransformEditor.tsx +++ b/components/src/TransformsEditor/TransformEditor.tsx @@ -27,7 +27,7 @@ import { MergeIndexedColumnsTransform, MergeSeriesTransform, Transform, -} from '@perses-dev/core'; +} from '@perses-dev/core'; // TODO import { ReactElement } from 'react'; import { TextField } from '../controls'; diff --git a/components/src/TransformsEditor/TransformEditorContainer.tsx b/components/src/TransformsEditor/TransformEditorContainer.tsx index 78df21e..8b2a83e 100644 --- a/components/src/TransformsEditor/TransformEditorContainer.tsx +++ b/components/src/TransformsEditor/TransformEditorContainer.tsx @@ -17,7 +17,7 @@ import ChevronDown from 'mdi-material-ui/ChevronDown'; import EyeOffIcon from 'mdi-material-ui/EyeOffOutline'; import EyeIcon from 'mdi-material-ui/EyeOutline'; import DeleteIcon from 'mdi-material-ui/DeleteOutline'; -import { Transform, TRANSFORM_TEXT } from '@perses-dev/core'; +import { Transform, TRANSFORM_TEXT } from '@perses-dev/core'; // TODO import { ReactElement } from 'react'; import { TransformEditor, TransformEditorProps } from './TransformEditor'; diff --git a/components/src/TransformsEditor/TransformsEditor.test.tsx b/components/src/TransformsEditor/TransformsEditor.test.tsx index 5e0e766..e9eee4e 100644 --- a/components/src/TransformsEditor/TransformsEditor.test.tsx +++ b/components/src/TransformsEditor/TransformsEditor.test.tsx @@ -13,7 +13,7 @@ import { render, screen, fireEvent } from '@testing-library/react'; import { TransformsEditor } from '@perses-dev/components'; -import { Transform } from '@perses-dev/core'; +import { Transform } from '@perses-dev/core'; // TODO describe('TransformsEditor', () => { function renderTableColumnsEditor(value: Transform[], onChange = jest.fn()): void { diff --git a/components/src/TransformsEditor/TransformsEditor.tsx b/components/src/TransformsEditor/TransformsEditor.tsx index d1127bc..421f69c 100644 --- a/components/src/TransformsEditor/TransformsEditor.tsx +++ b/components/src/TransformsEditor/TransformsEditor.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Transform } from '@perses-dev/core'; +import { Transform } from '@perses-dev/core'; // TODO import { Button, Stack, StackProps } from '@mui/material'; import { ReactElement, useState } from 'react'; import AddIcon from 'mdi-material-ui/Plus'; diff --git a/components/src/ValueMappingEditor/ValueMappingEditor.tsx b/components/src/ValueMappingEditor/ValueMappingEditor.tsx index 8774096..ad302e4 100644 --- a/components/src/ValueMappingEditor/ValueMappingEditor.tsx +++ b/components/src/ValueMappingEditor/ValueMappingEditor.tsx @@ -24,7 +24,7 @@ import { } from '@mui/material'; import DeleteIcon from 'mdi-material-ui/DeleteOutline'; import PlusIcon from 'mdi-material-ui/Plus'; -import { ValueMapping } from '@perses-dev/core'; +import { ValueMapping } from '@perses-dev/core'; // TODO import { FC } from 'react'; import { OptionsColorPicker } from '../ColorPicker/OptionsColorPicker'; diff --git a/components/src/ValueMappingEditor/ValueMappingsEditor.tsx b/components/src/ValueMappingEditor/ValueMappingsEditor.tsx index ec2357a..70a0c8f 100644 --- a/components/src/ValueMappingEditor/ValueMappingsEditor.tsx +++ b/components/src/ValueMappingEditor/ValueMappingsEditor.tsx @@ -12,10 +12,9 @@ // limitations under the License. import { Button, Divider, Stack, Typography, Grid2 as Grid } from '@mui/material'; - import { FC, useState } from 'react'; import AddIcon from 'mdi-material-ui/Plus'; -import { ValueMapping } from '@perses-dev/core'; +import { ValueMapping } from '@perses-dev/core'; // TODO import { ValueMappingEditor } from './ValueMappingEditor'; export interface ValueMappingsEditorProps { diff --git a/components/src/model/graph.ts b/components/src/model/graph.ts index 358edc3..7ae6877 100644 --- a/components/src/model/graph.ts +++ b/components/src/model/graph.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesValueTuple } from '@perses-dev/core'; +import { TimeSeriesValueTuple } from '@perses-dev/spec'; import { LineSeriesOption, BarSeriesOption } from 'echarts/charts'; import { LegendItem } from '../Legend'; diff --git a/components/src/model/theme.ts b/components/src/model/theme.ts index 80d0c41..4614fc5 100644 --- a/components/src/model/theme.ts +++ b/components/src/model/theme.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ThresholdColorPalette } from '@perses-dev/core'; +import { ThresholdColorPalette } from '@perses-dev/core'; // TODO import type { EChartsOption, BarSeriesOption, diff --git a/components/src/model/timeOption.ts b/components/src/model/timeOption.ts index da33a18..e711a81 100644 --- a/components/src/model/timeOption.ts +++ b/components/src/model/timeOption.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DurationString, parseDurationString, RelativeTimeRange } from '@perses-dev/core'; +import { DurationString, parseDurationString, RelativeTimeRange } from '@perses-dev/spec'; import { formatDuration } from 'date-fns'; export interface TimeOption { diff --git a/components/src/utils/axis.ts b/components/src/utils/axis.ts index 2b6537e..5373930 100644 --- a/components/src/utils/axis.ts +++ b/components/src/utils/axis.ts @@ -13,7 +13,7 @@ import merge from 'lodash/merge'; import type { XAXisComponentOption, YAXisComponentOption } from 'echarts'; -import { formatValue, FormatOptions } from '@perses-dev/core'; +import { formatValue, FormatOptions } from '@perses-dev/core'; // TODO export interface YAxisConfig { format?: FormatOptions; diff --git a/components/src/utils/chart-actions.test.ts b/components/src/utils/chart-actions.test.ts index e5b7e66..ca3e627 100644 --- a/components/src/utils/chart-actions.test.ts +++ b/components/src/utils/chart-actions.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/core'; +import { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec'; import { getClosestTimestamp, getClosestTimestampInFullDataset } from './chart-actions'; const TEST_TIME_SERIES_VALUES: TimeSeriesValueTuple[] = [ diff --git a/components/src/utils/chart-actions.ts b/components/src/utils/chart-actions.ts index 0f01da7..50330c0 100644 --- a/components/src/utils/chart-actions.ts +++ b/components/src/utils/chart-actions.ts @@ -12,7 +12,7 @@ // limitations under the License. import { ECharts as EChartsInstance } from 'echarts/core'; -import { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/core'; +import { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec'; import { DatapointInfo, PINNED_CROSSHAIR_SERIES_NAME, TimeChartSeriesMapping } from '../model'; export interface ZoomEventData { diff --git a/components/src/utils/variable-interpolation.ts b/components/src/utils/variable-interpolation.ts index 5208149..27d4259 100644 --- a/components/src/utils/variable-interpolation.ts +++ b/components/src/utils/variable-interpolation.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { VariableValue } from '@perses-dev/core'; +import { VariableValue } from '@perses-dev/spec'; /** * Option for a variable with label and value diff --git a/dashboards/package.json b/dashboards/package.json index e789c32..89a91e0 100644 --- a/dashboards/package.json +++ b/dashboards/package.json @@ -32,6 +32,7 @@ "@perses-dev/components": "0.53.1", "@perses-dev/core": "0.53.0", "@perses-dev/plugin-system": "0.53.1", + "@perses-dev/spec": "0.2.0-beta.0", "@types/react-grid-layout": "^1.3.2", "date-fns": "^4.1.0", "immer": "^10.1.1", diff --git a/dashboards/src/components/Dashboard/Dashboard.tsx b/dashboards/src/components/Dashboard/Dashboard.tsx index 9a5a2d8..f52502d 100644 --- a/dashboards/src/components/Dashboard/Dashboard.tsx +++ b/dashboards/src/components/Dashboard/Dashboard.tsx @@ -18,6 +18,7 @@ import { usePanelGroupIds } from '../../context'; import { GridLayout } from '../GridLayout'; import { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard'; import { PanelOptions } from '../Panel'; + export type DashboardProps = BoxProps & { /** * Props for `EmptyDashboard` component that will be rendered when the dashboard diff --git a/dashboards/src/components/DashboardLinks/DashboardLinksEditor.tsx b/dashboards/src/components/DashboardLinks/DashboardLinksEditor.tsx index f07ebf5..3ce3018 100644 --- a/dashboards/src/components/DashboardLinks/DashboardLinksEditor.tsx +++ b/dashboards/src/components/DashboardLinks/DashboardLinksEditor.tsx @@ -32,7 +32,7 @@ import ArrowUp from 'mdi-material-ui/ArrowUp'; import ArrowDown from 'mdi-material-ui/ArrowDown'; import PencilIcon from 'mdi-material-ui/Pencil'; import ChevronUp from 'mdi-material-ui/ChevronUp'; -import { Link } from '@perses-dev/core'; +import { Link } from '@perses-dev/spec'; import { useImmer } from 'use-immer'; import { InfoTooltip, LinkEditorForm } from '@perses-dev/components'; import { useDiscardChangesConfirmationDialog } from '../../context'; diff --git a/dashboards/src/components/DashboardLinks/EditDashboardLinksButton.tsx b/dashboards/src/components/DashboardLinks/EditDashboardLinksButton.tsx index 5badd43..de74e42 100644 --- a/dashboards/src/components/DashboardLinks/EditDashboardLinksButton.tsx +++ b/dashboards/src/components/DashboardLinks/EditDashboardLinksButton.tsx @@ -15,7 +15,7 @@ import { ReactElement, useState } from 'react'; import { Button, ButtonProps } from '@mui/material'; import PencilIcon from 'mdi-material-ui/PencilOutline'; import { Drawer, InfoTooltip } from '@perses-dev/components'; -import { Link } from '@perses-dev/core'; +import { Link } from '@perses-dev/spec'; import { TOOLTIP_TEXT, editButtonStyle } from '../../constants'; import { useDashboardLinks, useDashboardLinksActions } from '../../context'; import { DashboardLinksEditor } from './DashboardLinksEditor'; diff --git a/dashboards/src/components/Datasources/DatasourceEditor.tsx b/dashboards/src/components/Datasources/DatasourceEditor.tsx index eebc530..8d302a1 100644 --- a/dashboards/src/components/Datasources/DatasourceEditor.tsx +++ b/dashboards/src/components/Datasources/DatasourceEditor.tsx @@ -27,7 +27,8 @@ import { import AddIcon from 'mdi-material-ui/Plus'; import PencilIcon from 'mdi-material-ui/Pencil'; import TrashIcon from 'mdi-material-ui/TrashCan'; -import { Action, DatasourceDefinition, DatasourceSpec } from '@perses-dev/core'; +import { Action, DatasourceDefinition } from '@perses-dev/core'; // TODO +import { DatasourceSpec } from '@perses-dev/spec'; import { DatasourceEditorForm, ValidationProvider } from '@perses-dev/plugin-system'; import { ReactElement, useState } from 'react'; import { useImmer } from 'use-immer'; diff --git a/dashboards/src/components/Datasources/EditDatasourcesButton.tsx b/dashboards/src/components/Datasources/EditDatasourcesButton.tsx index 1105c95..2a986c9 100644 --- a/dashboards/src/components/Datasources/EditDatasourcesButton.tsx +++ b/dashboards/src/components/Datasources/EditDatasourcesButton.tsx @@ -15,7 +15,8 @@ import { ReactElement, useState } from 'react'; import { Button } from '@mui/material'; import PencilIcon from 'mdi-material-ui/PencilOutline'; import { Drawer, InfoTooltip } from '@perses-dev/components'; -import { DashboardResource, DatasourceSpec, EphemeralDashboardResource } from '@perses-dev/core'; +import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; // TODO weird that ephemeral dashboard is required here +import { DatasourceSpec } from '@perses-dev/spec'; import { useDatasourceStore } from '@perses-dev/plugin-system'; import { TOOLTIP_TEXT, editButtonStyle } from '../../constants'; import { useDashboard } from '../../context'; diff --git a/dashboards/src/components/DownloadButton/serializeDashboard.ts b/dashboards/src/components/DownloadButton/serializeDashboard.ts index e630854..393f46e 100644 --- a/dashboards/src/components/DownloadButton/serializeDashboard.ts +++ b/dashboards/src/components/DownloadButton/serializeDashboard.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; +import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; // TODO metadata should not be used, same for ephemeral dashboard import { stringify } from 'yaml'; type SerializedDashboard = { diff --git a/dashboards/src/components/GridLayout/GridItemContent.tsx b/dashboards/src/components/GridLayout/GridItemContent.tsx index 86d5a5d..55543f5 100644 --- a/dashboards/src/components/GridLayout/GridItemContent.tsx +++ b/dashboards/src/components/GridLayout/GridItemContent.tsx @@ -15,7 +15,7 @@ import { Box } from '@mui/material'; import { useInView } from 'react-intersection-observer'; import { DataQueriesProvider, usePlugin, useSuggestedStepMs } from '@perses-dev/plugin-system'; import React, { ReactElement, useMemo, useState } from 'react'; -import { isPanelGroupItemIdEqual, PanelGroupItemId } from '@perses-dev/core'; +import { isPanelGroupItemIdEqual, PanelGroupItemId } from '@perses-dev/core'; // TODO import { useEditMode, usePanel, usePanelActions, useViewPanelGroup } from '../../context'; import { Panel, PanelProps, PanelOptions } from '../Panel'; import { QueryViewerDialog } from '../QueryViewerDialog'; diff --git a/dashboards/src/components/GridLayout/GridLayout.tsx b/dashboards/src/components/GridLayout/GridLayout.tsx index 0c2a0a6..422daf4 100644 --- a/dashboards/src/components/GridLayout/GridLayout.tsx +++ b/dashboards/src/components/GridLayout/GridLayout.tsx @@ -12,7 +12,8 @@ // limitations under the License. import { ReactElement, useState } from 'react'; import { Layouts, Layout } from 'react-grid-layout'; -import { PanelGroupId, PanelGroupDefinition } from '@perses-dev/core'; +import { PanelGroupDefinition } from '@perses-dev/core'; // TODO what should we do about the PanelGroupDefinition ? +import { PanelGroupId } from '@perses-dev/spec'; import { useVariableValues, VariableContext } from '@perses-dev/plugin-system'; import { useEditMode, usePanelGroup, usePanelGroupActions, useViewPanelGroup } from '../../context'; import { GRID_LAYOUT_SMALL_BREAKPOINT } from '../../constants'; diff --git a/dashboards/src/components/GridLayout/GridTitle.tsx b/dashboards/src/components/GridLayout/GridTitle.tsx index a6fc5df..f88e8ae 100644 --- a/dashboards/src/components/GridLayout/GridTitle.tsx +++ b/dashboards/src/components/GridLayout/GridTitle.tsx @@ -21,7 +21,7 @@ import ArrowDownIcon from 'mdi-material-ui/ArrowDown'; import DeleteIcon from 'mdi-material-ui/DeleteOutline'; import { InfoTooltip } from '@perses-dev/components'; import { useReplaceVariablesInString } from '@perses-dev/plugin-system'; -import { PanelGroupId } from '@perses-dev/core'; +import { PanelGroupId } from '@perses-dev/spec'; import { ReactElement } from 'react'; import { ARIA_LABEL_TEXT, TOOLTIP_TEXT } from '../../constants'; import { usePanelGroupActions, useEditMode, useDeletePanelGroupDialog } from '../../context'; diff --git a/dashboards/src/components/GridLayout/Row.tsx b/dashboards/src/components/GridLayout/Row.tsx index 47d3269..6c66e14 100644 --- a/dashboards/src/components/GridLayout/Row.tsx +++ b/dashboards/src/components/GridLayout/Row.tsx @@ -12,7 +12,8 @@ // limitations under the License. import { Collapse, useTheme } from '@mui/material'; -import { PanelGroupId, PanelGroupDefinition, PanelGroupItemLayout } from '@perses-dev/core'; +import { PanelGroupDefinition, PanelGroupItemLayout } from '@perses-dev/core'; // TODO should go somewhere else +import { PanelGroupId } from '@perses-dev/spec'; import { PanelOptions, useViewPanelGroup } from '@perses-dev/dashboards'; import { ReactElement, useEffect, useMemo, useState } from 'react'; import { Layout, Layouts, Responsive, WidthProvider } from 'react-grid-layout'; diff --git a/dashboards/src/components/LeaveDialog/LeaveDialog.tsx b/dashboards/src/components/LeaveDialog/LeaveDialog.tsx index 0924da7..832e8a1 100644 --- a/dashboards/src/components/LeaveDialog/LeaveDialog.tsx +++ b/dashboards/src/components/LeaveDialog/LeaveDialog.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; +import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; // TODO only dashboard spec should be used import { ReactElement, ReactNode, useEffect } from 'react'; import { useBlocker } from 'react-router-dom'; import { DiscardChangesConfirmationDialog } from '@perses-dev/components'; diff --git a/dashboards/src/components/LinksDisplay/LinksDisplay.tsx b/dashboards/src/components/LinksDisplay/LinksDisplay.tsx index d35588b..dcd06a9 100644 --- a/dashboards/src/components/LinksDisplay/LinksDisplay.tsx +++ b/dashboards/src/components/LinksDisplay/LinksDisplay.tsx @@ -13,7 +13,7 @@ import { IconButton, Link as LinkComponent, Menu, MenuItem, Theme, Chip, capitalize, Stack } from '@mui/material'; import LaunchIcon from 'mdi-material-ui/Launch'; -import { Link } from '@perses-dev/core'; +import { Link } from '@perses-dev/spec'; import { MouseEvent, ReactElement, useState } from 'react'; import { InfoTooltip } from '@perses-dev/components'; import { useReplaceVariablesInString } from '@perses-dev/plugin-system'; diff --git a/dashboards/src/components/Panel/Panel.test.tsx b/dashboards/src/components/Panel/Panel.test.tsx index dccfd98..cc689a4 100644 --- a/dashboards/src/components/Panel/Panel.test.tsx +++ b/dashboards/src/components/Panel/Panel.test.tsx @@ -13,7 +13,7 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { PanelDefinition } from '@perses-dev/core'; +import { PanelDefinition } from '@perses-dev/spec'; import { DataQueriesProvider, TimeRangeProviderBasic, useDataQueriesContext } from '@perses-dev/plugin-system'; import { createTheme, ThemeProvider } from '@mui/material/styles'; import { renderWithContext } from '../../test'; diff --git a/dashboards/src/components/Panel/Panel.tsx b/dashboards/src/components/Panel/Panel.tsx index bb0029d..14b89ba 100644 --- a/dashboards/src/components/Panel/Panel.tsx +++ b/dashboards/src/components/Panel/Panel.tsx @@ -20,7 +20,8 @@ import { combineSx, useId, } from '@perses-dev/components'; -import { PanelDefinition, PanelGroupItemId } from '@perses-dev/core'; +import { PanelGroupItemId } from '@perses-dev/core'; // TODO +import { PanelDefinition } from '@perses-dev/spec'; import { ActionOptions, useDataQueriesContext, usePluginRegistry } from '@perses-dev/plugin-system'; import { ReactNode, memo, useEffect, useMemo, useState } from 'react'; import useResizeObserver from 'use-resize-observer'; diff --git a/dashboards/src/components/Panel/PanelActions.tsx b/dashboards/src/components/Panel/PanelActions.tsx index 1520f02..d79eb1a 100644 --- a/dashboards/src/components/Panel/PanelActions.tsx +++ b/dashboards/src/components/Panel/PanelActions.tsx @@ -27,7 +27,7 @@ import AlertIcon from 'mdi-material-ui/Alert'; import AlertCircleIcon from 'mdi-material-ui/AlertCircle'; import InformationOutlineIcon from 'mdi-material-ui/InformationOutline'; import LightningBoltIcon from 'mdi-material-ui/LightningBolt'; -import { Link, Notice } from '@perses-dev/core'; +import { Link, Notice } from '@perses-dev/spec'; import { ARIA_LABEL_TEXT, HEADER_ACTIONS_CONTAINER_NAME, diff --git a/dashboards/src/components/Panel/PanelContent.tsx b/dashboards/src/components/Panel/PanelContent.tsx index 4ac622d..5a46a07 100644 --- a/dashboards/src/components/Panel/PanelContent.tsx +++ b/dashboards/src/components/Panel/PanelContent.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { usePlugin, PanelProps, QueryData, PanelPlugin } from '@perses-dev/plugin-system'; -import { UnknownSpec, PanelDefinition, QueryDataType } from '@perses-dev/core'; +import { UnknownSpec, PanelDefinition, QueryDataType } from '@perses-dev/spec'; import { ReactElement } from 'react'; import { LoadingOverlay } from '@perses-dev/components'; import { Skeleton } from '@mui/material'; diff --git a/dashboards/src/components/Panel/PanelHeader.tsx b/dashboards/src/components/Panel/PanelHeader.tsx index b865048..dc4293e 100644 --- a/dashboards/src/components/Panel/PanelHeader.tsx +++ b/dashboards/src/components/Panel/PanelHeader.tsx @@ -13,7 +13,7 @@ import { CardHeader, CardHeaderProps, Stack, Typography, Tooltip } from '@mui/material'; import { combineSx } from '@perses-dev/components'; -import { Link } from '@perses-dev/core'; +import { Link } from '@perses-dev/spec'; import { ItemAction, QueryData, useAllVariableValues, useReplaceVariablesInString } from '@perses-dev/plugin-system'; import { ReactElement, ReactNode, useRef } from 'react'; import { HEADER_ACTIONS_CONTAINER_NAME } from '../../constants'; diff --git a/dashboards/src/components/Panel/PanelPluginLoader.tsx b/dashboards/src/components/Panel/PanelPluginLoader.tsx index df3e576..217667d 100644 --- a/dashboards/src/components/Panel/PanelPluginLoader.tsx +++ b/dashboards/src/components/Panel/PanelPluginLoader.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { usePlugin, PanelProps } from '@perses-dev/plugin-system'; -import { UnknownSpec, QueryDataType } from '@perses-dev/core'; +import { UnknownSpec, QueryDataType } from '@perses-dev/spec'; import { ReactElement } from 'react'; import { Skeleton } from '@mui/material'; diff --git a/dashboards/src/components/PanelDrawer/PanelDrawer.tsx b/dashboards/src/components/PanelDrawer/PanelDrawer.tsx index d1d0bc6..eec9b1a 100644 --- a/dashboards/src/components/PanelDrawer/PanelDrawer.tsx +++ b/dashboards/src/components/PanelDrawer/PanelDrawer.tsx @@ -27,7 +27,7 @@ import { ReactElement, useState, useMemo, ReactNode, useCallback } from 'react'; import { Drawer, ErrorAlert, ErrorBoundary } from '@perses-dev/components'; -import { PanelEditorValues } from '@perses-dev/core'; +import { PanelEditorValues } from '@perses-dev/spec'; import { useVariableValues, VariableContext } from '@perses-dev/plugin-system'; import { usePanelEditor, usePanelKey } from '../../context'; import { PanelEditorForm } from './PanelEditorForm'; diff --git a/dashboards/src/components/PanelDrawer/PanelEditorForm.tsx b/dashboards/src/components/PanelDrawer/PanelEditorForm.tsx index ddc5cf6..863f125 100644 --- a/dashboards/src/components/PanelDrawer/PanelEditorForm.tsx +++ b/dashboards/src/components/PanelDrawer/PanelEditorForm.tsx @@ -13,7 +13,8 @@ import { ReactElement, useCallback, useEffect, useState } from 'react'; import { Box, Button, Grid, MenuItem, Stack, TextField, Typography } from '@mui/material'; -import { Action, PanelDefinition, PanelEditorValues } from '@perses-dev/core'; +import { Action } from '@perses-dev/core'; // TODO Perses permission should not be used +import { PanelDefinition, PanelEditorValues } from '@perses-dev/spec'; import { DiscardChangesConfirmationDialog, ErrorAlert, ErrorBoundary } from '@perses-dev/components'; import { PluginKindSelect, diff --git a/dashboards/src/components/PanelDrawer/PanelPreview.tsx b/dashboards/src/components/PanelDrawer/PanelPreview.tsx index 1b5c6fa..606b7b6 100644 --- a/dashboards/src/components/PanelDrawer/PanelPreview.tsx +++ b/dashboards/src/components/PanelDrawer/PanelPreview.tsx @@ -13,7 +13,7 @@ import { ReactElement, useContext, useEffect, useRef } from 'react'; import { Box } from '@mui/material'; -import { PanelEditorValues } from '@perses-dev/core'; +import { PanelEditorValues } from '@perses-dev/spec'; import { Panel } from '../Panel'; import { PanelEditorContext } from '../../context'; diff --git a/dashboards/src/components/PanelDrawer/PanelQueriesSharedControls.tsx b/dashboards/src/components/PanelDrawer/PanelQueriesSharedControls.tsx index 7d83583..fc28bc4 100644 --- a/dashboards/src/components/PanelDrawer/PanelQueriesSharedControls.tsx +++ b/dashboards/src/components/PanelDrawer/PanelQueriesSharedControls.tsx @@ -15,7 +15,7 @@ import { Grid, Typography } from '@mui/material'; import { ErrorAlert, ErrorBoundary } from '@perses-dev/components'; import { PanelEditorContext, PanelPreview } from '@perses-dev/dashboards'; import { DataQueriesProvider, PanelSpecEditor, usePlugin, useSuggestedStepMs } from '@perses-dev/plugin-system'; -import { Definition, PanelDefinition, PanelEditorValues, QueryDefinition, UnknownSpec } from '@perses-dev/core'; +import { Definition, PanelDefinition, PanelEditorValues, QueryDefinition, UnknownSpec } from '@perses-dev/spec'; import { Control } from 'react-hook-form'; import { ReactElement, useCallback, useContext, useMemo, useState } from 'react'; diff --git a/dashboards/src/components/PanelDrawer/usePanelEditor.test.tsx b/dashboards/src/components/PanelDrawer/usePanelEditor.test.tsx index 71cb4d5..3101772 100644 --- a/dashboards/src/components/PanelDrawer/usePanelEditor.test.tsx +++ b/dashboards/src/components/PanelDrawer/usePanelEditor.test.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { act, renderHook } from '@testing-library/react'; -import { PanelDefinition, QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/core'; +import { PanelDefinition, QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/spec'; import { usePanelEditor } from './usePanelEditor'; describe('usePanelEditor', () => { diff --git a/dashboards/src/components/PanelDrawer/usePanelEditor.tsx b/dashboards/src/components/PanelDrawer/usePanelEditor.tsx index a081211..402134b 100644 --- a/dashboards/src/components/PanelDrawer/usePanelEditor.tsx +++ b/dashboards/src/components/PanelDrawer/usePanelEditor.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { useCallback, useMemo, useState } from 'react'; -import { Definition, Link, PanelDefinition, QueryDefinition, UnknownSpec } from '@perses-dev/core'; +import { Definition, Link, PanelDefinition, QueryDefinition, UnknownSpec } from '@perses-dev/spec'; interface UsePanelEditorResult { setName: (value: string) => void; diff --git a/dashboards/src/components/QuerySummaryTable/QuerySummaryTable.tsx b/dashboards/src/components/QuerySummaryTable/QuerySummaryTable.tsx index 2a32c5b..5811560 100644 --- a/dashboards/src/components/QuerySummaryTable/QuerySummaryTable.tsx +++ b/dashboards/src/components/QuerySummaryTable/QuerySummaryTable.tsx @@ -25,7 +25,7 @@ import { Stack, } from '@mui/material'; import { useQueryClient } from '@tanstack/react-query'; -import { TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core'; +import { TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/spec'; import { useActiveTimeSeriesQueries, useDatasourceClient, useTimeRange } from '@perses-dev/plugin-system'; import { ReactElement } from 'react'; diff --git a/dashboards/src/components/QueryViewerDialog/QueryViewerDialog.tsx b/dashboards/src/components/QueryViewerDialog/QueryViewerDialog.tsx index 84329b4..dbef63d 100644 --- a/dashboards/src/components/QueryViewerDialog/QueryViewerDialog.tsx +++ b/dashboards/src/components/QueryViewerDialog/QueryViewerDialog.tsx @@ -15,7 +15,7 @@ import React, { ReactElement, useMemo } from 'react'; import { Dialog } from '@perses-dev/components'; import { Button, Divider } from '@mui/material'; import { PluginSpecEditor } from '@perses-dev/plugin-system'; -import { QueryDefinition } from '@perses-dev/core'; +import { QueryDefinition } from '@perses-dev/spec'; export interface QueryViewerDialogProps { open: boolean; diff --git a/dashboards/src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx b/dashboards/src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx index e73ad23..4880a1e 100644 --- a/dashboards/src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx +++ b/dashboards/src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx @@ -14,7 +14,7 @@ import { ReactElement, useState } from 'react'; import { Checkbox, FormGroup, FormControlLabel, Typography } from '@mui/material'; import { DEFAULT_REFRESH_INTERVAL_OPTIONS, useTimeRange } from '@perses-dev/plugin-system'; -import { isRelativeTimeRange } from '@perses-dev/core'; +import { isRelativeTimeRange } from '@perses-dev/spec'; import { Dialog } from '@perses-dev/components'; import { useSaveChangesConfirmationDialog, useVariableDefinitionActions } from '../../context'; diff --git a/dashboards/src/components/SaveDashboardButton/SaveDashboardButton.tsx b/dashboards/src/components/SaveDashboardButton/SaveDashboardButton.tsx index 4e08c4d..35fe3f8 100644 --- a/dashboards/src/components/SaveDashboardButton/SaveDashboardButton.tsx +++ b/dashboards/src/components/SaveDashboardButton/SaveDashboardButton.tsx @@ -13,7 +13,7 @@ import { ReactElement, useState } from 'react'; import { Button, ButtonProps } from '@mui/material'; -import { isRelativeTimeRange } from '@perses-dev/core'; +import { isRelativeTimeRange } from '@perses-dev/spec'; import { useTimeRange } from '@perses-dev/plugin-system'; import { OnSaveDashboard, diff --git a/dashboards/src/components/Variables/BuiltinVariableAccordions.tsx b/dashboards/src/components/Variables/BuiltinVariableAccordions.tsx index ba2c780..3540517 100644 --- a/dashboards/src/components/Variables/BuiltinVariableAccordions.tsx +++ b/dashboards/src/components/Variables/BuiltinVariableAccordions.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { BuiltinVariableDefinition } from '@perses-dev/core'; +import { BuiltinVariableDefinition } from '@perses-dev/spec'; import { Accordion, AccordionDetails, diff --git a/dashboards/src/components/Variables/EditVariablesButton.tsx b/dashboards/src/components/Variables/EditVariablesButton.tsx index 7fb6ce4..e2865d7 100644 --- a/dashboards/src/components/Variables/EditVariablesButton.tsx +++ b/dashboards/src/components/Variables/EditVariablesButton.tsx @@ -15,7 +15,8 @@ import { ReactElement, useState } from 'react'; import { Button, ButtonProps } from '@mui/material'; import PencilIcon from 'mdi-material-ui/PencilOutline'; import { Drawer, InfoTooltip } from '@perses-dev/components'; -import { BuiltinVariableDefinition, VariableDefinition, ExternalVariableDefinition } from '@perses-dev/core'; +import { ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { BuiltinVariableDefinition, VariableDefinition } from '@perses-dev/spec'; import { useBuiltinVariableDefinitions } from '@perses-dev/plugin-system'; import { TOOLTIP_TEXT, editButtonStyle } from '../../constants'; import { useExternalVariableDefinitions, useVariableDefinitionActions, useVariableDefinitions } from '../../context'; diff --git a/dashboards/src/components/Variables/ListVariableListBox.tsx b/dashboards/src/components/Variables/ListVariableListBox.tsx index 8e650ea..e27ce6d 100644 --- a/dashboards/src/components/Variables/ListVariableListBox.tsx +++ b/dashboards/src/components/Variables/ListVariableListBox.tsx @@ -14,7 +14,7 @@ import React, { ForwardedRef, HTMLAttributes, ReactNode, forwardRef, useContext, useMemo } from 'react'; import { Checkbox, Divider } from '@mui/material'; import { VariableOption } from '@perses-dev/plugin-system'; -import { DEFAULT_ALL_VALUE } from '@perses-dev/core'; +import { DEFAULT_ALL_VALUE } from '@perses-dev/spec'; export interface ListVariableListBoxContextValue { options: VariableOption[]; diff --git a/dashboards/src/components/Variables/Variable.test.ts b/dashboards/src/components/Variables/Variable.test.ts index b9b6981..8f8c857 100644 --- a/dashboards/src/components/Variables/Variable.test.ts +++ b/dashboards/src/components/Variables/Variable.test.ts @@ -13,7 +13,7 @@ import { useListVariableState } from '@perses-dev/dashboards'; import { renderHook } from '@testing-library/react'; -import { VariableValue } from '@perses-dev/core'; +import { VariableValue } from '@perses-dev/spec'; import { VariableOption } from '@perses-dev/plugin-system'; /** diff --git a/dashboards/src/components/Variables/Variable.tsx b/dashboards/src/components/Variables/Variable.tsx index f568256..d2caca0 100644 --- a/dashboards/src/components/Variables/Variable.tsx +++ b/dashboards/src/components/Variables/Variable.tsx @@ -20,7 +20,7 @@ import { TextVariableDefinition, VariableName, VariableValue, -} from '@perses-dev/core'; +} from '@perses-dev/spec'; import { SORT_METHODS, SortMethodName, diff --git a/dashboards/src/components/Variables/VariableEditor.tsx b/dashboards/src/components/Variables/VariableEditor.tsx index a7edd82..ab4350d 100644 --- a/dashboards/src/components/Variables/VariableEditor.tsx +++ b/dashboards/src/components/Variables/VariableEditor.tsx @@ -34,7 +34,8 @@ import { AccordionDetails, } from '@mui/material'; import AddIcon from 'mdi-material-ui/Plus'; -import { Action, BuiltinVariableDefinition, VariableDefinition, ExternalVariableDefinition } from '@perses-dev/core'; +import { Action, ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { BuiltinVariableDefinition, VariableDefinition } from '@perses-dev/spec'; import { useImmer } from 'use-immer'; import PencilIcon from 'mdi-material-ui/Pencil'; import CloneIcon from 'mdi-material-ui/ContentCopy'; diff --git a/dashboards/src/components/Variables/VariableList.tsx b/dashboards/src/components/Variables/VariableList.tsx index 70961c8..883d7a5 100644 --- a/dashboards/src/components/Variables/VariableList.tsx +++ b/dashboards/src/components/Variables/VariableList.tsx @@ -12,7 +12,8 @@ // limitations under the License. import { Box } from '@mui/material'; -import { VariableDefinition, VariableSpec, ExternalVariableDefinition } from '@perses-dev/core'; +import { ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { VariableDefinition, VariableSpec } from '@perses-dev/spec'; import { ReactElement } from 'react'; import { useExternalVariableDefinitions, useVariableDefinitionAndState, useVariableDefinitions } from '../../context'; import { MAX_VARIABLE_WIDTH, MIN_VARIABLE_WIDTH } from '../../constants'; diff --git a/dashboards/src/context/DashboardProvider/DashboardProvider.tsx b/dashboards/src/context/DashboardProvider/DashboardProvider.tsx index 814c2ad..2e8cb27 100644 --- a/dashboards/src/context/DashboardProvider/DashboardProvider.tsx +++ b/dashboards/src/context/DashboardProvider/DashboardProvider.tsx @@ -19,14 +19,12 @@ import { immer } from 'zustand/middleware/immer'; import { shallow } from 'zustand/shallow'; import { createContext, ReactElement, ReactNode, useCallback, useContext, useEffect, useState } from 'react'; import { - DashboardResource, - Display, ProjectMetadata, - DurationString, + DashboardResource, DEFAULT_REFRESH_INTERVAL, - DatasourceSpec, EphemeralDashboardResource, } from '@perses-dev/core'; +import { Display, DurationString, DatasourceSpec } from '@perses-dev/spec'; import { usePlugin, usePluginRegistry } from '@perses-dev/plugin-system'; import { createPanelGroupEditorSlice, PanelGroupEditorSlice } from './panel-group-editor-slice'; import { convertLayoutsToPanelGroups, createPanelGroupSlice, PanelGroupSlice } from './panel-group-slice'; diff --git a/dashboards/src/context/DashboardProvider/common.ts b/dashboards/src/context/DashboardProvider/common.ts index ae7faac..f69c770 100644 --- a/dashboards/src/context/DashboardProvider/common.ts +++ b/dashboards/src/context/DashboardProvider/common.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DashboardResource, EphemeralDashboardResource, PanelDefinition, UnknownSpec } from '@perses-dev/core'; +import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; // TODO +import { PanelDefinition, UnknownSpec } from '@perses-dev/spec'; export type OnSaveDashboard = (dashboard: DashboardResource | EphemeralDashboardResource) => Promise; diff --git a/dashboards/src/context/DashboardProvider/dashboard-provider-api.ts b/dashboards/src/context/DashboardProvider/dashboard-provider-api.ts index a2a01a8..cf7baf3 100644 --- a/dashboards/src/context/DashboardProvider/dashboard-provider-api.ts +++ b/dashboards/src/context/DashboardProvider/dashboard-provider-api.ts @@ -14,15 +14,12 @@ import { useCallback, useMemo } from 'react'; import { DashboardResource, - DurationString, EphemeralDashboardResource, - Link, - PanelDefinition, - PanelGroupId, + PanelGroupItemLayout, PanelGroupDefinition, PanelGroupItemId, - PanelGroupItemLayout, -} from '@perses-dev/core'; +} from '@perses-dev/core'; // TODO +import { DurationString, Link, PanelDefinition, PanelGroupId } from '@perses-dev/spec'; import { DashboardStoreState, useDashboardStore } from './DashboardProvider'; import { DeletePanelGroupDialogState } from './delete-panel-group-slice'; import { PanelGroupEditor } from './panel-group-editor-slice'; diff --git a/dashboards/src/context/DashboardProvider/delete-panel-group-slice.ts b/dashboards/src/context/DashboardProvider/delete-panel-group-slice.ts index 89eb0ec..33eabdf 100644 --- a/dashboards/src/context/DashboardProvider/delete-panel-group-slice.ts +++ b/dashboards/src/context/DashboardProvider/delete-panel-group-slice.ts @@ -12,7 +12,7 @@ // limitations under the License. import { StateCreator } from 'zustand'; -import { PanelGroupId } from '@perses-dev/core'; +import { PanelGroupId } from '@perses-dev/spec'; import { Middleware } from './common'; import { PanelGroupSlice } from './panel-group-slice'; import { PanelSlice } from './panel-slice'; diff --git a/dashboards/src/context/DashboardProvider/delete-panel-slice.ts b/dashboards/src/context/DashboardProvider/delete-panel-slice.ts index 4f80acc..e547554 100644 --- a/dashboards/src/context/DashboardProvider/delete-panel-slice.ts +++ b/dashboards/src/context/DashboardProvider/delete-panel-slice.ts @@ -12,7 +12,7 @@ // limitations under the License. import { StateCreator } from 'zustand'; -import { PanelGroupItemId } from '@perses-dev/core'; +import { PanelGroupItemId } from '@perses-dev/core'; // TODO import { Middleware } from './common'; import { PanelGroupSlice } from './panel-group-slice'; import { PanelSlice } from './panel-slice'; diff --git a/dashboards/src/context/DashboardProvider/duplicate-panel-slice.ts b/dashboards/src/context/DashboardProvider/duplicate-panel-slice.ts index ebd81ac..35ea58b 100644 --- a/dashboards/src/context/DashboardProvider/duplicate-panel-slice.ts +++ b/dashboards/src/context/DashboardProvider/duplicate-panel-slice.ts @@ -12,7 +12,7 @@ // limitations under the License. import { StateCreator } from 'zustand'; -import { PanelGroupItemId } from '@perses-dev/core'; +import { PanelGroupItemId } from '@perses-dev/core'; // TODO import { generatePanelKey, insertPanelInLayout, UnpositionedPanelGroupItemLayout } from '../../utils/panelUtils'; import { generateId, Middleware } from './common'; import { PanelGroupSlice } from './panel-group-slice'; diff --git a/dashboards/src/context/DashboardProvider/links-slice.ts b/dashboards/src/context/DashboardProvider/links-slice.ts index 7c05f2a..401868a 100644 --- a/dashboards/src/context/DashboardProvider/links-slice.ts +++ b/dashboards/src/context/DashboardProvider/links-slice.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Link } from '@perses-dev/core'; +import { Link } from '@perses-dev/spec'; import { StateCreator } from 'zustand'; import { Middleware } from './common'; diff --git a/dashboards/src/context/DashboardProvider/panel-editor-slice.ts b/dashboards/src/context/DashboardProvider/panel-editor-slice.ts index 95b90d0..926ab19 100644 --- a/dashboards/src/context/DashboardProvider/panel-editor-slice.ts +++ b/dashboards/src/context/DashboardProvider/panel-editor-slice.ts @@ -11,14 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { - Action, - PanelEditorValues, - PanelGroupId, - PanelGroupItemId, - PanelGroupDefinition, - PanelGroupItemLayout, -} from '@perses-dev/core'; +import { Action, PanelGroupItemId, PanelGroupDefinition, PanelGroupItemLayout } from '@perses-dev/core'; // TODO +import { PanelEditorValues, PanelGroupId } from '@perses-dev/spec'; import { StateCreator } from 'zustand'; import { generatePanelKey, getYForNewRow } from '../../utils'; import { generateId, Middleware, createPanelDefinition } from './common'; diff --git a/dashboards/src/context/DashboardProvider/panel-group-editor-slice.ts b/dashboards/src/context/DashboardProvider/panel-group-editor-slice.ts index 1ff10d1..250c808 100644 --- a/dashboards/src/context/DashboardProvider/panel-group-editor-slice.ts +++ b/dashboards/src/context/DashboardProvider/panel-group-editor-slice.ts @@ -12,7 +12,7 @@ // limitations under the License. import { StateCreator } from 'zustand'; -import { PanelGroupId } from '@perses-dev/core'; +import { PanelGroupId } from '@perses-dev/spec'; import { Middleware } from './common'; import { PanelGroupSlice, addPanelGroup, createEmptyPanelGroup } from './panel-group-slice'; diff --git a/dashboards/src/context/DashboardProvider/panel-group-slice.ts b/dashboards/src/context/DashboardProvider/panel-group-slice.ts index d349574..fcf60c5 100644 --- a/dashboards/src/context/DashboardProvider/panel-group-slice.ts +++ b/dashboards/src/context/DashboardProvider/panel-group-slice.ts @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { getPanelKeyFromRef, LayoutDefinition, PanelGroupId, PanelGroupDefinition } from '@perses-dev/core'; - +import { PanelGroupDefinition } from '@perses-dev/core'; // TODO +import { getPanelKeyFromRef, LayoutDefinition, PanelGroupId } from '@perses-dev/spec'; import { StateCreator } from 'zustand'; import { WritableDraft } from 'immer'; import { generateId, Middleware } from './common'; diff --git a/dashboards/src/context/DashboardProvider/panel-slice.ts b/dashboards/src/context/DashboardProvider/panel-slice.ts index 67dda1c..6c413c9 100644 --- a/dashboards/src/context/DashboardProvider/panel-slice.ts +++ b/dashboards/src/context/DashboardProvider/panel-slice.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { PanelDefinition } from '@perses-dev/core'; +import { PanelDefinition } from '@perses-dev/spec'; import { StateCreator } from 'zustand'; import { Middleware } from './common'; diff --git a/dashboards/src/context/DashboardProvider/view-panel-slice.ts b/dashboards/src/context/DashboardProvider/view-panel-slice.ts index f032877..20488a5 100644 --- a/dashboards/src/context/DashboardProvider/view-panel-slice.ts +++ b/dashboards/src/context/DashboardProvider/view-panel-slice.ts @@ -12,7 +12,8 @@ // limitations under the License. import { StateCreator } from 'zustand'; -import { PanelGroupDefinition, PanelGroupItemId, PanelGroupId } from '@perses-dev/core'; +import { PanelGroupDefinition, PanelGroupItemId } from '@perses-dev/core'; // TODO +import { PanelGroupId } from '@perses-dev/spec'; import { Middleware } from './common'; import { PanelGroupSlice } from './panel-group-slice'; diff --git a/dashboards/src/context/DatasourceStoreProvider.test.tsx b/dashboards/src/context/DatasourceStoreProvider.test.tsx index 802538c..4200065 100644 --- a/dashboards/src/context/DatasourceStoreProvider.test.tsx +++ b/dashboards/src/context/DatasourceStoreProvider.test.tsx @@ -23,14 +23,8 @@ import { import { DatasourceStoreProvider } from '@perses-dev/dashboards'; import { PropsWithChildren, ReactElement } from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { - DashboardResource, - DashboardSpec, - Datasource, - DatasourceSpec, - GlobalDatasourceResource, - DatasourceResource, -} from '@perses-dev/core'; +import { DashboardResource, Datasource, GlobalDatasourceResource, DatasourceResource } from '@perses-dev/core'; // TODO Datasource should not be used like that, only the spec should be considered +import { DashboardSpec, DatasourceSpec } from '@perses-dev/spec'; const PROJECT = 'perses'; const FAKE_PLUGIN_NAME = 'FakeDatasourcePlugin'; diff --git a/dashboards/src/context/DatasourceStoreProvider.tsx b/dashboards/src/context/DatasourceStoreProvider.tsx index d9dda7f..38309da 100644 --- a/dashboards/src/context/DatasourceStoreProvider.tsx +++ b/dashboards/src/context/DatasourceStoreProvider.tsx @@ -14,14 +14,12 @@ import { ReactElement, ReactNode, useCallback, useMemo, useState } from 'react'; import { DashboardResource, - DashboardSpec, - DatasourceSelector, - DatasourceSpec, EphemeralDashboardResource, DatasourceDefinition, - DatasourceApi, BuildDatasourceProxyUrlParams, -} from '@perses-dev/core'; + DatasourceApi, +} from '@perses-dev/core'; // TODO +import { DashboardSpec, DatasourceSelector, DatasourceSpec } from '@perses-dev/spec'; import { DatasourceStoreContext, DatasourceStore, diff --git a/dashboards/src/context/VariableProvider/VariableProvider.tsx b/dashboards/src/context/VariableProvider/VariableProvider.tsx index de90514..a5adca9 100644 --- a/dashboards/src/context/VariableProvider/VariableProvider.tsx +++ b/dashboards/src/context/VariableProvider/VariableProvider.tsx @@ -27,18 +27,17 @@ import { BuiltinVariableContext, useTimeRange, } from '@perses-dev/plugin-system'; +import { intervalToPrometheusDuration, ExternalVariableDefinition } from '@perses-dev/core'; // TODO weird to have something related to prometheus in the dashboard package import { DEFAULT_ALL_VALUE as ALL_VALUE, VariableName, VariableValue, VariableDefinition, formatDuration, - intervalToPrometheusDuration, BuiltinVariableDefinition, TextVariableDefinition, ListVariableDefinition, - ExternalVariableDefinition, -} from '@perses-dev/core'; +} from '@perses-dev/spec'; import { checkSavedDefaultVariableStatus, findVariableDefinitionByName, mergeVariableDefinitions } from './utils'; import { hydrateVariableDefinitionStates as hydrateVariableDefinitionStates } from './hydrationUtils'; import { getInitalValuesFromQueryParameters, getURLQueryParamName, useVariableQueryParams } from './query-params'; diff --git a/dashboards/src/context/VariableProvider/hydrationUtils.test.ts b/dashboards/src/context/VariableProvider/hydrationUtils.test.ts index 9d37211..2fa4470 100644 --- a/dashboards/src/context/VariableProvider/hydrationUtils.test.ts +++ b/dashboards/src/context/VariableProvider/hydrationUtils.test.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DEFAULT_ALL_VALUE, VariableDefinition, ExternalVariableDefinition } from '@perses-dev/core'; +import { ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { DEFAULT_ALL_VALUE, VariableDefinition } from '@perses-dev/spec'; import { hydrateVariableDefinitionStates } from './hydrationUtils'; describe('hydrateVariableStates', () => { diff --git a/dashboards/src/context/VariableProvider/hydrationUtils.ts b/dashboards/src/context/VariableProvider/hydrationUtils.ts index 77c0141..535328d 100644 --- a/dashboards/src/context/VariableProvider/hydrationUtils.ts +++ b/dashboards/src/context/VariableProvider/hydrationUtils.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DEFAULT_ALL_VALUE, VariableValue, VariableDefinition, ExternalVariableDefinition } from '@perses-dev/core'; +import { ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { DEFAULT_ALL_VALUE, VariableValue, VariableDefinition } from '@perses-dev/spec'; import { VariableStoreStateMap, VariableState } from '@perses-dev/plugin-system'; // TODO: move to VariableProvider/utils.ts diff --git a/dashboards/src/context/VariableProvider/query-params.test.ts b/dashboards/src/context/VariableProvider/query-params.test.ts index 020bf57..ca254a3 100644 --- a/dashboards/src/context/VariableProvider/query-params.test.ts +++ b/dashboards/src/context/VariableProvider/query-params.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { VariableValue } from '@perses-dev/core'; +import { VariableValue } from '@perses-dev/spec'; import { getInitalValuesFromQueryParameters, decodeVariableValue, encodeVariableValue } from './query-params'; describe('getInitalValuesFromQueryParameters', () => { diff --git a/dashboards/src/context/VariableProvider/query-params.ts b/dashboards/src/context/VariableProvider/query-params.ts index 2279bec..86e1627 100644 --- a/dashboards/src/context/VariableProvider/query-params.ts +++ b/dashboards/src/context/VariableProvider/query-params.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { VariableValue, VariableDefinition } from '@perses-dev/core'; +import { VariableValue, VariableDefinition } from '@perses-dev/spec'; import { QueryParamConfig, useQueryParams } from 'use-query-params'; const variableQueryParameterPrefix = 'var-'; diff --git a/dashboards/src/context/VariableProvider/utils.test.ts b/dashboards/src/context/VariableProvider/utils.test.ts index bd138c8..77c7a8e 100644 --- a/dashboards/src/context/VariableProvider/utils.test.ts +++ b/dashboards/src/context/VariableProvider/utils.test.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { VariableDefinition, ExternalVariableDefinition } from '@perses-dev/core'; +import { ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { VariableDefinition } from '@perses-dev/spec'; import { VariableStoreStateMap } from '@perses-dev/plugin-system'; import { checkSavedDefaultVariableStatus, mergeVariableDefinitions } from './utils'; diff --git a/dashboards/src/context/VariableProvider/utils.ts b/dashboards/src/context/VariableProvider/utils.ts index 90074fc..1a742ff 100644 --- a/dashboards/src/context/VariableProvider/utils.ts +++ b/dashboards/src/context/VariableProvider/utils.ts @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { VariableDefinition, ExternalVariableDefinition } from '@perses-dev/core'; +import { ExternalVariableDefinition } from '@perses-dev/core'; // TODO +import { VariableDefinition } from '@perses-dev/spec'; import { VariableStoreStateMap } from '@perses-dev/plugin-system'; /* diff --git a/dashboards/src/context/useDashboard.tsx b/dashboards/src/context/useDashboard.tsx index 16ad484..00235df 100644 --- a/dashboards/src/context/useDashboard.tsx +++ b/dashboards/src/context/useDashboard.tsx @@ -11,14 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { - createPanelRef, - DashboardResource, - EphemeralDashboardResource, - GridDefinition, - PanelGroupDefinition, - PanelGroupId, -} from '@perses-dev/core'; +import { DashboardResource, EphemeralDashboardResource, PanelGroupDefinition } from '@perses-dev/core'; // TODO +import { createPanelRef, GridDefinition, PanelGroupId } from '@perses-dev/spec'; import { useDashboardStore } from './DashboardProvider'; import { useVariableDefinitionActions, useVariableDefinitions } from './VariableProvider'; diff --git a/dashboards/src/test/dashboard-provider.tsx b/dashboards/src/test/dashboard-provider.tsx index 9acde73..fa28d2c 100644 --- a/dashboards/src/test/dashboard-provider.tsx +++ b/dashboards/src/test/dashboard-provider.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DashboardResource } from '@perses-dev/core'; +import { DashboardResource } from '@perses-dev/core'; // TODO import { useContext } from 'react'; import { StoreApi } from 'zustand'; import { DashboardContext, DashboardStoreState } from '../context'; diff --git a/dashboards/src/test/datasource-provider.tsx b/dashboards/src/test/datasource-provider.tsx index d6a1500..4b8ff00 100644 --- a/dashboards/src/test/datasource-provider.tsx +++ b/dashboards/src/test/datasource-provider.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { GlobalDatasourceResource } from '@perses-dev/core'; +import { GlobalDatasourceResource } from '@perses-dev/core'; // TODO import { DatasourceStoreProviderProps } from '../context'; import { getTestDashboard } from './dashboard-provider'; diff --git a/dashboards/src/test/plugin-registry.tsx b/dashboards/src/test/plugin-registry.tsx index 72330cc..b6bcee5 100644 --- a/dashboards/src/test/plugin-registry.tsx +++ b/dashboards/src/test/plugin-registry.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { PanelPlugin, MockPlugin } from '@perses-dev/plugin-system'; import { ReactElement } from 'react'; diff --git a/dashboards/src/test/testDashboard.ts b/dashboards/src/test/testDashboard.ts index 0600069..83e630f 100644 --- a/dashboards/src/test/testDashboard.ts +++ b/dashboards/src/test/testDashboard.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DashboardResource } from '@perses-dev/core'; +import { DashboardResource } from '@perses-dev/core'; // TODO const testDashboard: DashboardResource = { kind: 'Dashboard', diff --git a/dashboards/src/utils/panelUtils.test.ts b/dashboards/src/utils/panelUtils.test.ts index d876061..7b16a72 100644 --- a/dashboards/src/utils/panelUtils.test.ts +++ b/dashboards/src/utils/panelUtils.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { PanelGroupItemLayout } from '@perses-dev/core'; +import { PanelGroupItemLayout } from '@perses-dev/core'; // TODO import { insertPanelInLayout, UnpositionedPanelGroupItemLayout } from './panelUtils'; describe('insertPanelInLayout', () => { diff --git a/dashboards/src/utils/panelUtils.ts b/dashboards/src/utils/panelUtils.ts index bf78e57..f191fb9 100644 --- a/dashboards/src/utils/panelUtils.ts +++ b/dashboards/src/utils/panelUtils.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { PanelGroupDefinition, PanelGroupItemLayout } from '@perses-dev/core'; +import { PanelGroupDefinition, PanelGroupItemLayout } from '@perses-dev/core'; // TODO import { GRID_LAYOUT_SMALL_BREAKPOINT, GRID_LAYOUT_COLS } from '../constants'; // Given a PanelGroup, will find the Y coordinate for adding a new row to the grid, taking into account the items present diff --git a/dashboards/src/views/ViewDashboard/DashboardApp.tsx b/dashboards/src/views/ViewDashboard/DashboardApp.tsx index aa010fa..5609ea5 100644 --- a/dashboards/src/views/ViewDashboard/DashboardApp.tsx +++ b/dashboards/src/views/ViewDashboard/DashboardApp.tsx @@ -14,7 +14,7 @@ import { ReactElement, ReactNode, useState } from 'react'; import { Box } from '@mui/material'; import { ChartsProvider, ErrorAlert, ErrorBoundary, useChartsTheme } from '@perses-dev/components'; -import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; +import { DashboardResource, EphemeralDashboardResource } from '@perses-dev/core'; // TODO only spec should be used import { useDatasourceStore } from '@perses-dev/plugin-system'; import { PanelDrawer, diff --git a/dashboards/src/views/ViewDashboard/ViewDashboard.tsx b/dashboards/src/views/ViewDashboard/ViewDashboard.tsx index 3dbba37..6725cc7 100644 --- a/dashboards/src/views/ViewDashboard/ViewDashboard.tsx +++ b/dashboards/src/views/ViewDashboard/ViewDashboard.tsx @@ -12,7 +12,8 @@ // limitations under the License. import { Box, BoxProps } from '@mui/material'; -import { BuiltinVariableDefinition, DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL } from '@perses-dev/core'; +import { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL } from '@perses-dev/core'; // TODO +import { BuiltinVariableDefinition } from '@perses-dev/spec'; import { ErrorBoundary, ErrorAlert, combineSx } from '@perses-dev/components'; import { TimeRangeProviderWithQueryParams, diff --git a/explore/package.json b/explore/package.json index e82ebec..262228e 100644 --- a/explore/package.json +++ b/explore/package.json @@ -44,7 +44,7 @@ "use-immer": "^0.11.0", "use-query-params": "^2.2.1", "use-resize-observer": "^9.0.0", - "zod": "^3.21.4", + "zod": "^3.25.76", "zustand": "^4.3.3" }, "devDependencies": { diff --git a/explore/src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.tsx b/explore/src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.tsx index f70d008..6d6575d 100644 --- a/explore/src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.tsx +++ b/explore/src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.tsx @@ -12,7 +12,6 @@ // limitations under the License. import { ReactElement, ReactNode } from 'react'; - import { JsonParam, StringParam, useQueryParams, withDefault } from 'use-query-params'; import { ExplorerManagerProvider } from './ExplorerManagerProvider'; diff --git a/explore/src/views/ViewExplore/ViewExplore.tsx b/explore/src/views/ViewExplore/ViewExplore.tsx index 83af1cf..b6f611f 100644 --- a/explore/src/views/ViewExplore/ViewExplore.tsx +++ b/explore/src/views/ViewExplore/ViewExplore.tsx @@ -17,7 +17,7 @@ import { useInitialRefreshInterval, useInitialTimeRange, } from '@perses-dev/plugin-system'; -import { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL } from '@perses-dev/core'; +import { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL } from '@perses-dev/core'; // TODO import { ErrorAlert, ErrorBoundary, combineSx } from '@perses-dev/components'; import { DatasourceStoreProviderProps, diff --git a/go.mod b/go.mod index bb33585..0b75314 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/perses/shared -go 1.25.5 +go 1.25.7 require ( - github.com/perses/perses v0.53.0 + github.com/perses/perses v0.53.1 github.com/sirupsen/logrus v1.9.4 ) diff --git a/go.sum b/go.sum index 138dcd4..9b61ff5 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/perses/common v0.30.2 h1:RAiVxUpX76lTCb4X7pfcXSvYdXQmZwKi4oDKAEO//u0= github.com/perses/common v0.30.2/go.mod h1:DFtur1QPah2/ChXbKKhw7djYdwNgz27s5fPKpiK0Xao= -github.com/perses/perses v0.53.0 h1:gh0m/OE3yTG4jCkseORuT3B1qAL3VlsnBckJSbpFjPs= -github.com/perses/perses v0.53.0/go.mod h1:HsCfkI+EZta2UEDCFa//HUyLRY0Z0fElJkpAWdARbGs= +github.com/perses/perses v0.53.1 h1:9VY/6p9QWrZwPSV7qiwTMSOsgcB37Lb1AXKT0ORXc6I= +github.com/perses/perses v0.53.1/go.mod h1:ro8fsgBkHYOdrL/MV+fdP9mflKzYCy/+gcbxiaReI/A= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= diff --git a/jest.shared.ts b/jest.shared.ts index 6e85ace..e38a130 100644 --- a/jest.shared.ts +++ b/jest.shared.ts @@ -29,7 +29,7 @@ const config: Config.InitialOptions = { '^use-resize-observer$': 'use-resize-observer/polyfilled', // Tell Jest where other Perses packages live since it doesn't know about project references - '^@perses-dev/(?!core)(.*)$': '/../$1/src', + '^@perses-dev/(components|dashboards|explore|plugin-system)(.*)$': '/../$1/src', // Configure Jest to handle stylesheets '\\.(css|less)$': '/../stylesMock.js', diff --git a/package-lock.json b/package-lock.json index 8e1846c..e72145f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,6 +67,7 @@ "@fontsource/lato": "^4.5.10", "@mui/x-date-pickers": "^7.23.1", "@perses-dev/core": "0.53.0", + "@perses-dev/spec": "0.2.0-beta.0", "@tanstack/react-table": "^8.20.5", "@uiw/react-codemirror": "^4.19.1", "date-fns": "^4.1.0", @@ -99,6 +100,7 @@ "@perses-dev/components": "0.53.1", "@perses-dev/core": "0.53.0", "@perses-dev/plugin-system": "0.53.1", + "@perses-dev/spec": "0.2.0-beta.0", "@types/react-grid-layout": "^1.3.2", "date-fns": "^4.1.0", "immer": "^10.1.1", @@ -155,7 +157,7 @@ "use-immer": "^0.11.0", "use-query-params": "^2.2.1", "use-resize-observer": "^9.0.0", - "zod": "^3.21.4", + "zod": "^3.25.76", "zustand": "^4.3.3" }, "devDependencies": { @@ -3995,6 +3997,62 @@ "resolved": "plugin-system", "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==", + "license": "Apache-2.0", + "dependencies": { + "date-fns": "^4.1.0", + "mathjs": "^15.1.1", + "zod": "^3.21.4" + } + }, + "node_modules/@perses-dev/spec/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/spec/node_modules/mathjs": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-15.1.1.tgz", + "integrity": "sha512-rM668DTtpSzMVoh/cKAllyQVEbBApM5g//IMGD8vD7YlrIz9ITRr3SrdhjaDxcBNTdyETWwPebj2unZyHD7ZdA==", + "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/spec/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/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -16915,13 +16973,14 @@ "@module-federation/enhanced": "^0.21.4", "@perses-dev/components": "0.53.1", "@perses-dev/core": "0.53.0", + "@perses-dev/spec": "0.2.0-beta.0", "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", "use-query-params": "^2.2.1", - "zod": "^3.22.2" + "zod": "^3.25.76" }, "peerDependencies": { "@hookform/resolvers": "^3.2.0", diff --git a/plugin-system/package.json b/plugin-system/package.json index d701069..cb24f15 100644 --- a/plugin-system/package.json +++ b/plugin-system/package.json @@ -31,13 +31,14 @@ "@module-federation/enhanced": "^0.21.4", "@perses-dev/components": "0.53.1", "@perses-dev/core": "0.53.0", + "@perses-dev/spec": "0.2.0-beta.0", "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", "use-query-params": "^2.2.1", - "zod": "^3.22.2" + "zod": "^3.25.76" }, "peerDependencies": { "@mui/material": "^6.1.10", diff --git a/plugin-system/src/components/CalculationSelector/CalculationSelector.test.tsx b/plugin-system/src/components/CalculationSelector/CalculationSelector.test.tsx index 36987e5..34cddd2 100644 --- a/plugin-system/src/components/CalculationSelector/CalculationSelector.test.tsx +++ b/plugin-system/src/components/CalculationSelector/CalculationSelector.test.tsx @@ -13,7 +13,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { CalculationType } from '@perses-dev/core'; +import { CalculationType } from '@perses-dev/core'; // TODO to come from the utils lib ? import { CalculationSelector } from './CalculationSelector'; describe('CalculationSelector', () => { diff --git a/plugin-system/src/components/CalculationSelector/CalculationSelector.tsx b/plugin-system/src/components/CalculationSelector/CalculationSelector.tsx index 9eeb69b..cef8bdc 100644 --- a/plugin-system/src/components/CalculationSelector/CalculationSelector.tsx +++ b/plugin-system/src/components/CalculationSelector/CalculationSelector.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components'; -import { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core'; +import { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core'; // TODO weird this is part of the model from the core package ... import { ReactElement } from 'react'; type AutocompleteCalculationOption = CalculationConfig & { id: CalculationType }; diff --git a/plugin-system/src/components/DatasourceEditorForm/DatasourceEditorForm.tsx b/plugin-system/src/components/DatasourceEditorForm/DatasourceEditorForm.tsx index 5ed4125..363e141 100644 --- a/plugin-system/src/components/DatasourceEditorForm/DatasourceEditorForm.tsx +++ b/plugin-system/src/components/DatasourceEditorForm/DatasourceEditorForm.tsx @@ -14,7 +14,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { Box, Divider, FormControlLabel, Grid, Stack, Switch, TextField, Typography } from '@mui/material'; import { DiscardChangesConfirmationDialog, FormActions } from '@perses-dev/components'; -import { Action, DatasourceDefinition } from '@perses-dev/core'; +import { Action, DatasourceDefinition } from '@perses-dev/core'; // TODO import { DispatchWithoutAction, ReactElement, useState } from 'react'; import { Controller, FormProvider, SubmitHandler, useForm } from 'react-hook-form'; import { useValidationSchemas } from '../../context'; diff --git a/plugin-system/src/components/DatasourceSelect/DatasourceSelect.tsx b/plugin-system/src/components/DatasourceSelect/DatasourceSelect.tsx index 6fc6410..1c1881d 100644 --- a/plugin-system/src/components/DatasourceSelect/DatasourceSelect.tsx +++ b/plugin-system/src/components/DatasourceSelect/DatasourceSelect.tsx @@ -23,7 +23,7 @@ import { Autocomplete, TextField, } from '@mui/material'; -import { DatasourceSelector, VariableName } from '@perses-dev/core'; +import { DatasourceSelector, VariableName } from '@perses-dev/spec'; import { ReactElement, useMemo } from 'react'; import { DatasourceSelectItem, diff --git a/plugin-system/src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx b/plugin-system/src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx index ea299b6..e7f2eae 100644 --- a/plugin-system/src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx +++ b/plugin-system/src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { RequestHeaders, HTTPDatasourceSpec } from '@perses-dev/core'; +import { RequestHeaders, HTTPDatasourceSpec } from '@perses-dev/core'; // TODO this is the proxy definition that should go to a different lib import { Grid, IconButton, MenuItem, TextField, Typography } from '@mui/material'; import React, { Fragment, ReactElement, useState } from 'react'; import { produce } from 'immer'; diff --git a/plugin-system/src/components/LegendOptionsEditor/LegendOptionsEditor.tsx b/plugin-system/src/components/LegendOptionsEditor/LegendOptionsEditor.tsx index e05cdcc..b440a97 100644 --- a/plugin-system/src/components/LegendOptionsEditor/LegendOptionsEditor.tsx +++ b/plugin-system/src/components/LegendOptionsEditor/LegendOptionsEditor.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { Switch, SwitchProps, ToggleButtonGroup, ToggleButton } from '@mui/material'; -import { DEFAULT_LEGEND, getLegendMode, getLegendPosition, getLegendSize } from '@perses-dev/core'; +import { DEFAULT_LEGEND, getLegendMode, getLegendPosition, getLegendSize } from '@perses-dev/core'; // TODO should go to components import { ErrorAlert, OptionsEditorControl, OptionsEditorGroup, SettingsAutocomplete } from '@perses-dev/components'; import { ReactElement, useMemo } from 'react'; import { diff --git a/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.test.tsx b/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.test.tsx index 2adcc13..9d37b5a 100644 --- a/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.test.tsx +++ b/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.test.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { screen, cleanup } from '@testing-library/react'; -import { QueryDefinition, QueryPluginType } from '@perses-dev/core'; +import { QueryDefinition, QueryPluginType } from '@perses-dev/spec'; import { renderWithContext } from '../../test'; import { QueryEditorContainer } from './QueryEditorContainer'; diff --git a/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.tsx b/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.tsx index 013d875..1c0a8ce 100644 --- a/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.tsx +++ b/plugin-system/src/components/MultiQueryEditor/QueryEditorContainer.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { produce } from 'immer'; -import { QueryDefinition, QueryPluginType } from '@perses-dev/core'; +import { QueryDefinition, QueryPluginType } from '@perses-dev/spec'; import { Stack, IconButton, Typography, BoxProps, Box, CircularProgress } from '@mui/material'; import DeleteIcon from 'mdi-material-ui/DeleteOutline'; import ChevronDown from 'mdi-material-ui/ChevronDown'; diff --git a/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.test.tsx b/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.test.tsx index f72192f..a9c1f7d 100644 --- a/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.test.tsx +++ b/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.test.tsx @@ -13,7 +13,7 @@ import { screen } from '@testing-library/react'; import { useForm } from 'react-hook-form'; -import { PanelEditorValues } from '@perses-dev/core'; +import { PanelEditorValues } from '@perses-dev/spec'; import { ReactElement } from 'react'; import { renderWithContext } from '../../test'; import { DataQueriesContext } from '../../runtime'; diff --git a/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.tsx b/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.tsx index 5f45616..6129c59 100644 --- a/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.tsx +++ b/plugin-system/src/components/PanelSpecEditor/PanelSpecEditor.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { ErrorAlert, JSONEditor, LinksEditor } from '@perses-dev/components'; -import { PanelDefinition, PanelEditorValues, QueryDefinition, UnknownSpec } from '@perses-dev/core'; +import { PanelDefinition, PanelEditorValues, QueryDefinition, UnknownSpec } from '@perses-dev/spec'; import { Control, Controller } from 'react-hook-form'; import { forwardRef, ReactElement } from 'react'; import { QueryCountProvider, useDataQueriesContext, usePlugin } from '../../runtime'; diff --git a/plugin-system/src/components/PluginEditor/PluginEditor.tsx b/plugin-system/src/components/PluginEditor/PluginEditor.tsx index 2d8eed4..b585e63 100644 --- a/plugin-system/src/components/PluginEditor/PluginEditor.tsx +++ b/plugin-system/src/components/PluginEditor/PluginEditor.tsx @@ -15,7 +15,7 @@ import { Box, Button } from '@mui/material'; import Reload from 'mdi-material-ui/Reload'; import { ErrorAlert, ErrorBoundary } from '@perses-dev/components'; import { ReactElement, useCallback } from 'react'; -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { PluginKindSelect } from '../PluginKindSelect'; import { PluginSpecEditor } from '../PluginSpecEditor'; import { PluginEditorProps, usePluginEditor } from './plugin-editor-api'; diff --git a/plugin-system/src/components/PluginEditor/plugin-editor-api.ts b/plugin-system/src/components/PluginEditor/plugin-editor-api.ts index 8951b52..83fe357 100644 --- a/plugin-system/src/components/PluginEditor/plugin-editor-api.ts +++ b/plugin-system/src/components/PluginEditor/plugin-editor-api.ts @@ -12,7 +12,7 @@ // limitations under the License. import { BoxProps } from '@mui/material'; -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { useState, useRef, useEffect } from 'react'; import { produce } from 'immer'; import { PanelPlugin, PluginType } from '../../model'; diff --git a/plugin-system/src/components/PluginRegistry/PluginRegistry.tsx b/plugin-system/src/components/PluginRegistry/PluginRegistry.tsx index 9b91bdb..8b7b773 100644 --- a/plugin-system/src/components/PluginRegistry/PluginRegistry.tsx +++ b/plugin-system/src/components/PluginRegistry/PluginRegistry.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { useRef, useCallback, useMemo, ReactNode, ReactElement } from 'react'; import { PluginModuleResource, diff --git a/plugin-system/src/components/PluginSpecEditor/PluginSpecEditor.tsx b/plugin-system/src/components/PluginSpecEditor/PluginSpecEditor.tsx index 9542694..01501b2 100644 --- a/plugin-system/src/components/PluginSpecEditor/PluginSpecEditor.tsx +++ b/plugin-system/src/components/PluginSpecEditor/PluginSpecEditor.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { ErrorAlert } from '@perses-dev/components'; -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { ReactElement } from 'react'; import { CircularProgress, Stack } from '@mui/material'; import { OptionsEditorProps } from '../../model'; diff --git a/plugin-system/src/components/TimeRangeControls/TimeRangeControls.test.tsx b/plugin-system/src/components/TimeRangeControls/TimeRangeControls.test.tsx index 281efa1..c9aaa98 100644 --- a/plugin-system/src/components/TimeRangeControls/TimeRangeControls.test.tsx +++ b/plugin-system/src/components/TimeRangeControls/TimeRangeControls.test.tsx @@ -13,7 +13,7 @@ import userEvent from '@testing-library/user-event'; import { screen, RenderOptions, render, RenderResult } from '@testing-library/react'; -import { DurationString } from '@perses-dev/core'; +import { DurationString } from '@perses-dev/spec'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React, { ReactElement } from 'react'; import { SnackbarProvider } from '@perses-dev/components'; diff --git a/plugin-system/src/components/TimeRangeControls/TimeRangeControls.tsx b/plugin-system/src/components/TimeRangeControls/TimeRangeControls.tsx index 6f615b3..73fb782 100644 --- a/plugin-system/src/components/TimeRangeControls/TimeRangeControls.tsx +++ b/plugin-system/src/components/TimeRangeControls/TimeRangeControls.tsx @@ -27,7 +27,7 @@ import { getTimeZoneOptions, buildRelativeTimeOption, } from '@perses-dev/components'; -import { AbsoluteTimeRange, DurationString, parseDurationString, RelativeTimeRange } from '@perses-dev/core'; +import { AbsoluteTimeRange, DurationString, parseDurationString, RelativeTimeRange } from '@perses-dev/spec'; import { ReactElement, useCallback } from 'react'; import { TOOLTIP_TEXT } from '../../constants'; import { diff --git a/plugin-system/src/components/Variables/VariableEditorForm/VariableEditorForm.tsx b/plugin-system/src/components/Variables/VariableEditorForm/VariableEditorForm.tsx index ae7d53e..187878c 100644 --- a/plugin-system/src/components/Variables/VariableEditorForm/VariableEditorForm.tsx +++ b/plugin-system/src/components/Variables/VariableEditorForm/VariableEditorForm.tsx @@ -13,7 +13,8 @@ import { DispatchWithoutAction, ReactElement, useCallback, useState } from 'react'; import { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Stack, Divider } from '@mui/material'; -import { VariableDefinition, ListVariableDefinition, Action } from '@perses-dev/core'; +import { VariableDefinition, ListVariableDefinition } from '@perses-dev/spec'; +import { Action } from '@perses-dev/core'; import { DiscardChangesConfirmationDialog, ErrorAlert, ErrorBoundary, FormActions } from '@perses-dev/components'; import { Control, Controller, FormProvider, SubmitHandler, useForm, useFormContext, useWatch } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; diff --git a/plugin-system/src/components/Variables/VariableEditorForm/VariablePreview.tsx b/plugin-system/src/components/Variables/VariableEditorForm/VariablePreview.tsx index 90244f8..89a3c5f 100644 --- a/plugin-system/src/components/Variables/VariableEditorForm/VariablePreview.tsx +++ b/plugin-system/src/components/Variables/VariableEditorForm/VariablePreview.tsx @@ -15,7 +15,7 @@ import React, { ReactElement, useMemo, useState } from 'react'; import { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from '@mui/material'; import { InfoTooltip, useSnackbar } from '@perses-dev/components'; import Clipboard from 'mdi-material-ui/ClipboardOutline'; -import { ListVariableDefinition } from '@perses-dev/core'; +import { ListVariableDefinition } from '@perses-dev/spec'; import { TOOLTIP_TEXT } from '../../../constants'; import { useListVariablePluginValues } from '../variable-model'; import { SORT_METHODS } from './variable-editor-form-model'; diff --git a/plugin-system/src/components/Variables/VariableEditorForm/variable-editor-form-model.ts b/plugin-system/src/components/Variables/VariableEditorForm/variable-editor-form-model.ts index 52211b0..0432b3b 100644 --- a/plugin-system/src/components/Variables/VariableEditorForm/variable-editor-form-model.ts +++ b/plugin-system/src/components/Variables/VariableEditorForm/variable-editor-form-model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ListVariableSpec, TextVariableDefinition, TextVariableSpec, VariableDefinition } from '@perses-dev/core'; +import { ListVariableSpec, TextVariableDefinition, TextVariableSpec, VariableDefinition } from '@perses-dev/spec'; import { VariableOption } from '../../../model'; export type SortMethodName = diff --git a/plugin-system/src/components/Variables/variable-model.test.ts b/plugin-system/src/components/Variables/variable-model.test.ts index af858da..3da9f51 100644 --- a/plugin-system/src/components/Variables/variable-model.test.ts +++ b/plugin-system/src/components/Variables/variable-model.test.ts @@ -12,7 +12,7 @@ // limitations under the License. import { useAllVariableValues, usePlugin, VariableOption, VariableStateMap } from '@perses-dev/plugin-system'; -import { ListVariableDefinition } from '@perses-dev/core'; +import { ListVariableDefinition } from '@perses-dev/spec'; import { renderHookWithContext } from '../../test/render-hook'; import { filterVariableList, useListVariablePluginValues } from './variable-model'; diff --git a/plugin-system/src/components/Variables/variable-model.ts b/plugin-system/src/components/Variables/variable-model.ts index bfeb238..c9c57d2 100644 --- a/plugin-system/src/components/Variables/variable-model.ts +++ b/plugin-system/src/components/Variables/variable-model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ListVariableDefinition } from '@perses-dev/core'; +import { ListVariableDefinition } from '@perses-dev/spec'; import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { VariableOption } from '../../model'; import { useDatasourceStore, usePlugin, useTimeRange, useAllVariableValues, VariableStateMap } from '../../runtime'; diff --git a/plugin-system/src/context/ValidationProvider.tsx b/plugin-system/src/context/ValidationProvider.tsx index 7c44ec1..f502134 100644 --- a/plugin-system/src/context/ValidationProvider.tsx +++ b/plugin-system/src/context/ValidationProvider.tsx @@ -13,17 +13,15 @@ import { createContext, ReactElement, ReactNode, useContext, useState } from 'react'; import { - DatasourceDefinition, PanelEditorValues, VariableDefinition, PluginSchema, - datasourceDefinitionSchema, panelEditorSchema as defaultPanelEditorSchema, variableDefinitionSchema, - buildDatasourceDefinitionSchema, buildPanelEditorSchema, buildVariableDefinitionSchema, -} from '@perses-dev/core'; +} from '@perses-dev/spec'; +import { DatasourceDefinition, datasourceDefinitionSchema, buildDatasourceDefinitionSchema } from '@perses-dev/core'; // Todo these things should not be part of the plugin system. Only the spec should be used import { z } from 'zod'; export interface ValidationSchemas { @@ -55,7 +53,7 @@ interface ValidationProviderProps { export function ValidationProvider({ children }: ValidationProviderProps): ReactElement { const [datasourceEditorSchema, setDatasourceEditorSchema] = useState>(datasourceDefinitionSchema); - const [panelEditorSchema, setPanelEditorSchema] = useState>(defaultPanelEditorSchema); + const [panelEditorSchema, setPanelEditorSchema] = useState>(defaultPanelEditorSchema); // TODO I don't get why this does not compile const [variableEditorSchema, setVariableEditorSchema] = useState>(variableDefinitionSchema); diff --git a/plugin-system/src/model/datasource.ts b/plugin-system/src/model/datasource.ts index 2333928..4e60102 100644 --- a/plugin-system/src/model/datasource.ts +++ b/plugin-system/src/model/datasource.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/core'; +import { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/spec'; import { Plugin } from './plugin-base'; /** diff --git a/plugin-system/src/model/explore.ts b/plugin-system/src/model/explore.ts index 573809e..669656f 100644 --- a/plugin-system/src/model/explore.ts +++ b/plugin-system/src/model/explore.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { Plugin } from './plugin-base'; export interface ExploreComponentProps { diff --git a/plugin-system/src/model/legend.test.ts b/plugin-system/src/model/legend.test.ts index e1104a9..7ffee67 100644 --- a/plugin-system/src/model/legend.test.ts +++ b/plugin-system/src/model/legend.test.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LegendOptionsBase } from '@perses-dev/core'; +import { LegendOptionsBase } from '@perses-dev/core'; // TODO import { validateLegendSpec } from './legend'; describe('validateLegendSpec', () => { diff --git a/plugin-system/src/model/legend.ts b/plugin-system/src/model/legend.ts index 12045d8..8445166 100644 --- a/plugin-system/src/model/legend.ts +++ b/plugin-system/src/model/legend.ts @@ -21,7 +21,7 @@ import { isValidLegendPosition, LegendSize, isValidLegendSize, -} from '@perses-dev/core'; +} from '@perses-dev/core'; // TODO, maybe this should come from the future utils package // This file contains legend-related model code specific to panel plugin specs. // See the `core` package for common/shared legend model code and the diff --git a/plugin-system/src/model/log-queries.ts b/plugin-system/src/model/log-queries.ts index 0506f2a..1d6b30f 100644 --- a/plugin-system/src/model/log-queries.ts +++ b/plugin-system/src/model/log-queries.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AbsoluteTimeRange, UnknownSpec, LogData } from '@perses-dev/core'; +import { AbsoluteTimeRange, UnknownSpec, LogData } from '@perses-dev/spec'; import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system'; export interface LogQueryResult { diff --git a/plugin-system/src/model/panels.ts b/plugin-system/src/model/panels.ts index ac58407..b28eb8e 100644 --- a/plugin-system/src/model/panels.ts +++ b/plugin-system/src/model/panels.ts @@ -12,7 +12,7 @@ // limitations under the License. import React from 'react'; -import { UnknownSpec, PanelDefinition, QueryPluginType, QueryDataType, QueryDefinition } from '@perses-dev/core'; +import { UnknownSpec, PanelDefinition, QueryPluginType, QueryDataType, QueryDefinition } from '@perses-dev/spec'; import { OptionsEditorTab } from '../components'; import { QueryOptions } from '../runtime'; import { OptionsEditorProps, Plugin } from './plugin-base'; diff --git a/plugin-system/src/model/plugin-base.ts b/plugin-system/src/model/plugin-base.ts index 1ff3567..f59f4bf 100644 --- a/plugin-system/src/model/plugin-base.ts +++ b/plugin-system/src/model/plugin-base.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { QueryDefinition } from '@perses-dev/core'; +import { QueryDefinition } from '@perses-dev/spec'; import React from 'react'; /** diff --git a/plugin-system/src/model/plugins.ts b/plugin-system/src/model/plugins.ts index 00e3bc0..4c5a76c 100644 --- a/plugin-system/src/model/plugins.ts +++ b/plugin-system/src/model/plugins.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { DatasourcePlugin } from './datasource'; import { PanelPlugin } from './panels'; import { Plugin } from './plugin-base'; diff --git a/plugin-system/src/model/profile-queries.ts b/plugin-system/src/model/profile-queries.ts index 8777365..f42a9be 100644 --- a/plugin-system/src/model/profile-queries.ts +++ b/plugin-system/src/model/profile-queries.ts @@ -12,7 +12,7 @@ // limitations under the License. import { Query, QueryKey } from '@tanstack/react-query'; -import { UnknownSpec, ProfileData, AbsoluteTimeRange } from '@perses-dev/core'; +import { UnknownSpec, ProfileData, AbsoluteTimeRange } from '@perses-dev/spec'; import { DatasourceStore } from '../runtime'; import { Plugin } from './plugin-base'; diff --git a/plugin-system/src/model/time-series-queries.ts b/plugin-system/src/model/time-series-queries.ts index 1cfb0c4..d711417 100644 --- a/plugin-system/src/model/time-series-queries.ts +++ b/plugin-system/src/model/time-series-queries.ts @@ -12,7 +12,7 @@ // limitations under the License. import { Query, QueryKey } from '@tanstack/react-query'; -import { AbsoluteTimeRange, UnknownSpec, TimeSeriesData } from '@perses-dev/core'; +import { AbsoluteTimeRange, UnknownSpec, TimeSeriesData } from '@perses-dev/spec'; import { DatasourceStore, VariableStateMap } from '../runtime'; import { Plugin } from './plugin-base'; diff --git a/plugin-system/src/model/trace-queries.ts b/plugin-system/src/model/trace-queries.ts index ce80ff3..6ec3ffb 100644 --- a/plugin-system/src/model/trace-queries.ts +++ b/plugin-system/src/model/trace-queries.ts @@ -12,7 +12,7 @@ // limitations under the License. import { Query, QueryKey } from '@tanstack/react-query'; -import { UnknownSpec, TraceData, AbsoluteTimeRange } from '@perses-dev/core'; +import { UnknownSpec, TraceData, AbsoluteTimeRange } from '@perses-dev/spec'; import { DatasourceStore, VariableStateMap } from '../runtime'; import { Plugin } from './plugin-base'; diff --git a/plugin-system/src/model/variables.ts b/plugin-system/src/model/variables.ts index b6064c6..377a8f8 100644 --- a/plugin-system/src/model/variables.ts +++ b/plugin-system/src/model/variables.ts @@ -12,7 +12,7 @@ // limitations under the License. import type { VariableOption } from '@perses-dev/components'; -import { AbsoluteTimeRange, UnknownSpec } from '@perses-dev/core'; +import { AbsoluteTimeRange, UnknownSpec } from '@perses-dev/spec'; import { DatasourceStore, VariableStateMap } from '../runtime'; import { Plugin } from './plugin-base'; diff --git a/plugin-system/src/remote/PluginRuntime.tsx b/plugin-system/src/remote/PluginRuntime.tsx index b471ae0..cc08279 100644 --- a/plugin-system/src/remote/PluginRuntime.tsx +++ b/plugin-system/src/remote/PluginRuntime.tsx @@ -90,6 +90,7 @@ const getPluginRuntime = (): ModuleFederation => { requiredVersion: '^5.5.0', }, }, + // TODO should we add @perses-dev/spec here ? '@perses-dev/core': { version: '0.53.0-beta.3', lib: () => require('@perses-dev/core'), diff --git a/plugin-system/src/runtime/DataQueriesProvider/DataQueriesProvider.tsx b/plugin-system/src/runtime/DataQueriesProvider/DataQueriesProvider.tsx index 97a5ed2..193166f 100644 --- a/plugin-system/src/runtime/DataQueriesProvider/DataQueriesProvider.tsx +++ b/plugin-system/src/runtime/DataQueriesProvider/DataQueriesProvider.tsx @@ -12,7 +12,7 @@ // limitations under the License. import { createContext, ReactElement, useCallback, useContext, useMemo } from 'react'; -import { QueryType, TimeSeriesQueryDefinition } from '@perses-dev/core'; +import { QueryType, TimeSeriesQueryDefinition } from '@perses-dev/spec'; import { useTimeSeriesQueries } from '../time-series-queries'; import { useTraceQueries, TraceQueryDefinition } from '../trace-queries'; import { useProfileQueries, ProfileQueryDefinition } from '../profile-queries'; diff --git a/plugin-system/src/runtime/DataQueriesProvider/model.ts b/plugin-system/src/runtime/DataQueriesProvider/model.ts index 8e94759..c7eb437 100644 --- a/plugin-system/src/runtime/DataQueriesProvider/model.ts +++ b/plugin-system/src/runtime/DataQueriesProvider/model.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Definition, QueryDefinition, UnknownSpec, QueryDataType } from '@perses-dev/core'; +import { Definition, QueryDefinition, UnknownSpec, QueryDataType } from '@perses-dev/spec'; import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; import { ReactNode, useCallback, useMemo } from 'react'; import { useListPluginMetadata } from '../plugin-registry'; diff --git a/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProvider.tsx b/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProvider.tsx index 8c493b8..bd6f30e 100644 --- a/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProvider.tsx +++ b/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProvider.tsx @@ -19,7 +19,7 @@ import { isRelativeTimeRange, toAbsoluteTimeRange, getSuggestedStepMs, -} from '@perses-dev/core'; +} from '@perses-dev/spec'; import { useQueryClient } from '@tanstack/react-query'; import { getRefreshIntervalInMs } from './refresh-interval'; diff --git a/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProviders.tsx b/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProviders.tsx index 8cdfb07..4faf671 100644 --- a/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProviders.tsx +++ b/plugin-system/src/runtime/TimeRangeProvider/TimeRangeProviders.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DurationString, TimeRangeValue } from '@perses-dev/core'; +import { DurationString, TimeRangeValue } from '@perses-dev/spec'; import React, { ReactElement } from 'react'; import { TimeZoneProvider } from '@perses-dev/components'; import { TimeRangeProvider } from './TimeRangeProvider'; diff --git a/plugin-system/src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx b/plugin-system/src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx index d695e45..ff2c0ec 100644 --- a/plugin-system/src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx +++ b/plugin-system/src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx @@ -13,7 +13,7 @@ import { createContext, ReactElement, ReactNode, useContext, useMemo } from 'react'; import { buildRelativeTimeOption, TimeOption } from '@perses-dev/components'; -import { DurationString } from '@perses-dev/core'; +import { DurationString } from '@perses-dev/spec'; const DEFAULT_OPTIONS: DurationString[] = ['5m', '15m', '30m', '1h', '6h', '12h', '24h', '7d', '14d']; const defaultTimeRangeSettings: TimeRangeSettings = { diff --git a/plugin-system/src/runtime/TimeRangeProvider/query-params.ts b/plugin-system/src/runtime/TimeRangeProvider/query-params.ts index 78d64ab..e9649da 100644 --- a/plugin-system/src/runtime/TimeRangeProvider/query-params.ts +++ b/plugin-system/src/runtime/TimeRangeProvider/query-params.ts @@ -20,7 +20,7 @@ import { isDurationString, DurationString, AbsoluteTimeRange, -} from '@perses-dev/core'; +} from '@perses-dev/spec'; import { TimeRange } from './TimeRangeProvider'; export type TimeOptionValue = Date | DurationString | null | undefined; diff --git a/plugin-system/src/runtime/TimeRangeProvider/refresh-interval.ts b/plugin-system/src/runtime/TimeRangeProvider/refresh-interval.ts index ea42084..4ef0f9f 100644 --- a/plugin-system/src/runtime/TimeRangeProvider/refresh-interval.ts +++ b/plugin-system/src/runtime/TimeRangeProvider/refresh-interval.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DurationString, parseDurationString } from '@perses-dev/core'; +import { DurationString, parseDurationString } from '@perses-dev/spec'; import { milliseconds } from 'date-fns'; /** diff --git a/plugin-system/src/runtime/UsageMetricsProvider.tsx b/plugin-system/src/runtime/UsageMetricsProvider.tsx index cce28ed..309dafd 100644 --- a/plugin-system/src/runtime/UsageMetricsProvider.tsx +++ b/plugin-system/src/runtime/UsageMetricsProvider.tsx @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { fetch, QueryDefinition } from '@perses-dev/core'; +import { fetch } from '@perses-dev/core'; // TODO +import { QueryDefinition } from '@perses-dev/spec'; import { createContext, ReactElement, ReactNode, useContext } from 'react'; type QueryState = 'pending' | 'success' | 'error'; diff --git a/plugin-system/src/runtime/builtin-variables.ts b/plugin-system/src/runtime/builtin-variables.ts index 1dcf0f0..2889c20 100644 --- a/plugin-system/src/runtime/builtin-variables.ts +++ b/plugin-system/src/runtime/builtin-variables.ts @@ -12,7 +12,7 @@ // limitations under the License. import { createContext, useContext, useMemo } from 'react'; -import { BuiltinVariableDefinition } from '@perses-dev/core'; +import { BuiltinVariableDefinition } from '@perses-dev/spec'; import { VariableStateMap } from './variables'; export type BuiltinVariableSrv = { diff --git a/plugin-system/src/runtime/datasources.ts b/plugin-system/src/runtime/datasources.ts index 40822fa..efb174f 100644 --- a/plugin-system/src/runtime/datasources.ts +++ b/plugin-system/src/runtime/datasources.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DatasourceSelector, DatasourceSpec } from '@perses-dev/core'; +import { DatasourceSelector, DatasourceSpec } from '@perses-dev/spec'; import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { createContext, useContext } from 'react'; diff --git a/plugin-system/src/runtime/item-actions.ts b/plugin-system/src/runtime/item-actions.ts index d546d08..28ad745 100644 --- a/plugin-system/src/runtime/item-actions.ts +++ b/plugin-system/src/runtime/item-actions.ts @@ -18,7 +18,7 @@ import { SelectionItem, VariableStateMap, } from '@perses-dev/components'; -import { fetch } from '@perses-dev/core'; +import { fetch } from '@perses-dev/core'; // TODO should be part of an utils package import { ItemAction, EventAction, WebhookAction } from '../components/ItemSelectionActionsOptionsEditor'; const BODY_METHODS = new Set(['POST', 'PUT', 'PATCH']); diff --git a/plugin-system/src/runtime/log-queries.ts b/plugin-system/src/runtime/log-queries.ts index 711b08f..f3b208c 100644 --- a/plugin-system/src/runtime/log-queries.ts +++ b/plugin-system/src/runtime/log-queries.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { QueryDefinition, UnknownSpec } from '@perses-dev/core'; +import { QueryDefinition, UnknownSpec } from '@perses-dev/spec'; import { useQueries, UseQueryResult } from '@tanstack/react-query'; import { LogQueryResult } from '../model/log-queries'; import { useDatasourceStore } from './datasources'; diff --git a/plugin-system/src/runtime/plugin-registry.ts b/plugin-system/src/runtime/plugin-registry.ts index 42edda5..f8d4882 100644 --- a/plugin-system/src/runtime/plugin-registry.ts +++ b/plugin-system/src/runtime/plugin-registry.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { BuiltinVariableDefinition } from '@perses-dev/core'; +import { BuiltinVariableDefinition } from '@perses-dev/spec'; import { useQueries, useQuery, UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import { createContext, useContext } from 'react'; import { DefaultPluginKinds, PluginImplementation, PluginMetadataWithModule, PluginType } from '../model'; diff --git a/plugin-system/src/runtime/profile-queries.ts b/plugin-system/src/runtime/profile-queries.ts index f677195..f94e3c7 100644 --- a/plugin-system/src/runtime/profile-queries.ts +++ b/plugin-system/src/runtime/profile-queries.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { QueryDefinition, UnknownSpec, ProfileData } from '@perses-dev/core'; +import { QueryDefinition, UnknownSpec, ProfileData } from '@perses-dev/spec'; import { useQueries, UseQueryResult } from '@tanstack/react-query'; import { useDatasourceStore } from './datasources'; import { usePluginRegistry } from './plugin-registry'; diff --git a/plugin-system/src/runtime/time-series-queries.ts b/plugin-system/src/runtime/time-series-queries.ts index 3c24068..2c7b54e 100644 --- a/plugin-system/src/runtime/time-series-queries.ts +++ b/plugin-system/src/runtime/time-series-queries.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TimeSeriesData, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core'; +import { TimeSeriesData, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/spec'; import { Query, QueryCache, diff --git a/plugin-system/src/runtime/trace-queries.ts b/plugin-system/src/runtime/trace-queries.ts index f0d9ddb..2835fd9 100644 --- a/plugin-system/src/runtime/trace-queries.ts +++ b/plugin-system/src/runtime/trace-queries.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { QueryDefinition, UnknownSpec, TraceData } from '@perses-dev/core'; +import { QueryDefinition, UnknownSpec, TraceData } from '@perses-dev/spec'; import { QueryKey, useQueries, UseQueryResult } from '@tanstack/react-query'; import { TraceQueryContext, TraceQueryPlugin } from '../model'; import { useDatasourceStore } from './datasources'; diff --git a/plugin-system/src/test-utils/mock-plugin-registry.tsx b/plugin-system/src/test-utils/mock-plugin-registry.tsx index dbc9a4e..6a213df 100644 --- a/plugin-system/src/test-utils/mock-plugin-registry.tsx +++ b/plugin-system/src/test-utils/mock-plugin-registry.tsx @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { UnknownSpec } from '@perses-dev/core'; +import { UnknownSpec } from '@perses-dev/spec'; import { PluginRegistryProps } from '../components'; import { PluginModuleResource, Plugin, PluginLoader, PluginImplementation, PluginType } from '../model'; diff --git a/plugin-system/src/test/mock-data.ts b/plugin-system/src/test/mock-data.ts index 42a408d..4da61eb 100644 --- a/plugin-system/src/test/mock-data.ts +++ b/plugin-system/src/test/mock-data.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { LogData, ProfileData, TimeSeriesData, TraceData } from '@perses-dev/core'; +import { LogData, ProfileData, TimeSeriesData, TraceData } from '@perses-dev/spec'; export const MOCK_TIME_SERIES_DATA: TimeSeriesData = { timeRange: { diff --git a/plugin-system/src/test/utils.tsx b/plugin-system/src/test/utils.tsx index 74f2de5..65c3bb5 100644 --- a/plugin-system/src/test/utils.tsx +++ b/plugin-system/src/test/utils.tsx @@ -13,7 +13,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactNode } from 'react'; -import { DEFAULT_DASHBOARD_DURATION } from '@perses-dev/core'; +import { DEFAULT_DASHBOARD_DURATION } from '@perses-dev/core'; // TODO what should we do with this value ? import { PluginRegistry } from '../components'; import { DefaultPluginKinds } from '../model'; import { TimeRangeProviderBasic } from '../runtime'; diff --git a/plugin-system/src/utils/action.ts b/plugin-system/src/utils/action.ts index 553144e..a945db5 100644 --- a/plugin-system/src/utils/action.ts +++ b/plugin-system/src/utils/action.ts @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Action } from '@perses-dev/core'; +import { Action } from '@perses-dev/core'; // TODO this is weird the plugin-system is providing component depending on the RBAC system of Perses. export function getTitleAction(action: Action, isDraft: boolean): string { if (action === 'read') return 'View';