chore: use framework sub paths everywhere (#9253)

This commit is contained in:
Adrien de Peretti
2024-09-26 16:38:38 +05:30
committed by GitHub
parent 48bea267dc
commit a8e19faf8d
417 changed files with 870 additions and 934 deletions
@@ -1,4 +1,7 @@
import { HttpCompressionOptions, ProjectConfigOptions } from "@medusajs/types"
import {
HttpCompressionOptions,
ProjectConfigOptions,
} from "@medusajs/framework/types"
import compression from "compression"
import { Request, Response } from "express"
@@ -1,4 +1,4 @@
import { pickDeep } from "@medusajs/utils"
import { pickDeep } from "@medusajs/framework/utils"
import { omitDeep } from "./omit-deep"
// TODO: once the legacy totals decoration will be removed.
@@ -1,4 +1,4 @@
import { defineMiddlewares as originalDefineMiddlewares } from "@medusajs/framework"
import { defineMiddlewares as originalDefineMiddlewares } from "@medusajs/framework/http"
/**
* A helper function to configure the routes by defining custom middleware,
@@ -1,3 +1,3 @@
import { formatException as originalFormatException } from "@medusajs/framework"
import { formatException as originalFormatException } from "@medusajs/framework/http"
export const formatException = originalFormatException
@@ -1,5 +1,5 @@
import { parse } from "path"
import { toCamelCase, upperCaseFirst } from "@medusajs/utils"
import { toCamelCase, upperCaseFirst } from "@medusajs/framework/utils"
/**
* Formats a filename into the correct container resolution name.
@@ -1,11 +1,11 @@
import { RequestQueryFields } from "@medusajs/types"
import { RequestQueryFields } from "@medusajs/framework/types"
import {
getSetDifference,
isDefined,
isPresent,
MedusaError,
stringToSelectRelationObject,
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
import { pick } from "lodash"
import { FindConfig, QueryConfig } from "../types/common"
@@ -1,3 +1,3 @@
import { authenticate as originalAuthenticate } from "@medusajs/framework"
import { authenticate as originalAuthenticate } from "@medusajs/framework/http"
export const authenticate = originalAuthenticate
@@ -2,13 +2,13 @@ import {
MedusaNextFunction,
MedusaResponse,
MedusaStoreRequest,
} from "@medusajs/framework"
} from "@medusajs/framework/http"
import {
ApiKeyType,
isPresent,
MedusaError,
PUBLISHABLE_KEY_HEADER,
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
import { refetchEntity } from "../../api/utils/refetch-entity"
export function ensurePublishableApiKey() {
@@ -1,3 +1,3 @@
import { errorHandler as originalErrorHandler } from "@medusajs/framework"
import { errorHandler as originalErrorHandler } from "@medusajs/framework/http"
export const errorHandler = originalErrorHandler
+1 -1
View File
@@ -1,4 +1,4 @@
import { isObject } from "@medusajs/utils"
import { isObject } from "@medusajs/framework/utils"
export function omitDeep<T extends object = object>(
input: object,
@@ -1,4 +1,4 @@
import { isDefined } from "@medusajs/utils"
import { isDefined } from "@medusajs/framework/utils"
export function removeUndefinedProperties<T extends object>(inputObj: T): T {
const removeProperties = (obj: T) => {