medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.96k stars 2.61k forks source link

VS Code auto imports work don't work for dependency packages #9274

Closed jakub-borek closed 1 month ago

jakub-borek commented 1 month ago

Describe the bug

Auto import suggestions don't work for @medusajs/utils, @medusajs/types, @medusajs/core-flows.

It's not breaking code, but adding imports by hand everytime becomes quite time consuming in the long run.

From what I can see this happens because these packages are not present in package.json, but rather are dependencies of core modules.

System information

Medusa version (including plugins): preview from 24.09.2024 Node.js version: 20.16.0 Database: PostgreSQL 16.0 Operating system: Windows 10 Browser (if relevant): -

Expected behavior

Classes and types from @medusajs/utils, @medusajs/types, @medusajs/core-flows should be in auto import suggestions from VS Code

bwmirek commented 1 month ago

The same thing happens in the JetBrains IDE. It seems to me that the problem may affect all Medusa packages and not just the ones mentioned above, but this would require further investigation as some hand imports have been memorised for me and I can't tell which is the correct suggestion and which is a cached one.

ricardolopesit commented 1 month ago

The same thing happens in the JetBrains IDE. For packages from medusa.

ricardolopesit commented 1 month ago

@bwmirek to work in current version of medusa "RC version" in my JetBrains IDE i changed the tsconfig.json to work like this: { "compilerOptions": { "target": "es2021", "allowJs": true, "esModuleInterop": true, "module": "Node16", "moduleResolution": "Node16", "emitDecoratorMetadata": true, "experimentalDecorators": true, "skipLibCheck": true, "skipDefaultLibCheck": true, "declaration": true, "sourceMap": false, "outDir": "./dist", "rootDir": ".", "baseUrl": "./*", "jsx": "preserve", "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "checkJs": false, }, "ts-node": { "swc": true }, "include": [ ".medusa", "src/" ], "exclude": [ "**/__tests__", "**/__fixtures__", "node_modules", "build", ".cache" ] }