Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medusa v2 Docs: Typo in module creation example + clarification #9220

Closed
2 tasks done
damien-thiesson opened this issue Sep 21, 2024 · 0 comments · Fixed by #9222
Closed
2 tasks done

Medusa v2 Docs: Typo in module creation example + clarification #9220

damien-thiesson opened this issue Sep 21, 2024 · 0 comments · Fixed by #9222

Comments

@damien-thiesson
Copy link
Contributor

damien-thiesson commented Sep 21, 2024

What Medusa version and documentation are you using?

v2

Preliminary Checks

Issue Summary

In https://docs.medusajs.com/v2/basics/modules-and-services#test-the-module, the example provided contains

import HelloModuleService from "../../../modules/hello/service"
import { HELLO_MODULE } from "../../../modules/hello"

It should only go two levels up:

import HelloModuleService from "../../modules/hello/service"
import { HELLO_MODULE } from "../../modules/hello"

Also for clarity, in the example of medusa-config.js (https://docs.medusajs.com/v2/basics/modules-and-services#3-add-module-to-configurations), you probably want to clarify how the structure is altered. I myself made the mistake of putting the modules node under projectConfig and got stuck for a while. Current version in the documentation:

module.exports = defineConfig({
  // ...
  modules: {
    helloModuleService: {
      resolve: "./modules/hello",
    },
  },
})

Suggested change to clarify and avoid other people doing the same mistake:

module.exports = defineConfig({
  projectConfig: {
    // ...
  },
  modules: {
    helloModuleService: {
      resolve: "./modules/hello",
    },
  },
})

How can this issue be resolved?

  1. Suggesting to adjust as per described above

Are you interested in working on this issue?

  • I would like to fix this issue
@damien-thiesson damien-thiesson changed the title Medusa v2 Docs: Issue in 1. Introduction - Medusa v2 Docs Medusa v2 Docs: Issue in module creation example Sep 21, 2024
@damien-thiesson damien-thiesson changed the title Medusa v2 Docs: Issue in module creation example Medusa v2 Docs: Typo in module creation example + clarification Sep 21, 2024
@kodiakhq kodiakhq bot closed this as completed in #9222 Sep 23, 2024
kodiakhq bot pushed a commit that referenced this issue Sep 23, 2024
…cs (#9222)

### What
This PR addresses an issue in the Medusa v2 documentation regarding the module creation example. The import paths were corrected to reflect the proper directory structure, ensuring clarity for users.

Closes #9220 

### Why
The previous documentation contained incorrect import paths that could lead to confusion for users attempting to create and configure modules. Clarifying the structure aims to prevent similar issues for future users.

### How
- Updated the import statements in the documentation to go two levels up instead of three.
- Added clarification in the `medusa-config.js` example to indicate that the `modules` node should be a part of `projectConfig`.

### Testing
While documentation changes do not require formal testing, I reviewed the updated paths and descriptions against the current code structure to ensure accuracy and clarity.

### Note
This is my first contribution to an open source project, and I'm excited to contribute to the Medusa community!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant