chore(): Update dependencies usage (#13910)

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* fix for wxios 1.6

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* push scripts

* update build concurrency

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* chore(): Update dependencies usage

* fixes

* update yarn

* fixes

* fix script

* Create heavy-suns-tickle.md

* update changeset

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
Adrien de Peretti
2025-10-31 16:44:14 +01:00
committed by GitHub
parent 4e5b318583
commit 224ab39a81
90 changed files with 2431 additions and 6666 deletions

View File

@@ -0,0 +1,77 @@
---
"@medusajs/admin-bundler": "patch"
"@medusajs/admin-sdk": "patch"
"@medusajs/admin-shared": "patch"
"@medusajs/admin-vite-plugin": "patch"
"@medusajs/analytics": "patch"
"@medusajs/analytics-local": "patch"
"@medusajs/analytics-posthog": "patch"
"@medusajs/api-key": "patch"
"@medusajs/auth": "patch"
"@medusajs/auth-emailpass": "patch"
"@medusajs/auth-github": "patch"
"@medusajs/auth-google": "patch"
"@medusajs/cache-inmemory": "patch"
"@medusajs/cache-redis": "patch"
"@medusajs/caching": "patch"
"@medusajs/caching-redis": "patch"
"@medusajs/cart": "patch"
"@medusajs/cli": "patch"
"@medusajs/core-flows": "patch"
"@medusajs/currency": "patch"
"@medusajs/customer": "patch"
"@medusajs/dashboard": "patch"
"@medusajs/deps": "patch"
"@medusajs/draft-order": "patch"
"@medusajs/event-bus-local": "patch"
"@medusajs/event-bus-redis": "patch"
"@medusajs/file": "patch"
"@medusajs/file-local": "patch"
"@medusajs/file-s3": "patch"
"@medusajs/framework": "patch"
"@medusajs/fulfillment": "patch"
"@medusajs/fulfillment-manual": "patch"
"@medusajs/icons": "patch"
"@medusajs/index": "patch"
"@medusajs/inventory": "patch"
"@medusajs/js-sdk": "patch"
"@medusajs/link-modules": "patch"
"@medusajs/locking": "patch"
"@medusajs/locking-postgres": "patch"
"@medusajs/locking-redis": "patch"
"@medusajs/medusa": "patch"
"@medusajs/medusa-oas-cli": "patch"
"@medusajs/modules-sdk": "patch"
"@medusajs/notification": "patch"
"@medusajs/notification-local": "patch"
"@medusajs/notification-sendgrid": "patch"
"@medusajs/oas-github-ci": "patch"
"@medusajs/orchestration": "patch"
"@medusajs/order": "patch"
"@medusajs/payment": "patch"
"@medusajs/payment-stripe": "patch"
"@medusajs/pricing": "patch"
"@medusajs/product": "patch"
"@medusajs/promotion": "patch"
"@medusajs/region": "patch"
"@medusajs/sales-channel": "patch"
"@medusajs/settings": "patch"
"@medusajs/stock-location": "patch"
"@medusajs/store": "patch"
"@medusajs/tax": "patch"
"@medusajs/telemetry": "patch"
"@medusajs/test-utils": "patch"
"@medusajs/toolbox": "patch"
"@medusajs/types": "patch"
"@medusajs/ui": "patch"
"@medusajs/ui-preset": "patch"
"@medusajs/user": "patch"
"@medusajs/utils": "patch"
"@medusajs/workflow-engine-inmemory": "patch"
"@medusajs/workflow-engine-redis": "patch"
"@medusajs/workflows-sdk": "patch"
"create-medusa-app": "patch"
"medusa-dev-cli": "patch"
---
chore(): Dependencies cleanup and improvements

View File

@@ -180,7 +180,6 @@ module.exports = {
],
extends: [
"plugin:react/recommended",
"plugin:storybook/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
],

View File

@@ -30,7 +30,7 @@
"pg": "^8.11.3"
},
"devDependencies": {
"@swc/core": "^1.4.8",
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"typescript": "^5.6.2"

View File

@@ -174,6 +174,12 @@ medusaIntegrationTestRunner({
)
.catch((e) => e.message)
// With axios 1.6+, the 'auth' field takes precedence over headers
// So we need to manually construct the Basic auth header and let adminHeaders override it
const basicAuthHeader = `Basic ${Buffer.from(
created.data.api_key.token + ":"
).toString("base64")}`
const createdRegion = await api.post(
`/admin/regions`,
{
@@ -182,10 +188,10 @@ medusaIntegrationTestRunner({
countries: ["us", "ca"],
},
{
auth: {
username: created.data.api_key.token,
headers: {
Authorization: basicAuthHeader, // Try revoked API key first
...adminHeaders.headers, // This will override with valid Bearer token
},
...adminHeaders,
}
)

View File

@@ -39,7 +39,7 @@
},
"devDependencies": {
"@medusajs/types": "workspace:^",
"@swc/core": "^1.4.8",
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"json-2-csv": "^5.5.9",

View File

@@ -44,7 +44,7 @@
},
"devDependencies": {
"@medusajs/types": "workspace:^",
"@swc/core": "^1.4.8",
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"typescript": "^5.6.2"

View File

@@ -17,7 +17,7 @@
"get-port": "^7.1.0",
"@medusajs/medusa": "^1.20.10",
"@medusajs/core-flows": "^0.0.10",
"axios": "^1.7.7",
"axios": "^1.12.0",
"scrypt-kdf": "^2.0.1",
"jsonwebtoken": "^9.0.2",
"@medusajs/framework": "^1.0.1",

View File

@@ -20,9 +20,10 @@
]
},
"devDependencies": {
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"axios": "^0.21.4",
"axios": "^1.12.0",
"axios-mock-adapter": "^1.19.0",
"cross-env": "^7.0.3",
"eslint": "^8.23.0",
@@ -32,7 +33,6 @@
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-unused-imports": "^2.0.0",
"express": "^4.17.1",
"get-port": "^5.1.1",
@@ -40,21 +40,21 @@
"import-from": "^3.0.0",
"jest": "^29.7.0",
"lint-staged": "^11.2.6",
"microbundle": "^0.13.3",
"pg-god": "^1.0.12",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.2.3",
"resolve-cwd": "^3.0.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"turbo": "^1.6.3"
"turbo": "^1.6.3",
"typescript": "^5.6.2"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "yarn run lint",
"*.{md,yaml,yml}": "prettier --write"
},
"scripts": {
"build": "turbo run build --concurrency=50% --no-daemon",
"build": "turbo run build --concurrency=100% --no-daemon",
"lint": "eslint --ignore-path .eslintignore --ext .js,.ts,.tsx .",
"lint:path": "eslint --ignore-path .eslintignore --ext .js,.ts,.tsx",
"prettier": "prettier",
@@ -86,6 +86,8 @@
"@redocly/cli/react-dom": "^17.0.1",
"pg": "8.16.3",
"@changesets/assemble-release-plan@^6.0.0": "patch:@changesets/assemble-release-plan@npm:^6.0.0#.yarn/patches/changesets.patch",
"@changesets/get-github-info@^0.5.2": "patch:@changesets/get-github-info@npm:^0.5.2#.yarn/patches/changesets-github-info.patch"
"@changesets/get-github-info@^0.5.2": "patch:@changesets/get-github-info@npm:^0.5.2#.yarn/patches/changesets-github-info.patch",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25"
}
}

View File

@@ -20,23 +20,23 @@
"devDependencies": {
"@medusajs/types": "2.11.2",
"@types/compression": "^1.7.5",
"express": "^4.21.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"@types/express": "^4.17.21",
"tsup": "^8.4.0",
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/admin-shared": "2.11.2",
"@medusajs/admin-vite-plugin": "2.11.2",
"@medusajs/dashboard": "2.11.2",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"compression": "^1.7.4",
"autoprefixer": "^10.4.19",
"compression": "^1.8.0",
"express": "^4.21.0",
"get-port": "^5.1.1",
"glob": "^10.3.10",
"glob": "^10.4.5",
"outdent": "^0.8.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"vite": "^5.4.14"
},
"packageManager": "yarn@3.2.1"

View File

@@ -20,8 +20,8 @@
},
"devDependencies": {
"@types/react": "^18.3.2",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"tsup": "^8.4.0",
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/admin-shared": "2.11.2",

View File

@@ -20,8 +20,8 @@
},
"devDependencies": {
"@types/react": "^18.3.2",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
"tsup": "^8.4.0",
"typescript": "^5.6.2"
},
"packageManager": "yarn@3.2.1"
}

View File

@@ -6,9 +6,9 @@
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": "./dist/index.js"
}
},
"repository": {
@@ -27,14 +27,14 @@
"test:watch": "vitest"
},
"devDependencies": {
"@types/node": "^20.10.4",
"tsup": "8.0.1",
"typescript": "5.3.3",
"@types/node": "^20.12.11",
"tsup": "^8.4.0",
"typescript": "^5.6.2",
"vite": "^5.4.14",
"vitest": "^3.0.5"
},
"peerDependencies": {
"vite": "^5.0.0"
"vite": "^5.4.14"
},
"dependencies": {
"@babel/parser": "7.25.6",

View File

@@ -17,9 +17,9 @@
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/app.mjs",
"require": "./dist/app.js",
"types": "./dist/index.d.ts"
"require": "./dist/app.js"
},
"./css": {
"import": "./dist/app.css",
@@ -40,6 +40,7 @@
],
"dependencies": {
"@ariakit/react": "^0.4.15",
"@babel/runtime": "^7.26.10",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
@@ -61,15 +62,17 @@
"i18next": "23.7.11",
"i18next-browser-languagedetector": "7.2.0",
"i18next-http-backend": "2.4.2",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"lodash.set": "^4.3.2",
"match-sorter": "^6.3.4",
"motion": "^11.15.0",
"qs": "^6.12.0",
"qs": "^6.12.1",
"radix-ui": "1.1.2",
"react": "^18.2.0",
"react": "^18.3.1",
"react-country-flag": "^3.1.0",
"react-currency-input-field": "^3.6.11",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-helmet-async": "^2.0.5",
"react-hook-form": "7.49.1",
"react-i18next": "13.5.0",
@@ -82,17 +85,19 @@
"@medusajs/admin-vite-plugin": "2.11.2",
"@medusajs/types": "2.11.2",
"@medusajs/ui-preset": "2.11.2",
"@types/node": "^20.11.15",
"@types/react": "^18.2.79",
"@types/lodash.debounce": "^4.0.9",
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^20.12.11",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "4.2.1",
"@vitejs/plugin-react": "^4.2.1",
"ajv": "^8.17.1",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.33",
"prettier": "^3.1.1",
"tailwindcss": "^3.4.1",
"tsup": "^8.0.2",
"typescript": "5.2.2",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"prettier": "^2.8.8",
"tailwindcss": "^3.4.3",
"tsup": "^8.4.0",
"typescript": "^5.6.2",
"vite": "^5.4.14",
"vite-plugin-inspect": "^0.8.7",
"vitest": "^3.0.5"

View File

@@ -1,5 +1,4 @@
import get from "lodash/get"
import set from "lodash/set"
import set from "lodash.set"
import { useCallback } from "react"
import { FieldValues, Path, PathValue, UseFormReturn } from "react-hook-form"
@@ -18,7 +17,7 @@ type UseDataGridFormHandlersOptions<TData, TFieldValues extends FieldValues> = {
export const useDataGridFormHandlers = <
TData,
TFieldValues extends FieldValues
TFieldValues extends FieldValues,
>({
matrix,
form,
@@ -140,7 +139,7 @@ function convertToggleableNumber(value: any): {
}
function setValue<
T extends DataGridToggleableNumber = DataGridToggleableNumber
T extends DataGridToggleableNumber = DataGridToggleableNumber,
>(
currentValues: any,
field: string,
@@ -162,7 +161,9 @@ function setValueToggleableNumber(
newValue: DataGridToggleableNumber,
isHistory?: boolean
) {
const currentValue = get(currentValues, field)
const currentValue = field
.split(".")
.reduce((obj, key) => obj?.[key], currentValues)
const { disabledToggle } = currentValue
const normalizeQuantity = (value: number | string | null | undefined) => {

View File

@@ -1,5 +1,5 @@
import { Input } from "@medusajs/ui"
import { debounce } from "lodash"
import debounce from "lodash.debounce"
import { ChangeEvent, useCallback, useEffect, useState } from "react"
import { useTranslation } from "react-i18next"
import { useSearchParams } from "react-router-dom"

View File

@@ -1,6 +1,6 @@
import { EllipseMiniSolid } from "@medusajs/icons"
import { DatePicker, Text, clx } from "@medusajs/ui"
import isEqual from "lodash/isEqual"
import isEqual from "lodash.isequal"
import { Popover as RadixPopover } from "radix-ui"
import { useMemo, useState } from "react"

View File

@@ -1,6 +1,6 @@
import { EllipseMiniSolid } from "@medusajs/icons"
import { Input, Label, clx } from "@medusajs/ui"
import { debounce } from "lodash"
import debounce from "lodash.debounce"
import {
Popover as RadixPopover,
RadioGroup as RadixRadioGroup,

View File

@@ -1,5 +1,5 @@
import { Input, Label, clx } from "@medusajs/ui"
import { debounce } from "lodash"
import debounce from "lodash.debounce"
import { Popover as RadixPopover } from "radix-ui"
import { ChangeEvent, useCallback, useEffect, useState } from "react"
import { useSelectedParams } from "../hooks"

View File

@@ -2,7 +2,7 @@ import { Input } from "@medusajs/ui"
import { ChangeEvent, useCallback, useEffect } from "react"
import { useTranslation } from "react-i18next"
import { debounce } from "lodash"
import debounce from "lodash.debounce"
import { useSelectedParams } from "../hooks"
type DataTableSearchProps = {

View File

@@ -1,4 +1,4 @@
import debounce from "lodash/debounce"
import debounce from "lodash.debounce"
import { useCallback, useEffect, useState } from "react"
/**

View File

@@ -1,4 +1,4 @@
import debounceFn from "lodash/debounce"
import { default as debounceFn } from "lodash.debounce"
import { useCallback, useContext, useEffect, useState } from "react"
import { useTranslation } from "react-i18next"
import { useNavigate } from "react-router-dom"

View File

@@ -15,18 +15,18 @@
"dependencies": {
"@medusajs/deps": "2.11.2",
"@medusajs/telemetry": "2.11.2",
"boxen": "^5",
"chalk": "^5.2.0",
"commander": "^10.0.1",
"inquirer": "^9.2.2",
"boxen": "^5.0.1",
"chalk": "^4.1.2",
"commander": "^11.0.0",
"inquirer": "^8.0.0",
"nanoid": "^4.0.2",
"node-emoji": "^2.0.2",
"node-fetch": "^3.3.1",
"open": "^9.1.0",
"ora": "^6.3.0",
"ora": "^5.4.1",
"slugify": "^1.6.6",
"uuid": "^9.0.0",
"validator": "^13.9.0",
"validator": "^13.15.20",
"wait-on": "^7.0.1",
"winston": "^3.9.0"
},
@@ -42,13 +42,13 @@
"@types/wait-on": "^5.3.1",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"configstore": "^6.0.0",
"configstore": "^5.0.1",
"eslint": "^8.40.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
},
"engines": {

View File

@@ -43,15 +43,15 @@
"@medusajs/deps": "2.11.2",
"@medusajs/telemetry": "2.11.2",
"@medusajs/utils": "2.11.2",
"@types/express": "^4.17.17",
"chalk": "^4.0.0",
"configstore": "5.0.1",
"@types/express": "^4.17.21",
"chalk": "^4.1.2",
"configstore": "^5.0.1",
"dotenv": "^16.4.5",
"execa": "^5.1.1",
"express": "^4.21.0",
"fs-exists-cached": "^1.0.0",
"fs-extra": "^10.0.0",
"glob": "^10.3.10",
"fs-extra": "^11.1.1",
"glob": "^10.4.5",
"hosted-git-info": "^4.0.2",
"inquirer": "^8.0.0",
"is-valid-path": "^0.1.1",
@@ -62,8 +62,8 @@
"resolve-cwd": "^3.0.0",
"stack-trace": "^0.0.10",
"ulid": "^2.3.0",
"winston": "^3.8.2",
"yargs": "^15.3.1"
"winston": "^3.9.0",
"yargs": "^17.7.2"
},
"gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808"
}

View File

@@ -14,21 +14,21 @@
"configstore": "^5.0.1",
"del": "^6.0.0",
"dotenv": "^16.4.5",
"execa": "^4.1.0",
"execa": "^5.1.1",
"find-yarn-workspace-root": "^2.0.0",
"fs-extra": "^9.0.1",
"glob": "^8.1.0",
"fs-extra": "^11.1.1",
"glob": "^10.4.5",
"got": "^11.8.6",
"lodash": "^4.17.21",
"signal-exit": "^3.0.7",
"verdaccio": "^4.10.0",
"yargs": "^15.4.1"
"verdaccio": "^5.0.0",
"yargs": "^17.7.2"
},
"devDependencies": {
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"typescript": "^5.3.3"
"typescript": "^5.6.2"
},
"peerDependencies": {
"ts-node": "^10.9.2",

View File

@@ -23,11 +23,13 @@
"devDependencies": {
"@medusajs/types": "2.11.2",
"@types/js-yaml": "^4.0.9",
"jest": "^29.1.0",
"@types/lodash.mergewith": "^4.6.9",
"@types/node": "^20.12.11",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "4.9.5",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"uuid": "^9.0.0"
},
"scripts": {
@@ -39,11 +41,10 @@
"@medusajs/utils": "2.11.2",
"@readme/json-schema-ref-parser": "^1.2.0",
"@readme/openapi-parser": "^2.4.0",
"@redocly/cli": "^1.7.0",
"@types/lodash": "^4.14.191",
"commander": "^10.0.0",
"execa": "1.0.0",
"lodash": "^4.17.21",
"@redocly/cli": "1.25.3",
"commander": "^11.0.0",
"execa": "^5.1.1",
"lodash.mergewith": "^4.6.2",
"openapi3-ts": "^3.1.2",
"swagger-inline": "^6.1.0",
"yargs": "^17.7.2"

View File

@@ -6,8 +6,10 @@ import { commandWrapper } from "@redocly/cli/lib/wrapper"
import { Command, Option, OptionValues } from "commander"
import execa from "execa"
import fs, { mkdir } from "fs/promises"
import { isArray, mergeWith } from "lodash"
import mergeWith from "lodash.mergewith"
import * as path from "path"
import yargs from "yargs"
import {
formatHintRecommendation,
getCircularPatchRecommendation,
@@ -21,7 +23,6 @@ import {
writeYaml,
writeYamlFromJson,
} from "./utils/yaml-utils"
import yargs from "yargs"
/**
* Constants
@@ -201,7 +202,7 @@ const mergeConfig = async (
: await readJson(configFileCustom)
const config = mergeWith(configDefault, configCustom, (objValue, srcValue) =>
isArray(objValue) ? objValue.concat(srcValue) : undefined
Array.isArray(objValue) ? objValue.concat(srcValue) : undefined
) as RedoclyConfig
await writeYamlFromJson(configFileOut, config)

View File

@@ -1,5 +1,5 @@
import { upperCaseFirst } from "@medusajs/utils"
import { OpenAPIObject } from "openapi3-ts"
import { upperFirst } from "lodash"
export async function combineOAS(
adminOAS: OpenAPIObject,
@@ -71,7 +71,9 @@ function prepareOASForCombine(
apiType: ApiType
): OpenAPIObject {
console.log(
`🔵 Prefixing ${apiType} tags and operationId with ${upperFirst(apiType)}`
`🔵 Prefixing ${apiType} tags and operationId with ${upperCaseFirst(
apiType
)}`
)
for (const pathKey in oas.paths) {
for (const operationKey in oas.paths[pathKey]) {
@@ -110,9 +112,9 @@ function prepareOASForCombine(
}
function getPrefixedTagName(tagName: string, apiType: ApiType): string {
return `${upperFirst(apiType)} ${tagName}`
return `${upperCaseFirst(apiType)} ${tagName}`
}
function getPrefixedOperationId(operationId: string, apiType: ApiType): string {
return `${upperFirst(apiType)}${operationId}`
return `${upperCaseFirst(apiType)}${operationId}`
}

View File

@@ -43,6 +43,7 @@
"./opentelemetry/sdk-node": "./dist/deps/opentelemetry-sdk-node.js",
"./opentelemetry/sdk-trace-node": "./dist/deps/opentelemetry-sdk-trace-node.js",
"./opentelemetry/resources": "./dist/deps/opentelemetry-resources.js",
"./opentelemetry/api": "./dist/deps/opentelemetry-api.js",
"./awilix": "./dist/deps/awilix.js",
"./pg": "./dist/deps/pg.js"
},
@@ -75,7 +76,7 @@
"connect-dynamodb": "^3.0.5",
"ioredis": "^5.4.1",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.1",
"supertest": "^4.0.2",
"typescript": "^5.6.2",
"vite": "^5.4.14"
@@ -89,20 +90,19 @@
"@medusajs/types": "2.11.2",
"@medusajs/utils": "2.11.2",
"@medusajs/workflows-sdk": "2.11.2",
"@opentelemetry/api": "^1.9.0",
"@types/express": "^4.17.17",
"chokidar": "^3.4.2",
"compression": "1.8.0",
"@types/express": "^4.17.21",
"chokidar": "^3.5.3",
"compression": "^1.8.0",
"connect-redis": "5.2.0",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"express": "^4.21.0",
"express-session": "^1.17.3",
"glob": "10.4.5",
"glob": "^10.4.5",
"jsonwebtoken": "^9.0.2",
"lodash": "4.17.21",
"lodash.memoize": "^4.1.2",
"morgan": "^1.9.1",
"path-to-regexp": "^0.1.10",
"path-to-regexp": "^0.1.12",
"tsconfig-paths": "^4.2.0",
"zod": "3.25.76",
"zod-validation-error": "3.5.1"

View File

@@ -0,0 +1 @@
export * from "@medusajs/deps/opentelemetry/api"

View File

@@ -1,4 +1,4 @@
import { memoize } from "lodash"
import memoize from "lodash.memoize"
import logger from "@medusajs/cli/dist/reporter"
import { json, NextFunction, RequestHandler, text, urlencoded } from "express"

View File

@@ -5,8 +5,8 @@ import {
MedusaError,
buildOrder,
stringToSelectRelationObject,
pickDeep,
} from "@medusajs/utils"
import { pick } from "lodash"
export function pickByConfig<TModel>(
obj: TModel | TModel[],
@@ -16,9 +16,9 @@ export function pickByConfig<TModel>(
if (fields.length) {
if (Array.isArray(obj)) {
return obj.map((o) => pick(o, fields))
return obj.map((o) => pickDeep(o as object, fields as string[]))
} else {
return pick(obj, fields)
return pickDeep(obj as object, fields as string[])
}
}
return obj

View File

@@ -1,7 +1,6 @@
import { BaseEntity, QueryConfig, RequestQueryFields } from "@medusajs/types"
import { MedusaError, removeUndefinedProperties } from "@medusajs/utils"
import { NextFunction } from "express"
import { omit } from "lodash"
import { z } from "zod"
import { zodValidator } from "../../zod/zod-helpers"
@@ -50,8 +49,8 @@ const normalizeQuery = (req: MedusaRequest) => {
* @param obj
*/
const getFilterableFields = <T extends RequestQueryFields>(obj: T): T => {
const result = omit(obj, ["limit", "offset", "fields", "order"]) as T
return removeUndefinedProperties(result)
const { limit, offset, fields, order, ...result } = obj
return removeUndefinedProperties(result) as T
}
export function validateAndTransformQuery<TEntity extends BaseEntity>(

View File

@@ -4,7 +4,7 @@ import {
trace,
context,
propagation,
} from "@opentelemetry/api"
} from "../deps/opentelemetry-api"
/**
* Tracer creates an instrumentation scope within the application

View File

@@ -45,7 +45,7 @@
},
"peerDependencies": {
"ioredis": "^5.4.1",
"vite": "^5 || ^6"
"vite": "^5.4.14"
},
"peerDependenciesMeta": {
"ioredis": {

View File

@@ -1,8 +1,10 @@
import { BigNumberInput, BigNumberRawValue, IBigNumber } from "@medusajs/types"
import { BigNumber as BigNumberJS } from "bignumber.js"
import { BigNumber as BigNumberConstructor } from "bignumber.js"
import { isBigNumber } from "../common/is-big-number"
import { isString } from "../common/is-string"
type BigNumberJS = InstanceType<typeof BigNumberConstructor>
const BigNumberJS = BigNumberConstructor
export class BigNumber implements IBigNumber {
static DEFAULT_PRECISION = 20

View File

@@ -1,9 +1,12 @@
import { BigNumberInput, BigNumberRawValue } from "@medusajs/types"
import { BigNumber as BigNumberJS } from "bignumber.js"
import { BigNumber as BigNumberConstructor } from "bignumber.js"
import { isDefined } from "../common"
import { BigNumber } from "./big-number"
type BigNumberJS = InstanceType<typeof BigNumberConstructor>
type BNInput = BigNumberInput | BigNumber
const BigNumberJS = BigNumberConstructor
export class MathBN {
static convert(num: BNInput, decimalPlaces?: number): BigNumberJS {
if (num == null) {
@@ -22,10 +25,10 @@ export class MathBN {
}
if (decimalPlaces) {
num_ = num_.decimalPlaces(decimalPlaces)
num_ = (num_ as BigNumberJS).decimalPlaces(decimalPlaces)
}
return num_
return num_ as BigNumberJS
}
static add(...nums: BNInput[]): BigNumberJS {

View File

@@ -23,6 +23,7 @@
"./opentelemetry/sdk-node": "./dist/opentelemetry-sdk-node.js",
"./opentelemetry/sdk-trace-node": "./dist/opentelemetry-sdk-trace-node.js",
"./opentelemetry/resources": "./dist/opentelemetry-resources.js",
"./opentelemetry/api": "./dist/opentelemetry-api.js",
"./mikro-orm/cli": "./dist/mikro-orm-cli.js",
"./mikro-orm/core": "./dist/mikro-orm-core.js",
"./mikro-orm/knex": "./dist/mikro-orm-knex.js",
@@ -42,10 +43,11 @@
"@mikro-orm/knex": "6.4.16",
"@mikro-orm/migrations": "6.4.16",
"@mikro-orm/postgresql": "6.4.16",
"@opentelemetry/instrumentation-pg": "^0.44.0",
"@opentelemetry/resources": "^1.26.0",
"@opentelemetry/sdk-node": "^0.53.0",
"@opentelemetry/sdk-trace-node": "^1.26.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/instrumentation-pg": "^0.52.0",
"@opentelemetry/resources": "^2.0.0",
"@opentelemetry/sdk-node": "^0.200.0",
"@opentelemetry/sdk-trace-node": "^2.0.0",
"awilix": "^8.0.1",
"pg": "^8.16.3"
},

View File

@@ -0,0 +1 @@
export * from "@opentelemetry/api"

View File

@@ -36,26 +36,25 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jsdom": "^21.1.1",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"esbuild": "^0.18.11",
"eslint": "^7.32.0",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"esbuild": "^0.25.0",
"eslint": "^8.40.0",
"jsdom": "^22.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"resize-observer-polyfill": "^1.5.1",
"rimraf": "^5.0.1",
"rollup": "^3.26.0",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-license": "^3.0.1",
"rollup-plugin-ts": "^3.2.0",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.1.6",
"typescript": "^5.6.2",
"vite": "^5.4.14",
"vitest": "^3.0.5"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
"react": "^18.3.1"
},
"packageManager": "yarn@3.2.1",
"publishConfig": {

View File

@@ -2,7 +2,6 @@ import bundleSize from "@atomico/rollup-plugin-sizes"
import nodeResolve from "@rollup/plugin-node-resolve"
import replace from "@rollup/plugin-replace"
import esbuild from "rollup-plugin-esbuild"
import license from "rollup-plugin-license"
import { visualizer } from "rollup-plugin-visualizer"
import fs from "fs"
import path from "path"
@@ -15,9 +14,6 @@ const plugins = (pkg, minify, esbuildOptions = {}) =>
minify,
...esbuildOptions,
}),
license({
banner: `${pkg.name} v${pkg.version} - ${pkg.license}`,
}),
bundleSize(),
visualizer({
sourcemap: true,
@@ -78,6 +74,7 @@ const configs = bundles
external: ["react", "prop-types"],
output: {
name: packageName,
banner: `/* ${pkg.name} v${pkg.version} - ${pkg.license} */`,
...(preserveModules
? {
dir: `${outputDir}/${format}`,

View File

@@ -14,20 +14,20 @@
"@svgr/plugin-jsx": "8.0.1",
"@svgr/plugin-prettier": "8.0.1",
"@svgr/plugin-svgo": "8.0.1",
"axios": "^0.24.0",
"axios": "^1.12.0",
"axios-retry": "^3.1.9",
"commander": "11.0.0",
"commander": "^11.0.0",
"dotenv": "^16.4.5",
"fs-extra": "11.1.1",
"picocolors": "^1.0.0",
"fs-extra": "^11.1.1",
"picocolors": "^1.1.0",
"ts-dedent": "2.2.0"
},
"devDependencies": {
"@types/fs-extra": "11.0.1",
"@types/react": "^18.2.14",
"eslint": "7.32.0",
"react": "^18.2.0",
"tsup": "7.1.0",
"typescript": "5.1.6"
"@types/react": "^18.3.2",
"eslint": "^8.40.0",
"react": "^18.3.1",
"tsup": "^8.4.0",
"typescript": "^5.6.2"
}
}

View File

@@ -27,13 +27,13 @@
"tailwindcss-animate": "^1.0.6"
},
"peerDependencies": {
"tailwindcss": ">=3.0.0"
"tailwindcss": "^3.4.3"
},
"devDependencies": {
"@medusajs/toolbox": "2.11.2",
"tailwindcss": "^3.4.1",
"tsup": "^7.1.0",
"typescript": "^5.1.6"
"tailwindcss": "^3.4.3",
"tsup": "^8.4.0",
"typescript": "^5.6.2"
},
"publishConfig": {
"access": "public"

View File

@@ -57,14 +57,14 @@
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jsdom": "^21.1.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@vitejs/plugin-react": "^4.0.1",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^0.32.2",
"autoprefixer": "^10.4.19",
"chromatic": "^6.20.0",
"eslint": "^7.32.0",
"eslint-plugin-storybook": "^0.6.12",
"eslint": "^8.40.0",
"eslint-plugin-storybook": "^10.0.1",
"jsdom": "^22.1.0",
"postcss": "^8.4.38",
"prop-types": "^15.8.1",
@@ -75,15 +75,15 @@
"storybook": "^8.3.5",
"tailwindcss": "^3.4.3",
"tsc-alias": "^1.8.7",
"typescript": "^5.1.6",
"typescript": "^5.6.2",
"vite": "^5.4.14",
"vite-plugin-turbosnap": "^1.0.2",
"vitest": "^3.0.5"
},
"dependencies": {
"@dnd-kit/core": "^6.0.0",
"@dnd-kit/sortable": "^7.0.0",
"@dnd-kit/utilities": "^3.2.0",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@medusajs/icons": "2.11.2",
"@radix-ui/react-dialog": "1.1.4",
"@radix-ui/react-dismissable-layer": "1.1.4",
@@ -92,7 +92,7 @@
"copy-to-clipboard": "^3.3.3",
"cva": "1.0.0-beta.1",
"prism-react-renderer": "^2.0.6",
"prismjs": "^1.29.0",
"prismjs": "^1.30.0",
"radix-ui": "1.1.2",
"react-aria": "^3.33.1",
"react-currency-input-field": "^3.6.11",
@@ -101,8 +101,8 @@
"tailwind-merge": "^2.2.1"
},
"peerDependencies": {
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
"react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"browserslist": [
"last 3 chrome versions",

View File

@@ -10,6 +10,7 @@ import { cva } from "cva"
import * as React from "react"
import {
DateValue,
TimeValue,
useDatePicker,
useInteractOutside,
type AriaDatePickerProps as BaseDatePickerProps,
@@ -187,7 +188,7 @@ const DatePicker = React.forwardRef<HTMLDivElement, DatePickerProps>(
<div className="p-3">
<TimeInput
value={state.timeValue}
onChange={state.setTimeValue}
onChange={(value) => state.setTimeValue(value as TimeValue)}
hourCycle={props.hourCycle}
/>
</div>

View File

@@ -37,24 +37,24 @@ const Toaster = ({
/**
* The time in milliseconds that a toast is shown before it's
* automatically dismissed.
*
*
* @defaultValue 4000
*/
duration,
...props
}: ToasterProps) => {
return (
<Primitive
position={position}
gap={gap}
offset={offset}
cn={clx}
toastOptions={{
duration,
}}
{...props}
/>
)
const primitiveProps = {
...props,
position,
gap,
offset,
cn: clx,
toastOptions: {
duration,
},
} as React.ComponentPropsWithoutRef<typeof Primitive>
return <Primitive {...primitiveProps} />
}
export { Toaster }

View File

@@ -23,7 +23,7 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"nodemon": "^2.0.20",
"rimraf": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^5.6.2"
},
"scripts": {
@@ -36,16 +36,16 @@
"test": "jest --passWithNoTests src"
},
"dependencies": {
"@babel/runtime": "^7.22.10",
"axios": "^0.21.4",
"@babel/runtime": "^7.26.10",
"axios": "^1.12.0",
"axios-retry": "^3.1.9",
"boxen": "^5.0.1",
"ci-info": "^3.2.0",
"configstore": "5.0.1",
"configstore": "^5.0.1",
"global": "^4.4.0",
"is-docker": "^2.2.1",
"remove-trailing-slash": "^0.1.1",
"uuid": "^8.3.2"
"uuid": "^9.0.0"
},
"gitHead": "41a5425405aea5045a26def95c0dc00cf4a5a44d"
}

View File

@@ -28,14 +28,14 @@
"@medusajs/framework": "2.11.2",
"jest": "^29.7.0",
"pg-god": "^1.0.12",
"rimraf": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^5.6.2"
},
"dependencies": {
"@types/express": "^4.17.17",
"axios": "^0.21.4",
"@types/express": "^4.17.21",
"axios": "^1.12.0",
"express": "^4.21.0",
"get-port": "^5.1.0",
"get-port": "^5.1.1",
"randomatic": "^3.1.1"
},
"peerDependencies": {

View File

@@ -50,22 +50,17 @@
},
"devDependencies": {
"@medusajs/framework": "2.11.2",
"@opentelemetry/instrumentation-pg": "^0.52.0",
"@opentelemetry/resources": "^2.0.0",
"@opentelemetry/sdk-node": "^0.200.0",
"@opentelemetry/sdk-trace-node": "^2.0.0",
"@swc/core": "1.5.7",
"@swc/core": "^1.7.28",
"@swc/helpers": "^0.5.11",
"@swc/jest": "^0.2.36",
"@types/express": "^4.17.17",
"@types/express": "^4.17.21",
"@types/jsonwebtoken": "^8.5.9",
"@types/lodash": "^4.14.191",
"@types/multer": "^1.4.7",
"@types/multer": "^2.0.0",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"supertest": "^4.0.2",
"typescript": "^5.6.2",
"yalc": "1.0.0-pre.53"
"yalc": "^1.0.0-pre.53"
},
"dependencies": {
"@inquirer/checkbox": "^2.3.11",
@@ -120,18 +115,16 @@
"@medusajs/user": "2.11.2",
"@medusajs/workflow-engine-inmemory": "2.11.2",
"@medusajs/workflow-engine-redis": "2.11.2",
"@opentelemetry/api": "^1.9.0",
"boxen": "^5.0.1",
"chalk": "^4.0.0",
"chokidar": "^3.4.2",
"compression": "^1.7.5",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"compression": "^1.8.0",
"express": "^4.21.0",
"fs-exists-cached": "^1.0.0",
"jsonwebtoken": "^9.0.2",
"lodash": "^4.17.21",
"multer": "^1.4.5-lts.1",
"multer": "^2.0.2",
"node-schedule": "^2.1.1",
"qs": "^6.11.2",
"qs": "^6.12.1",
"request-ip": "^3.3.0",
"slugify": "^1.6.6",
"uuid": "^9.0.0",
@@ -139,28 +132,12 @@
},
"peerDependencies": {
"@medusajs/framework": "2.11.2",
"@opentelemetry/instrumentation-pg": "^0.52.0",
"@opentelemetry/resources": "^2.0.0",
"@opentelemetry/sdk-node": "^0.200.0",
"@opentelemetry/sdk-trace-node": "^2.0.0",
"@swc/core": "1.5.7",
"@swc/core": "^1.7.28",
"posthog-node": "^4.17.1",
"react-dom": "^18.0.0",
"yalc": "1.0.0-pre.53"
"react-dom": "^18.3.1",
"yalc": "^1.0.0-pre.53"
},
"peerDependenciesMeta": {
"@opentelemetry/instrumentation-pg": {
"optional": true
},
"@opentelemetry/resources": {
"optional": true
},
"@opentelemetry/sdk-node": {
"optional": true
},
"@opentelemetry/sdk-trace-node": {
"optional": true
},
"@swc/core": {
"optional": true
},

View File

@@ -1,7 +1,6 @@
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
import { HttpTypes } from "@medusajs/framework/types"
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
import { isString } from "lodash"
import { ContainerRegistrationKeys, isString } from "@medusajs/framework/utils"
export const GET = async (
req: MedusaRequest<unknown>,

View File

@@ -5,15 +5,14 @@ import {
Query,
} from "@medusajs/framework"
import { ApiLoader } from "@medusajs/framework/http"
import { SpanStatusCode } from "@medusajs/framework/opentelemetry/api"
import type { NodeSDKConfiguration } from "@medusajs/framework/opentelemetry/sdk-node"
import type { SpanExporter } from "@medusajs/framework/opentelemetry/sdk-trace-node"
import { TransactionOrchestrator } from "@medusajs/framework/orchestration"
import { Tracer } from "@medusajs/framework/telemetry"
import { FeatureFlag } from "@medusajs/framework/utils"
import { SpanStatusCode } from "@opentelemetry/api"
import type { NodeSDKConfiguration } from "@opentelemetry/sdk-node"
import type { SpanExporter } from "@opentelemetry/sdk-trace-node"
import { snakeCase } from "lodash"
import CacheModule from "../modules/caching"
import { ICachingModuleService } from "@medusajs/framework/types"
import { camelToSnakeCase, FeatureFlag } from "@medusajs/framework/utils"
import CacheModule from "../modules/caching"
const EXCLUDED_RESOURCES = [".vite", "virtual:"]
@@ -30,7 +29,6 @@ function shouldExcludeResource(resource: string) {
export function instrumentHttpLayer() {
const startCommand = require("../commands/start")
const HTTPTracer = new Tracer("@medusajs/http", "2.0.0")
const { SpanStatusCode } = require("@opentelemetry/api")
startCommand.traceRequestHandler = async (
requestHandler,
@@ -110,7 +108,7 @@ export function instrumentHttpLayer() {
}
const traceName = `middleware: ${
handler.name ? snakeCase(handler.name) : `anonymous`
handler.name ? camelToSnakeCase(handler.name) : `anonymous`
}`
await HTTPTracer.trace(traceName, async (span) => {
@@ -135,7 +133,6 @@ export function instrumentHttpLayer() {
*/
export function instrumentRemoteQuery() {
const QueryTracer = new Tracer("@medusajs/query", "2.0.0")
const { SpanStatusCode } = require("@opentelemetry/api")
Query.instrument.graphQuery(async function (queryFn, queryOptions) {
return await QueryTracer.trace(
@@ -198,7 +195,7 @@ export function instrumentRemoteQuery() {
options
) {
return await QueryTracer.trace(
`${snakeCase(serviceName)}.${snakeCase(method)}`,
`${camelToSnakeCase(serviceName)}.${camelToSnakeCase(method)}`,
async (span) => {
span.setAttributes({
"fetch.select": options.select,
@@ -235,7 +232,7 @@ export function instrumentWorkflows() {
metadata
) => {
return await WorkflowsTracer.trace(
`workflow:${snakeCase(metadata.model_id)}`,
`workflow:${camelToSnakeCase(metadata.model_id)}`,
async function (span) {
span.setAttribute("workflow.transaction_id", metadata.transaction_id)
@@ -252,7 +249,7 @@ export function instrumentWorkflows() {
TransactionOrchestrator.traceStep = async (stepHandler, metadata) => {
return await WorkflowsTracer.trace(
`step:${snakeCase(metadata.action)}:${metadata.type}`,
`step:${camelToSnakeCase(metadata.action)}:${metadata.type}`,
async function (span) {
Object.entries(metadata).forEach(([key, value]) => {
span.setAttribute(`workflow.step.${key}`, value)
@@ -410,12 +407,16 @@ export function registerOtel(
const {
Resource,
resourceFromAttributes,
} = require("@opentelemetry/resources")
const { NodeSDK } = require("@opentelemetry/sdk-node")
const { SimpleSpanProcessor } = require("@opentelemetry/sdk-trace-node")
} = require("@medusajs/framework/opentelemetry/resources")
const { NodeSDK } = require("@medusajs/framework/opentelemetry/sdk-node")
const {
SimpleSpanProcessor,
} = require("@medusajs/framework/opentelemetry/sdk-trace-node")
if (instrument.db) {
const { PgInstrumentation } = require("@opentelemetry/instrumentation-pg")
const {
PgInstrumentation,
} = require("@medusajs/framework/opentelemetry/instrumentation-pg")
instrumentations.push(new PgInstrumentation())
}
if (instrument.http) {

View File

@@ -2,9 +2,9 @@ import { INotificationModuleService } from "@medusajs/framework/types"
import {
ContainerRegistrationKeys,
Modules,
pickValueFromObject,
promiseAll,
} from "@medusajs/framework/utils"
import { get } from "lodash"
import { SubscriberArgs, SubscriberConfig } from "../types/subscribers"
type HandlerConfig = {
@@ -60,11 +60,11 @@ export default async function configurableNotifications({
const notificationData = {
template: handler.template,
channel: handler.channel,
to: get(payload, handler.to),
to: pickValueFromObject(handler.to, payload),
trigger_type: handler.event,
resource_id: get(payload, handler.resource_id),
resource_id: pickValueFromObject(handler.resource_id, payload),
data: Object.entries(handler.data).reduce((acc, [key, value]) => {
acc[key] = get(payload, value)
acc[key] = pickValueFromObject(value, payload)
return acc
}, {}),
}

View File

@@ -37,8 +37,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -33,8 +33,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -42,8 +42,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -1,6 +1,5 @@
import LocalEventBusService from "../event-bus-local"
jest.genMockFromModule("events")
jest.mock("events")
const loggerMock = {

View File

@@ -10,8 +10,6 @@ import RedisEventBusService from "../event-bus-redis"
// maxRetriesPerRequest: 0,
// })
jest.genMockFromModule("bullmq")
jest.genMockFromModule("ioredis")
jest.mock("bullmq")
jest.mock("ioredis")

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -29,7 +29,7 @@
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.6",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -40,7 +40,7 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.6",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -37,8 +37,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -104,7 +104,7 @@ export function formatOrder<T = any>(
)
})
return isArray ? orders : orders[0]
return isArray ? (orders as T) : orders[0]
}
function cleanNestedRelations(obj) {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -42,8 +42,8 @@
"@swc/jest": "^0.2.36",
"faker": "^5.5.3",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -42,8 +42,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -29,7 +29,7 @@
"@medusajs/framework": "2.11.2",
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"axios": "^1.6.8",
"axios": "^1.12.0",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"typescript": "^5.6.2"

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -29,7 +29,7 @@
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.6",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"peerDependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"dependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"dependencies": {

View File

@@ -41,8 +41,8 @@
"@swc/core": "^1.7.28",
"@swc/jest": "^0.2.36",
"jest": "^29.7.0",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"rimraf": "^5.0.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.6.2"
},
"dependencies": {

View File

@@ -35,11 +35,14 @@
},
"dependencies": {
"@ariakit/react": "^0.4.15",
"@babel/runtime": "^7.26.10",
"@hookform/resolvers": "3.4.2",
"@medusajs/js-sdk": "2.11.2",
"@tanstack/react-query": "5.64.2",
"@uiw/react-json-view": "^2.0.0-alpha.17",
"date-fns": "^3.6.0",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"match-sorter": "^6.3.4",
"radix-ui": "1.1.2",
"react-hook-form": "7.49.1"
@@ -51,21 +54,22 @@
"@medusajs/icons": "2.11.2",
"@medusajs/test-utils": "2.11.2",
"@medusajs/types": "2.11.2",
"@medusajs/ui": "4.0.26",
"@medusajs/ui": "4.0.25",
"@medusajs/ui-preset": "2.11.2",
"@swc/core": "1.5.7",
"@swc/core": "^1.7.28",
"@types/lodash": "^4.17.15",
"@types/node": "^20.0.0",
"@types/lodash.debounce": "^4.0.9",
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^20.12.11",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "6.20.1",
"ts-node": "^10.9.2",
"tsup": "^8.4.0",
"typescript": "^5.6.2",
"vite": "^5.2.11",
"vite": "^5.4.14",
"yalc": "^1.0.0-pre.53"
},
"peerDependencies": {
@@ -74,10 +78,37 @@
"@medusajs/framework": "2.11.2",
"@medusajs/icons": "2.11.2",
"@medusajs/test-utils": "2.11.2",
"@medusajs/ui": "4.0.26",
"lodash": "^4.17.21",
"@medusajs/ui": "4.0.25",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "6.20.1"
},
"peerDependenciesMeta": {
"@medusajs/admin-sdk": {
"optional": true
},
"@medusajs/cli": {
"optional": true
},
"@medusajs/icons": {
"optional": true
},
"@medusajs/test-utils": {
"optional": true
},
"@medusajs/ui": {
"optional": true
},
"react": {
"optional": true
},
"react-dom": {
"optional": true
},
"react-router-dom": {
"optional": true
}
},
"engines": {
"node": ">=20"
},

View File

@@ -1,4 +1,4 @@
import debounce from "lodash/debounce"
import debounce from "lodash.debounce"
import { useCallback, useEffect, useState } from "react"
/**

View File

@@ -24,7 +24,7 @@ import {
TriangleRightMini,
TruckFast,
} from "@medusajs/icons"
import { isEqual } from "lodash"
import isEqual from "lodash.isequal"
import { Accordion } from "radix-ui"
import { ConditionalTooltip } from "../../../../components/common/conditional-tooltip"
import { Form } from "../../../../components/common/form"
@@ -98,7 +98,7 @@ const Shipping = () => {
<RouteFocusModal.Header />
<RouteFocusModal.Body className="flex flex-1 flex-col overflow-hidden">
<div className="flex flex-1 flex-col items-center overflow-y-auto">
<div className="flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6">
<div className="flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16">
<RouteFocusModal.Title asChild>
<Heading>Shipping</Heading>
</RouteFocusModal.Title>
@@ -252,7 +252,7 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
<RouteFocusModal.Header />
<RouteFocusModal.Body className="flex flex-1 flex-col overflow-hidden">
<div className="flex flex-1 flex-col items-center overflow-y-auto">
<div className="flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6">
<div className="flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16">
<div>
<RouteFocusModal.Title asChild>
<Heading>Shipping</Heading>
@@ -266,8 +266,8 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
</div>
<Divider variant="dashed" />
<Accordion.Root type="multiple">
<div className="bg-ui-bg-subtle rounded-xl shadow-elevation-card-rest">
<div className="px-4 py-2 flex items-center justify-between">
<div className="bg-ui-bg-subtle shadow-elevation-card-rest rounded-xl">
<div className="flex items-center justify-between px-4 py-2">
<Text
size="xsmall"
weight="plus"
@@ -312,8 +312,8 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
value={profile.id}
className="bg-ui-bg-base shadow-elevation-card-rest rounded-lg"
>
<div className="px-3 py-2 flex items-center justify-between gap-3">
<div className="flex items-center gap-x-3 w-full overflow-hidden">
<div className="flex items-center justify-between gap-3 px-3 py-2">
<div className="flex w-full items-center gap-x-3 overflow-hidden">
<Accordion.Trigger asChild>
<IconButton
size="2xsmall"
@@ -321,17 +321,17 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
className="group/trigger"
disabled={!hasItems}
>
<TriangleRightMini className="group-data-[state=open]/trigger:rotate-90 transition-transform" />
<TriangleRightMini className="transition-transform group-data-[state=open]/trigger:rotate-90" />
</IconButton>
</Accordion.Trigger>
{!shippingOption ? (
<div className="flex items-center gap-x-3">
<div className="size-7 rounded-md shadow-borders-base flex items-center justify-center">
<div className="size-6 rounded bg-ui-bg-component-hover flex items-center justify-center">
<div className="shadow-borders-base flex size-7 items-center justify-center rounded-md">
<div className="bg-ui-bg-component-hover flex size-6 items-center justify-center rounded">
<Shopping className="text-ui-fg-subtle" />
</div>
</div>
<div className="flex flex-col flex-1">
<div className="flex flex-1 flex-col">
<Text
size="small"
weight="plus"
@@ -350,7 +350,7 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
</div>
</div>
) : (
<div className="flex items-center gap-[5px] max-sm:flex-col max-sm:items-start flex-1 w-full overflow-hidden">
<div className="flex w-full flex-1 items-center gap-[5px] overflow-hidden max-sm:flex-col max-sm:items-start">
<Tooltip
content={
<ul>
@@ -363,7 +363,7 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
}
>
<Badge
className="flex items-center gap-x-[3px] overflow-hidden cursor-default"
className="flex cursor-default items-center gap-x-[3px] overflow-hidden"
size="xsmall"
>
<Shopping className="shrink-0" />
@@ -384,7 +384,7 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
}
>
<Badge
className="flex items-center gap-x-[3px] overflow-hidden cursor-default"
className="flex cursor-default items-center gap-x-[3px] overflow-hidden"
size="xsmall"
>
<Buildings className="shrink-0" />
@@ -398,7 +398,7 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
</Tooltip>
<Tooltip content={shippingOption.name}>
<Badge
className="flex items-center gap-x-[3px] overflow-hidden cursor-default"
className="flex cursor-default items-center gap-x-[3px] overflow-hidden"
size="xsmall"
>
<TruckFast className="shrink-0" />
@@ -471,17 +471,17 @@ const ShippingForm = ({ preview, order }: ShippingFormProps) => {
return (
<div key={item.id}>
<div
className="px-3 flex items-center gap-x-3"
className="flex items-center gap-x-3 px-3"
key={item.id}
>
<div className="w-5 h-[56px] flex flex-col justify-center items-center">
<div className="flex h-[56px] w-5 flex-col items-center justify-center">
<Divider
variant="dashed"
orientation="vertical"
/>
</div>
<div className="py-2 flex items-center gap-x-3">
<div className="size-7 flex items-center justify-center tabular-nums">
<div className="flex items-center gap-x-3 py-2">
<div className="flex size-7 items-center justify-center tabular-nums">
<Text
size="small"
leading="compact"
@@ -694,7 +694,7 @@ const ShippingProfileForm = ({
<StackedFocusModal.Header />
<StackedFocusModal.Body className="flex flex-1 flex-col overflow-hidden">
<div className="flex flex-1 flex-col items-center overflow-y-auto">
<div className="flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6">
<div className="flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16">
<div>
<RouteFocusModal.Title asChild>
<Heading>Shipping</Heading>
@@ -782,7 +782,7 @@ const ItemsPreview = ({ order, shippingProfileId }: ItemsPreviewProps) => {
</div>
</div>
<div className="bg-ui-bg-subtle shadow-elevation-card-rest rounded-xl">
<div className="grid grid-cols-2 gap-3 px-4 py-2 text-ui-fg-muted">
<div className="text-ui-fg-muted grid grid-cols-2 gap-3 px-4 py-2">
<div>
<Text size="small" weight="plus">
Item
@@ -799,7 +799,7 @@ const ItemsPreview = ({ order, shippingProfileId }: ItemsPreviewProps) => {
matches?.map((item) => (
<div
key={item.id}
className="grid grid-cols-2 gap-3 px-4 py-2 bg-ui-bg-base shadow-elevation-card-rest rounded-lg items-center"
className="bg-ui-bg-base shadow-elevation-card-rest grid grid-cols-2 items-center gap-3 rounded-lg px-4 py-2"
>
<div className="flex items-center gap-x-3">
<Thumbnail
@@ -838,7 +838,7 @@ const ItemsPreview = ({ order, shippingProfileId }: ItemsPreviewProps) => {
</div>
))
) : (
<div className="flex items-center justify-center gap-x-3 bg-ui-bg-base rounded-lg p-4 shadow-elevation-card-rest flex-col gap-1">
<div className="bg-ui-bg-base shadow-elevation-card-rest flex flex-col items-center justify-center gap-1 gap-x-3 rounded-lg p-4">
<Text size="small" weight="plus" leading="compact">
No items found
</Text>

7
script.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Run after build
for pkg in packages/*/dist packages/*/build; do
if [ -d "$pkg" ]; then
echo "$(du -sh $pkg | cut -f1) - $pkg"
fi
done | sort -hr

View File

@@ -0,0 +1,136 @@
#!/usr/bin/env node
const fs = require("fs")
const path = require("path")
const { execSync } = require("child_process")
/**
* Analyze dependency sizes across all workspace packages
*/
// Get all package.json files
const packagesOutput = execSync(
'find packages -name "package.json" -not -path "*/node_modules/*"',
{
cwd: path.join(__dirname, "../../"),
encoding: "utf8",
}
)
const packagePaths = packagesOutput.trim().split("\n").filter(Boolean)
console.log(`Found ${packagePaths.length} packages\n`)
// Collect all dependencies across the workspace
const allDependencies = new Map()
const packageDependencies = []
for (const pkgPath of packagePaths) {
const fullPath = path.join(__dirname, "../..", pkgPath)
const packageJson = JSON.parse(fs.readFileSync(fullPath, "utf8"))
const deps = {
...packageJson.dependencies,
...packageJson.devDependencies,
}
packageDependencies.push({
name: packageJson.name,
path: pkgPath,
dependencies: deps,
depCount: Object.keys(deps || {}).length,
})
// Aggregate dependencies
for (const [dep, version] of Object.entries(deps || {})) {
if (!allDependencies.has(dep)) {
allDependencies.set(dep, { count: 0, versions: new Set(), packages: [] })
}
const info = allDependencies.get(dep)
info.count++
info.versions.add(version)
info.packages.push(packageJson.name)
}
}
// Sort packages by dependency count
packageDependencies.sort((a, b) => b.depCount - a.depCount)
console.log("=== Packages with Most Dependencies ===\n")
packageDependencies.slice(0, 15).forEach((pkg) => {
console.log(`${pkg.name}: ${pkg.depCount} dependencies`)
})
console.log("\n=== Most Common Dependencies ===\n")
const sortedDeps = Array.from(allDependencies.entries())
.sort((a, b) => b[1].count - a[1].count)
.slice(0, 30)
sortedDeps.forEach(([dep, info]) => {
const versionInfo =
info.versions.size > 1 ? ` ⚠️ (${info.versions.size} versions)` : ""
console.log(`${dep}: used in ${info.count} packages${versionInfo}`)
})
// Find dependencies with multiple versions
console.log("\n=== Dependencies with Version Conflicts ===\n")
const conflicts = Array.from(allDependencies.entries())
.filter(([_, info]) => info.versions.size > 1)
.sort((a, b) => b[1].versions.size - a[1].versions.size)
if (conflicts.length > 0) {
conflicts.slice(0, 20).forEach(([dep, info]) => {
console.log(`${dep}:`)
console.log(` Versions: ${Array.from(info.versions).join(", ")}`)
console.log(` Used in ${info.count} packages\n`)
})
} else {
console.log("No version conflicts found!\n")
}
// Analyze large dependencies (if node_modules exists)
console.log("=== Analyzing Installed Dependency Sizes ===\n")
const nodeModulesPath = path.join(__dirname, "../../", "node_modules")
if (fs.existsSync(nodeModulesPath)) {
try {
// Use du to get sizes of top-level node_modules directories
const duOutput = execSync(
`du -sh node_modules/* 2>/dev/null | sort -hr | head -50`,
{
cwd: path.join(__dirname, "../../"),
encoding: "utf8",
stdio: ["pipe", "pipe", "ignore"], // Suppress stderr
}
)
console.log("Top 50 Largest Dependencies by Install Size:\n")
console.log(duOutput)
} catch (error) {
console.log("Could not analyze node_modules sizes\n")
}
} else {
console.log("node_modules not found. Run `yarn install` first.\n")
}
// Save detailed report
const report = {
totalPackages: packagePaths.length,
totalUniqueDependencies: allDependencies.size,
packagesWithMostDeps: packageDependencies.slice(0, 20),
mostCommonDeps: sortedDeps.map(([dep, info]) => ({
name: dep,
usedInPackages: info.count,
versions: Array.from(info.versions),
hasConflict: info.versions.size > 1,
})),
versionConflicts: conflicts.map(([dep, info]) => ({
name: dep,
versions: Array.from(info.versions),
packages: info.packages,
})),
}
const reportPath = path.join(__dirname, "../../", "dependency-analysis.json")
fs.writeFileSync(reportPath, JSON.stringify(report, null, 2))
console.log(`\nDetailed report saved to: dependency-analysis.json`)

View File

@@ -0,0 +1,36 @@
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: ./update-dependency-versions.sh <package-name> <new-version>"
echo "Example: ./update-dependency-versions.sh typescript ^5.6.2"
exit 1
fi
PACKAGE_NAME=$1
NEW_VERSION=$2
echo "=== Updating $PACKAGE_NAME to $NEW_VERSION across all packages ===\n"
# Find all package.json files (excluding node_modules)
find packages -name "package.json" -not -path "*/node_modules/*" | while read -r pkgfile; do
# Check if package exists in dependencies or devDependencies
if grep -q "\"$PACKAGE_NAME\":" "$pkgfile"; then
echo "📝 Updating $pkgfile"
# Use sed to update the version (works on both macOS and Linux)
# Using | as delimiter to avoid conflicts with / in package names like @types/react
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' "s|\"$PACKAGE_NAME\": \"[^\"]*\"|\"$PACKAGE_NAME\": \"$NEW_VERSION\"|" "$pkgfile"
else
# Linux
sed -i "s|\"$PACKAGE_NAME\": \"[^\"]*\"|\"$PACKAGE_NAME\": \"$NEW_VERSION\"|" "$pkgfile"
fi
fi
done
echo "\n✅ Update complete!"
echo "Next steps:"
echo " 1. Review changes: git diff"
echo " 2. Install dependencies: yarn install"
echo " 3. Test the build: yarn build"

8156
yarn.lock

File diff suppressed because it is too large Load Diff