chore(): Move peer deps into a single package and re export from framework (#13439)
* chore(): Move peer deps into a single package and re export from framework * WIP * update core packages * update cli and deps * update medusa * update exports path * remove analyze * update modules deps * finalise changes * fix yarn * fix import * Refactor peer dependencies into a single package Consolidate peer dependencies into one package and re-export from the framework. * update changeset * Update .changeset/brown-cows-sleep.md Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * rm deps * fix deps * increase timeout * upgrade version * update versions * update versions * fixes * update lock * fix missing import * fix missing import --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
55f89b2151
commit
12a96a7c70
@@ -25,7 +25,7 @@ import {
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import { moduleIntegrationTestRunner } from "@medusajs/test-utils"
|
||||
import { WorkflowsModuleService } from "@services"
|
||||
import { asFunction } from "awilix"
|
||||
import { asFunction } from "@medusajs/framework/awilix"
|
||||
import { setTimeout as setTimeoutSync } from "timers"
|
||||
import { setTimeout as setTimeoutPromise } from "timers/promises"
|
||||
import { ulid } from "ulid"
|
||||
|
||||
@@ -38,10 +38,6 @@
|
||||
"devDependencies": {
|
||||
"@medusajs/framework": "2.10.3",
|
||||
"@medusajs/test-utils": "2.10.3",
|
||||
"@mikro-orm/cli": "6.5.4",
|
||||
"@mikro-orm/core": "6.5.4",
|
||||
"@mikro-orm/migrations": "6.5.4",
|
||||
"@mikro-orm/postgresql": "6.5.4",
|
||||
"@swc/core": "^1.7.28",
|
||||
"@swc/jest": "^0.2.36",
|
||||
"jest": "^29.7.0",
|
||||
@@ -54,10 +50,6 @@
|
||||
"ulid": "^2.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@medusajs/framework": "2.10.3",
|
||||
"@mikro-orm/core": "6.5.4",
|
||||
"@mikro-orm/migrations": "6.5.4",
|
||||
"@mikro-orm/postgresql": "6.5.4",
|
||||
"awilix": "^8.0.1"
|
||||
"@medusajs/framework": "2.10.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { asClass } from "awilix"
|
||||
import { asClass } from "@medusajs/framework/awilix"
|
||||
import { InMemoryDistributedTransactionStorage } from "../utils"
|
||||
|
||||
export default async ({ container }): Promise<void> => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
import { Migration } from "@medusajs/framework/mikro-orm/migrations"
|
||||
|
||||
export class Migration20231221104256 extends Migration {
|
||||
async up(): Promise<void> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
import { Migration } from "@medusajs/framework/mikro-orm/migrations"
|
||||
|
||||
export class Migration20241206101446 extends Migration {
|
||||
async up(): Promise<void> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
import { Migration } from "@medusajs/framework/mikro-orm/migrations"
|
||||
|
||||
export class Migration20250128174331 extends Migration {
|
||||
override async up(): Promise<void> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
import { Migration } from "@medusajs/framework/mikro-orm/migrations"
|
||||
import { ulid } from "ulid"
|
||||
|
||||
export class Migration20250505092459 extends Migration {
|
||||
@@ -19,7 +19,7 @@ export class Migration20250505092459 extends Migration {
|
||||
this.addSql(
|
||||
`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id_run_id_unique" ON "workflow_execution" (workflow_id, transaction_id, run_id) WHERE deleted_at IS NULL;`
|
||||
)
|
||||
/*
|
||||
/*
|
||||
* We mistakenly named this migration differently in the workflow engines; this has caused issues with the migrations. Switching between engines will fail because the primary key is attempted to be set twice.
|
||||
* The issue happens in the following scenario:
|
||||
* 1. In memory engine is used
|
||||
@@ -29,9 +29,9 @@ export class Migration20250505092459 extends Migration {
|
||||
* 4. Migration is run
|
||||
* 5. Same primary key is attempted to be set again
|
||||
* 6. Migration fails
|
||||
*
|
||||
*
|
||||
* The same scenario can happen if you go from Redis to In memory.
|
||||
*
|
||||
*
|
||||
* With this fix, we ensure the primary key is only ever set once.
|
||||
*/
|
||||
this.addSql(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
import { Migration } from "@medusajs/framework/mikro-orm/migrations"
|
||||
|
||||
export class Migration20250819104213 extends Migration {
|
||||
override async up(): Promise<void> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
import { Migration } from "@medusajs/framework/mikro-orm/migrations"
|
||||
|
||||
export class Migration20250819110924 extends Migration {
|
||||
override async up(): Promise<void> {
|
||||
|
||||
@@ -1,19 +1,33 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
import { Migration } from "@medusajs/deps/mikro-orm/migrations"
|
||||
|
||||
export class Migration20250908080305 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id" ON "workflow_execution" (workflow_id, transaction_id) WHERE deleted_at IS NULL;`);
|
||||
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_state_updated_at" ON "workflow_execution" (state, updated_at) WHERE deleted_at IS NULL;`);
|
||||
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_retention_time_updated_at_state" ON "workflow_execution" (retention_time, updated_at, state) WHERE deleted_at IS NULL AND retention_time IS NOT NULL;`);
|
||||
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_updated_at_retention_time" ON "workflow_execution" (updated_at, retention_time) WHERE deleted_at IS NULL AND retention_time IS NOT NULL AND state IN ('done', 'failed', 'reverted');`);
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id" ON "workflow_execution" (workflow_id, transaction_id) WHERE deleted_at IS NULL;`
|
||||
)
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_state_updated_at" ON "workflow_execution" (state, updated_at) WHERE deleted_at IS NULL;`
|
||||
)
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_retention_time_updated_at_state" ON "workflow_execution" (retention_time, updated_at, state) WHERE deleted_at IS NULL AND retention_time IS NOT NULL;`
|
||||
)
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_updated_at_retention_time" ON "workflow_execution" (updated_at, retention_time) WHERE deleted_at IS NULL AND retention_time IS NOT NULL AND state IN ('done', 'failed', 'reverted');`
|
||||
)
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`drop index if exists "IDX_workflow_execution_workflow_id_transaction_id";`);
|
||||
this.addSql(`drop index if exists "IDX_workflow_execution_state_updated_at";`);
|
||||
this.addSql(`drop index if exists "IDX_workflow_execution_retention_time_updated_at_state";`);
|
||||
this.addSql(`drop index if exists "IDX_workflow_execution_updated_at_retention_time";`);
|
||||
this.addSql(
|
||||
`drop index if exists "IDX_workflow_execution_workflow_id_transaction_id";`
|
||||
)
|
||||
this.addSql(
|
||||
`drop index if exists "IDX_workflow_execution_state_updated_at";`
|
||||
)
|
||||
this.addSql(
|
||||
`drop index if exists "IDX_workflow_execution_retention_time_updated_at_state";`
|
||||
)
|
||||
this.addSql(
|
||||
`drop index if exists "IDX_workflow_execution_updated_at_retention_time";`
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import type {
|
||||
ReturnWorkflow,
|
||||
UnwrapWorkflowInputDataType,
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||
import { SqlEntityManager } from "@medusajs/framework/mikro-orm/postgresql"
|
||||
import { WorkflowExecution } from "@models"
|
||||
import { WorkflowOrchestratorService } from "@services"
|
||||
import { WorkflowOrchestratorCancelOptions } from "@types"
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
TransactionStepState,
|
||||
isPresent,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { raw } from "@mikro-orm/core"
|
||||
import { raw } from "@medusajs/framework/mikro-orm/core"
|
||||
import { WorkflowOrchestratorService } from "@services"
|
||||
import { type CronExpression, parseExpression } from "cron-parser"
|
||||
import { WorkflowExecution } from "../models/workflow-execution"
|
||||
|
||||
Reference in New Issue
Block a user