Chore(medusa,utils,types,inventory,stock-location): remove core dependency modules (#3531)
This commit is contained in:
1 parent
bfef22b33e
commit
4e9d257d3b
159 files changed
+1769
-693
No files matched your search
@@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
globals: {
|
||||
"ts-jest": {
|
||||
tsConfig: "tsconfig.json",
|
||||
tsConfig: "tsconfig.spec.json",
|
||||
isolatedModules: false,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
"author": "Medusa",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@medusajs/medusa": "^1.7.7",
|
||||
"@medusajs/types": "*",
|
||||
"@medusajs/types": "^0.0.1",
|
||||
"cross-env": "^5.2.1",
|
||||
"jest": "^25.5.4",
|
||||
"ts-jest": "^25.5.1",
|
||||
"typescript": "^4.4.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@medusajs/modules-sdk": "*",
|
||||
"@medusajs/modules-sdk": "^0.0.1",
|
||||
"@medusajs/utils": "^0.0.1",
|
||||
"awilix": "^8.0.0",
|
||||
"typeorm": "^0.3.11"
|
||||
@@ -36,9 +35,5 @@
|
||||
"build": "tsc --build",
|
||||
"test": "jest --passWithNoTests",
|
||||
"test:unit": "jest --passWithNoTests"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@medusajs/medusa": "^1.7.7",
|
||||
"@medusajs/types": "^0.0.1"
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
import { IStockLocationService } from "@medusajs/medusa"
|
||||
import {
|
||||
ExternalModuleDeclaration,
|
||||
InternalModuleDeclaration,
|
||||
MedusaModule
|
||||
MedusaModule,
|
||||
} from "@medusajs/modules-sdk"
|
||||
import { EventBusTypes } from "@medusajs/types"
|
||||
import { IEventBusService, IStockLocationService } from "@medusajs/types"
|
||||
import { StockLocationServiceInitializeOptions } from "../types"
|
||||
|
||||
export const initialize = async (
|
||||
options?: StockLocationServiceInitializeOptions | ExternalModuleDeclaration,
|
||||
injectedDependencies?: {
|
||||
eventBusService: EventBusTypes.IEventBusService
|
||||
eventBusService: IEventBusService
|
||||
}
|
||||
): Promise<IStockLocationService> => {
|
||||
const serviceKey = "stockLocationService"
|
||||
|
||||
@@ -2,10 +2,10 @@ import {
|
||||
InternalModuleDeclaration,
|
||||
LoaderOptions,
|
||||
MODULE_RESOURCE_TYPE,
|
||||
MODULE_SCOPE
|
||||
MODULE_SCOPE,
|
||||
} from "@medusajs/modules-sdk"
|
||||
import { MedusaError } from "@medusajs/utils"
|
||||
import { asValue } from "awilix"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
import { DataSource, DataSourceOptions } from "typeorm"
|
||||
import * as StockLocationModels from "../models"
|
||||
import { StockLocationServiceInitializeOptions } from "../types"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { generateEntityId, SoftDeletableEntity } from "@medusajs/utils"
|
||||
import { BeforeInsert, Column, Entity, Index } from "typeorm"
|
||||
import { SoftDeletableEntity, generateEntityId } from "@medusajs/medusa"
|
||||
|
||||
@Entity()
|
||||
export class StockLocationAddress extends SoftDeletableEntity {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { generateEntityId, SoftDeletableEntity } from "@medusajs/utils"
|
||||
import {
|
||||
BeforeInsert,
|
||||
Column,
|
||||
@@ -6,9 +7,7 @@ import {
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm"
|
||||
import { SoftDeletableEntity, generateEntityId } from "@medusajs/medusa"
|
||||
|
||||
import { StockLocationAddress } from "."
|
||||
import { StockLocationAddress } from "./stock-location-address"
|
||||
|
||||
@Entity()
|
||||
export class StockLocation extends SoftDeletableEntity {
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
|
||||
import {
|
||||
buildQuery,
|
||||
CreateStockLocationInput,
|
||||
FilterableStockLocationProps,
|
||||
FindConfig,
|
||||
setMetadata,
|
||||
IEventBusService,
|
||||
SharedContext,
|
||||
StockLocationAddressInput,
|
||||
UpdateStockLocationInput
|
||||
} from "@medusajs/medusa"
|
||||
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
|
||||
import { EventBusTypes, SharedContext } from "@medusajs/types"
|
||||
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
|
||||
import { isDefined, MedusaError } from "medusa-core-utils"
|
||||
UpdateStockLocationInput,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
buildQuery,
|
||||
InjectEntityManager,
|
||||
isDefined,
|
||||
MedusaContext,
|
||||
MedusaError,
|
||||
setMetadata,
|
||||
} from "@medusajs/utils"
|
||||
import { EntityManager } from "typeorm"
|
||||
import { StockLocation, StockLocationAddress } from "../models"
|
||||
|
||||
type InjectedDependencies = {
|
||||
manager: EntityManager
|
||||
eventBusService: EventBusTypes.IEventBusService
|
||||
eventBusService: IEventBusService
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +36,7 @@ export default class StockLocationService {
|
||||
}
|
||||
|
||||
protected readonly manager_: EntityManager
|
||||
protected readonly eventBusService_: EventBusTypes.IEventBusService
|
||||
protected readonly eventBusService_: IEventBusService
|
||||
|
||||
constructor(
|
||||
{ eventBusService, manager }: InjectedDependencies,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in new issue
Block a user