Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
perf: update all deps to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
pfferrari committed Apr 4, 2024
1 parent 71d20b2 commit b37e9c6
Show file tree
Hide file tree
Showing 11 changed files with 883 additions and 415 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
"husky": "^9.0.11",
"lerna": "^8.1.2",
"lint-staged": "^15.2.2",
"npm-check-updates": "^16.14.15"
"npm-check-updates": "^16.14.18"
},
"resolutions": {
"ip": "^2.0.1"
"ip": "^2.0.1",
"follow-redirects": "^1.15.6"
}
}
30 changes: 15 additions & 15 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@
"prepare": "touch ./public/config.local.js"
},
"dependencies": {
"@commercelayer/app-elements": "1.16.0",
"@commercelayer/sdk": "5.33.1",
"@commercelayer/app-elements": "1.20.1",
"@commercelayer/sdk": "5.36.0",
"@hookform/resolvers": "^3.3.4",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "7.51.0",
"react-hook-form": "7.51.2",
"swr": "^2.2.5",
"type-fest": "^4.11.1",
"wouter": "^3.0.1",
"type-fest": "^4.15.0",
"wouter": "^3.1.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@commercelayer/eslint-config-ts-react": "^1.3.0",
"@testing-library/react": "^14.2.1",
"@types/lodash": "^4.14.202",
"@types/node": "20.11.24",
"@types/react": "^18.2.63",
"@types/react-dom": "^18.2.20",
"@commercelayer/eslint-config-ts-react": "^1.4.5",
"@testing-library/react": "^14.2.2",
"@types/lodash": "^4.17.0",
"@types/node": "20.12.4",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"jsdom": "^24.0.0",
"rollup-plugin-external-globals": "^0.9.2",
"typescript": "^5.3.3",
"vite": "^5.1.5",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.3.1"
"typescript": "^5.4.3",
"vite": "^5.2.8",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.4.0"
}
}
5 changes: 2 additions & 3 deletions packages/app/src/components/ListItemSku.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const ListItemSku = withSkeletonTemplate<Props>(
({ resource = makeSku(), variant, disabled = false, onSelect }) => {
return (
<ListItem
tag='a'
onClick={(e) => {
e.preventDefault()
if (!disabled && onSelect != null) {
Expand All @@ -35,7 +34,7 @@ export const ListItemSku = withSkeletonTemplate<Props>(
}
variant={variant}
disabled={disabled}
className={variant === 'card' ? 'bg-white hover:bg-white' : ''}
className={variant === 'boxed' ? 'bg-white hover:bg-white' : ''}
>
<div>
<Text tag='div' variant='info' weight='semibold'>
Expand All @@ -45,7 +44,7 @@ export const ListItemSku = withSkeletonTemplate<Props>(
{resource.name}
</Text>
</div>
{variant === 'card' && !disabled && (
{variant === 'boxed' && !disabled && (
<Icon
name='pencilSimple'
size='18'
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/components/ListItemStockItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const ListItemStockItem = withSkeletonTemplate<Props>(

return (
<ListItem
tag='a'
icon={
<Avatar
alt={resource.sku?.name ?? ''}
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/components/ListItemStockLocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const ListItemStockLocation = withSkeletonTemplate<Props>(
return (
<ListItem
className='items-center'
tag='div'
onClick={() => {
setLocation(appRoutes.stockLocation.makePath(resource.id))
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/StockItemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function StockItemForm({
<ListItemSku
resource={sku}
disabled={defaultValues?.id != null}
variant='card'
variant='boxed'
onSelect={() => {
if (defaultValues?.id == null) {
showAddItemOverlay({ type: 'skus', excludedId: sku?.id })
Expand Down
15 changes: 8 additions & 7 deletions packages/app/src/hooks/useStockItemDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ export function useStockItemDetails(id: string): {
} = useCoreApi(
'stock_items',
'retrieve',
[
id,
{
include: ['stock_location', 'sku', 'reserved_stock']
}
],
!isMockedId(id)
? [
id,
{
include: ['stock_location', 'sku', 'reserved_stock']
}
]
: null,
{
isPaused: () => isMockedId(id),
fallbackData: makeStockItem()
}
)
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/hooks/useStockLocationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export function useStockLocationDetails(id: string): {
isLoading,
error,
mutate: mutateStockLocation
} = useCoreApi('stock_locations', 'retrieve', [id], {
isPaused: () => isMockedId(id),
} = useCoreApi('stock_locations', 'retrieve', !isMockedId(id) ? [id] : null, {
fallbackData: makeStockLocation()
})

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/StockItemEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export function StockItemEdit(): JSX.Element {
void sdkClient.stock_items
.update(stockItem)
.then((updatedStockItem) => {
setLocation(goBackUrl)
void mutateStockItem({ ...updatedStockItem })
setLocation(goBackUrl)
})
.catch((error) => {
setApiError(error)
Expand Down
1 change: 1 addition & 0 deletions packages/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"global.d.ts",
"src",
"*.config.ts",
"*.config.mts",
"*.config.js",
"*.config.cjs",
".eslintrc.cjs",
Expand Down
Loading

0 comments on commit b37e9c6

Please sign in to comment.