chore: upgrade moduleResolution to Node16 (#9269)
This commit is contained in:
1 parent
d721282600
commit
9e711720dd
216 files changed
+981
-2439
No files matched your search
@@ -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/"],
|
||||
}
|
||||
})
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user