refactor(framework): Align configuration and fixes (#9246)
* refactor(framework): Align configuration and fixes * refactor(framework): Align configuration and fixes * move framework * rm unnecessary script * update jest config
This commit is contained in:
@@ -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`],
|
||||||
|
}
|
||||||
@@ -5,7 +5,10 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist",
|
||||||
|
"!dist/**/__tests__",
|
||||||
|
"!dist/**/__mocks__",
|
||||||
|
"!dist/**/__fixtures__"
|
||||||
],
|
],
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./dist/index.js",
|
".": "./dist/index.js",
|
||||||
@@ -31,11 +34,10 @@
|
|||||||
"author": "Medusa",
|
"author": "Medusa",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "tsc --watch -p ./tsconfig.build.json",
|
"watch": "tsc --watch ",
|
||||||
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
"watch:test": "tsc --watch",
|
||||||
"build": "rimraf dist && tsc -p ./tsconfig.spec.json --noEmit && tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
|
"build": "rimraf dist && tsc --build",
|
||||||
"test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
|
"test": "jest --runInBand --bail --passWithNoTests --forceExit"
|
||||||
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@medusajs/orchestration": "^0.5.7",
|
"@medusajs/orchestration": "^0.5.7",
|
||||||
@@ -43,10 +45,11 @@
|
|||||||
"@types/express": "^4.17.17",
|
"@types/express": "^4.17.17",
|
||||||
"@types/jsonwebtoken": "^8.5.9",
|
"@types/jsonwebtoken": "^8.5.9",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"jest": "^29.7.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"supertest": "^4.0.2",
|
"supertest": "^4.0.2",
|
||||||
"tsc-alias": "^1.8.6",
|
"tsc-alias": "^1.8.6",
|
||||||
"typescript": "^5.1.6",
|
"typescript": "^5.6.2",
|
||||||
"vite": "^5.2.11"
|
"vite": "^5.2.11"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { NextFunction, Request, Response } from "express"
|
import { Request, Response } from "express"
|
||||||
|
|
||||||
export function GET(req: Request, res: Response) {
|
export function GET(req: Request, res: Response) {
|
||||||
res.send("list customers")
|
res.send("list customers")
|
||||||
+1
-1
@@ -74,7 +74,7 @@ export class MedusaAppLoader {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const configModules = { ...modulesConfig } ?? {}
|
const configModules = { ...modulesConfig }
|
||||||
|
|
||||||
for (const defaultModule of defaultModules as ModuleDefinition[]) {
|
for (const defaultModule of defaultModules as ModuleDefinition[]) {
|
||||||
configModules[defaultModule.key] ??=
|
configModules[defaultModule.key] ??=
|
||||||
@@ -8,6 +8,8 @@
|
|||||||
"declaration": true,
|
"declaration": true,
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
@@ -17,7 +19,6 @@
|
|||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"downlevelIteration": true,
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
@@ -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/"],
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"include": ["src"],
|
|
||||||
"exclude": [
|
|
||||||
"dist",
|
|
||||||
"src/**/__tests__",
|
|
||||||
"src/**/__mocks__",
|
|
||||||
"src/**/__fixtures__",
|
|
||||||
"node_modules"
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"include": ["src", "integration-tests"],
|
|
||||||
"exclude": ["node_modules", "dist"],
|
|
||||||
"compilerOptions": {
|
|
||||||
"sourceMap": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5921,9 +5921,9 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
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
|
version: 0.0.0-use.local
|
||||||
resolution: "@medusajs/framework@workspace:packages/framework/framework"
|
resolution: "@medusajs/framework@workspace:packages/core/framework"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@medusajs/medusa-cli": ^1.3.22
|
"@medusajs/medusa-cli": ^1.3.22
|
||||||
"@medusajs/modules-sdk": ^1.12.11
|
"@medusajs/modules-sdk": ^1.12.11
|
||||||
@@ -5941,13 +5941,14 @@ __metadata:
|
|||||||
express-session: ^1.17.3
|
express-session: ^1.17.3
|
||||||
ioredis: ^5.4.1
|
ioredis: ^5.4.1
|
||||||
ioredis-mock: 8.4.0
|
ioredis-mock: 8.4.0
|
||||||
|
jest: ^29.7.0
|
||||||
jsonwebtoken: ^9.0.2
|
jsonwebtoken: ^9.0.2
|
||||||
medusa-telemetry: ^0.0.17
|
medusa-telemetry: ^0.0.17
|
||||||
morgan: ^1.9.1
|
morgan: ^1.9.1
|
||||||
rimraf: ^3.0.2
|
rimraf: ^3.0.2
|
||||||
supertest: ^4.0.2
|
supertest: ^4.0.2
|
||||||
tsc-alias: ^1.8.6
|
tsc-alias: ^1.8.6
|
||||||
typescript: ^5.1.6
|
typescript: ^5.6.2
|
||||||
vite: ^5.2.11
|
vite: ^5.2.11
|
||||||
zod: 3.22.4
|
zod: 3.22.4
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user