diff --git a/_tsconfig.base.json b/_tsconfig.base.json index 7452b366f3..8c8f0acaf5 100644 --- a/_tsconfig.base.json +++ b/_tsconfig.base.json @@ -19,8 +19,7 @@ "strictFunctionTypes": true, "noImplicitThis": true, "allowJs": true, - "skipLibCheck": true, - "rootDir": "${configDir}/src" + "skipLibCheck": true }, "include": ["${configDir}/src"], "exclude": ["${configDir}/dist", "${configDir}/node_modules"] diff --git a/integration-tests/api/package.json b/integration-tests/api/package.json index 3413fc2489..64b85bbe5a 100644 --- a/integration-tests/api/package.json +++ b/integration-tests/api/package.json @@ -35,6 +35,6 @@ "form-data": "^4.0.0", "jest": "^29.7.0", "jest-environment-node": "^29.7.0", - "typescript": "^5.3.3" + "typescript": "^5.6.2" } } diff --git a/integration-tests/http/package.json b/integration-tests/http/package.json index d804112519..9a3a704cf1 100644 --- a/integration-tests/http/package.json +++ b/integration-tests/http/package.json @@ -40,6 +40,6 @@ "@swc/jest": "^0.2.36", "jest": "^29.7.0", "jest-environment-node": "^29.7.0", - "typescript": "^5.3.3" + "typescript": "^5.6.2" } } diff --git a/integration-tests/modules/package.json b/integration-tests/modules/package.json index d3af78cd22..5c6855ebd6 100644 --- a/integration-tests/modules/package.json +++ b/integration-tests/modules/package.json @@ -40,6 +40,6 @@ "@swc/jest": "^0.2.36", "jest": "^29.7.0", "jest-environment-node": "^29.7.0", - "typescript": "^5.3.3" + "typescript": "^5.6.2" } } diff --git a/packages/cli/create-medusa-app/src/commands/create.ts b/packages/cli/create-medusa-app/src/commands/create.ts index 8217a7ed1b..5b76df3cb6 100644 --- a/packages/cli/create-medusa-app/src/commands/create.ts +++ b/packages/cli/create-medusa-app/src/commands/create.ts @@ -17,7 +17,6 @@ import { track } from "medusa-telemetry" import boxen from "boxen" import { emojify } from "node-emoji" import ProcessManager from "../utils/process-manager.js" -import { nanoid } from "nanoid" import { displayFactBox, FactBoxOptions } from "../utils/facts.js" import { EOL } from "os" import { runCloneRepo } from "../utils/clone-repo.js" @@ -57,7 +56,7 @@ export default async ({ if (nodeVersion < MIN_SUPPORTED_NODE_VERSION) { logMessage({ message: `Medusa requires at least v20 of Node.js. You're using v${nodeVersion}. Please install at least v20 and try again: https://nodejs.org/en/download`, - type: "error" + type: "error", }) } track("CREATE_CLI_CMA") @@ -160,7 +159,7 @@ export default async ({ abortController, factBoxOptions, verbose, - processManager + processManager, }) : "" @@ -297,7 +296,17 @@ function showSuccessMessage( message: boxen( chalk.green( // eslint-disable-next-line prettier/prettier - `Change to the \`${projectName}\` directory to explore your Medusa project.${EOL}${EOL}Start your Medusa app again with the following command:${EOL}${EOL}yarn dev${EOL}${EOL}${inviteToken ? `After you start the Medusa app, you can set a password for your admin user with the URL ${getInviteUrl(inviteToken)}${EOL}${EOL}` : ""}${nextjsDirectory?.length ? `The Next.js Starter storefront was installed in the \`${nextjsDirectory}\` directory. Change to that directory and start it with the following command:${EOL}${EOL}npm run dev${EOL}${EOL}` : ""}Check out the Medusa documentation to start your development:${EOL}${EOL}https://docs.medusajs.com/${EOL}${EOL}Star us on GitHub if you like what we're building:${EOL}${EOL}https://github.com/medusajs/medusa/stargazers` + `Change to the \`${projectName}\` directory to explore your Medusa project.${EOL}${EOL}Start your Medusa app again with the following command:${EOL}${EOL}yarn dev${EOL}${EOL}${ + inviteToken + ? `After you start the Medusa app, you can set a password for your admin user with the URL ${getInviteUrl( + inviteToken + )}${EOL}${EOL}` + : "" + }${ + nextjsDirectory?.length + ? `The Next.js Starter storefront was installed in the \`${nextjsDirectory}\` directory. Change to that directory and start it with the following command:${EOL}${EOL}npm run dev${EOL}${EOL}` + : "" + }Check out the Medusa documentation to start your development:${EOL}${EOL}https://docs.medusajs.com/${EOL}${EOL}Star us on GitHub if you like what we're building:${EOL}${EOL}https://github.com/medusajs/medusa/stargazers` ), { titleAlignment: "center", diff --git a/packages/core/medusa-test-utils/src/medusa-test-runner.ts b/packages/core/medusa-test-utils/src/medusa-test-runner.ts index f09039c8db..3e08d1d6ef 100644 --- a/packages/core/medusa-test-utils/src/medusa-test-runner.ts +++ b/packages/core/medusa-test-utils/src/medusa-test-runner.ts @@ -37,7 +37,6 @@ export function medusaIntegrationTestRunner({ moduleName, dbName, medusaConfigFile, - loadApplication, schema = "public", env = {}, debug = false, @@ -48,7 +47,6 @@ export function medusaIntegrationTestRunner({ env?: Record dbName?: string medusaConfigFile?: string - loadApplication?: boolean schema?: string debug?: boolean inApp?: boolean @@ -133,9 +131,7 @@ export function medusaIntegrationTestRunner({ let serverShutdownRes: () => any let portRes: number - if (loadApplication) { - loadedApplication = await appLoader.load() - } + loadedApplication = await appLoader.load() try { const { diff --git a/packages/core/utils/package.json b/packages/core/utils/package.json index 262dd29270..dbfab45b8e 100644 --- a/packages/core/utils/package.json +++ b/packages/core/utils/package.json @@ -28,18 +28,21 @@ "devDependencies": { "@swc/jest": "^0.2.36", "@types/express": "^4.17.21", - "cross-env": "^5.2.1", "expect-type": "^0.20.0", "express": "^4.21.0", "jest": "^29.7.0", + "pg-god": "^1.0.12", "rimraf": "^5.0.1", "typescript": "^5.6.2" }, "dependencies": { + "@graphql-codegen/core": "^4.0.2", + "@graphql-codegen/typescript": "^4.0.9", "@graphql-tools/merge": "^9.0.7", "@graphql-tools/schema": "^10.0.6", "@medusajs/types": "^1.11.16", "@mikro-orm/core": "5.9.7", + "@mikro-orm/knex": "5.9.7", "@mikro-orm/migrations": "5.9.7", "@mikro-orm/postgresql": "5.9.7", "awilix": "^8.0.1", diff --git a/packages/core/utils/src/graphql/graphql-to-ts-types.ts b/packages/core/utils/src/graphql/graphql-to-ts-types.ts index 34fe687e50..037a3396c5 100644 --- a/packages/core/utils/src/graphql/graphql-to-ts-types.ts +++ b/packages/core/utils/src/graphql/graphql-to-ts-types.ts @@ -1,9 +1,9 @@ -import { FileSystem } from "@medusajs/utils" import { GraphQLSchema } from "graphql/type" import { parse, printSchema } from "graphql" import { codegen } from "@graphql-codegen/core" import * as typescriptPlugin from "@graphql-codegen/typescript" import { ModuleJoinerConfig } from "@medusajs/types" +import { FileSystem } from "../common" function buildEntryPointsTypeMap({ schema, diff --git a/yarn.lock b/yarn.lock index 86db165a92..3f1a2c136d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6739,17 +6739,19 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/utils@workspace:packages/core/utils" dependencies: + "@graphql-codegen/core": ^4.0.2 + "@graphql-codegen/typescript": ^4.0.9 "@graphql-tools/merge": ^9.0.7 "@graphql-tools/schema": ^10.0.6 "@medusajs/types": ^1.11.16 "@mikro-orm/core": 5.9.7 + "@mikro-orm/knex": 5.9.7 "@mikro-orm/migrations": 5.9.7 "@mikro-orm/postgresql": 5.9.7 "@swc/jest": ^0.2.36 "@types/express": ^4.17.21 awilix: ^8.0.1 bignumber.js: ^9.1.2 - cross-env: ^5.2.1 dotenv: ^16.4.5 dotenv-expand: ^11.0.6 expect-type: ^0.20.0 @@ -6759,6 +6761,7 @@ __metadata: jsonwebtoken: ^9.0.2 pg: ^8.13.0 pg-connection-string: ^2.7.0 + pg-god: ^1.0.12 pluralize: ^8.0.0 rimraf: ^5.0.1 typescript: ^5.6.2 @@ -22173,7 +22176,7 @@ __metadata: jest: ^29.7.0 jest-environment-node: ^29.7.0 pg: ^8.11.3 - typescript: ^5.3.3 + typescript: ^5.6.2 languageName: unknown linkType: soft @@ -22209,7 +22212,7 @@ __metadata: jest-environment-node: ^29.7.0 medusa-test-utils: "workspace:*" pg: ^8.11.3 - typescript: ^5.3.3 + typescript: ^5.6.2 languageName: unknown linkType: soft @@ -22245,7 +22248,7 @@ __metadata: jest-environment-node: ^29.7.0 medusa-test-utils: "workspace:*" pg: ^8.11.3 - typescript: ^5.3.3 + typescript: ^5.6.2 languageName: unknown linkType: soft