Skip to content

Commit

Permalink
Merge branch 'develop' into fix/local-workflow-orchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p authored Aug 27, 2024
2 parents 6d2293c + 59217a9 commit fcdebac
Show file tree
Hide file tree
Showing 66 changed files with 627 additions and 481 deletions.
3 changes: 1 addition & 2 deletions packages/cli/create-medusa-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"dev": "node --loader ts-node/esm src/index.ts",
"start": "node dist/index.js",
"build": "tsc",
"watch": "tsc --watch",
"prepublishOnly": "cross-env NODE_ENV=production tsc --build"
"watch": "tsc --watch"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/medusa-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"scripts": {
"test": "jest --passWithNoTests src",
"build": "rimraf dist && tsc",
"watch": "tsc --watch",
"prepublishOnly": "cross-env NODE_ENV=production tsc --build"
"watch": "tsc --watch"
},
"author": "Sebastian Rindom",
"license": "MIT",
Expand Down
52 changes: 38 additions & 14 deletions packages/cli/medusa-cli/src/create-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function buildLocalCommands(cli, isLocalProject) {

function resolveLocalCommand(command) {
if (!isLocalProject) {
cli.showHelp()
cli.showHelp((s: string) => console.log(s))
}

try {
Expand All @@ -44,12 +44,8 @@ function buildLocalCommands(cli, isLocalProject) {
)!
return require(cmdPath).default
} catch (err) {
if (!process.env.NODE_ENV?.startsWith("prod")) {
console.log("--------------- ERROR ---------------------")
console.log(err)
console.log("-------------------------------------------")
}
cli.showHelp()
console.error(err)
cli.showHelp((s: string) => console.error(s))
}
}

Expand Down Expand Up @@ -146,6 +142,26 @@ function buildLocalCommands(cli, isLocalProject) {
})
),
})
.command({
command: "db:sync-links",
desc: "Sync database schema with the links defined by your application and Medusa core",
builder: (builder) => {
builder.option("execute-all", {
type: "boolean",
describe: "Skip prompts and execute all (including unsafe) actions",
})
builder.option("execute-safe", {
type: "boolean",
describe: "Skip prompts and execute only safe actions",
})
},
handler: handlerP(
getCommandHandler("db/sync-links", (args, cmd) => {
process.env.NODE_ENV = process.env.NODE_ENV || `development`
return cmd(args)
})
),
})
.command({
command: `telemetry`,
describe: `Enable or disable collection of anonymous usage data.`,
Expand Down Expand Up @@ -484,15 +500,23 @@ export default (argv) => {
const arg = argv.slice(2)[0]
const suggestion = arg ? didYouMean(arg, availableCommands) : ``

if (!process.env.NODE_ENV?.startsWith("prod")) {
console.log("--------------- ERROR ---------------------")
console.log(err)
console.log("-------------------------------------------")
if (msg) {
reporter.error(msg)
console.log()
}
if (suggestion) {
reporter.info(suggestion)
console.log()
}

if (err) {
console.error("--------------- ERROR ---------------------")
console.error(err)
console.error("-------------------------------------------")
}

cli.showHelp()
reporter.info(suggestion)
reporter.info(msg)
cli.showHelp((s: string) => console.error(s))
process.exit(1)
})
.parse(argv.slice(2))
}
1 change: 0 additions & 1 deletion packages/cli/medusa-dev-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"directory": "packages/medusa-dev-cli"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"test": "jest --passWithNoTests -- src",
"build": "tsc",
"watch": "tsc --watch"
Expand Down
1 change: 0 additions & 1 deletion packages/cli/oas/medusa-oas-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"uuid": "^9.0.0"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "tsc --build",
"medusa-oas": "ts-node src/index.ts"
},
Expand Down
1 change: 0 additions & 1 deletion packages/core/core-flows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"ulid": "^2.3.0"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "jest --runInBand --bail --forceExit --passWithNoTests"
Expand Down
1 change: 0 additions & 1 deletion packages/core/js-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"qs": "^6.12.1"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"test": "jest --passWithNoTests --runInBand --bail --forceExit",
"watch": "tsc --build --watch"
Expand Down
2 changes: 0 additions & 2 deletions packages/core/medusa-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"node": ">=16"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"prepare": "cross-env NODE_ENV=production yarn run build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "jest --passWithNoTests src"
Expand Down
1 change: 0 additions & 1 deletion packages/core/modules-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"awilix": "^8.0.1"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"test": "jest --runInBand --bail --forceExit",
"watch": "tsc --build --watch"
Expand Down
1 change: 0 additions & 1 deletion packages/core/orchestration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"awilix": "^8.0.1"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "jest --runInBand --bail --forceExit"
Expand Down
1 change: 0 additions & 1 deletion packages/core/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"winston": "^3.8.2"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "exit 0"
Expand Down
1 change: 0 additions & 1 deletion packages/core/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"ulid": "^2.3.0"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "jest --silent --bail --maxWorkers=50% --forceExit --testPathIgnorePatterns='/integration-tests/' -- src/**/__tests__/**/*.ts",
Expand Down
3 changes: 1 addition & 2 deletions packages/core/utils/src/dml/__tests__/entity-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { ArrayType, EntityMetadata, MetadataStorage } from "@mikro-orm/core"
import { expectTypeOf } from "expect-type"
import { DmlEntity } from "../entity"
import { model } from "../entity-builder"
import { DuplicateIdPropertyError } from "../errors"
import {
createMikrORMEntity,
toMikroOrmEntities,
toMikroORMEntity,
} from "../helpers/create-mikro-orm-entity"
import { User } from "@medusajs/icons"
import { DuplicateIdPropertyError } from "../errors"

describe("Entity builder", () => {
beforeEach(() => {
Expand Down
1 change: 0 additions & 1 deletion packages/core/workflows-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"ulid": "^2.3.0"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "jest --runInBand --bail --forceExit",
Expand Down
1 change: 0 additions & 1 deletion packages/framework/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"scripts": {
"watch": "tsc --watch -p ./tsconfig.build.json",
"watch:test": "tsc --build tsconfig.spec.json --watch",
"prepublishOnly": "cross-env NODE_ENV=production tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
"build": "rimraf dist && tsc --noEmit && tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
"test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/framework/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig",
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": [
"dist",
Expand Down
5 changes: 0 additions & 5 deletions packages/medusa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
},
"scripts": {
"watch": "tsc --build --watch",
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"serve": "node dist/app.js",
"test": "jest --silent --bail --maxWorkers=50% --forceExit"
Expand Down Expand Up @@ -64,14 +63,10 @@
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"express": "^4.18.2",
"express-session": "^1.17.3",
"fs-exists-cached": "^1.0.0",
"glob": "^7.1.6",
"ioredis": "^5.4.1",
"ioredis-mock": "8.4.0",
"lodash": "^4.17.21",
"medusa-telemetry": "^0.0.17",
"morgan": "^1.9.1",
"multer": "^1.4.5-lts.1",
"node-schedule": "^2.1.1",
"qs": "^6.11.2",
Expand Down
Loading

0 comments on commit fcdebac

Please sign in to comment.