Skip to content

Commit

Permalink
docs: Re-build docs with new adjustements
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Feb 9, 2022
1 parent 99b0a79 commit 26a66ec
Show file tree
Hide file tree
Showing 37 changed files with 102 additions and 118 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a href="https://github.com/adrien2p/medusa-extender/commits/main"><img src="https://img.shields.io/github/commit-activity/m/adrien2p/medusa-extender?style=flat-square" alt="activity" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/issues"><img src="https://img.shields.io/github/issues/adrien2p/medusa-extender?style=flat-square" alt="issues" height="18"></a>
<a href="https://www.npmjs.com/package/medusa-extender"><img src="https://img.shields.io/npm/dm/medusa-extender?style=flat-square" alt="download" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/blob/assets/assets/coverage/badge-statements.svg"><img src="https://github.com/adrien2p/medusa-extender/blob/main/assets/coverage/badge-statements.svg" alt="coverage" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/blob/assets/assets/coverage/badge-statements.svg"><img src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/coverage/badge-statements.svg" alt="coverage" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/blob/main/LICENSE"><img src="https://img.shields.io/github/license/adrien2p/medusa-extender?style=flat-square" alt="licence" height="18"></a>
<a href="https://twitter.com/intent/tweet?text=Check%20this%20out!%20The%20new%20medusa%20headless%20e-commerce%20extender&url=https://github.com/adrien2p/medusa-extender"><img src="https://badgen.net/badge/icon/twitter?icon=twitter&label=Share%20it%20on" alt="twitter" height="18"></a>
<a href="https://discord.gg/xpCwq3Kfn8">
Expand Down
38 changes: 11 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ medusa-extender / [Exports](modules.md)
<!--lint disable awesome-list-item-->
<div align="center">
<p align="center">
<img alt="Medusa" src="https://uploads-ssl.webflow.com/61fba9f6deac297b7b22017d/62000006ce573a706c92546c_logo.svg" width="200" />
<img alt="Medusa" src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/logo.png"/>
</p>

<h1>Extend medusa badass features</h1>
<h1>Extend medusa with badass features</h1>

<p>
Do you want to extend existing entities to add custom fields? Do you want to implement your own feature or extend existing one
Expand All @@ -26,7 +26,7 @@ medusa-extender / [Exports](modules.md)
<a href="https://github.com/adrien2p/medusa-extender/commits/main"><img src="https://img.shields.io/github/commit-activity/m/adrien2p/medusa-extender?style=flat-square" alt="activity" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/issues"><img src="https://img.shields.io/github/issues/adrien2p/medusa-extender?style=flat-square" alt="issues" height="18"></a>
<a href="https://www.npmjs.com/package/medusa-extender"><img src="https://img.shields.io/npm/dm/medusa-extender?style=flat-square" alt="download" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/blob/main/assets/coverage/badge-statements.svg"><img src="https://github.com/adrien2p/medusa-extender/blob/main/assets/coverage/badge-statements.svg" alt="coverage" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/blob/assets/assets/coverage/badge-statements.svg"><img src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/coverage/badge-statements.svg" alt="coverage" height="18"></a>
<a href="https://github.com/adrien2p/medusa-extender/blob/main/LICENSE"><img src="https://img.shields.io/github/license/adrien2p/medusa-extender?style=flat-square" alt="licence" height="18"></a>
<a href="https://twitter.com/intent/tweet?text=Check%20this%20out!%20The%20new%20medusa%20headless%20e-commerce%20extender&url=https://github.com/adrien2p/medusa-extender"><img src="https://badgen.net/badge/icon/twitter?icon=twitter&label=Share%20it%20on" alt="twitter" height="18"></a>
<a href="https://discord.gg/xpCwq3Kfn8">
Expand Down Expand Up @@ -77,9 +77,7 @@ npm i medusa-extender

# Code base overview

<img src="/assets/medusa-extender.jpeg"
onerror="if (this.src != './media/medusa-extender.jpeg') this.src = './media/medusa-extender.jpeg';"
alt="Dependency graph" />
<img src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/medusa-extender.jpeg" alt="Dependency graph" />

# Features

Expand Down Expand Up @@ -137,9 +135,7 @@ For the purpose of the examples that will follow in the next sections,
I will organise my files in the following manner
(You can organise it as you want, there is no restrictions to your architecture).

<img width='75%' src="/assets/readme/scenario-1-architecture.png"
onerror="if (this.src != './media/readme/scenario-1-architecture.png') this.src = './media/readme/scenario-1-architecture.png';"
alt="Scenario 1 module architecture" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/scenario-1-architecture.png" alt="Scenario 1 module architecture" />

## Extending an existing feature

Expand All @@ -163,9 +159,7 @@ Let's create a scenario.
The idea here, is that we will import the medusa product entity that we will extend in
order to add our new field. Of course, you can do everything typeorm provides (if you need to add a custom relationships, then follow the typeorm doc.).

<img width='75%' src="/assets/readme/src-modules-product-product-entity.png"
onerror="if (this.src != './media/readme/src-modules-product-product-entity.png') this.src = './media/readme/src-modules-product-product-entity.png';"
alt="Step 1 Extend the product entity" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/src-modules-product-product-entity.png" alt="Step 1 Extend the product entity" />
<details>

