chore: upgrade moduleResolution to Node16 (#9269)

This commit is contained in:
Harminder Virk authored and GitHub committed 2024-09-24 17:19:20 +05:30
1 parent d721282600
commit 9e711720dd
216 files changed
+981 -2439

No files matched your search

+3 -16
View File
@@ -1,22 +1,9 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -40,7 +44,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
+2 -29
View File
@@ -1,38 +1,11 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
}
},
"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
}
}
+3 -16
View File
@@ -1,22 +1,9 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -40,7 +44,7 @@
"medusa-test-utils": "^1.1.42",
"rimraf": "^3.0.2",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
+2 -30
View File
@@ -1,39 +1,11 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true,
// to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
}
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
}
}
-8
View File
@@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src", "integration-tests"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"sourceMap": true
}
}
+2 -15
View File
@@ -1,15 +1,2 @@
module.exports = {
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
}
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({})
+5 -2
View File
@@ -15,7 +15,10 @@
"access": "public"
},
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"author": "Medusa",
"license": "MIT",
@@ -24,7 +27,7 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"scripts": {
"watch": "tsc --build --watch",
+1 -28
View File
@@ -1,30 +1,3 @@
{
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true // to use ES5 specific tooling
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
"extends": "../../../_tsconfig.base.json"
}
@@ -1,5 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src", "integration-tests"],
"exclude": ["node_modules"]
}
+2 -15
View File
@@ -1,15 +1,2 @@
module.exports = {
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
}
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({})
+5 -2
View File
@@ -15,7 +15,10 @@
"node": ">=20"
},
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"author": "Medusa",
"license": "MIT",
@@ -24,7 +27,7 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"scripts": {
"watch": "tsc --build --watch",
+1 -28
View File
@@ -1,30 +1,3 @@
{
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true // to use ES5 specific tooling
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
"extends": "../../../_tsconfig.base.json"
}
@@ -1,5 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["node_modules"]
}
+3 -17
View File
@@ -1,23 +1,9 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -41,7 +45,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
+7 -5
View File
@@ -16,6 +16,12 @@ import {
type OptionalAddressProps = DAL.SoftDeletableModelDateColumns
const PgIndex = createPsqlIndexStatementHelper({
tableName: "cart_address",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
})
@Entity({ tableName: "cart_address" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class Address {
@@ -75,11 +81,7 @@ export default class Address {
})
updated_at: Date
@createPsqlIndexStatementHelper({
tableName: "cart_address",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@PgIndex.MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
+2 -29
View File
@@ -1,38 +1,11 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
}
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
}
}
-8
View File
@@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src", "integration-tests"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"sourceMap": true
}
}
+3 -16
View File
@@ -1,22 +1,9 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -41,7 +45,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
+2 -29
View File
@@ -1,38 +1,11 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
}
},
"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
}
}
+4 -16
View File
@@ -1,21 +1,9 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": "MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -41,7 +45,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
+2 -29
View File
@@ -1,38 +1,11 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
}
},
"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
}
}
@@ -1,15 +1,2 @@
module.exports = {
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
}
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({})
@@ -4,7 +4,10 @@
"description": "Local Event Bus Module for Medusa",
"main": "dist/index.js",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"repository": {
"type": "git",
@@ -24,7 +27,7 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"scripts": {
"watch": "tsc --build --watch",
+1 -28
View File
@@ -1,30 +1,3 @@
{
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true // to use ES5 specific tooling
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
"extends": "../../../_tsconfig.base.json"
}
@@ -1,5 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["node_modules"]
}
@@ -1,15 +1,2 @@
module.exports = {
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
}
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({})
@@ -4,7 +4,10 @@
"description": "Redis Event Bus Module for Medusa",
"main": "dist/index.js",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"repository": {
"type": "git",
@@ -25,7 +28,7 @@
"jest": "^29.7.0",
"medusa-test-utils": "^1.1.44",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"scripts": {
"watch": "tsc --build --watch",
@@ -339,8 +339,6 @@ describe("RedisEventBusService", () => {
})
describe("worker_", () => {
let result!: any
describe("Successfully processes the jobs", () => {
beforeEach(async () => {
jest.clearAllMocks()
@@ -395,7 +393,7 @@ describe("RedisEventBusService", () => {
return Promise.reject("fail2")
})
result = await eventBus.worker_({
await eventBus.worker_({
name: "eventName",
data: { data: { test: 1 } },
opts: { attempts: 1 },
@@ -434,7 +432,7 @@ describe("RedisEventBusService", () => {
}
)
result = await eventBus
await eventBus
.worker_({
name: "eventName",
data: {
@@ -473,7 +471,7 @@ describe("RedisEventBusService", () => {
}
)
result = await eventBus
await eventBus
.worker_({
name: "eventName",
data: {
+1 -28
View File
@@ -1,30 +1,3 @@
{
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true // to use ES5 specific tooling
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
"extends": "../../../_tsconfig.base.json"
}
@@ -1,5 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["node_modules"]
}
+3 -16
View File
@@ -1,22 +1,9 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --passWithNoTests --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --passWithNoTests --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -43,7 +47,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
+2 -29
View File
@@ -1,38 +1,11 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
}
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
}
}
-8
View File
@@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src", "integration-tests"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"sourceMap": true
}
}
+3 -17
View File
@@ -1,4 +1,5 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
@@ -6,19 +7,4 @@ module.exports = {
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
/*setupFilesAfterEnv: ["<rootDir>/integration-tests/setup.js"],*/
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit --passWithNoTests -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -42,7 +46,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
@@ -26,12 +26,6 @@ const DeletedAtIndex = createPsqlIndexStatementHelper({
where: "deleted_at IS NOT NULL",
})
const ShippingOptionIdIndex = createPsqlIndexStatementHelper({
tableName: "shipping_option_type",
columns: "shipping_option_id",
where: "deleted_at IS NULL",
})
@Entity()
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class ShippingOptionType {
+2 -29
View File
@@ -1,25 +1,6 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
@@ -27,13 +8,5 @@
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
+4 -16
View File
@@ -1,22 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"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",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --passWithNoTests ./src",
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -41,7 +45,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
@@ -116,9 +116,7 @@ export class QueryBuilder {
const isList = graphqlType.endsWith("[]")
graphqlType = graphqlType.replace("[]", "")
return (
(graphqlToPostgresTypeMap[graphqlType] ?? "") + (isList ? "[]" : "") ?? ""
)
return (graphqlToPostgresTypeMap[graphqlType] ?? "") + (isList ? "[]" : "")
}
private parseWhere(
@@ -1,11 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": [
"dist",
"src/**/__tests__",
"src/**/__mocks__",
"src/**/__fixtures__",
"node_modules"
]
}
+4 -27
View File
@@ -1,35 +1,12 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"include": ["src"],
"exclude": [
"dist",
"node_modules"
],
}
}
@@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src", "integration-tests"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"sourceMap": true
}
}
+4 -15
View File
@@ -1,21 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
}
})
+7 -3
View File
@@ -12,7 +12,10 @@
"access": "public"
},
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -28,7 +31,7 @@
"rimraf": "^5.0.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
@@ -42,7 +45,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.spec.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -145,12 +145,12 @@ export class InventoryItem {
stocked_quantity: number
@BeforeCreate()
private beforeCreate(): void {
beforeCreate(): void {
this.id = generateEntityId(this.id, "iitem")
}
@OnInit()
private onInit(): void {
onInit(): void {
this.id = generateEntityId(this.id, "iitem")
}
}
@@ -114,18 +114,18 @@ export class InventoryLevel {
available_quantity: BigNumber | number | null = null
@BeforeCreate()
private beforeCreate(): void {
beforeCreate(): void {
this.id = generateEntityId(this.id, "ilev")
this.inventory_item_id ??= this.inventory_item?.id
}
@OnInit()
private onInit(): void {
onInit(): void {
this.id = generateEntityId(this.id, "ilev")
}
@OnLoad()
private onLoad(): void {
onLoad(): void {
if (isDefined(this.stocked_quantity) && isDefined(this.reserved_quantity)) {
this.available_quantity = new BigNumber(
MathBN.sub(this.raw_stocked_quantity, this.raw_reserved_quantity)
@@ -111,12 +111,12 @@ export class ReservationItem {
inventory_item: Rel<InventoryItem>
@BeforeCreate()
private beforeCreate(): void {
beforeCreate(): void {
this.id = generateEntityId(this.id, "resitem")
}
@OnInit()
private onInit(): void {
onInit(): void {
this.id = generateEntityId(this.id, "resitem")
}
}
+2 -29
View File
@@ -1,25 +1,6 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
@@ -27,13 +8,5 @@
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
}
}
@@ -1,5 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["node_modules"]
}
+4 -16
View File
@@ -1,22 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"repository": {
"type": "git",
@@ -24,7 +27,8 @@
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"prepare": "cross-env NODE_ENV=production yarn run build",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --passWithNoTests --runInBand --bail --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts"
},
@@ -37,7 +41,7 @@
"rimraf": "^5.0.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.5.0"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
@@ -83,7 +83,7 @@ export function generateGraphQLSchema(
? extend.relationship.isList
: config.isList ?? extend.relationship.isList
const pathSegments = path.split(",").reverse()
// const pathSegments = path.split(",").reverse()
/*const relationshipMarkerIndex = pathSegments.findIndex((segment) => {
return !!joinerConfig.relationships!.find(
+6 -30
View File
@@ -1,36 +1,12 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"]
"@repositories": ["./src/repositories"],
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"include": ["src"],
"exclude": [
"dist",
"./src/**/__tests__",
"./src/**/__mocks__",
"./src/**/__fixtures__",
"node_modules"
]
}
}
@@ -1,5 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src", "integration-tests"],
"exclude": ["node_modules", "dist"]
}
+3 -16
View File
@@ -1,4 +1,5 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
@@ -6,18 +7,4 @@ module.exports = {
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit --passWithNoTests -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -41,7 +45,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
+2 -29
View File
@@ -1,25 +1,6 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
@@ -27,13 +8,5 @@
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
+4 -16
View File
@@ -1,22 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -41,7 +45,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
@@ -4,14 +4,18 @@ import { calculateOrderChange } from "../../../../utils"
describe("Order Exchange - Actions", function () {
const originalOrder = {
id: "1",
items: [
{
id: "1",
quantity: 1,
unit_price: 10,
order_id: "1",
detail: {
quantity: 1,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -24,9 +28,12 @@ describe("Order Exchange - Actions", function () {
id: "2",
quantity: 2,
unit_price: 100,
order_id: "1",
detail: {
quantity: 2,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -39,9 +46,12 @@ describe("Order Exchange - Actions", function () {
id: "3",
quantity: 3,
unit_price: 20,
order_id: "1",
detail: {
quantity: 3,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 3,
fulfilled_quantity: 3,
return_requested_quantity: 0,
@@ -55,6 +65,7 @@ describe("Order Exchange - Actions", function () {
{
id: "ship_123",
amount: 0,
order_id: "1",
},
],
total: 270,
@@ -113,10 +124,13 @@ describe("Order Exchange - Actions", function () {
expect(toJson).toEqual([
{
id: "1",
order_id: "1",
quantity: 1,
unit_price: 10,
detail: {
quantity: 1,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -127,10 +141,13 @@ describe("Order Exchange - Actions", function () {
},
{
id: "2",
order_id: "1",
quantity: 2,
unit_price: 100,
detail: {
quantity: 2,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -141,10 +158,13 @@ describe("Order Exchange - Actions", function () {
},
{
id: "3",
order_id: "1",
quantity: 3,
unit_price: 20,
detail: {
quantity: 3,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 3,
fulfilled_quantity: 3,
return_requested_quantity: "1",
@@ -166,6 +186,7 @@ describe("Order Exchange - Actions", function () {
},
{
id: "item_555",
order_id: "1",
unit_price: 50,
quantity: 1,
actions: [
@@ -185,10 +206,12 @@ describe("Order Exchange - Actions", function () {
expect(changes.order.shipping_methods).toEqual([
{
id: "ship_123",
order_id: "1",
amount: 0,
},
{
id: "shipping_345",
order_id: "1",
amount: 5,
actions: [
{
@@ -200,6 +223,7 @@ describe("Order Exchange - Actions", function () {
},
{
id: "return_shipping_345",
order_id: "1",
amount: 7.5,
actions: [
{
@@ -4,14 +4,18 @@ import { calculateOrderChange } from "../../../../utils"
describe("Order Return - Actions", function () {
const originalOrder = {
id: "1",
items: [
{
id: "1",
quantity: 1,
unit_price: 10,
order_id: "1",
detail: {
order_id: "1",
quantity: 1,
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -24,9 +28,12 @@ describe("Order Return - Actions", function () {
id: "2",
quantity: 2,
unit_price: 100,
order_id: "1",
detail: {
order_id: "1",
quantity: 2,
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -39,9 +46,12 @@ describe("Order Return - Actions", function () {
id: "3",
quantity: 3,
unit_price: 20,
order_id: "1",
detail: {
order_id: "1",
quantity: 3,
delivered_quantity: 1,
shipped_quantity: 3,
fulfilled_quantity: 3,
return_requested_quantity: 0,
@@ -54,7 +64,8 @@ describe("Order Return - Actions", function () {
shipping_methods: [
{
id: "ship_123",
price: 0,
amount: 0,
order_id: "1",
},
],
total: 270,
@@ -130,10 +141,13 @@ describe("Order Return - Actions", function () {
expect(toJson).toEqual([
{
id: "1",
order_id: "1",
quantity: 1,
unit_price: 10,
detail: {
order_id: "1",
quantity: 1,
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -144,11 +158,14 @@ describe("Order Return - Actions", function () {
},
{
id: "2",
order_id: "1",
quantity: 2,
unit_price: 100,
detail: {
order_id: "1",
quantity: 2,
shipped_quantity: 1,
delivered_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: "1",
return_received_quantity: 0,
@@ -158,11 +175,14 @@ describe("Order Return - Actions", function () {
},
{
id: "3",
order_id: "1",
quantity: 3,
unit_price: 20,
detail: {
quantity: 3,
order_id: "1",
shipped_quantity: 3,
delivered_quantity: 1,
fulfilled_quantity: 3,
return_requested_quantity: "2",
return_received_quantity: 0,
@@ -261,10 +281,13 @@ describe("Order Return - Actions", function () {
expect(toJsonReceived).toEqual([
{
id: "1",
order_id: "1",
quantity: 1,
unit_price: 10,
detail: {
quantity: 1,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: 0,
@@ -275,10 +298,13 @@ describe("Order Return - Actions", function () {
},
{
id: "2",
order_id: "1",
quantity: 2,
unit_price: 100,
detail: {
quantity: 2,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 1,
fulfilled_quantity: 1,
return_requested_quantity: "1",
@@ -289,10 +315,13 @@ describe("Order Return - Actions", function () {
},
{
id: "3",
order_id: "1",
quantity: 3,
unit_price: 20,
detail: {
quantity: 3,
order_id: "1",
delivered_quantity: 1,
shipped_quantity: 3,
fulfilled_quantity: 3,
return_requested_quantity: "0",
@@ -64,6 +64,7 @@ import {
import {
CreateOrderChangeDTO,
CreateOrderItemDTO,
UpdateReturnReasonDTO,
CreateOrderLineItemDTO,
CreateOrderLineItemTaxLineDTO,
CreateOrderShippingMethodDTO,
@@ -73,7 +74,6 @@ import {
UpdateOrderLineItemTaxLineDTO,
UpdateOrderShippingMethodTaxLineDTO,
} from "@types"
import { UpdateReturnReasonDTO } from "src/types/return-reason"
import { joinerConfig } from "../joiner-config"
import {
applyChangesToOrder,
@@ -12,6 +12,7 @@ export * from "./shipping-method-adjustment"
export * from "./shipping-method-tax-line"
export * from "./transaction"
export * from "./utils"
export * from "./return-reason"
export type InitializeModuleInjectableDependencies = {
logger?: Logger
+4 -30
View File
@@ -1,38 +1,12 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
+5 -14
View File
@@ -1,19 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -42,7 +46,7 @@
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
+5 -30
View File
@@ -1,37 +1,12 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"]
"@repositories": ["./src/repositories"],
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
+3 -14
View File
@@ -1,4 +1,5 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
@@ -6,16 +7,4 @@ module.exports = {
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -42,7 +46,7 @@
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
@@ -47,9 +47,8 @@ import {
PriceSet,
} from "@models"
import { ServiceTypes } from "@types"
import { eventBuilders, validatePriceListDates } from "@utils"
import { CreatePriceListDTO, UpsertPriceDTO } from "src/types/services"
import { ServiceTypes } from "@types"
import { joinerConfig } from "../joiner-config"
type InjectedDependencies = {
@@ -590,7 +589,7 @@ export default class PricingModuleService
price_list_id: priceListId,
price_rules: hasRulesInput ? rules : undefined,
rules_count: hasRulesInput ? ruleEntries.length : undefined,
} as UpsertPriceDTO
} as ServiceTypes.UpsertPriceDTO
delete (entry as CreatePricesDTO).rules
const entryHash = hashPrice(entry)
@@ -967,7 +966,7 @@ export default class PricingModuleService
)
)
.filter(Boolean)
.flat() as UpsertPriceDTO[]
.flat() as ServiceTypes.UpsertPriceDTO[]
const priceSetMap = new Map<string, PriceSetDTO>(
priceSets.map((p) => [p.id, p])
@@ -1025,18 +1024,18 @@ export default class PricingModuleService
) {
const normalized = this.normalizePriceListDate(data)
const priceListsToCreate: CreatePriceListDTO[] = normalized.map(
(priceListData) => {
const priceListsToCreate: ServiceTypes.CreatePriceListDTO[] =
normalized.map((priceListData) => {
const entry = {
...priceListData,
rules: undefined,
} as CreatePriceListDTO
} as ServiceTypes.CreatePriceListDTO
if (priceListData.prices) {
entry.prices = this.normalizePrices(
priceListData.prices,
[]
) as UpsertPriceDTO[]
) as ServiceTypes.UpsertPriceDTO[]
}
if (priceListData.rules) {
@@ -1060,8 +1059,7 @@ export default class PricingModuleService
}
return entry
}
)
})
const priceLists = await this.priceListService_.create(
priceListsToCreate,
@@ -1156,7 +1154,7 @@ export default class PricingModuleService
const normalizedData = this.normalizePriceListDate(data).map(
(priceList) => {
const entry: Partial<CreatePriceListDTO> = {
const entry: Partial<ServiceTypes.CreatePriceListDTO> = {
...priceList,
rules: undefined,
price_list_rules: undefined,
@@ -1214,17 +1212,17 @@ export default class PricingModuleService
const pricesToUpsert = data
.map((addPrice) =>
this.normalizePrices(
addPrice.prices as UpsertPriceDTO[],
addPrice.prices as ServiceTypes.UpsertPriceDTO[],
existingPrices,
addPrice.price_list_id
)
)
.filter(Boolean)
.flat() as UpsertPriceDTO[]
.flat() as ServiceTypes.UpsertPriceDTO[]
const priceListMap = new Map(priceLists.map((p) => [p.id, p]))
for (const { price_list_id: priceListId, prices } of data) {
for (const { price_list_id: priceListId } of data) {
const priceList = priceListMap.get(priceListId)
if (!priceList) {
@@ -1276,7 +1274,7 @@ export default class PricingModuleService
)
)
.filter(Boolean)
.flat() as UpsertPriceDTO[]
.flat() as ServiceTypes.UpsertPriceDTO[]
const priceListMap = new Map(priceLists.map((p) => [p.id, p]))
pricesToUpsert.forEach((price) => {
@@ -1456,7 +1454,7 @@ export default class PricingModuleService
data: (
| ServiceTypes.UpdatePriceListDTO
| ServiceTypes.CreatePriceListDTO
| CreatePriceListDTO
| ServiceTypes.CreatePriceListDTO
)[]
) {
return data.map((priceListData: any) => {
+2 -30
View File
@@ -1,26 +1,6 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true,
// to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
@@ -28,13 +8,5 @@
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
+4 -16
View File
@@ -1,22 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s$": [
"@swc/jest",
{
jsc: {
parser: { syntax: "typescript", decorators: true },
transform: { decoratorMetadata: true },
},
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -43,7 +47,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9"
@@ -2,19 +2,16 @@ import {
createPsqlIndexStatementHelper,
DALUtils,
generateEntityId,
optionalNumericSerializer,
Searchable,
} from "@medusajs/utils"
import {
BeforeCreate,
Cascade,
Collection,
Entity,
Filter,
Index,
ManyToMany,
ManyToOne,
OneToMany,
OnInit,
PrimaryKey,
Property,
@@ -4,8 +4,6 @@ import { Context, DAL } from "@medusajs/types"
import { SqlEntityManager } from "@mikro-orm/postgresql"
import { DALUtils } from "@medusajs/utils"
import { UpdateProductInput } from "../types"
// eslint-disable-next-line max-len
export class ProductRepository extends DALUtils.mikroOrmBaseRepositoryFactory<Product>(
Product
+4 -30
View File
@@ -1,38 +1,12 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"]
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
+4 -15
View File
@@ -1,21 +1,10 @@
module.exports = {
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@utils": "<rootDir>/src/utils",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
transform: {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
}
})
+7 -3
View File
@@ -5,7 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -23,7 +26,8 @@
"scripts": {
"watch": "tsc --build --watch",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
"test": "jest --runInBand --passWithNoTests --bail --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
@@ -42,7 +46,7 @@
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "1.11.9"
@@ -53,7 +53,6 @@ import {
validateApplicationMethodAttributes,
validatePromotionRuleAttributes,
} from "@utils"
import { EligibleItem } from "src/utils/compute-actions"
import { joinerConfig } from "../joiner-config"
import { CreatePromotionRuleValueDTO } from "../types/promotion-rule-value"
@@ -340,9 +339,15 @@ export default class PromotionModuleService
>()
const methodIdPromoValueMap = new Map<string, number>()
// Keeps a map of all elgible items in the buy section and its eligible quantity
const eligibleBuyItemMap = new Map<string, EligibleItem[]>()
const eligibleBuyItemMap = new Map<
string,
ComputeActionUtils.EligibleItem[]
>()
// Keeps a map of all elgible items in the target section and its eligible quantity
const eligibleTargetItemMap = new Map<string, EligibleItem[]>()
const eligibleTargetItemMap = new Map<
string,
ComputeActionUtils.EligibleItem[]
>()
const automaticPromotions = preventAutoPromotions
? []
: await this.listPromotions(
+2 -29
View File
@@ -1,25 +1,6 @@
{
"extends": "../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
@@ -27,13 +8,5 @@
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
},
"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
}
}
@@ -1,5 +1,10 @@
module.exports = {
transform: { "^.+\\.[jt]s?$": "@swc/jest" },
testEnvironment: `node`,
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
}
const defineJestConfig = require("../../../../define_jest_config")
module.exports = defineJestConfig({
moduleNameMapper: {
"^@models": "<rootDir>/src/models",
"^@services": "<rootDir>/src/services",
"^@repositories": "<rootDir>/src/repositories",
"^@types": "<rootDir>/src/types",
"^@utils": "<rootDir>/src/utils",
},
})
@@ -9,7 +9,10 @@
"directory": "packages/modules/providers/auth-emailpass"
},
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"engines": {
"node": ">=20"
@@ -26,7 +29,7 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"typescript": "^5.3.3"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
@@ -1,33 +1,12 @@
{
"extends": "../../../../_tsconfig.base.json",
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"jsx": "react-jsx" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true,
"downlevelIteration": true, // to use ES5 specific tooling
"inlineSourceMap": true /* Emit a single file with source maps instead of having a separate file. */
},
"include": ["src"],
"exclude": [
"dist",
"build",
"src/**/__tests__",
"src/**/__mocks__",
"src/**/__fixtures__",
"node_modules",
".eslintrc.js"
]
"paths": {
"@models": ["./src/models"],
"@services": ["./src/services"],
"@repositories": ["./src/repositories"],
"@types": ["./src/types"],
"@utils": ["./src/utils"]
}
}
}
Loaded 100 of 216 files, more files were not shown because too many files have changed in this diff. Show more