diff --git a/apps/docs/scripts/search/generate-embeddings.ts b/apps/docs/scripts/search/generate-embeddings.ts index 490861209d2..bed0d7da47f 100644 --- a/apps/docs/scripts/search/generate-embeddings.ts +++ b/apps/docs/scripts/search/generate-embeddings.ts @@ -75,13 +75,11 @@ async function generateEmbeddings() { throw fetchPageError } - type Singular = T extends any[] ? undefined : T - // We use checksum to determine if this page & its sections need to be regenerated if (!shouldRefresh && existingPage?.checksum === checksum) { - const existingParentPage = existingPage?.parentPage as Singular< - typeof existingPage.parentPage - > + const existingParentPage = Array.isArray(existingPage?.parentPage) + ? existingPage?.parentPage[0] + : existingPage?.parentPage // If parent page changed, update it if (existingParentPage?.path !== parentPath) { diff --git a/apps/www/lib/markdownToHtml.ts b/apps/www/lib/markdownToHtml.ts index 4917e910448..9b486c82f8b 100644 --- a/apps/www/lib/markdownToHtml.ts +++ b/apps/www/lib/markdownToHtml.ts @@ -1,4 +1,4 @@ -import remark from 'remark' +import { remark } from 'remark' import html from 'remark-html' export default async function markdownToHtml(markdown: string) { diff --git a/apps/www/package.json b/apps/www/package.json index a409afa9274..06f9b0a3b00 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -25,7 +25,7 @@ "common": "*", "config": "*", "date-fns": "2.10.0", - "dayjs": "^1.11.5", + "dayjs": "^1.11.7", "framer-motion": "^6.5.1", "globby": "^12.0.2", "gray-matter": "^4.0.3", @@ -64,7 +64,7 @@ "yup": "^0.32.11" }, "devDependencies": { - "@tailwindcss/typography": "^0.5.7", + "@tailwindcss/typography": "^0.5.9", "@types/classnames": "^2.3.1", "@types/jest": "^27.4.0", "@types/marked": "^4.0.3", diff --git a/package-lock.json b/package-lock.json index b9e1726e099..f9af7f08365 100644 --- a/package-lock.json +++ b/package-lock.json @@ -272,7 +272,7 @@ "common": "*", "config": "*", "date-fns": "2.10.0", - "dayjs": "^1.11.5", + "dayjs": "^1.11.7", "framer-motion": "^6.5.1", "globby": "^12.0.2", "gray-matter": "^4.0.3", @@ -311,7 +311,7 @@ "yup": "^0.32.11" }, "devDependencies": { - "@tailwindcss/typography": "^0.5.7", + "@tailwindcss/typography": "^0.5.9", "@types/classnames": "^2.3.1", "@types/jest": "^27.4.0", "@types/marked": "^4.0.3", @@ -348,32 +348,6 @@ "react": ">=16" } }, - "apps/www/node_modules/@tailwindcss/typography": { - "version": "0.5.8", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, - "apps/www/node_modules/postcss-selector-parser": { - "version": "6.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "apps/www/node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -14179,6 +14153,32 @@ "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" } }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.9.tgz", + "integrity": "sha512-t8Sg3DyynFysV9f4JDOVISGsjazNb48AeIYQwcL+Bsq5uf4RYL75C1giZ43KISjeDGBaTN3Kxh7Xj/vRSMJUUg==", + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, + "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@testdeck/core": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/@testdeck/core/-/core-0.2.2.tgz", @@ -28003,6 +28003,11 @@ "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==" }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -28013,6 +28018,11 @@ "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", @@ -42724,7 +42734,7 @@ "@mertasan/tailwindcss-variables": "^2.2.3", "@radix-ui/colors": "^0.1.8", "@tailwindcss/forms": "^0.5.0", - "@tailwindcss/typography": "^0.5.7", + "@tailwindcss/typography": "^0.5.9", "deepmerge": "^4.2.2", "eslint-config-next": "^13.3.0", "eslint-config-prettier": "^8.3.0", @@ -42740,19 +42750,6 @@ "glob": "7.1.7" } }, - "packages/config/node_modules/@tailwindcss/typography": { - "version": "0.5.7", - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "packages/config/node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -42879,17 +42876,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/config/node_modules/postcss-selector-parser": { - "version": "6.0.10", - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "packages/config/node_modules/resolve": { "version": "2.0.0-next.4", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", @@ -42948,7 +42934,7 @@ "@radix-ui/react-tabs": "^1.0.2", "@supabase/auth-helpers-react": "^0.3.1", "@tailwindcss/forms": "^0.5.0", - "@tailwindcss/typography": "^0.5.7", + "@tailwindcss/typography": "^0.5.9", "autoprefixer": "^10.4.14", "clsx": "^1.2.1", "cmdk-supabase": "^0.2.2", @@ -43168,19 +43154,6 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, - "packages/ui/node_modules/@tailwindcss/typography": { - "version": "0.5.7", - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "packages/ui/node_modules/brace-expansion": { "version": "2.0.1", "dev": true, @@ -43225,17 +43198,6 @@ "node": ">=10" } }, - "packages/ui/node_modules/postcss-selector-parser": { - "version": "6.0.10", - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "packages/ui/node_modules/react-inspector": { "version": "6.0.1", "dev": true, @@ -43330,7 +43292,7 @@ "common-tags": "^1.8.2", "config": "*", "configcat-js": "^7.0.0", - "dayjs": "^1.11.5", + "dayjs": "^1.11.7", "eslint-config-next": "^13.3.0", "file-saver": "^2.0.5", "generate-password": "^1.7.0", @@ -43396,7 +43358,7 @@ "@storybook/react": "^7.0.5", "@storybook/testing-library": "^0.0.9", "@supabase/postgres-meta": "^0.64.4", - "@tailwindcss/typography": "^0.5.7", + "@tailwindcss/typography": "^0.5.9", "@testing-library/dom": "^8.19.0", "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^8.0.1", @@ -43640,20 +43602,6 @@ "url": "https://opencollective.com/storybook" } }, - "studio/node_modules/@tailwindcss/typography": { - "version": "0.5.8", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "studio/node_modules/@tanstack/match-sorter-utils": { "version": "8.7.6", "license": "MIT", @@ -43905,18 +43853,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, - "studio/node_modules/postcss-selector-parser": { - "version": "6.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "studio/node_modules/proxy-compare": { "version": "2.3.0", "license": "MIT" diff --git a/packages/config/package.json b/packages/config/package.json index ec0028a1333..45901f19411 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -15,6 +15,6 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-react": "7.28.0", "tailwindcss-radix": "^2.0.0", - "@tailwindcss/typography": "^0.5.7" + "@tailwindcss/typography": "^0.5.9" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index ea71d06c73b..7d52de2e850 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -28,7 +28,7 @@ "@radix-ui/react-tabs": "^1.0.2", "@supabase/auth-helpers-react": "^0.3.1", "@tailwindcss/forms": "^0.5.0", - "@tailwindcss/typography": "^0.5.7", + "@tailwindcss/typography": "^0.5.9", "autoprefixer": "^10.4.14", "clsx": "^1.2.1", "cmdk-supabase": "^0.2.2", diff --git a/studio/__mocks__/hooks.js b/studio/__mocks__/hooks.js index 77e269ed6c9..b65063f7371 100644 --- a/studio/__mocks__/hooks.js +++ b/studio/__mocks__/hooks.js @@ -1,8 +1,8 @@ export const useFlag = jest.fn().mockReturnValue(true) export const checkPermissions = jest.fn().mockReturnValue(true) -const { useStore, StoreProvider } = jest.requireActual('hooks') -export const useStore = useStore +const { useStore: _useStore, StoreProvider: _StoreProvider } = jest.requireActual('hooks') +export const useStore = _useStore export const useParams = jest.fn().mockImplementation(() => ({ ref: '123' })) @@ -10,6 +10,6 @@ export const useParams = jest.fn().mockImplementation(() => ({ ref: '123' })) window.matchMedia = jest.fn().mockReturnValue({ removeEventListener: jest.fn(), }) -export const StoreProvider = StoreProvider +export const StoreProvider = _StoreProvider export const withAuth = jest.fn() diff --git a/studio/components/ui/Charts/BarChart.tsx b/studio/components/ui/Charts/BarChart.tsx index 2da9cf9a76e..e2f9d135882 100644 --- a/studio/components/ui/Charts/BarChart.tsx +++ b/studio/components/ui/Charts/BarChart.tsx @@ -7,7 +7,7 @@ import { Datum, CommonChartProps } from './Charts.types' import utc from 'dayjs/plugin/utc' import ChartNoData from './NoDataPlaceholder' import { numberFormatter, useChartSize } from './Charts.utils' -import { CategoricalChartProps } from 'recharts/types/chart/generateCategoricalChart' +import { CategoricalChartState } from 'recharts/types/chart/generateCategoricalChart' dayjs.extend(utc) export interface BarChartProps extends CommonChartProps { @@ -16,7 +16,7 @@ export interface BarChartProps extends CommonChartProps { format?: string customDateFormat?: string displayDateInUtc?: boolean - onBarClick?: (datum: Datum, tooltipData?: Parameters[0]) => void + onBarClick?: (datum: Datum, tooltipData?: CategoricalChartState) => void } const BarChart: React.FC = ({ @@ -81,7 +81,7 @@ const BarChart: React.FC = ({ } }} onMouseLeave={() => setFocusDataIndex(null)} - onClick={(tooltipData: any) => { + onClick={(tooltipData) => { // receives tooltip data https://github.com/recharts/recharts/blob/2a3405ff64a0c050d2cf94c36f0beef738d9e9c2/src/chart/generateCategoricalChart.tsx const datum = tooltipData?.activePayload?.[0]?.payload if (onBarClick) onBarClick(datum, tooltipData) diff --git a/studio/components/ui/Charts/StackedBarChart.tsx b/studio/components/ui/Charts/StackedBarChart.tsx index aceea8560d3..4ce2b8e1ee8 100644 --- a/studio/components/ui/Charts/StackedBarChart.tsx +++ b/studio/components/ui/Charts/StackedBarChart.tsx @@ -115,14 +115,14 @@ const StackedBarChart: React.FC = ({ ? (label) => timestampFormatter(label, customDateFormat, displayDateInUtc) : undefined } - formatter={(value: number, name: string, props: any) => { + formatter={(value, name, props) => { const suffix = format || '' if (variant === 'percentages' && percentagesStackedData) { const index = percentagesStackedData.findIndex( (pStack) => pStack === props.payload! ) const val = stackedData[index][name] - const percentage = precisionFormatter(value * 100, 1) + '%' + const percentage = precisionFormatter(Number(value) * 100, 1) + '%' return `${percentage} (${val}${suffix})` } return String(value) + suffix diff --git a/studio/components/ui/InfiniteList.tsx b/studio/components/ui/InfiniteList.tsx index 615cbfcf929..78eac67aeaa 100644 --- a/studio/components/ui/InfiniteList.tsx +++ b/studio/components/ui/InfiniteList.tsx @@ -73,7 +73,7 @@ function InfiniteList({
- {({ height, width }) => ( + {({ height, width }: { height: number; width: number }) => (