diff --git a/packages/framework/framework/README.md b/packages/core/framework/README.md similarity index 100% rename from packages/framework/framework/README.md rename to packages/core/framework/README.md diff --git a/packages/core/framework/jest.config.js b/packages/core/framework/jest.config.js new file mode 100644 index 0000000000..867ce6519f --- /dev/null +++ b/packages/core/framework/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + transform: { + "^.+\\.[jt]s$": [ + "@swc/jest", + { + jsc: { + parser: { + syntax: "typescript", + decorators: true, + }, + transform: { + useDefineForClassFields: false, + legacyDecorator: true, + decoratorMetadata: true, + }, + target: "ES2021", + }, + }, + ], + }, + testPathIgnorePatterns: [`dist/`, `node_modules/`], + testEnvironment: `node`, + moduleFileExtensions: [`js`, `ts`], +} diff --git a/packages/framework/framework/package.json b/packages/core/framework/package.json similarity index 81% rename from packages/framework/framework/package.json rename to packages/core/framework/package.json index de83acc01e..73706c7077 100644 --- a/packages/framework/framework/package.json +++ b/packages/core/framework/package.json @@ -5,7 +5,10 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ - "dist" + "dist", + "!dist/**/__tests__", + "!dist/**/__mocks__", + "!dist/**/__fixtures__" ], "exports": { ".": "./dist/index.js", @@ -31,11 +34,10 @@ "author": "Medusa", "license": "MIT", "scripts": { - "watch": "tsc --watch -p ./tsconfig.build.json", - "watch:test": "tsc --build tsconfig.spec.json --watch", - "build": "rimraf dist && tsc -p ./tsconfig.spec.json --noEmit && tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json", - "test": "jest --runInBand --bail --passWithNoTests --forceExit -- src", - "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts" + "watch": "tsc --watch ", + "watch:test": "tsc --watch", + "build": "rimraf dist && tsc --build", + "test": "jest --runInBand --bail --passWithNoTests --forceExit" }, "devDependencies": { "@medusajs/orchestration": "^0.5.7", @@ -43,10 +45,11 @@ "@types/express": "^4.17.17", "@types/jsonwebtoken": "^8.5.9", "cross-env": "^7.0.3", + "jest": "^29.7.0", "rimraf": "^3.0.2", "supertest": "^4.0.2", "tsc-alias": "^1.8.6", - "typescript": "^5.1.6", + "typescript": "^5.6.2", "vite": "^5.2.11" }, "dependencies": { diff --git a/packages/framework/framework/src/config/__fixtures__/medusa-config-2.js b/packages/core/framework/src/config/__fixtures__/medusa-config-2.js similarity index 100% rename from packages/framework/framework/src/config/__fixtures__/medusa-config-2.js rename to packages/core/framework/src/config/__fixtures__/medusa-config-2.js diff --git a/packages/framework/framework/src/config/__fixtures__/medusa-config.js b/packages/core/framework/src/config/__fixtures__/medusa-config.js similarity index 100% rename from packages/framework/framework/src/config/__fixtures__/medusa-config.js rename to packages/core/framework/src/config/__fixtures__/medusa-config.js diff --git a/packages/framework/framework/src/config/__tests__/index.spec.ts b/packages/core/framework/src/config/__tests__/index.spec.ts similarity index 100% rename from packages/framework/framework/src/config/__tests__/index.spec.ts rename to packages/core/framework/src/config/__tests__/index.spec.ts diff --git a/packages/framework/framework/src/config/config.ts b/packages/core/framework/src/config/config.ts similarity index 100% rename from packages/framework/framework/src/config/config.ts rename to packages/core/framework/src/config/config.ts diff --git a/packages/framework/framework/src/config/index.ts b/packages/core/framework/src/config/index.ts similarity index 100% rename from packages/framework/framework/src/config/index.ts rename to packages/core/framework/src/config/index.ts diff --git a/packages/framework/framework/src/config/loader.ts b/packages/core/framework/src/config/loader.ts similarity index 100% rename from packages/framework/framework/src/config/loader.ts rename to packages/core/framework/src/config/loader.ts diff --git a/packages/framework/framework/src/config/types.ts b/packages/core/framework/src/config/types.ts similarity index 100% rename from packages/framework/framework/src/config/types.ts rename to packages/core/framework/src/config/types.ts diff --git a/packages/framework/framework/src/container.ts b/packages/core/framework/src/container.ts similarity index 100% rename from packages/framework/framework/src/container.ts rename to packages/core/framework/src/container.ts diff --git a/packages/framework/framework/src/database/index.ts b/packages/core/framework/src/database/index.ts similarity index 100% rename from packages/framework/framework/src/database/index.ts rename to packages/core/framework/src/database/index.ts diff --git a/packages/framework/framework/src/database/pg-connection-loader.ts b/packages/core/framework/src/database/pg-connection-loader.ts similarity index 100% rename from packages/framework/framework/src/database/pg-connection-loader.ts rename to packages/core/framework/src/database/pg-connection-loader.ts diff --git a/packages/framework/framework/src/feature-flags/__tests__/feature-flags.spec.ts b/packages/core/framework/src/feature-flags/__tests__/feature-flags.spec.ts similarity index 100% rename from packages/framework/framework/src/feature-flags/__tests__/feature-flags.spec.ts rename to packages/core/framework/src/feature-flags/__tests__/feature-flags.spec.ts diff --git a/packages/framework/framework/src/feature-flags/feature-flag-loader.ts b/packages/core/framework/src/feature-flags/feature-flag-loader.ts similarity index 100% rename from packages/framework/framework/src/feature-flags/feature-flag-loader.ts rename to packages/core/framework/src/feature-flags/feature-flag-loader.ts diff --git a/packages/framework/framework/src/feature-flags/flag-router.ts b/packages/core/framework/src/feature-flags/flag-router.ts similarity index 100% rename from packages/framework/framework/src/feature-flags/flag-router.ts rename to packages/core/framework/src/feature-flags/flag-router.ts diff --git a/packages/framework/framework/src/feature-flags/index.ts b/packages/core/framework/src/feature-flags/index.ts similarity index 100% rename from packages/framework/framework/src/feature-flags/index.ts rename to packages/core/framework/src/feature-flags/index.ts diff --git a/packages/framework/framework/src/feature-flags/types.ts b/packages/core/framework/src/feature-flags/types.ts similarity index 100% rename from packages/framework/framework/src/feature-flags/types.ts rename to packages/core/framework/src/feature-flags/types.ts diff --git a/packages/framework/framework/src/http/__fixtures__/mocks/index.ts b/packages/core/framework/src/http/__fixtures__/mocks/index.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/mocks/index.ts rename to packages/core/framework/src/http/__fixtures__/mocks/index.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.ts b/packages/core/framework/src/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-error-handler/middlewares.ts b/packages/core/framework/src/http/__fixtures__/routers-error-handler/middlewares.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-error-handler/middlewares.ts rename to packages/core/framework/src/http/__fixtures__/routers-error-handler/middlewares.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-error-handler/store/route.ts b/packages/core/framework/src/http/__fixtures__/routers-error-handler/store/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-error-handler/store/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-error-handler/store/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/admin/protected/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/admin/protected/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/admin/protected/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/admin/protected/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/admin/unprotected/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/admin/unprotected/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/admin/unprotected/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/admin/unprotected/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/customers/error/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/customers/error/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/customers/error/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/customers/error/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/customers/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/customers/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/customers/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/customers/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/middlewares.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/middlewares.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/middlewares.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/middlewares.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/store/customers/me/protected/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/store/customers/me/protected/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/store/customers/me/protected/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/store/customers/me/protected/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers-middleware/webhooks/payment/route.ts b/packages/core/framework/src/http/__fixtures__/routers-middleware/webhooks/payment/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers-middleware/webhooks/payment/route.ts rename to packages/core/framework/src/http/__fixtures__/routers-middleware/webhooks/payment/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/_private/route.ts b/packages/core/framework/src/http/__fixtures__/routers/_private/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/_private/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/_private/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/admin/orders/[id]/route.ts b/packages/core/framework/src/http/__fixtures__/routers/admin/orders/[id]/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/admin/orders/[id]/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/admin/orders/[id]/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/admin/orders/route.ts b/packages/core/framework/src/http/__fixtures__/routers/admin/orders/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/admin/orders/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/admin/orders/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/admin/products/[id]/route.ts b/packages/core/framework/src/http/__fixtures__/routers/admin/products/[id]/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/admin/products/[id]/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/admin/products/[id]/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/admin/products/route.ts b/packages/core/framework/src/http/__fixtures__/routers/admin/products/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/admin/products/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/admin/products/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/admin/route.ts b/packages/core/framework/src/http/__fixtures__/routers/admin/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/admin/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/admin/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.ts b/packages/core/framework/src/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.ts diff --git a/packages/framework/framework/src/http/__fixtures__/routers/customers/route.ts b/packages/core/framework/src/http/__fixtures__/routers/customers/route.ts similarity index 58% rename from packages/framework/framework/src/http/__fixtures__/routers/customers/route.ts rename to packages/core/framework/src/http/__fixtures__/routers/customers/route.ts index c3e8918f8b..3154602458 100644 --- a/packages/framework/framework/src/http/__fixtures__/routers/customers/route.ts +++ b/packages/core/framework/src/http/__fixtures__/routers/customers/route.ts @@ -1,4 +1,4 @@ -import { NextFunction, Request, Response } from "express" +import { Request, Response } from "express" export function GET(req: Request, res: Response) { res.send("list customers") diff --git a/packages/framework/framework/src/http/__fixtures__/server/index.ts b/packages/core/framework/src/http/__fixtures__/server/index.ts similarity index 100% rename from packages/framework/framework/src/http/__fixtures__/server/index.ts rename to packages/core/framework/src/http/__fixtures__/server/index.ts diff --git a/packages/framework/framework/src/http/__tests__/index.spec.ts b/packages/core/framework/src/http/__tests__/index.spec.ts similarity index 100% rename from packages/framework/framework/src/http/__tests__/index.spec.ts rename to packages/core/framework/src/http/__tests__/index.spec.ts diff --git a/packages/framework/framework/src/http/express-loader.ts b/packages/core/framework/src/http/express-loader.ts similarity index 100% rename from packages/framework/framework/src/http/express-loader.ts rename to packages/core/framework/src/http/express-loader.ts diff --git a/packages/framework/framework/src/http/index.ts b/packages/core/framework/src/http/index.ts similarity index 100% rename from packages/framework/framework/src/http/index.ts rename to packages/core/framework/src/http/index.ts diff --git a/packages/framework/framework/src/http/middlewares/authenticate-middleware.ts b/packages/core/framework/src/http/middlewares/authenticate-middleware.ts similarity index 100% rename from packages/framework/framework/src/http/middlewares/authenticate-middleware.ts rename to packages/core/framework/src/http/middlewares/authenticate-middleware.ts diff --git a/packages/framework/framework/src/http/middlewares/error-handler.ts b/packages/core/framework/src/http/middlewares/error-handler.ts similarity index 100% rename from packages/framework/framework/src/http/middlewares/error-handler.ts rename to packages/core/framework/src/http/middlewares/error-handler.ts diff --git a/packages/framework/framework/src/http/middlewares/exception-formatter.ts b/packages/core/framework/src/http/middlewares/exception-formatter.ts similarity index 100% rename from packages/framework/framework/src/http/middlewares/exception-formatter.ts rename to packages/core/framework/src/http/middlewares/exception-formatter.ts diff --git a/packages/framework/framework/src/http/middlewares/index.ts b/packages/core/framework/src/http/middlewares/index.ts similarity index 100% rename from packages/framework/framework/src/http/middlewares/index.ts rename to packages/core/framework/src/http/middlewares/index.ts diff --git a/packages/framework/framework/src/http/router.ts b/packages/core/framework/src/http/router.ts similarity index 100% rename from packages/framework/framework/src/http/router.ts rename to packages/core/framework/src/http/router.ts diff --git a/packages/framework/framework/src/http/types.ts b/packages/core/framework/src/http/types.ts similarity index 100% rename from packages/framework/framework/src/http/types.ts rename to packages/core/framework/src/http/types.ts diff --git a/packages/framework/framework/src/http/utils/define-middlewares.ts b/packages/core/framework/src/http/utils/define-middlewares.ts similarity index 100% rename from packages/framework/framework/src/http/utils/define-middlewares.ts rename to packages/core/framework/src/http/utils/define-middlewares.ts diff --git a/packages/framework/framework/src/index.ts b/packages/core/framework/src/index.ts similarity index 100% rename from packages/framework/framework/src/index.ts rename to packages/core/framework/src/index.ts diff --git a/packages/framework/framework/src/jobs/__fixtures__/mock-scheduler-storage.ts b/packages/core/framework/src/jobs/__fixtures__/mock-scheduler-storage.ts similarity index 100% rename from packages/framework/framework/src/jobs/__fixtures__/mock-scheduler-storage.ts rename to packages/core/framework/src/jobs/__fixtures__/mock-scheduler-storage.ts diff --git a/packages/framework/framework/src/jobs/__fixtures__/plugin/jobs/order-summary.ts b/packages/core/framework/src/jobs/__fixtures__/plugin/jobs/order-summary.ts similarity index 100% rename from packages/framework/framework/src/jobs/__fixtures__/plugin/jobs/order-summary.ts rename to packages/core/framework/src/jobs/__fixtures__/plugin/jobs/order-summary.ts diff --git a/packages/framework/framework/src/jobs/__tests__/register-jobs.spec.ts b/packages/core/framework/src/jobs/__tests__/register-jobs.spec.ts similarity index 100% rename from packages/framework/framework/src/jobs/__tests__/register-jobs.spec.ts rename to packages/core/framework/src/jobs/__tests__/register-jobs.spec.ts diff --git a/packages/framework/framework/src/jobs/index.ts b/packages/core/framework/src/jobs/index.ts similarity index 100% rename from packages/framework/framework/src/jobs/index.ts rename to packages/core/framework/src/jobs/index.ts diff --git a/packages/framework/framework/src/jobs/job-loader.ts b/packages/core/framework/src/jobs/job-loader.ts similarity index 100% rename from packages/framework/framework/src/jobs/job-loader.ts rename to packages/core/framework/src/jobs/job-loader.ts diff --git a/packages/framework/framework/src/links/__fixtures__/links/link.ts b/packages/core/framework/src/links/__fixtures__/links/link.ts similarity index 100% rename from packages/framework/framework/src/links/__fixtures__/links/link.ts rename to packages/core/framework/src/links/__fixtures__/links/link.ts diff --git a/packages/framework/framework/src/links/__fixtures__/links/sub-links/link.ts b/packages/core/framework/src/links/__fixtures__/links/sub-links/link.ts similarity index 100% rename from packages/framework/framework/src/links/__fixtures__/links/sub-links/link.ts rename to packages/core/framework/src/links/__fixtures__/links/sub-links/link.ts diff --git a/packages/framework/framework/src/links/__tests__/index.spec.ts b/packages/core/framework/src/links/__tests__/index.spec.ts similarity index 100% rename from packages/framework/framework/src/links/__tests__/index.spec.ts rename to packages/core/framework/src/links/__tests__/index.spec.ts diff --git a/packages/framework/framework/src/links/index.ts b/packages/core/framework/src/links/index.ts similarity index 100% rename from packages/framework/framework/src/links/index.ts rename to packages/core/framework/src/links/index.ts diff --git a/packages/framework/framework/src/links/link-loader.ts b/packages/core/framework/src/links/link-loader.ts similarity index 100% rename from packages/framework/framework/src/links/link-loader.ts rename to packages/core/framework/src/links/link-loader.ts diff --git a/packages/framework/framework/src/logger/index.ts b/packages/core/framework/src/logger/index.ts similarity index 100% rename from packages/framework/framework/src/logger/index.ts rename to packages/core/framework/src/logger/index.ts diff --git a/packages/framework/framework/src/medusa-app-loader.ts b/packages/core/framework/src/medusa-app-loader.ts similarity index 99% rename from packages/framework/framework/src/medusa-app-loader.ts rename to packages/core/framework/src/medusa-app-loader.ts index 3fa85549cc..64eea7c669 100644 --- a/packages/framework/framework/src/medusa-app-loader.ts +++ b/packages/core/framework/src/medusa-app-loader.ts @@ -74,7 +74,7 @@ export class MedusaAppLoader { } ) - const configModules = { ...modulesConfig } ?? {} + const configModules = { ...modulesConfig } for (const defaultModule of defaultModules as ModuleDefinition[]) { configModules[defaultModule.key] ??= diff --git a/packages/framework/framework/src/subscribers/__fixtures__/subscribers/order-notifier.ts b/packages/core/framework/src/subscribers/__fixtures__/subscribers/order-notifier.ts similarity index 100% rename from packages/framework/framework/src/subscribers/__fixtures__/subscribers/order-notifier.ts rename to packages/core/framework/src/subscribers/__fixtures__/subscribers/order-notifier.ts diff --git a/packages/framework/framework/src/subscribers/__fixtures__/subscribers/product-updater.ts b/packages/core/framework/src/subscribers/__fixtures__/subscribers/product-updater.ts similarity index 100% rename from packages/framework/framework/src/subscribers/__fixtures__/subscribers/product-updater.ts rename to packages/core/framework/src/subscribers/__fixtures__/subscribers/product-updater.ts diff --git a/packages/framework/framework/src/subscribers/__fixtures__/subscribers/variant-created.ts b/packages/core/framework/src/subscribers/__fixtures__/subscribers/variant-created.ts similarity index 100% rename from packages/framework/framework/src/subscribers/__fixtures__/subscribers/variant-created.ts rename to packages/core/framework/src/subscribers/__fixtures__/subscribers/variant-created.ts diff --git a/packages/framework/framework/src/subscribers/__mocks__/index.ts b/packages/core/framework/src/subscribers/__mocks__/index.ts similarity index 100% rename from packages/framework/framework/src/subscribers/__mocks__/index.ts rename to packages/core/framework/src/subscribers/__mocks__/index.ts diff --git a/packages/framework/framework/src/subscribers/__tests__/index.spec.ts b/packages/core/framework/src/subscribers/__tests__/index.spec.ts similarity index 100% rename from packages/framework/framework/src/subscribers/__tests__/index.spec.ts rename to packages/core/framework/src/subscribers/__tests__/index.spec.ts diff --git a/packages/framework/framework/src/subscribers/index.ts b/packages/core/framework/src/subscribers/index.ts similarity index 100% rename from packages/framework/framework/src/subscribers/index.ts rename to packages/core/framework/src/subscribers/index.ts diff --git a/packages/framework/framework/src/subscribers/subscriber-loader.ts b/packages/core/framework/src/subscribers/subscriber-loader.ts similarity index 100% rename from packages/framework/framework/src/subscribers/subscriber-loader.ts rename to packages/core/framework/src/subscribers/subscriber-loader.ts diff --git a/packages/framework/framework/src/subscribers/types.ts b/packages/core/framework/src/subscribers/types.ts similarity index 100% rename from packages/framework/framework/src/subscribers/types.ts rename to packages/core/framework/src/subscribers/types.ts diff --git a/packages/framework/framework/src/telemetry/index.ts b/packages/core/framework/src/telemetry/index.ts similarity index 100% rename from packages/framework/framework/src/telemetry/index.ts rename to packages/core/framework/src/telemetry/index.ts diff --git a/packages/framework/framework/src/workflows/__fixtures__/workflows/deep-workflows/product-updater.ts b/packages/core/framework/src/workflows/__fixtures__/workflows/deep-workflows/product-updater.ts similarity index 100% rename from packages/framework/framework/src/workflows/__fixtures__/workflows/deep-workflows/product-updater.ts rename to packages/core/framework/src/workflows/__fixtures__/workflows/deep-workflows/product-updater.ts diff --git a/packages/framework/framework/src/workflows/__fixtures__/workflows/order-notifier.ts b/packages/core/framework/src/workflows/__fixtures__/workflows/order-notifier.ts similarity index 100% rename from packages/framework/framework/src/workflows/__fixtures__/workflows/order-notifier.ts rename to packages/core/framework/src/workflows/__fixtures__/workflows/order-notifier.ts diff --git a/packages/framework/framework/src/workflows/__tests__/index.spec.ts b/packages/core/framework/src/workflows/__tests__/index.spec.ts similarity index 100% rename from packages/framework/framework/src/workflows/__tests__/index.spec.ts rename to packages/core/framework/src/workflows/__tests__/index.spec.ts diff --git a/packages/framework/framework/src/workflows/index.ts b/packages/core/framework/src/workflows/index.ts similarity index 100% rename from packages/framework/framework/src/workflows/index.ts rename to packages/core/framework/src/workflows/index.ts diff --git a/packages/framework/framework/src/workflows/workflow-loader.ts b/packages/core/framework/src/workflows/workflow-loader.ts similarity index 100% rename from packages/framework/framework/src/workflows/workflow-loader.ts rename to packages/core/framework/src/workflows/workflow-loader.ts diff --git a/packages/framework/framework/tsconfig.json b/packages/core/framework/tsconfig.json similarity index 89% rename from packages/framework/framework/tsconfig.json rename to packages/core/framework/tsconfig.json index 93695bb174..ea80f1e93f 100644 --- a/packages/framework/framework/tsconfig.json +++ b/packages/core/framework/tsconfig.json @@ -8,6 +8,8 @@ "declaration": true, "module": "commonjs", "moduleResolution": "node", + "noUnusedLocals": true, + "forceConsistentCasingInFileNames": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": false, @@ -17,7 +19,6 @@ "noImplicitThis": true, "allowJs": true, "skipLibCheck": true, - "downlevelIteration": true, "baseUrl": ".", "resolveJsonModule": true, "paths": { diff --git a/packages/framework/framework/jest.config.js b/packages/framework/framework/jest.config.js deleted file mode 100644 index 747af0cb05..0000000000 --- a/packages/framework/framework/jest.config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - moduleNameMapper: {}, - transform: { - "^.+\\.[jt]s$": [ - "@swc/jest", - { - jsc: { - parser: { syntax: "typescript", decorators: true }, - transform: { decoratorMetadata: true }, - }, - }, - ], - }, - testEnvironment: `node`, - moduleFileExtensions: [`js`, `ts`], - modulePathIgnorePatterns: ["dist/"], -} diff --git a/packages/framework/framework/tsconfig.build.json b/packages/framework/framework/tsconfig.build.json deleted file mode 100644 index 2ce34105bc..0000000000 --- a/packages/framework/framework/tsconfig.build.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src"], - "exclude": [ - "dist", - "src/**/__tests__", - "src/**/__mocks__", - "src/**/__fixtures__", - "node_modules" - ], -} diff --git a/packages/framework/framework/tsconfig.spec.json b/packages/framework/framework/tsconfig.spec.json deleted file mode 100644 index 48e47e8cbb..0000000000 --- a/packages/framework/framework/tsconfig.spec.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src", "integration-tests"], - "exclude": ["node_modules", "dist"], - "compilerOptions": { - "sourceMap": true - } -} diff --git a/yarn.lock b/yarn.lock index e1ab2a00d1..54e570e199 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5921,9 +5921,9 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/framework@^0.0.1, @medusajs/framework@workspace:packages/framework/framework": +"@medusajs/framework@^0.0.1, @medusajs/framework@workspace:packages/core/framework": version: 0.0.0-use.local - resolution: "@medusajs/framework@workspace:packages/framework/framework" + resolution: "@medusajs/framework@workspace:packages/core/framework" dependencies: "@medusajs/medusa-cli": ^1.3.22 "@medusajs/modules-sdk": ^1.12.11 @@ -5941,13 +5941,14 @@ __metadata: express-session: ^1.17.3 ioredis: ^5.4.1 ioredis-mock: 8.4.0 + jest: ^29.7.0 jsonwebtoken: ^9.0.2 medusa-telemetry: ^0.0.17 morgan: ^1.9.1 rimraf: ^3.0.2 supertest: ^4.0.2 tsc-alias: ^1.8.6 - typescript: ^5.1.6 + typescript: ^5.6.2 vite: ^5.2.11 zod: 3.22.4 peerDependencies: