From adc4fc4b8fe8416711bae20cd9310c72109bbe83 Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 17:44:20 +0530 Subject: [PATCH 1/5] fix(react): type issue in `Dialog` with `OverridableComponent` --- packages/react/src/components/Dialog/Dialog.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/react/src/components/Dialog/Dialog.tsx b/packages/react/src/components/Dialog/Dialog.tsx index 1dc5f4cf..08f69e76 100644 --- a/packages/react/src/components/Dialog/Dialog.tsx +++ b/packages/react/src/components/Dialog/Dialog.tsx @@ -18,10 +18,8 @@ import MuiDialog from '@mui/material/Dialog'; import type {DialogProps as MuiDialogProps} from '@mui/material/Dialog'; -import type {ModalTypeMap} from '@mui/material/Modal'; -import {OverridableComponent} from '@mui/material/OverridableComponent'; import clsx from 'clsx'; -import {forwardRef} from 'react'; +import {forwardRef, ForwardRefExoticComponent} from 'react'; import type {ElementType, ReactElement, Ref} from 'react'; export type DialogProps = { @@ -46,7 +44,7 @@ export type DialogProps = { * * @remarks * - ✔️ Props of the [Modal](https://mui.com/material-ui/api/modal/) component are also available. - * - ✅ `component` prop is supported. + * - FIXME: ⚠️ `component` prop is temporarily not supported due to https://github.com/wso2/oxygen-ui/issues/283 * - ✅ The `ref` is forwarded to the root element. * * @template C - The type of the component. @@ -54,11 +52,11 @@ export type DialogProps = { * @param ref - The ref to be forwarded to the MuiDialog component. * @returns The rendered Dialog component. */ -const Dialog: OverridableComponent> = forwardRef( +const Dialog: ForwardRefExoticComponent = forwardRef( ( {className, ...rest}: DialogProps, ref: Ref, ): ReactElement => , -) as OverridableComponent>; +) as ForwardRefExoticComponent; export default Dialog; From 30304ab6eff4a6eede2adcca9e45296edea577e2 Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 17:50:27 +0530 Subject: [PATCH 2/5] chore(examples): remove indexes --- examples/multi-brand-identity/src/App.tsx | 9 ++++-- .../src/branding/index.ts | 20 ------------- .../src/branding/store/branding-reducer.ts | 9 ++++-- .../src/branding/store/index.ts | 19 ------------ .../themes/{asgardeo.ts => AsgardeoTheme.ts} | 4 ++- .../{ballerina.ts => BallerinaTheme.ts} | 4 ++- .../themes/{choreo.ts => ChoreoTheme.ts} | 4 ++- .../themes/{default.ts => DefaultTheme.ts} | 4 ++- .../src/branding/themes/index.ts | 22 -------------- .../{brand-switcher.tsx => BrandSwitcher.tsx} | 8 +++-- ...og.tsx => OrganizationSelectionDialog.tsx} | 29 +++++++++---------- .../{building-icon.tsx => BuildingIcon.tsx} | 4 ++- .../src/components/icons/index.ts | 19 ------------ .../src/components/index.ts | 21 -------------- .../pages/{login-page.tsx => LoginPage.tsx} | 8 +++-- .../multi-brand-identity/src/pages/index.ts | 19 ------------ pnpm-lock.yaml | 12 ++++---- tsconfig.base.json | 8 ++--- 18 files changed, 64 insertions(+), 159 deletions(-) delete mode 100644 examples/multi-brand-identity/src/branding/index.ts delete mode 100644 examples/multi-brand-identity/src/branding/store/index.ts rename examples/multi-brand-identity/src/branding/themes/{asgardeo.ts => AsgardeoTheme.ts} (99%) rename examples/multi-brand-identity/src/branding/themes/{ballerina.ts => BallerinaTheme.ts} (98%) rename examples/multi-brand-identity/src/branding/themes/{choreo.ts => ChoreoTheme.ts} (99%) rename examples/multi-brand-identity/src/branding/themes/{default.ts => DefaultTheme.ts} (98%) delete mode 100644 examples/multi-brand-identity/src/branding/themes/index.ts rename examples/multi-brand-identity/src/components/{brand-switcher.tsx => BrandSwitcher.tsx} (91%) rename examples/multi-brand-identity/src/components/{organization-selection-dialog.tsx => OrganizationSelectionDialog.tsx} (88%) rename examples/multi-brand-identity/src/components/icons/{building-icon.tsx => BuildingIcon.tsx} (95%) delete mode 100644 examples/multi-brand-identity/src/components/icons/index.ts delete mode 100644 examples/multi-brand-identity/src/components/index.ts rename examples/multi-brand-identity/src/pages/{login-page.tsx => LoginPage.tsx} (84%) delete mode 100644 examples/multi-brand-identity/src/pages/index.ts diff --git a/examples/multi-brand-identity/src/App.tsx b/examples/multi-brand-identity/src/App.tsx index 2f9defd5..921c760c 100644 --- a/examples/multi-brand-identity/src/App.tsx +++ b/examples/multi-brand-identity/src/App.tsx @@ -18,9 +18,12 @@ import {AppBar, ColorModeToggle, Toolbar, ThemeProvider, IconButton, Theme, Tooltip} from '@oxygen-ui/react'; import {ReactElement, useReducer, useState} from 'react'; -import {BrandingActions, brandingReducer, DefaultTheme} from './branding'; -import {BrandSwitcher, BuildingIcon, OrganizationSelectionDialog} from './components'; -import {LoginPage} from './pages'; +import brandingReducer, {BrandingActions} from './branding/store/branding-reducer'; +import DefaultTheme from './branding/themes/DefaultTheme'; +import BrandSwitcher from './components/BrandSwitcher'; +import BuildingIcon from './components/icons/BuildingIcon'; +import OrganizationSelectionDialog from './components/OrganizationSelectionDialog'; +import LoginPage from './pages/LoginPage'; const App = (): ReactElement => { const [theme, dispatch] = useReducer(brandingReducer, DefaultTheme as never); diff --git a/examples/multi-brand-identity/src/branding/index.ts b/examples/multi-brand-identity/src/branding/index.ts deleted file mode 100644 index 0a9d8f2d..00000000 --- a/examples/multi-brand-identity/src/branding/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './store'; -export * from './themes'; diff --git a/examples/multi-brand-identity/src/branding/store/branding-reducer.ts b/examples/multi-brand-identity/src/branding/store/branding-reducer.ts index 7e3b8a0d..792a2afc 100644 --- a/examples/multi-brand-identity/src/branding/store/branding-reducer.ts +++ b/examples/multi-brand-identity/src/branding/store/branding-reducer.ts @@ -17,13 +17,16 @@ */ import {Theme} from '@oxygen-ui/react'; -import {AsgardeoTheme, BallerinaTheme, ChoreoTheme, DefaultTheme} from '../themes'; +import AsgardeoTheme from '../themes/AsgardeoTheme'; +import BallerinaTheme from '../themes/BallerinaTheme'; +import ChoreoTheme from '../themes/ChoreoTheme'; +import DefaultTheme from '../themes/DefaultTheme'; export enum BrandingActions { ChangeTheme = 'ChangeTheme', } -export const brandingReducer = (theme: Theme, action: any): Theme => { +const brandingReducer = (theme: Theme, action: any): Theme => { switch (action.type) { case BrandingActions.ChangeTheme: { if (action.brand === 'WSO2') { @@ -50,3 +53,5 @@ export const brandingReducer = (theme: Theme, action: any): Theme => { } } }; + +export default brandingReducer; diff --git a/examples/multi-brand-identity/src/branding/store/index.ts b/examples/multi-brand-identity/src/branding/store/index.ts deleted file mode 100644 index e484163b..00000000 --- a/examples/multi-brand-identity/src/branding/store/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './branding-reducer'; diff --git a/examples/multi-brand-identity/src/branding/themes/asgardeo.ts b/examples/multi-brand-identity/src/branding/themes/AsgardeoTheme.ts similarity index 99% rename from examples/multi-brand-identity/src/branding/themes/asgardeo.ts rename to examples/multi-brand-identity/src/branding/themes/AsgardeoTheme.ts index 7facb302..6913b322 100644 --- a/examples/multi-brand-identity/src/branding/themes/asgardeo.ts +++ b/examples/multi-brand-identity/src/branding/themes/AsgardeoTheme.ts @@ -19,7 +19,7 @@ import tokens from '@oxygen-ui/primitives/dist/design-tokens/web/asgardeo/es/tokens'; import {extendTheme, Theme} from '@oxygen-ui/react'; -export const AsgardeoTheme: Theme = extendTheme({ +const AsgardeoTheme: Theme = extendTheme({ colorSchemes: { dark: { brand: { @@ -256,3 +256,5 @@ export const AsgardeoTheme: Theme = extendTheme({ }, }, }); + +export default AsgardeoTheme; diff --git a/examples/multi-brand-identity/src/branding/themes/ballerina.ts b/examples/multi-brand-identity/src/branding/themes/BallerinaTheme.ts similarity index 98% rename from examples/multi-brand-identity/src/branding/themes/ballerina.ts rename to examples/multi-brand-identity/src/branding/themes/BallerinaTheme.ts index 173e334b..430be642 100644 --- a/examples/multi-brand-identity/src/branding/themes/ballerina.ts +++ b/examples/multi-brand-identity/src/branding/themes/BallerinaTheme.ts @@ -18,7 +18,7 @@ import {extendTheme, Theme} from '@oxygen-ui/react'; -export const BallerinaTheme: Theme = extendTheme({ +const BallerinaTheme: Theme = extendTheme({ colorSchemes: { dark: { brand: { @@ -144,3 +144,5 @@ export const BallerinaTheme: Theme = extendTheme({ }, }, }); + +export default BallerinaTheme; diff --git a/examples/multi-brand-identity/src/branding/themes/choreo.ts b/examples/multi-brand-identity/src/branding/themes/ChoreoTheme.ts similarity index 99% rename from examples/multi-brand-identity/src/branding/themes/choreo.ts rename to examples/multi-brand-identity/src/branding/themes/ChoreoTheme.ts index e8d29c4c..cef6aca6 100644 --- a/examples/multi-brand-identity/src/branding/themes/choreo.ts +++ b/examples/multi-brand-identity/src/branding/themes/ChoreoTheme.ts @@ -20,7 +20,7 @@ import tokens from '@oxygen-ui/primitives/dist/design-tokens/web/choreo/es/tokens'; import {extendTheme, Theme} from '@oxygen-ui/react'; -export const ChoreoTheme: Theme = extendTheme({ +const ChoreoTheme: Theme = extendTheme({ components: { MuiTooltip: { styleOverrides: { @@ -414,3 +414,5 @@ export const ChoreoTheme: Theme = extendTheme({ }, }, }); + +export default ChoreoTheme; diff --git a/examples/multi-brand-identity/src/branding/themes/default.ts b/examples/multi-brand-identity/src/branding/themes/DefaultTheme.ts similarity index 98% rename from examples/multi-brand-identity/src/branding/themes/default.ts rename to examples/multi-brand-identity/src/branding/themes/DefaultTheme.ts index 5a8b4556..48b3acc9 100644 --- a/examples/multi-brand-identity/src/branding/themes/default.ts +++ b/examples/multi-brand-identity/src/branding/themes/DefaultTheme.ts @@ -20,7 +20,7 @@ import darkTokens from '@oxygen-ui/primitives/dist/design-tokens/web/oxygen/es/d import lightTokens from '@oxygen-ui/primitives/dist/design-tokens/web/oxygen/es/tokens'; import {extendTheme, Theme} from '@oxygen-ui/react'; -export const DefaultTheme: Theme = extendTheme({ +const DefaultTheme: Theme = extendTheme({ colorSchemes: { dark: { brand: { @@ -136,3 +136,5 @@ export const DefaultTheme: Theme = extendTheme({ ].join(','), }, }); + +export default DefaultTheme; diff --git a/examples/multi-brand-identity/src/branding/themes/index.ts b/examples/multi-brand-identity/src/branding/themes/index.ts deleted file mode 100644 index 1e3028ae..00000000 --- a/examples/multi-brand-identity/src/branding/themes/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './asgardeo'; -export * from './ballerina'; -export * from './choreo'; -export * from './default'; diff --git a/examples/multi-brand-identity/src/components/brand-switcher.tsx b/examples/multi-brand-identity/src/components/BrandSwitcher.tsx similarity index 91% rename from examples/multi-brand-identity/src/components/brand-switcher.tsx rename to examples/multi-brand-identity/src/components/BrandSwitcher.tsx index aaeef113..2620a6ef 100644 --- a/examples/multi-brand-identity/src/components/brand-switcher.tsx +++ b/examples/multi-brand-identity/src/components/BrandSwitcher.tsx @@ -16,7 +16,9 @@ * under the License. */ -import {ToggleButtonGroup, ToggleButton, Paper, Tooltip} from '@oxygen-ui/react'; +import {ToggleButtonGroup, ToggleButton} from '@oxygen-ui/react'; +import Paper from '@oxygen-ui/react/Paper'; +import Tooltip from '@oxygen-ui/react/Tooltip'; import {useState, MouseEvent, ReactElement} from 'react'; interface Brand { @@ -62,7 +64,7 @@ export interface BrandSwitcherProps { onBrandChange?: (brand: string) => void; } -export const BrandSwitcher = (props: BrandSwitcherProps): ReactElement => { +const BrandSwitcher = (props: BrandSwitcherProps): ReactElement => { const {onBrandChange} = props; const [activeBrand, setActiveBrand] = useState(BRANDS[0].name); @@ -103,3 +105,5 @@ export const BrandSwitcher = (props: BrandSwitcherProps): ReactElement => { ); }; + +export default BrandSwitcher; diff --git a/examples/multi-brand-identity/src/components/organization-selection-dialog.tsx b/examples/multi-brand-identity/src/components/OrganizationSelectionDialog.tsx similarity index 88% rename from examples/multi-brand-identity/src/components/organization-selection-dialog.tsx rename to examples/multi-brand-identity/src/components/OrganizationSelectionDialog.tsx index d9319d1b..8e6fa28f 100644 --- a/examples/multi-brand-identity/src/components/organization-selection-dialog.tsx +++ b/examples/multi-brand-identity/src/components/OrganizationSelectionDialog.tsx @@ -16,28 +16,25 @@ * under the License. */ -import { - Button, - Dialog, - DialogTitle, - DialogContent, - DialogContentText, - DialogActions, - TextField, - extendTheme, - Theme, - Alert, -} from '@oxygen-ui/react'; +import {extendTheme, Theme} from '@oxygen-ui/react'; +import Alert from '@oxygen-ui/react/Alert'; +import Button from '@oxygen-ui/react/Button'; +import Dialog from '@oxygen-ui/react/Dialog'; +import DialogActions from '@oxygen-ui/react/DialogActions'; +import DialogContent from '@oxygen-ui/react/DialogContent'; +import DialogContentText from '@oxygen-ui/react/DialogContentText'; +import DialogTitle from '@oxygen-ui/react/DialogTitle'; +import TextField from '@oxygen-ui/react/TextField'; import {ChangeEvent, FC, ReactElement, useState} from 'react'; -import {BrandingActions} from '../branding'; +import {BrandingActions} from '../branding/store/branding-reducer'; -interface OrganizationSelectionDialogProps { +export interface OrganizationSelectionDialogProps { onClose: () => void; onOrganizationConnect: (action: {brand: string | undefined; theme: Theme; type: BrandingActions}) => void; open: boolean; } -export const OrganizationSelectionDialog: FC = ( +const OrganizationSelectionDialog: FC = ( props: OrganizationSelectionDialogProps, ): ReactElement => { const {open, onClose, onOrganizationConnect} = props; @@ -167,3 +164,5 @@ export const OrganizationSelectionDialog: FC = ); }; + +export default OrganizationSelectionDialog; diff --git a/examples/multi-brand-identity/src/components/icons/building-icon.tsx b/examples/multi-brand-identity/src/components/icons/BuildingIcon.tsx similarity index 95% rename from examples/multi-brand-identity/src/components/icons/building-icon.tsx rename to examples/multi-brand-identity/src/components/icons/BuildingIcon.tsx index 779a0d01..0e21eadf 100644 --- a/examples/multi-brand-identity/src/components/icons/building-icon.tsx +++ b/examples/multi-brand-identity/src/components/icons/BuildingIcon.tsx @@ -19,7 +19,7 @@ import {Theme, useColorScheme} from '@oxygen-ui/react'; import {ReactElement} from 'react'; -export const BuildingIcon = ({theme}: {theme: Theme}): ReactElement => { +const BuildingIcon = ({theme}: {theme: Theme}): ReactElement => { const {mode} = useColorScheme(); return ( @@ -37,3 +37,5 @@ export const BuildingIcon = ({theme}: {theme: Theme}): ReactElement => { ); }; + +export default BuildingIcon; diff --git a/examples/multi-brand-identity/src/components/icons/index.ts b/examples/multi-brand-identity/src/components/icons/index.ts deleted file mode 100644 index fa156fe0..00000000 --- a/examples/multi-brand-identity/src/components/icons/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './building-icon'; diff --git a/examples/multi-brand-identity/src/components/index.ts b/examples/multi-brand-identity/src/components/index.ts deleted file mode 100644 index 8b0177cb..00000000 --- a/examples/multi-brand-identity/src/components/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './icons'; -export * from './brand-switcher'; -export * from './organization-selection-dialog'; diff --git a/examples/multi-brand-identity/src/pages/login-page.tsx b/examples/multi-brand-identity/src/pages/LoginPage.tsx similarity index 84% rename from examples/multi-brand-identity/src/pages/login-page.tsx rename to examples/multi-brand-identity/src/pages/LoginPage.tsx index 1034e16c..cce30426 100644 --- a/examples/multi-brand-identity/src/pages/login-page.tsx +++ b/examples/multi-brand-identity/src/pages/LoginPage.tsx @@ -16,10 +16,12 @@ * under the License. */ -import {Grid, SignIn, useTheme, useColorScheme, Theme} from '@oxygen-ui/react'; +import {useTheme, useColorScheme, Theme} from '@oxygen-ui/react'; +import Grid from '@oxygen-ui/react/Grid'; +import SignIn from '@oxygen-ui/react/SignIn'; import {ReactElement} from 'react'; -export const LoginPage = (): ReactElement => { +const LoginPage = (): ReactElement => { const theme: Theme = useTheme(); const {mode} = useColorScheme(); @@ -43,3 +45,5 @@ export const LoginPage = (): ReactElement => { ); }; + +export default LoginPage; diff --git a/examples/multi-brand-identity/src/pages/index.ts b/examples/multi-brand-identity/src/pages/index.ts deleted file mode 100644 index 6a7acd98..00000000 --- a/examples/multi-brand-identity/src/pages/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './login-page'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80c13456..25412e24 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,10 +112,10 @@ importers: specifier: ^4.5.13 version: 4.5.13 '@oxygen-ui/primitives': - specifier: 1.15.0 + specifier: ^1.15.0 version: link:../../packages/primitives '@oxygen-ui/react': - specifier: 1.15.0 + specifier: ^1.15.0 version: link:../../packages/react react: specifier: ^18.2.0 @@ -10860,8 +10860,8 @@ packages: eslint: ^7.32.0 || ^8.2.0 eslint-plugin-import: ^2.25.3 dependencies: - '@typescript-eslint/eslint-plugin': 5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.25.0)(typescript@4.9.3) - '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.3) + '@typescript-eslint/eslint-plugin': 5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.25.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.4) eslint: 8.25.0 eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.26.0)(eslint@8.25.0) eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.46.1)(eslint@8.25.0) @@ -10986,7 +10986,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.4) debug: 3.2.7(supports-color@5.5.0) eslint: 8.25.0 eslint-import-resolver-node: 0.3.6 @@ -11049,7 +11049,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.4) array-includes: 3.1.6 array.prototype.flat: 1.3.1 debug: 2.6.9 diff --git a/tsconfig.base.json b/tsconfig.base.json index 5e016b10..05fa38ee 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -3,10 +3,10 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@oxygen/primitives": ["packages/primitives/src"], - "@oxygen/logger": ["packages/logger/src/index.ts"], - "@oxygen/react": ["packages/react/src/index.ts"], - "@oxygen/react-icons": ["packages/react-icons/src/index.ts"] + "@oxygen-ui/primitives": ["packages/primitives/src"], + "@oxygen-ui/logger": ["packages/logger/src/index.ts"], + "@oxygen-ui/react": ["packages/react/src/index.ts"], + "@oxygen-ui/react-icons": ["packages/react-icons/src/index.ts"] } } } From 66e65acf9384ca4d266ccc0319e01dc15061e3ba Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 18:04:29 +0530 Subject: [PATCH 3/5] chore: update lock --- pnpm-lock.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 25412e24..80c13456 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,10 +112,10 @@ importers: specifier: ^4.5.13 version: 4.5.13 '@oxygen-ui/primitives': - specifier: ^1.15.0 + specifier: 1.15.0 version: link:../../packages/primitives '@oxygen-ui/react': - specifier: ^1.15.0 + specifier: 1.15.0 version: link:../../packages/react react: specifier: ^18.2.0 @@ -10860,8 +10860,8 @@ packages: eslint: ^7.32.0 || ^8.2.0 eslint-plugin-import: ^2.25.3 dependencies: - '@typescript-eslint/eslint-plugin': 5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.25.0)(typescript@4.9.4) - '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.4) + '@typescript-eslint/eslint-plugin': 5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.25.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.3) eslint: 8.25.0 eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.26.0)(eslint@8.25.0) eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.46.1)(eslint@8.25.0) @@ -10986,7 +10986,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.3) debug: 3.2.7(supports-color@5.5.0) eslint: 8.25.0 eslint-import-resolver-node: 0.3.6 @@ -11049,7 +11049,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.46.1(eslint@8.25.0)(typescript@4.9.3) array-includes: 3.1.6 array.prototype.flat: 1.3.1 debug: 2.6.9 From 34cff6a363af1d44ef2055c78034bc4363f385d3 Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 18:43:38 +0530 Subject: [PATCH 4/5] fix(examples): use workspace protocol for internal packages --- examples/multi-brand-identity/package.json | 4 ++-- pnpm-lock.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/multi-brand-identity/package.json b/examples/multi-brand-identity/package.json index 6e5c56f9..a99f54b2 100644 --- a/examples/multi-brand-identity/package.json +++ b/examples/multi-brand-identity/package.json @@ -32,8 +32,8 @@ "dependencies": { "@fontsource/inter": "^4.5.14", "@fontsource/montserrat": "^4.5.13", - "@oxygen-ui/primitives": "1.15.0", - "@oxygen-ui/react": "1.15.0", + "@oxygen-ui/primitives": "workspace:*", + "@oxygen-ui/react": "workspace:../../packages/react/dist", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80c13456..6febf648 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,11 +112,11 @@ importers: specifier: ^4.5.13 version: 4.5.13 '@oxygen-ui/primitives': - specifier: 1.15.0 + specifier: workspace:* version: link:../../packages/primitives '@oxygen-ui/react': - specifier: 1.15.0 - version: link:../../packages/react + specifier: workspace:../../packages/react/dist + version: link:../../packages/react/dist react: specifier: ^18.2.0 version: 18.2.0 From 2434cba653265541a1108bcfe5eaa241989daaa8 Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 20:27:11 +0530 Subject: [PATCH 5/5] chore(examples): fix unit tests --- examples/multi-brand-identity/jest.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/multi-brand-identity/jest.config.ts b/examples/multi-brand-identity/jest.config.ts index 3cf9dc9e..8981ab4d 100644 --- a/examples/multi-brand-identity/jest.config.ts +++ b/examples/multi-brand-identity/jest.config.ts @@ -22,6 +22,7 @@ module.exports = { moduleDirectories: ['node_modules', 'test-configs', __dirname], moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'], moduleNameMapper: { + '@oxygen-ui/react': '/node_modules/@oxygen-ui/react', '\\.(css|less|sass|scss)$': '/test-configs/__mocks__/style-mock.ts', '^@unit-testing(.*)$': '/test-configs/utils', }, @@ -35,6 +36,6 @@ module.exports = { '^.+\\.(js|jsx)?$': 'babel-jest', '^.+\\.(ts|tsx)?$': 'ts-jest', }, - transformIgnorePatterns: ['/node_modules/?(?!@wso2)'], + transformIgnorePatterns: ['/node_modules/?(?!@wso2)', '/node_modules/(?!@oxygen-ui/react/)'], verbose: true, };