medusa-test-utils 1.1.45-preview-20240722060544 → 1.1.45-preview-20240722101604
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-db.d.ts","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.ts"],"names":[],"mappings":"AAOA,wBAAsB,MAAM,CAAC,EAC3B,GAAG,EACH,GAAQ,GACT,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CACvB,
|
1
|
+
{"version":3,"file":"use-db.d.ts","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.ts"],"names":[],"mappings":"AAOA,wBAAsB,MAAM,CAAC,EAC3B,GAAG,EACH,GAAQ,GACT,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CACvB,gBAsDA"}
|
@@ -21,8 +21,22 @@ async function initDb({ cwd, env = {}, }) {
|
|
21
21
|
[utils_1.ContainerRegistrationKeys.FEATURE_FLAG_ROUTER]: (0, awilix_1.asValue)(featureFlagRouter),
|
22
22
|
});
|
23
23
|
try {
|
24
|
-
const { runMedusaAppMigrations, } = require("@medusajs/medusa/dist/loaders/medusa-app");
|
24
|
+
const { runMedusaAppMigrations, getLinksExecutionPlanner, } = require("@medusajs/medusa/dist/loaders/medusa-app");
|
25
25
|
await runMedusaAppMigrations({ configModule, container });
|
26
|
+
const planner = await getLinksExecutionPlanner({
|
27
|
+
configModule,
|
28
|
+
container,
|
29
|
+
});
|
30
|
+
const actionPlan = await planner.createPlan();
|
31
|
+
await planner.executePlan(actionPlan);
|
32
|
+
/**
|
33
|
+
* cleanup temporary created resources for the migrations
|
34
|
+
* @internal I didnt find a god place to put that, should we eventually add a close function
|
35
|
+
* to the planner to handle that part? so that you would do planner.close() and it will handle the cleanup
|
36
|
+
* automatically just like we usually do for the classic migrations actions
|
37
|
+
*/
|
38
|
+
const { MedusaModule } = require("@medusajs/modules-sdk");
|
39
|
+
MedusaModule.clearInstances();
|
26
40
|
}
|
27
41
|
catch (err) {
|
28
42
|
console.error("Something went wrong while running the migrations");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-db.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.ts"],"names":[],"mappings":";;;AAAA,2CAIwB;AACxB,mCAAgC;AAEzB,KAAK,UAAU,MAAM,CAAC,EAC3B,GAAG,EACH,GAAG,GAAG,EAAE,GAIT;IACC,IAAI,IAAA,gBAAQ,EAAC,GAAG,CAAC,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,6BAAqB,GAAE,CAAA;IAEzC,MAAM,YAAY,GAChB,MAAM,OAAO,CAAC,sCAAsC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAEpE,MAAM,YAAY,GAChB,MAAM,OAAO,CAAC,6CAA6C,CAAC,CAAC,OAAO,CAAC;QACnE,YAAY;QACZ,SAAS;KACV,CAAC,CAAA;IAEJ,MAAM,iBAAiB,GACrB,OAAO,CAAC,6CAA6C,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;IAE9E,SAAS,CAAC,QAAQ,CAAC;QACjB,CAAC,iCAAyB,CAAC,aAAa,CAAC,EAAE,IAAA,gBAAO,EAAC,YAAY,CAAC;QAChE,CAAC,iCAAyB,CAAC,MAAM,CAAC,EAAE,IAAA,gBAAO,EAAC,OAAO,CAAC;QACpD,CAAC,iCAAyB,CAAC,aAA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C,YAAY,CAAC;QAChE,CAAC,iCAAyB,CAAC,mBAAmB,CAAC,EAAE,IAAA,gBAAO,EAAC,iBAAiB,CAAC;KAC5E,CAAC,CAAA;IAEF,IAAI,CAAC;QACH,MAAM,EACJ,sBAAsB,EACtB,wBAAwB,GACzB,GAAG,OAAO,CAAC,0CAA0C,CAAC,CAAA;QACvD,MAAM,sBAAsB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAA;QACzD,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC;YAC7C,YAAY;YACZ,SAAS;SACV,CAAC,CAAA;QAEF,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAA;QAC7C,MAAM,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QAErC;;;;;WAKG;QACH,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;QACzD,YAAY,CAAC,cAAc,EAAE,CAAA;IAC/B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAA;QAClE,MAAM,GAAG,CAAA;IACX,CAAC;IAED,OAAO,YAAY,CAAA;AACrB,CAAC;AA5DD,wBA4DC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "medusa-test-utils",
|
3
|
-
"version": "1.1.45-preview-
|
3
|
+
"version": "1.1.45-preview-20240722101604",
|
4
4
|
"description": "Test utils for Medusa",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"repository": {
|
@@ -24,15 +24,15 @@
|
|
24
24
|
"author": "Sebastian Rindom",
|
25
25
|
"license": "MIT",
|
26
26
|
"devDependencies": {
|
27
|
-
"@medusajs/types": "1.12.0-preview-
|
27
|
+
"@medusajs/types": "1.12.0-preview-20240722101604",
|
28
28
|
"cross-env": "^5.2.1",
|
29
29
|
"jest": "^29.7.0",
|
30
30
|
"rimraf": "^3.0.2",
|
31
31
|
"typescript": "^5.1.6"
|
32
32
|
},
|
33
33
|
"peerDependencies": {
|
34
|
-
"@medusajs/medusa": "1.20.6-preview-
|
35
|
-
"@medusajs/modules-sdk": "1.13.0-preview-
|
34
|
+
"@medusajs/medusa": "1.20.6-preview-20240722101604",
|
35
|
+
"@medusajs/modules-sdk": "1.13.0-preview-20240722101604",
|
36
36
|
"axios": "^0.28.0",
|
37
37
|
"express": "^4.18.3",
|
38
38
|
"get-port": "^5.1.0",
|
@@ -56,7 +56,7 @@
|
|
56
56
|
}
|
57
57
|
},
|
58
58
|
"dependencies": {
|
59
|
-
"@medusajs/utils": "1.12.0-preview-
|
59
|
+
"@medusajs/utils": "1.12.0-preview-20240722101604",
|
60
60
|
"@mikro-orm/migrations": "5.9.7",
|
61
61
|
"@mikro-orm/postgresql": "5.9.7",
|
62
62
|
"randomatic": "^3.1.1"
|