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

docs: editing and general fixes of medusa's learning resources #7261

Merged
merged 8 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion www/apps/api-reference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@mdx-js/loader": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"@medusajs/icons": "^1.2.0",
"@medusajs/ui": "^2.4.1",
"@medusajs/ui": "^3.0.0",
"@next/mdx": "14.2.3",
"@readme/openapi-parser": "^2.5.0",
"@types/mapbox__rehype-prism": "^0.8.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export const metadata = {

# {metadata.title}

<Note type="soon">

Admin customizations are coming soon.

</Note>

This documentation page includes the list of injection zones you can add Admin Widgets to.

<Table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ npm install @medusajs/cache-inmemory
Next, add the module into the `modules` property of the exported object in `medusa-config.js`:

```js title="medusa-config.js"
const { Modules } = require("@medusajs/modules-sdk")

// ...

module.exports = {
// ...
modules: {
// ...
cacheService: {
[Modules.CACHE]: {
resolve: "@medusajs/cache-inmemory",
options: {
// optional options
Expand Down
24 changes: 14 additions & 10 deletions www/apps/resources/app/architectural-modules/cache/redis/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ npm install @medusajs/cache-redis
Next, add the module into the `modules` property of the exported object in `medusa-config.js`:

export const highlights = [
["8", "redisUrl", "The Redis connection URL."]
["12", "redisUrl", "The Redis connection URL."]
]

```js title="medusa-config.js" highlights={highlights}
const { Modules } = require("@medusajs/modules-sdk")

// ...

