Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade TypeScript and React types #1420

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _templates/create-package/library/files/package.json.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ to: packages/<%=package%>/package.json
"rimraf": "~3.0.2",
"ts-jest": "~27.1.3",
"typedoc": "~0.24.1",
"typescript": "~4.3.5"
"typescript": "~5.5.4"
},
"eslintConfig": {
"extends": "@rocket.chat/eslint-config-alt/typescript",
Expand Down
2 changes: 1 addition & 1 deletion packages/css-in-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"rollup-plugin-terser": "~7.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"dependencies": {
"@emotion/hash": "^0.9.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/css-supports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"prettier": "~2.8.7",
"rimraf": "~3.0.2",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"dependencies": {
"@rocket.chat/memo": "workspace:~"
Expand Down
2 changes: 1 addition & 1 deletion packages/emitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"rollup-plugin-terser": "~7.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
}
}
6 changes: 3 additions & 3 deletions packages/fuselage-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"@testing-library/react-hooks": "~8.0.1",
"@testing-library/user-event": "~14.4.3",
"@types/jest": "~29.5.0",
"@types/react": "~17.0.57",
"@types/react-dom": "^17.0.19",
"@types/react": "~17.0.80",
"@types/react-dom": "~17.0.25",
"@types/resize-observer-browser": "~0.1.7",
"@types/use-sync-external-store": "~0.0.3",
"bump": "workspace:~",
Expand All @@ -70,7 +70,7 @@
"testing-utils": "workspace:~",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"peerDependencies": {
"@rocket.chat/fuselage-tokens": "*",
Expand Down
6 changes: 3 additions & 3 deletions packages/fuselage-toastbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@storybook/react": "~6.5.16",
"@storybook/theming": "~6.5.16",
"@types/jest": "~29.5.0",
"@types/react": "~17.0.57",
"@types/react-dom": "^17.0.19",
"@types/react": "~17.0.80",
"@types/react-dom": "~17.0.25",
"bump": "workspace:~",
"eslint": "~8.38.0",
"jest": "~29.5.0",
Expand All @@ -71,7 +71,7 @@
"storybook-dark-mode": "~1.1.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"peerDependencies": {
"@rocket.chat/fuselage": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"testing-utils": "workspace:~",
"ts-jest": "~29.1.0",
"ts-loader": "~9.4.2",
"typescript": "~5.4.5",
"typescript": "~5.5.4",
"webpack": "~5.78.0",
"webpack-bundle-analyzer": "~4.8.0",
"webpack-cli": "~5.0.1",
Expand Down
9 changes: 5 additions & 4 deletions packages/fuselage/src/components/Menu/V2/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import type { ComponentProps, ReactNode } from 'react';
import type { Node } from '@react-types/shared';
import type { ReactNode } from 'react';
import React, { useRef } from 'react';
import { useMenuItem } from 'react-aria';
import type { TreeState } from 'react-stately';

import { MenuItemDescription } from '.';
import type { MenuOptionProps } from './MenuOption';
import MenuOption from './MenuOption';
import type { Node } from './types';

type MenuItemProps = {
item: Node<{
description?: ReactNode;
variant?: ComponentProps<typeof MenuOption>['variant'];
variant?: MenuOptionProps['variant'];
}>;
state: TreeState<unknown>;
};
Expand All @@ -30,7 +31,7 @@ function MenuItem({ item, state }: MenuItemProps) {
focus={isFocused}
disabled={isDisabled}
is='label'
variant={item.value && item.value.variant}
variant={item.value?.variant}
>
<div className='rcx-option__wrapper'>{item.rendered}</div>
{item.value && item.value.description && (
Expand Down
4 changes: 2 additions & 2 deletions packages/fuselage/src/components/Menu/V2/MenuOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { forwardRef, memo } from 'react';
import { prevent } from '../../../helpers/prevent';
import type Box from '../../Box/Box';

type OptionProps = {
export type MenuOptionProps = {
is?: ComponentProps<typeof Box>['is'];
id?: string;
children?: ReactNode;
Expand Down Expand Up @@ -41,7 +41,7 @@ const MenuOption = memo(
variant,
onClick,
...props
}: OptionProps,
}: MenuOptionProps,
ref
) => (
<Tag
Expand Down
11 changes: 7 additions & 4 deletions packages/fuselage/src/components/Menu/V2/MenuSection.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Node } from '@react-types/shared';
import React from 'react';
import { useMenuSection, useSeparator } from 'react-aria';
import type { TreeState } from 'react-stately';
Expand All @@ -6,14 +7,16 @@ import Box from '../../Box/Box';
import { Divider } from '../../Divider';
import { OptionTitle } from '../../Option';
import MenuItem from './MenuItem';
import type { Node } from './types';

type MenuSectionProps = {
section: Node<unknown>;
type MenuSectionProps<T extends object> = {
section: Node<T>;
state: TreeState<unknown>;
};

function MenuSection({ section, state }: MenuSectionProps) {
function MenuSection<T extends object>({
section,
state,
}: MenuSectionProps<T>) {
const { itemProps, headingProps, groupProps } = useMenuSection({
'heading': section.rendered,
'aria-label': section['aria-label'],
Expand Down
39 changes: 0 additions & 39 deletions packages/fuselage/src/components/Menu/V2/types.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"@storybook/react": "~6.5.16",
"@storybook/theming": "~6.5.16",
"@types/jest": "~29.5.0",
"@types/react": "^17",
"@types/react-dom": "^17",
"@types/react": "~17.0.80",
"@types/react-dom": "~17.0.25",
"bump": "workspace:~",
"eslint": "~8.38.0",
"jest": "~29.5.0",
Expand All @@ -70,7 +70,7 @@
"storybook-dark-mode": "~3.0.1",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"eslintConfig": {
"extends": "@rocket.chat/eslint-config-alt/typescript",
Expand Down
6 changes: 3 additions & 3 deletions packages/logo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@rocket.chat/fuselage-tokens": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"@types/jest": "~29.5.0",
"@types/react": "~17.0.57",
"@types/react-dom": "^17.0.19",
"@types/react": "~17.0.80",
"@types/react-dom": "~17.0.25",
"build-logo": "workspace:~",
"bump": "workspace:~",
"eslint": "~8.38.0",
Expand All @@ -60,7 +60,7 @@
"rimraf": "^3.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"dependencies": {
"@rocket.chat/fuselage-hooks": "workspace:~",
Expand Down
2 changes: 1 addition & 1 deletion packages/memo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"rimraf": "~3.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"eslintConfig": {
"extends": "@rocket.chat/eslint-config-alt/typescript",
Expand Down
2 changes: 1 addition & 1 deletion packages/mp3-encoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
"rollup": "~3.20.4",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
}
}
6 changes: 3 additions & 3 deletions packages/onboarding-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"@storybook/react": "~6.5.16",
"@storybook/theming": "~6.5.16",
"@types/jest": "~29.5.0",
"@types/react": "~17.0.57",
"@types/react-dom": "^17.0.19",
"@types/react": "~17.0.80",
"@types/react-dom": "~17.0.25",
"bump": "workspace:~",
"countries-list": "^2.6.1",
"eslint": "~8.38.0",
Expand All @@ -76,7 +76,7 @@
"storybook-dark-mode": "^1.1.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"dependencies": {
"i18next": "~21.6.16",
Expand Down
2 changes: 1 addition & 1 deletion packages/peggy-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"prettier": "~2.8.7",
"rimraf": "^3.0.2",
"ts-jest": "~29.1.0",
"typescript": "~5.4.5",
"typescript": "~5.5.4",
"webpack": "~5.78.0"
}
}
2 changes: 1 addition & 1 deletion packages/string-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"rimraf": "^3.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"eslintConfig": {
"extends": "@rocket.chat/eslint-config-alt/typescript",
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"rimraf": "^3.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"dependencies": {
"@rocket.chat/css-in-js": "workspace:~"
Expand Down
2 changes: 1 addition & 1 deletion packages/stylis-logical-props-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"stylis": "~4.3.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"dependencies": {
"@rocket.chat/css-supports": "workspace:~"
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"npm-run-all": "^4.1.5",
"prettier": "~2.8.7",
"ts-node": "~10.9.1",
"typescript": "~5.4.5"
"typescript": "~5.5.4"
},
"version": "0.31.25"
}
Loading
Loading