Skip to content

Commit

Permalink
docs: document swc dependency for plugins (#11426)
Browse files Browse the repository at this point in the history
* docs: document swc dependency for plugins

* added llms
  • Loading branch information
shahednasser authored Feb 25, 2025
1 parent 698a520 commit 47a9635
Show file tree
Hide file tree
Showing 3 changed files with 15,629 additions and 15,553 deletions.
40 changes: 40 additions & 0 deletions www/apps/book/app/learn/fundamentals/plugins/create/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ After the installation is done, the plugin structure will look like this:

## 2. Prepare Plugin

### Package Name

Before developing, testing, and publishing your plugin, make sure its name in `package.json` is correct. This is the name you'll use to install the plugin in your Medusa application.

For example:
Expand All @@ -61,6 +63,8 @@ For example:
}
```

### Package Keywords

In addition, make sure that the `keywords` field in `package.json` includes the keyword `medusa-plugin` and `medusa-v2`. This helps Medusa list community plugins on the Medusa website:

```json title="package.json"
Expand All @@ -73,6 +77,42 @@ In addition, make sure that the `keywords` field in `package.json` includes the
}
```

### Package Dependencies

<Note>

Your plugin project will already have the dependencies mentioned in this section. If you haven't made any changes to the dependencies, you can skip this section.

</Note>

In the `package.json` file you must have the Medusa dependencies as `devDependencies` and `peerDependencies`. In addition, you must have `@swc/core` as a `devDependency`, as it's used by the plugin CLI tools.

For example, assuming `2.5.0` is the latest Medusa version:

```json title="package.json"
{
"devDependencies": {
"@medusajs/admin-sdk": "2.5.0",
"@medusajs/cli": "2.5.0",
"@medusajs/framework": "2.5.0",
"@medusajs/medusa": "2.5.0",
"@medusajs/test-utils": "2.5.0",
"@medusajs/ui": "4.0.4",
"@medusajs/icons": "2.5.0",
"@swc/core": "1.5.7",
},
"peerDependencies": {
"@medusajs/admin-sdk": "2.5.0",
"@medusajs/cli": "2.5.0",
"@medusajs/framework": "2.5.0",
"@medusajs/test-utils": "2.5.0",
"@medusajs/medusa": "2.5.0",
"@medusajs/ui": "4.0.3",
"@medusajs/icons": "2.5.0",
}
}
```

---

## 3. Publish Plugin Locally for Development and Testing
Expand Down
2 changes: 1 addition & 1 deletion www/apps/book/generated/edit-dates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const generatedEditDates = {
"app/learn/fundamentals/module-links/link/page.mdx": "2025-01-06T09:27:25.604Z",
"app/learn/conventions/ts-aliases/page.mdx": "2025-01-23T15:01:15.403Z",
"app/learn/fundamentals/workflows/store-executions/page.mdx": "2025-02-11T15:56:03.835Z",
"app/learn/fundamentals/plugins/create/page.mdx": "2025-02-07T10:26:53.059Z",
"app/learn/fundamentals/plugins/create/page.mdx": "2025-02-12T15:48:25.439Z",
"app/learn/fundamentals/plugins/page.mdx": "2025-01-22T10:14:10.433Z",
"app/learn/customization/reuse-customizations/page.mdx": "2025-01-22T10:01:57.665Z",
"app/learn/update/page.mdx": "2025-01-27T08:45:19.030Z",
Expand Down
Loading

0 comments on commit 47a9635

Please sign in to comment.