module.exports = {
// ...
modules: {
// ...
cacheService: {
[Modules.CACHE]: {
resolve: "@medusajs/cache-redis",
options: {
redisUrl: process.env.CACHE_REDIS_URL,
Expand All @@ -45,6 +49,14 @@ module.exports = {
}
```

### Environment Variables

Make sure to add the following environment variables:

```bash
CACHE_REDIS_URL=<YOUR_REDIS_URL>
```

### Redis Cache Module Options

<Table>
Expand Down Expand Up @@ -148,14 +160,6 @@ module.exports = {
</Table.Body>
</Table>

### Environment Variables

Make sure to add the following environment variables:

```bash
CACHE_REDIS_URL=<YOUR_REDIS_URL>
```

---

## Test the Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ npm install @medusajs/event-local
Next, add the module into the `modules` property of the exported object in `medusa-config.js`:

```js title="medusa-config.js"
const { Modules } = require("@medusajs/modules-sdk")

// ...

module.exports = {
// ...
modules: {
// ...
eventBus: {
resolve: "@medusajs/event-local",
},
[Modules.EVENT_BUS]: true,
},
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ export const highlights = [
]

```js title="medusa-config.js"
const { Modules } = require("@medusajs/modules-sdk")

// ...

module.exports = {
// ...
modules: {
// ...
eventBus: {
[Modules.EVENT_BUS]: {
resolve: "@medusajs/event-redis",
options: {
redisUrl: process.env.EVENTS_REDIS_URL,
Expand All @@ -49,6 +53,14 @@ module.exports = {
}
```

### Environment Variables

Make sure to add the following environment variables:

```bash
EVENTS_REDIS_URL=<YOUR_REDIS_URL>
```

### Redis Event Bus Module Options

<Table>
Expand Down Expand Up @@ -196,14 +208,6 @@ module.exports = {
</Table.Body>
</Table>

### Environment Variables

Make sure to add the following environment variables:

```bash
EVENTS_REDIS_URL=<YOUR_REDIS_URL>
```

---

## Test the Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ module.exports = {
}
```

### Environment Variables

Make sure to add the following environment variables:

```bash
WE_REDIS_URL=<YOUR_REDIS_URL>
```

### Redis Workflow Engine Module Options

<Table>
Expand Down Expand Up @@ -157,14 +165,6 @@ module.exports = {
</Table.Body>
</Table>

### Environment Variables

Make sure to add the following environment variables:

```bash
WE_REDIS_URL=<YOUR_REDIS_URL>
```

---

## Test the Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ const modules = {
}
```

### Environment Variables

Make sure to add the necessary environment variables for the above options in `.env`:

```bash
STRIPE_USD_API_KEY=<YOUR_STRIPE_API_KEY>
```

### Module Options

<Table>
Expand Down Expand Up @@ -169,14 +177,6 @@ const modules = {
</Table.Body>
</Table>

### Environment Variables

Make sure to add the necessary environment variables for the above options in `.env`:

```bash
STRIPE_USD_API_KEY=<YOUR_STRIPE_API_KEY>
```

---

## Use Provider
Expand Down
55 changes: 18 additions & 37 deletions www/apps/resources/app/contribution-guidelines/docs/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export const metadata = {

# {metadata.title}

{/* TODO needs updating */}

Thank you for your interest in contributing to the documentation! You will be helping the open source community and other developers interested in learning more about Medusa and using it.

<Note title="Tip">
Expand All @@ -21,16 +19,13 @@ Medusa's documentation projects are all part of the documentation yarn workspace
The workspace has the following two directories:

- `apps`: this directory holds the different documentation websites and projects.
- `docs`: includes the codebase for the Medusa Book. It's built with [Next.js 14](https://nextjs.org/).
- `resources`: includes the codebase for the Medusa Resources documentation. It's built with [Next.js 14](https://nextjs.org/).
- `book`: includes the codebase for the Medusa Book. It's built with [Next.js 14](https://nextjs.org/).
- `resources`: includes the codebase for the Medusa Learning Resources documentation. It's built with [Next.js 14](https://nextjs.org/).
- `api-reference`: includes the codebase for the API reference website. It's built with [Next.js 14](https://nextjs.org/).
- `ui`: includes the codebase for the Medusa UI documentation website. It's built with [Next.js 14](https://nextjs.org/).
- `packages`: this directory holds the shared packages and components necessary for the development of the projects in the `apps` directory.
- `docs-ui` includes the shared React components between the different apps.
- `eslint-config-docs` includes the shared ESLint configuration between the different apps and packages.
- `remark-rehype-plugins` includes Remark and Rehype plugins used by the documentation projects.
- `tailwind` includes the shared Tailwind CSS configuration between the different apps and packages.
- `tsconfig` includes the shared TypeScript configuration between the different apps and packages.

---

Expand All @@ -40,39 +35,37 @@ All documentation projects are built with Next.js. The content is writtin in MDX

### Medusa Book Content

The content of the Medusa Book is placed under the `www/apps/docs/app` directory.
The content of the Medusa Book is placed under the `www/apps/book/app` directory.

### Medusa Resources Content
### Medusa Learning Resources Content

The content of the Medusa Resources documentation is placed under the `www/apps/resources/app` directory.

{/* TODO check info */}

<Note>

Documentation pages under the `www/apps/docs/content/references` directory are generated automatically from the source code under the `packages/medusa` directory. So, you can't directly make changes to them. Instead, you'll have to make changes to the comments in the original source code.
Documentation pages under the `www/apps/resources/references` directory are generated automatically from the source code under the `packages/medusa` directory. So, you can't directly make changes to them. Instead, you'll have to make changes to the comments in the original source code.

</Note>

### API Reference

The API reference's content is split into two types:

1. Static content, which are the content related to getting started, expanding fields, and more. These are located in the [www/apps/api-reference/app/_mdx](https://github.com/medusajs/medusa/tree/develop/www/apps/api-reference/app/_mdx) directory. They are MDX files.
2. OpenAPI specs that are shown to developers when checking the reference of an API Route. These are automatically generated from comments on API Routes. So, if you find issues in them or want to make improvements, you have to find the API Routes under the [`packages/medusa/src/api`](https://github.com/medusajs/medusa/tree/develop/packages/medusa/src/api) directory and make changes to its comments.
1. Static content, which are the content related to getting started, expanding fields, and more. These are located in the `www/apps/api-reference/app/_mdx` directory. They are MDX files.
2. OpenAPI specs that are shown to developers when checking the reference of an API Route. These are generated from OpenApi Spec comments, which are under the `www/utils/generated/oas-output` directory.

### Medusa UI Documentation

The content of the Medusa UI documentation are located under the [www/apps/ui/src/content/docs](https://github.com/medusajs/medusa/tree/develop/www/apps/ui/src/content/docs) directory. They are MDX files.
The content of the Medusa UI documentation are located under the `www/apps/ui/src/content/docs` directory. They are MDX files.

The UI documentation also shows code examples, which are under the `www/apps/ui/src/examples` directory.

The UI documentation also shows code examples, which you can find under the [www/apps/ui/src/examples](https://github.com/medusajs/medusa/tree/develop/www/apps/ui/src/examples) directory.
The UI component props are generated from the source code and placed into the `www/apps/ui/src/specs` directory. To contribute to these props and their comments, check the comments in the source code under the `packages/design-system/ui` directory.

---

## Style Guide

{/* TODO check link */}

When you contribute to the documentation content, make sure to follow the [documentation style guide](https://www.notion.so/Style-Guide-Docs-fad86dd1c5f84b48b145e959f36628e0).

---
Expand Down Expand Up @@ -161,11 +154,9 @@ cd www/vale
./run-vale.sh ui src/content/docs error
```

### VS Code Extension

To facilitate writing documentation, you can optionally use the [Vale VS Code extension](https://github.com/errata-ai/vale-vscode). This will show you any errors in your documentation while writing it.
{/* TODO need to enable MDX v1 comments first. */}

### Linter Exceptions
{/* ### Linter Exceptions

If it's needed to break some style guide rules in a document, you can wrap the parts that the linter shouldn't scan with the following comments in the `md` or `mdx` files:

Expand All @@ -187,7 +178,7 @@ Medusa supports Node versions 14 and 16.
<!-- vale docs.Numbers = YES -->
```

If you use this in your PR, you must justify its usage.
If you use this in your PR, you must justify its usage. */}

---

Expand Down Expand Up @@ -230,18 +221,14 @@ yarn install
2\. Run the turbo command in the `www` directory:

```bash
turbo run lint
yarn lint
```

This will fix any fixable errors, and show errors that require your action.

### ESLint Exceptions

:::note
{/* TODO need to enable MDX v1 comments first. */}

These exceptions only work in the main documentation website.

:::
{/* ### ESLint Exceptions

If some code blocks have errors that can't or shouldn't be fixed, you can add the following command before the code block:

Expand Down Expand Up @@ -269,10 +256,4 @@ console.log("This block can use semicolons");
```js
console.log("This block can't use semi colons")
```
~~~

---

## Need Additional Help

If you need any additional help while contributing, you can join Medusa's [Discord server](https://discord.gg/medusajs) and ask Medusa’s core team as well as the community any questions.
~~~ */}
Loading
Loading