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

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gciotola committed Jun 21, 2024
1 parent ecc55ac commit 9e0d66a
Show file tree
Hide file tree
Showing 16 changed files with 637 additions and 639 deletions.
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@
"packages/*"
],
"devDependencies": {
"lerna": "^8.1.2",
"lerna": "^8.1.3",
"npm-check-updates": "^16.14.20"
},
"resolutions": {
"ip": "^2.0.1",
"tar": "^6.2.1"
}
}
32 changes: 16 additions & 16 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,37 @@
"prepare": "touch ./public/config.local.js"
},
"dependencies": {
"@commercelayer/app-elements": "^1.24.0",
"@commercelayer/app-elements": "^2.0.7",
"@commercelayer/eslint-config-ts-react": "^1.4.5",
"@commercelayer/sdk": "5.37.0",
"@vitejs/plugin-react": "^4.2.1",
"@commercelayer/sdk": "6.9.1",
"@vitejs/plugin-react": "^4.3.1",
"lodash": "^4.17.21",
"papaparse": "^5.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-select": "^5.8.0",
"wouter": "^3.1.2",
"zod": "3.23.5"
"wouter": "^3.2.1",
"zod": "3.23.8"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.6",
"@types/lodash": "^4.17.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@types/lodash": "^4.17.5",
"@types/lodash-es": "^4.17.12",
"@types/node": "20.12.8",
"@types/node": "20.14.7",
"@types/papaparse": "^5.3.14",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/testing-library__jest-dom": "^5.14.9",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"jsdom": "^24.0.0",
"jsdom": "^24.1.0",
"rollup-plugin-external-globals": "^0.10.0",
"type-fest": "^4.18.1",
"type-fest": "^4.20.1",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vite": "^5.3.1",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.5.3"
"vitest": "^1.6.0"
},
"engines": {
"node": ">=18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
formatResourceName,
withSkeletonTemplate
} from '@commercelayer/app-elements'
import { type ListableResourceType } from '@commercelayer/sdk/lib/cjs/api'
import type { ListableResourceType } from '@commercelayer/sdk'

interface Props extends React.HTMLAttributes<HTMLSpanElement> {}

Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/List/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ import {
formatResourceName,
StatusIcon
} from '@commercelayer/app-elements'
import { type Import, CommerceLayerStatic } from '@commercelayer/sdk'
import {
type Import,
CommerceLayerStatic,
type ListableResourceType
} from '@commercelayer/sdk'
import { DescriptionLine } from '#components/List/ItemDescriptionLine'
import { getUiStatus } from '#components/List/utils'
import { getProgressPercentage } from '#utils/getProgressPercentage'
import { appRoutes } from '#data/routes'
import { Link } from 'wouter'
import { useListContext } from './Provider'
import { type ListableResourceType } from '@commercelayer/sdk/lib/cjs/api'
import { useState } from 'react'

interface Props {
Expand Down
10 changes: 7 additions & 3 deletions packages/app/src/components/List/Provider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { type CommerceLayerClient, type Import } from '@commercelayer/sdk'
import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource'
import {
type QueryParamsList,
type CommerceLayerClient,
type Import,
type ListResponse
} from '@commercelayer/sdk'
import { type ListImportContextValue, type ListImportContextState } from 'App'
import {
createContext,
Expand Down Expand Up @@ -115,7 +119,7 @@ const getAllImports = async ({
}): Promise<ListResponse<Import>> => {
return await cl.imports.list({
pageNumber: state.currentPage,
pageSize,
pageSize: pageSize as QueryParamsList<Import>['pageSize'],
sort: { created_at: 'desc' }
})
}
3 changes: 1 addition & 2 deletions packages/app/src/components/List/reducer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Import } from '@commercelayer/sdk'
import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource'
import { type Import, type ListResponse } from '@commercelayer/sdk'
import { type ListImportContextState } from 'App'
import { listHasProgressingItems } from './utils'

Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/components/List/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Import } from '@commercelayer/sdk'
import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource'
import type { Import, ListResponse } from '@commercelayer/sdk'

declare module 'App' {
export interface ListImportContextValue {
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/components/List/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Import } from '@commercelayer/sdk'
import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource'
import { type Import, type ListResponse } from '@commercelayer/sdk'
import { getUiStatus, listHasProgressingItems } from './utils'

// getUiStatus
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/components/List/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Import } from '@commercelayer/sdk'
import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource'
import type { Import, ListResponse } from '@commercelayer/sdk'

type StatusUI = 'progress' | 'success' | 'danger' | 'pending'

Expand Down
19 changes: 9 additions & 10 deletions packages/app/src/components/ResourceFinder/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type InputSelectValue } from '@commercelayer/app-elements/dist/ui/forms/InputSelect'
import { type CommerceLayerClient } from '@commercelayer/sdk'
import {
type ListResponse,
type Resource
} from '@commercelayer/sdk/lib/cjs/resource'
import type {
CommerceLayerClient,
ListResponse,
Resource
} from '@commercelayer/sdk'
import { type AllowedParentResource, type AllowedResourceType } from 'App'

/**
Expand All @@ -22,20 +22,19 @@ export const fetchResources = async ({
resourceType: AllowedResourceType | AllowedParentResource
hint?: string
}): Promise<InputSelectValue[]> => {
// @ts-expect-error Expression produces a union type that is too complex to represent
const fetchedResources = await sdkClient[resourceType].list({
fields: {
[resourceType]: ['id', 'name']
},
filters:
hint != null
? {
name_cont: hint
}
: undefined,
pageSize: 25,
// @ts-expect-error Expression produces a union type that is too complex to represent
sort: {
created_at: 'desc'
},
pageSize: 25
}
})
return adaptApiToSuggestions(fetchedResources)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/mocks/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Resource } from '@commercelayer/sdk/lib/cjs/resource'
import type { Resource } from '@commercelayer/sdk'

export * from './resources/imports'

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/mocks/resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ResourceTypeLock } from '@commercelayer/sdk/lib/cjs/api'
import type { ResourceTypeLock } from '@commercelayer/sdk'

interface GenericResource<T> {
readonly type: T
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/utils/validateParentResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async function fetchPromotionWithCouponPromotionRule(
return await sdkClient.promotions.retrieve(promotionId, {
fields: {
promotions: ['id', 'name', 'coupon_codes_promotion_rule'],
// @ts-expect-error this is a valid field
coupon_codes_promotion_rule: ['id']
},
include: ['coupon_codes_promotion_rule']
Expand Down
3 changes: 1 addition & 2 deletions packages/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
"*.config.cjs",
".eslintrc.cjs",
"@typing/**/*.d.ts",
"public/config*.js",
"vite.config.mts"
"public/config*.js"
],
"references": [
{
Expand Down
7 changes: 3 additions & 4 deletions packages/app/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import { defineConfig } from 'vitest/config'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const basePath =
isEmpty(env.PUBLIC_PROJECT_PATH) === true
? '/'
: `/${env.PUBLIC_PROJECT_PATH}/`
const basePath = isEmpty(env.PUBLIC_PROJECT_PATH)
? '/'
: `/${env.PUBLIC_PROJECT_PATH}/`

return {
plugins: [react(), tsconfigPaths()],
Expand Down
Loading

0 comments on commit 9e0d66a

Please sign in to comment.