Expand Down Expand Up @@ -193,9 +187,7 @@ order to add our new field. Of course, you can do everything typeorm provides (i
The idea here, is that we will import the medusa product repository that we will extend in
order to reflect our custom entity.

<img width='75%' src="/assets/readme/src-modules-product-product-repository.png"
onerror="if (this.src != './media/readme/src-modules-product-product-repository.png') this.src = './media/readme/src-modules-product-product-repository.png';"
alt="Step 2: Extend the product repository" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/src-modules-product-product-repository.png" alt="Step 2: Extend the product repository" />
<details>

Expand Down Expand Up @@ -224,9 +216,7 @@ The idea here, is that we will import the medusa product service that we will ex
order to override the product creation method of the base class in order to take in count the new field
of our extended product entity.

<img width='75%' src="/assets/readme/src-modules-product-product-service.png"
onerror="if (this.src != './media/readme/src-modules-product-product-service.png') this.src = './media/readme/src-modules-product-product-service.png';"
alt="Step 3: Extend the product service" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/src-modules-product-product-service.png" alt="Step 3: Extend the product service" />
<details>

Expand Down Expand Up @@ -285,9 +275,7 @@ When adding a new field, the class validator of the end point handler is not awa
about it. In order to handle that, it is possible to extend the validator to add
the constraint on the new custom field.

<img width='75%' src="/assets/readme/src-modules-product-adminPostProductsReq-validator.png"
onerror="if (this.src != './media/readme/src-modules-product-adminPostProductsReq-validator.png') this.src = './media/readme/src-modules-product-adminPostProductsReq-validator.png';"
alt="Step 4: Extend the product validator class to reflect the new field" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/src-modules-product-adminPostProductsReq-validator.png" alt="Step 4: Extend the product validator class to reflect the new field" />
<details>

Expand All @@ -310,9 +298,7 @@ the constraint on the new custom field.
To persist your custom field, you need to add it to the corresponding table.
As normal, write a new migration, except this time, you decorate it with the `@Migration()` decorator.

<img width='75%' src="/assets/readme/src-modules-product-customField-migration.png"
onerror="if (this.src != './media/readme/src-modules-product-customField-migration.png') this.src = './media/readme/src-modules-product-customField-migration.png';"
alt="Step 5: Create the migration" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/src-modules-product-customField-migration.png" alt="Step 5: Create the migration" />
<details>

Expand Down Expand Up @@ -345,9 +331,7 @@ As normal, write a new migration, except this time, you decorate it with the `@M
Now that we have done the job, we will import the entity, repository and service into a module
that will be loaded by Medusa.

<img width='75%' src="/assets/readme/src-modules-product-product-module.png"
onerror="if (this.src != './media/readme/src-modules-product-product-module.png') this.src = './media/readme/src-modules-product-product-module.png';"
alt="Step 4: Create the product module" />
<img width='75%' src="https://github.com/adrien2p/medusa-extender/blob/assets/assets/readme/src-modules-product-product-module.png" alt="Step 4: Create the product module" />
<details>

Expand Down
8 changes: 4 additions & 4 deletions docs/classes/Medusa.Medusa-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal container and database connection.

#### Defined in

[src/Medusa.ts:37](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/Medusa.ts#L37)
[src/Medusa.ts:37](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/Medusa.ts#L37)

## Properties

Expand All @@ -47,7 +47,7 @@ internal container and database connection.

#### Defined in

[src/Medusa.ts:30](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/Medusa.ts#L30)
[src/Medusa.ts:30](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/Medusa.ts#L30)

___

Expand All @@ -57,7 +57,7 @@ ___

#### Defined in

[src/Medusa.ts:31](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/Medusa.ts#L31)
[src/Medusa.ts:31](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/Medusa.ts#L31)

## Methods

Expand All @@ -77,4 +77,4 @@ ___

#### Defined in

[src/Medusa.ts:45](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/Medusa.ts#L45)
[src/Medusa.ts:45](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/Medusa.ts#L45)
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:42](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L42)
[src/decorators/onMedusaEntityEvent.decorator.ts:42](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L42)

## Properties

Expand All @@ -55,7 +55,7 @@

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:40](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L40)
[src/decorators/onMedusaEntityEvent.decorator.ts:40](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L40)

___

Expand All @@ -65,7 +65,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:39](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L39)
[src/decorators/onMedusaEntityEvent.decorator.ts:39](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L39)

## Accessors

Expand All @@ -79,7 +79,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:50](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L50)
[src/decorators/onMedusaEntityEvent.decorator.ts:50](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L50)

___

Expand All @@ -93,7 +93,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:46](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L46)
[src/decorators/onMedusaEntityEvent.decorator.ts:46](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L46)

## Methods

Expand All @@ -120,7 +120,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:70](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L70)
[src/decorators/onMedusaEntityEvent.decorator.ts:70](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L70)

___

Expand All @@ -146,7 +146,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:58](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L58)
[src/decorators/onMedusaEntityEvent.decorator.ts:58](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L58)

___

Expand All @@ -173,7 +173,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:84](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L84)
[src/decorators/onMedusaEntityEvent.decorator.ts:84](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L84)

___

Expand All @@ -199,7 +199,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:66](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L66)
[src/decorators/onMedusaEntityEvent.decorator.ts:66](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L66)

___

Expand All @@ -226,7 +226,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:77](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L77)
[src/decorators/onMedusaEntityEvent.decorator.ts:77](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L77)

___

Expand All @@ -252,7 +252,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:62](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L62)
[src/decorators/onMedusaEntityEvent.decorator.ts:62](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L62)

___

Expand Down Expand Up @@ -280,7 +280,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:91](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L91)
[src/decorators/onMedusaEntityEvent.decorator.ts:91](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L91)

___

Expand All @@ -300,4 +300,4 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:54](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/decorators/onMedusaEntityEvent.decorator.ts#L54)
[src/decorators/onMedusaEntityEvent.decorator.ts:54](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/decorators/onMedusaEntityEvent.decorator.ts#L54)
12 changes: 6 additions & 6 deletions docs/classes/event_emmiter.Internals.CustomEventEmmiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ EventEmitter.constructor

#### Defined in

[src/event-emmiter.ts:21](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/event-emmiter.ts#L21)
[src/event-emmiter.ts:21](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/event-emmiter.ts#L21)

## Properties

Expand All @@ -51,7 +51,7 @@ EventEmitter.constructor

#### Defined in

[src/event-emmiter.ts:19](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/event-emmiter.ts#L19)
[src/event-emmiter.ts:19](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/event-emmiter.ts#L19)

## Methods

Expand Down Expand Up @@ -80,7 +80,7 @@ Emit an asynchrone event entity based and wait for the result.

#### Defined in

[src/event-emmiter.ts:80](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/event-emmiter.ts#L80)
[src/event-emmiter.ts:80](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/event-emmiter.ts#L80)

___

Expand Down Expand Up @@ -110,7 +110,7 @@ Register a new event handler.

#### Defined in

[src/event-emmiter.ts:31](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/event-emmiter.ts#L31)
[src/event-emmiter.ts:31](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/event-emmiter.ts#L31)

___

Expand All @@ -132,7 +132,7 @@ Apply all event handlers hold by the `listenerDescriptor`.

#### Defined in

[src/event-emmiter.ts:43](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/event-emmiter.ts#L43)
[src/event-emmiter.ts:43](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/event-emmiter.ts#L43)

___

Expand All @@ -146,4 +146,4 @@ ___

#### Defined in

[src/event-emmiter.ts:68](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/event-emmiter.ts#L68)
[src/event-emmiter.ts:68](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/event-emmiter.ts#L68)
2 changes: 1 addition & 1 deletion docs/classes/metadata_reader.Internals.CustomMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ Map.get

#### Defined in

[src/metadata-reader.ts:5](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/metadata-reader.ts#L5)
[src/metadata-reader.ts:5](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/metadata-reader.ts#L5)
12 changes: 6 additions & 6 deletions docs/classes/utils.Utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Attach a new subscriber to a specific entities.

#### Defined in

[src/utils.ts:36](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/utils.ts#L36)
[src/utils.ts:36](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/utils.ts#L36)

___

Expand All @@ -80,7 +80,7 @@ Prepare the log to be shown to be consistent everywhere.

#### Defined in

[src/utils.ts:67](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/utils.ts#L67)
[src/utils.ts:67](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/utils.ts#L67)

___

Expand All @@ -102,7 +102,7 @@ Log all the routes from the express instance.

#### Defined in

[src/utils.ts:57](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/utils.ts#L57)
[src/utils.ts:57](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/utils.ts#L57)

___

Expand All @@ -123,7 +123,7 @@ ___

#### Defined in

[src/utils.ts:81](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/utils.ts#L81)
[src/utils.ts:81](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/utils.ts#L81)

___

Expand Down Expand Up @@ -153,7 +153,7 @@ Since it is not possible to use multiple extend, you can use that utilities to a

#### Defined in

[src/utils.ts:16](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/utils.ts#L16)
[src/utils.ts:16](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/utils.ts#L16)

___

Expand All @@ -173,4 +173,4 @@ ___

#### Defined in

[src/utils.ts:101](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/utils.ts#L101)
[src/utils.ts:101](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/utils.ts#L101)
2 changes: 1 addition & 1 deletion docs/interfaces/types.MedusaMiddleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Describe a custom middleware instance.

#### Defined in

[src/types.ts:152](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/types.ts#L152)
[src/types.ts:152](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/types.ts#L152)
2 changes: 1 addition & 1 deletion docs/interfaces/types.Type.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Function.constructor

#### Defined in

[src/types.ts:6](https://github.com/adrien2p/medusa-extender/blob/c87993f/src/types.ts#L6)
[src/types.ts:6](https://github.com/adrien2p/medusa-extender/blob/99b0a79/src/types.ts#L6)
Binary file removed docs/media/medusa-extender.jpeg
Binary file not shown.
Binary file removed docs/media/readme/scenario-1-architecture.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 26a66ec

Please sign in to comment.