fix: base tsconfig (#9309)

* fix: base tsconfig

* WIP

* wi[]

* update integration typescript version

* update lock file

* fix deps

* fix medusa tests runner
This commit is contained in:
Adrien de Peretti authored and GitHub committed 2024-09-25 16:31:57 +02:00
1 parent 6e5d007837
commit ae320ac73f
9 files changed
+30 -20

No files matched your search

+1 -2
View File
@@ -19,8 +19,7 @@
"strictFunctionTypes": true, "strictFunctionTypes": true,
"noImplicitThis": true, "noImplicitThis": true,
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true
"rootDir": "${configDir}/src"
}, },
"include": ["${configDir}/src"], "include": ["${configDir}/src"],
"exclude": ["${configDir}/dist", "${configDir}/node_modules"] "exclude": ["${configDir}/dist", "${configDir}/node_modules"]
+1 -1
View File
@@ -35,6 +35,6 @@
"form-data": "^4.0.0", "form-data": "^4.0.0",
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-environment-node": "^29.7.0", "jest-environment-node": "^29.7.0",
"typescript": "^5.3.3" "typescript": "^5.6.2"
} }
} }
+1 -1
View File
@@ -40,6 +40,6 @@
"@swc/jest": "^0.2.36", "@swc/jest": "^0.2.36",
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-environment-node": "^29.7.0", "jest-environment-node": "^29.7.0",
"typescript": "^5.3.3" "typescript": "^5.6.2"
} }
} }
+1 -1
View File
@@ -40,6 +40,6 @@
"@swc/jest": "^0.2.36", "@swc/jest": "^0.2.36",
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-environment-node": "^29.7.0", "jest-environment-node": "^29.7.0",
"typescript": "^5.3.3" "typescript": "^5.6.2"
} }
} }
@@ -17,7 +17,6 @@ import { track } from "medusa-telemetry"
import boxen from "boxen" import boxen from "boxen"
import { emojify } from "node-emoji" import { emojify } from "node-emoji"
import ProcessManager from "../utils/process-manager.js" import ProcessManager from "../utils/process-manager.js"
import { nanoid } from "nanoid"
import { displayFactBox, FactBoxOptions } from "../utils/facts.js" import { displayFactBox, FactBoxOptions } from "../utils/facts.js"
import { EOL } from "os" import { EOL } from "os"
import { runCloneRepo } from "../utils/clone-repo.js" import { runCloneRepo } from "../utils/clone-repo.js"
@@ -57,7 +56,7 @@ export default async ({
if (nodeVersion < MIN_SUPPORTED_NODE_VERSION) { if (nodeVersion < MIN_SUPPORTED_NODE_VERSION) {
logMessage({ 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`, 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") track("CREATE_CLI_CMA")
@@ -160,7 +159,7 @@ export default async ({
abortController, abortController,
factBoxOptions, factBoxOptions,
verbose, verbose,
processManager processManager,
}) })
: "" : ""
@@ -297,7 +296,17 @@ function showSuccessMessage(
message: boxen( message: boxen(
chalk.green( chalk.green(
// eslint-disable-next-line prettier/prettier // 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", titleAlignment: "center",
@@ -37,7 +37,6 @@ export function medusaIntegrationTestRunner({
moduleName, moduleName,
dbName, dbName,
medusaConfigFile, medusaConfigFile,
loadApplication,
schema = "public", schema = "public",
env = {}, env = {},
debug = false, debug = false,
@@ -48,7 +47,6 @@ export function medusaIntegrationTestRunner({
env?: Record<string, any> env?: Record<string, any>
dbName?: string dbName?: string
medusaConfigFile?: string medusaConfigFile?: string
loadApplication?: boolean
schema?: string schema?: string
debug?: boolean debug?: boolean
inApp?: boolean inApp?: boolean
@@ -133,9 +131,7 @@ export function medusaIntegrationTestRunner({
let serverShutdownRes: () => any let serverShutdownRes: () => any
let portRes: number let portRes: number
if (loadApplication) { loadedApplication = await appLoader.load()
loadedApplication = await appLoader.load()
}
try { try {
const { const {
+4 -1
View File
@@ -28,18 +28,21 @@
"devDependencies": { "devDependencies": {
"@swc/jest": "^0.2.36", "@swc/jest": "^0.2.36",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"cross-env": "^5.2.1",
"expect-type": "^0.20.0", "expect-type": "^0.20.0",
"express": "^4.21.0", "express": "^4.21.0",
"jest": "^29.7.0", "jest": "^29.7.0",
"pg-god": "^1.0.12",
"rimraf": "^5.0.1", "rimraf": "^5.0.1",
"typescript": "^5.6.2" "typescript": "^5.6.2"
}, },
"dependencies": { "dependencies": {
"@graphql-codegen/core": "^4.0.2",
"@graphql-codegen/typescript": "^4.0.9",
"@graphql-tools/merge": "^9.0.7", "@graphql-tools/merge": "^9.0.7",
"@graphql-tools/schema": "^10.0.6", "@graphql-tools/schema": "^10.0.6",
"@medusajs/types": "^1.11.16", "@medusajs/types": "^1.11.16",
"@mikro-orm/core": "5.9.7", "@mikro-orm/core": "5.9.7",
"@mikro-orm/knex": "5.9.7",
"@mikro-orm/migrations": "5.9.7", "@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7", "@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.1", "awilix": "^8.0.1",
@@ -1,9 +1,9 @@
import { FileSystem } from "@medusajs/utils"
import { GraphQLSchema } from "graphql/type" import { GraphQLSchema } from "graphql/type"
import { parse, printSchema } from "graphql" import { parse, printSchema } from "graphql"
import { codegen } from "@graphql-codegen/core" import { codegen } from "@graphql-codegen/core"
import * as typescriptPlugin from "@graphql-codegen/typescript" import * as typescriptPlugin from "@graphql-codegen/typescript"
import { ModuleJoinerConfig } from "@medusajs/types" import { ModuleJoinerConfig } from "@medusajs/types"
import { FileSystem } from "../common"
function buildEntryPointsTypeMap({ function buildEntryPointsTypeMap({
schema, schema,
+7 -4
View File
@@ -6739,17 +6739,19 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@medusajs/utils@workspace:packages/core/utils" resolution: "@medusajs/utils@workspace:packages/core/utils"
dependencies: dependencies:
"@graphql-codegen/core": ^4.0.2
"@graphql-codegen/typescript": ^4.0.9
"@graphql-tools/merge": ^9.0.7 "@graphql-tools/merge": ^9.0.7
"@graphql-tools/schema": ^10.0.6 "@graphql-tools/schema": ^10.0.6
"@medusajs/types": ^1.11.16 "@medusajs/types": ^1.11.16
"@mikro-orm/core": 5.9.7 "@mikro-orm/core": 5.9.7
"@mikro-orm/knex": 5.9.7
"@mikro-orm/migrations": 5.9.7 "@mikro-orm/migrations": 5.9.7
"@mikro-orm/postgresql": 5.9.7 "@mikro-orm/postgresql": 5.9.7
"@swc/jest": ^0.2.36 "@swc/jest": ^0.2.36
"@types/express": ^4.17.21 "@types/express": ^4.17.21
awilix: ^8.0.1 awilix: ^8.0.1
bignumber.js: ^9.1.2 bignumber.js: ^9.1.2
cross-env: ^5.2.1
dotenv: ^16.4.5 dotenv: ^16.4.5
dotenv-expand: ^11.0.6 dotenv-expand: ^11.0.6
expect-type: ^0.20.0 expect-type: ^0.20.0
@@ -6759,6 +6761,7 @@ __metadata:
jsonwebtoken: ^9.0.2 jsonwebtoken: ^9.0.2
pg: ^8.13.0 pg: ^8.13.0
pg-connection-string: ^2.7.0 pg-connection-string: ^2.7.0
pg-god: ^1.0.12
pluralize: ^8.0.0 pluralize: ^8.0.0
rimraf: ^5.0.1 rimraf: ^5.0.1
typescript: ^5.6.2 typescript: ^5.6.2
@@ -22173,7 +22176,7 @@ __metadata:
jest: ^29.7.0 jest: ^29.7.0
jest-environment-node: ^29.7.0 jest-environment-node: ^29.7.0
pg: ^8.11.3 pg: ^8.11.3
typescript: ^5.3.3 typescript: ^5.6.2
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@@ -22209,7 +22212,7 @@ __metadata:
jest-environment-node: ^29.7.0 jest-environment-node: ^29.7.0
medusa-test-utils: "workspace:*" medusa-test-utils: "workspace:*"
pg: ^8.11.3 pg: ^8.11.3
typescript: ^5.3.3 typescript: ^5.6.2
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@@ -22245,7 +22248,7 @@ __metadata:
jest-environment-node: ^29.7.0 jest-environment-node: ^29.7.0
medusa-test-utils: "workspace:*" medusa-test-utils: "workspace:*"
pg: ^8.11.3 pg: ^8.11.3
typescript: ^5.3.3 typescript: ^5.6.2
languageName: unknown languageName: unknown
linkType: soft linkType: soft