Skip to content

Commit

Permalink
Tidy package and type issues (finos#914)
Browse files Browse the repository at this point in the history
* fix package references, type issues

* add typescript config for correct auto import resolution
  • Loading branch information
heswell authored Oct 18, 2023
1 parent 4131a4b commit f68ef1c
Show file tree
Hide file tree
Showing 77 changed files with 286 additions and 264 deletions.
3 changes: 3 additions & 0 deletions vuu-ui/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "@thomaschaplin/isin-generator" {
export const isinGenerator = () => undefined;
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-codemirror/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-data-ag-grid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-data-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-data-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-data/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-datagrid-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
4 changes: 2 additions & 2 deletions vuu-ui/packages/vuu-datagrid/src/ColumnBearer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import "./column-bearer.css";
import { GridModelType } from "./grid-model";
import { ColumnDragState, dragPhase } from "./gridTypes";
import { buildColumnMap } from "@finos/vuu-utils";
import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types";
import { DataSourceRow } from "packages/vuu-data-types";
import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types";
import { DataSourceRow } from "@finos/vuu-data-types";

const LEFT = "left";
const RIGHT = "right";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from "react";
import { isTypeDescriptor } from "@finos/vuu-utils";
import { GridCellProps } from "../grid-cells";
import "./progress-cell.css";
import { ColumnTypeRenderer } from "packages/vuu-datagrid-types";
import { ColumnTypeRenderer } from "@finos/vuu-datagrid-types";

const ProgressCell = React.memo(function ProgressCell({
column,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ContextMenuGroupItemDescriptor,
ContextMenuItemDescriptor,
MenuBuilder,
} from "packages/vuu-data-types";
} from "@finos/vuu-data-types";
import {
VuuAggregation,
VuuGroupBy,
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-datagrid/src/grid-cells/HeaderCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { SortIndicator, sortStatus } from "./sort-indicator";
import { useCellResize } from "./useCellResize";

import "./HeaderCell.css";
import { DataSourceFilter } from "packages/vuu-data-types";
import { DataSourceFilter } from "@finos/vuu-data-types";

const classBase = "hwHeaderCell";
const NO_AGGREGATION = { aggType: -1 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cx from "classnames";
import { HTMLAttributes, useCallback, useMemo } from "react";

import "./filter-indicator.css";
import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types";
import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types";

export const Direction = {
ASC: "asc",
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-datagrid/src/grid-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
GridAction,
KeyedColumnDescriptor,
} from "@finos/vuu-datagrid-types";
import { DataSourceFilter } from "packages/vuu-data-types";
import { DataSourceFilter } from "@finos/vuu-data-types";

export interface GridActionGroup {
type: "group";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
toColumnDescriptor,
WindowRange,
} from "@finos/vuu-utils";
import { DataSourceRow } from "packages/vuu-data-types";
import { DataSourceRow } from "@finos/vuu-data-types";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useGridContext } from "../grid-context";
import { GridModelType } from "../grid-model/gridModelTypes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
DataSourceAction,
GridAction,
ScrollAction,
} from "packages/vuu-datagrid-types";
} from "@finos/vuu-datagrid-types";
import { useCallback } from "react";
import { GridActionSelection, GridModelDispatch } from "../grid-context";

Expand Down
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-datagrid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 3 additions & 3 deletions vuu-ui/packages/vuu-datatable/src/json-table/JsonTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { TableConfig } from "@finos/vuu-datagrid-types";

export interface JsonTableProps
extends Omit<TableProps, "config" | "dataSource"> {
config: Pick<
config?: Pick<
TableConfig,
"columns" | "columnSeparators" | "rowSeparators" | "zebraStripes"
"columnSeparators" | "rowSeparators" | "zebraStripes"
>;
source: JsonData | undefined;
}
Expand All @@ -20,7 +20,7 @@ export const JsonTable = ({
...tableProps
}: JsonTableProps) => {
const [dataSource, tableConfig] = useMemo<
[JsonDataSource, JsonTableProps["config"]]
[JsonDataSource, TableConfig]
>(() => {
const ds = new JsonDataSource({
data: source,
Expand Down
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-datatable/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-filter-parser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-filter-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-filters/src/filter-bar/useFilters.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useControlled } from "@finos/vuu-ui-controls";
import { Filter } from "packages/vuu-filter-types";
import { Filter } from "@finos/vuu-filter-types";
import { useCallback } from "react";

export interface FiltersHookProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ContextMenuProps } from "@finos/vuu-popups";
import { MenuActionHandler } from "packages/vuu-data-types";
import { MenuActionHandler } from "@finos/vuu-data-types";
import { ReactElement, useCallback, useRef } from "react";
import { PopupComponent as Popup, Portal } from "@finos/vuu-popups";
import { List, ListItem } from "@finos/vuu-ui-controls";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
useRef,
useState,
} from "react";
import { SingleSelectionHandler } from "packages/vuu-ui-controls/src";
import { SingleSelectionHandler } from "@finos/vuu-ui-controls/src";

const cursorAtTextStart = (input: HTMLInputElement) =>
input.selectionStart === 0;
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-filters/src/filter-pill/FilterPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Filter } from "@finos/vuu-filter-types";
import { EditableLabel, EditableLabelProps } from "@finos/vuu-ui-controls";
import { filterAsQuery, isMultiClauseFilter } from "@finos/vuu-utils";
import cx from "classnames";
import { PopupCloseCallback } from "packages/vuu-popups/src";
import { PopupCloseCallback } from "@finos/vuu-popups/src";
import { HTMLAttributes, useCallback, useRef } from "react";
import { FilterPillMenu } from "../filter-pill-menu";
import { filterClauses } from "../filter-utils";
Expand Down
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-filters/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-layout/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-popups/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-protocol-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-shell/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColumnDescriptor } from "packages/vuu-datagrid-types";
import { ColumnDescriptor } from "@finos/vuu-datagrid-types";
import {
getCalculatedColumnDetails,
setCalculatedColumnExpression,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormField, FormFieldLabel, Input } from "@salt-ds/core";
import { Switch } from "@salt-ds/lab";
import { ColumnDescriptor, TypeFormatting } from "packages/vuu-datagrid-types";
import { ColumnDescriptor, TypeFormatting } from "@finos/vuu-datagrid-types";
import { getTypeSettingsFromColumn } from "@finos/vuu-utils";
import {
ChangeEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { Checkbox } from "@salt-ds/core";
import { Switch } from "@salt-ds/lab";
import cx from "classnames";
import { ColumnDescriptor } from "packages/vuu-datagrid-types";
import { ColumnDescriptor } from "@finos/vuu-datagrid-types";
import { HTMLAttributes, SyntheticEvent, useCallback } from "react";
import { ColumnItem } from "../table-settings";

Expand Down
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-table-extras/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from "classnames";
import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types";
import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types";
import { HTMLAttributes, MouseEvent, useCallback } from "react";

import "./ColumnHeaderPill.css";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types";
import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types";
import { ColumnHeaderPill, ColumnHeaderPillProps } from "./ColumnHeaderPill";

import "./GroupColumnPill.css";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TableCellProps } from "@finos/vuu-datagrid-types";
import { metadataKeys } from "@finos/vuu-utils";
import { VuuColumnDataType } from "packages/vuu-protocol-types";
import { VuuColumnDataType } from "@finos/vuu-protocol-types";
import { MouseEventHandler, useCallback } from "react";
import { useCell } from "../useCell";

Expand Down
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-table/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { orientationType } from "@finos/vuu-utils";
import { useCallback, useMemo, useRef } from "react";
import { Direction } from "./dragDropTypesNext";
import { createDragSpacer as createDragDisplacer } from "./Draggable";
import {
MeasuredDropTarget,
mutateDropTargetsSwitchDropTargetPosition,
} from "./drop-target-utils";
import { createDragSpacer as createDragDisplacer } from "./Draggable";
import { Direction } from "./dragDropTypesNext";
import { orientationType } from "packages/vuu-utils/src";

export type DragDisplacersHookResult = {
displaceItem: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PopupComponentProps, PopupPlacement } from "packages/vuu-popups/src";
import type { PopupComponentProps, PopupPlacement } from "@finos/vuu-popups";
import {
HTMLAttributes,
KeyboardEvent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//TODO stansardise this

import { DataSource, SubscribeCallback } from "@finos/vuu-data";
import { DataSourceRow } from "packages/vuu-data-types";
import { DataSourceRow } from "@finos/vuu-data-types";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { MovingWindow } from "./moving-window";
export interface DataSourceHookProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//TODO stansardise this

import { DataSource, SubscribeCallback } from "@finos/vuu-data";
import { DataSourceRow } from "packages/vuu-data-types";
import { DataSourceRow } from "@finos/vuu-data-types";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { MovingWindow } from "./moving-window";
export interface DataSourceHookProps {
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO close button needs to be a button. Hence tab needs to include 2 buttons
import { useForkRef } from "@salt-ds/core";
import cx from "classnames";
import { MenuActionHandler } from "packages/vuu-data-types";
import { MenuActionHandler } from "@finos/vuu-data-types";
import {
FocusEvent,
ForwardedRef,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContextMenuItemDescriptor } from "packages/vuu-data-types";
import { ContextMenuItemDescriptor } from "@finos/vuu-data-types";

export type MenuOptions = { [key: string]: unknown };

Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
import { orientationType } from "@finos/vuu-utils";

import type { EditableLabelProps } from "../editable-label";
import type { MenuActionHandler } from "packages/vuu-data-types";
import type { MenuActionHandler } from "@finos/vuu-data-types";

export type ExitEditModeHandler = (
originalValue: string,
Expand Down
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-ui-controls/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
6 changes: 6 additions & 0 deletions vuu-ui/packages/vuu-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":{
"composite": true
},
}
2 changes: 1 addition & 1 deletion vuu-ui/sample-apps/app-vuu-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getFormConfig } from "./session-editing";
import "./App.css";
// Because we do not render the AppSidePanel directly, the css will not be included in bundle.
import "./app-sidepanel/AppSidePanel.css";
import { VuuTable } from "packages/vuu-protocol-types";
import { VuuTable } from "@finos/vuu-protocol-types";

const defaultWebsocketUrl = `wss://${location.hostname}:8090/websocket`;
const { websocketUrl: serverUrl = defaultWebsocketUrl, features } =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { PriceTicker } from "@finos/vuu-ui-controls";
import { Button } from "@salt-ds/core";
// import { VuuDataRow } from "packages/vuu-protocol-types";
import { DataSource, SubscribeCallback } from "@finos/vuu-data";
import { useId } from "@finos/vuu-layout";
import { PopupComponent as Popup, Portal } from "@finos/vuu-popups";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BasketStatus } from "../VuuBasketTradingFeature";
import { BasketMenu } from "./BasketMenu";

import "./BasketToolbar.css";
import { MenuActionHandler } from "packages/vuu-data-types";
import { MenuActionHandler } from "@finos/vuu-data-types";

const classBase = "vuuBasketToolbar";

Expand Down
Loading

0 comments on commit f68ef1c

Please sign in to comment.