Skip to content

Commit

Permalink
docs: improved generated typedoc config
Browse files Browse the repository at this point in the history
  • Loading branch information
boenrobot committed Jun 11, 2024
1 parent 3c8ee15 commit bf07252
Show file tree
Hide file tree
Showing 24 changed files with 178 additions and 42 deletions.
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn run doc
git add ./docs/.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Nuxt module for easy integration with MikroORM into your Nuxt application.

- [ Release Notes](/CHANGELOG.md)
- [🏀 Online playground](https://stackblitz.com/github/boenrobot/nuxt-mikro-orm-module?file=playground%2Fapp.vue)
- [ Release Notes](https://github.com/boenrobot/nuxt-mikro-orm-module/blob/main/CHANGELOG.md)

## Quick Setup

Expand All @@ -13,7 +12,7 @@ Install the module to your Nuxt application with one command:
npx nuxi module add nuxt-mikro-orm-module
```

After that, ideally in a Nitro plugin, call [registerGlobalOrm()](./docs/functions/runtime_server_utils_orm.registerGlobalOrm.html) with the instance's config.
After that, ideally in a Nitro plugin, call [registerGlobalOrm()](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_server_utils_orm.registerGlobalOrm.html) with the instance's config.

Example:

Expand All @@ -34,24 +33,24 @@ export default defineNitroPlugin(async (nitro) => {
});
```

Call useEntityManager() [in a request context](./docs/functions/runtime_server_utils_orm.useEntityManager.html) or [in an island component](./docs/functions/runtime_composables_em.useEntityManager.html) to get a forked EntityManager you can immediately use.
Call useEntityManager() [in a request context](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_server_utils_orm.useEntityManager.html) or [in an island component](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_composables_em.useEntityManager.html) to get a forked EntityManager you can immediately use.

If you are working in a different context, such as a Nitro task, you may call [useOrm()](./docs/functions/runtime_server_utils_orm.useOrm.html), and manually call `fork()` to get a locally scoped EntityManager.
If you are working in a different context, such as a Nitro task, you may call [useOrm()](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_server_utils_orm.useOrm.html), and manually call `fork()` to get a locally scoped EntityManager.

## Module options / Runtime options

This module's options are used as defaults for runtime options, under the `mikroOrm` key.

See [ModuleOptions](./docs/interfaces/module.ModuleOptions.html) for details.
See [ModuleOptions](https://boenrobot.github.io/nuxt-mikro-orm-module/interfaces/module.ModuleOptions.html) for details.

## API

Have a look at [the docs folder](./docs) for the full feature set.
Have a look at [the typedoc generated docs](https://boenrobot.github.io/nuxt-mikro-orm-module) for the full feature set.

In addition to the previously mentioned functions, if more fine-grained control over the MikroORM instance is needed,
you can also use [initOrm()](./docs/functions/runtime_server_utils_orm.initOrm.html) to init a MikroORM instance,
without making it available for all requests. You will need to call useEntityManager() [in a request context](./docs/functions/runtime_server_utils_orm.useEntityManager.html)
at the routes you want to enable the instance at. You should also call [closeOrm()](./docs/functions/runtime_server_utils_orm.closeOrm.html) when you are done with the instance,
you can also use [initOrm()](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_server_utils_orm.initOrm.html) to init a MikroORM instance,
without making it available for all requests. You will need to call useEntityManager() [in a request context](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_server_utils_orm.useEntityManager.html)
at the routes you want to enable the instance at. You should also call [closeOrm()](https://boenrobot.github.io/nuxt-mikro-orm-module/functions/runtime_server_utils_orm.closeOrm.html) when you are done with the instance,
be it at a Nitro close hook, or some other time at which you know the connection needs to be closed.

## Contribution
Expand Down
70 changes: 70 additions & 0 deletions docs/assets/highlight.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,92 @@
:root {
--light-hl-0: #795E26;
--dark-hl-0: #DCDCAA;
--light-hl-1: #000000;
--dark-hl-1: #D4D4D4;
--light-hl-2: #A31515;
--dark-hl-2: #CE9178;
--light-hl-3: #AF00DB;
--dark-hl-3: #C586C0;
--light-hl-4: #001080;
--dark-hl-4: #9CDCFE;
--light-hl-5: #0000FF;
--dark-hl-5: #569CD6;
--light-hl-6: #0070C1;
--dark-hl-6: #4FC1FF;
--light-hl-7: #267F99;
--dark-hl-7: #4EC9B0;
--light-hl-8: #098658;
--dark-hl-8: #B5CEA8;
--light-hl-9: #008000;
--dark-hl-9: #6A9955;
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}

@media (prefers-color-scheme: light) { :root {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--hl-9: var(--light-hl-9);
--code-background: var(--light-code-background);
} }

@media (prefers-color-scheme: dark) { :root {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--hl-9: var(--dark-hl-9);
--code-background: var(--dark-code-background);
} }

:root[data-theme='light'] {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--hl-9: var(--light-hl-9);
--code-background: var(--light-code-background);
}

:root[data-theme='dark'] {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--hl-9: var(--dark-hl-9);
--code-background: var(--dark-code-background);
}

.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }
.hl-5 { color: var(--hl-5); }
.hl-6 { color: var(--hl-6); }
.hl-7 { color: var(--hl-7); }
.hl-8 { color: var(--hl-8); }
.hl-9 { color: var(--hl-9); }
pre, code { background: var(--code-background); }

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/module.default.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | nuxt-mikro-orm-module</title><meta name="description" content="Documentation for nuxt-mikro-orm-module"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">nuxt-mikro-orm-module</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">nuxt-mikro-orm-module</a></li><li><a href="../modules/module.html">module</a></li><li><a href="module.default.html">default</a></li></ul><h1>Function default</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="default" class="tsd-anchor"></a><span class="tsd-kind-call-signature">default</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">inlineOptions</span>, <span class="tsd-kind-parameter">nuxt</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">_ModuleSetupReturn</span><a href="#default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <span class="tsd-signature-type">void</span></span></li><li><span><span class="tsd-kind-parameter">inlineOptions</span>: <a href="../interfaces/module.ModuleOptions.html" class="tsd-signature-type tsd-kind-interface">ModuleOptions</a></span></li><li><span><span class="tsd-kind-parameter">nuxt</span>: <span class="tsd-signature-type">Nuxt</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">_ModuleSetupReturn</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/boenrobot/nuxt-mikro-orm-module/blob/82134e35a3c4bfbcde7e37c6e7db08f84d010571/src/module.ts#L101">module.ts:101</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>nuxt-mikro-orm-module</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | nuxt-mikro-orm-module</title><meta name="description" content="Documentation for nuxt-mikro-orm-module"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">nuxt-mikro-orm-module</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">nuxt-mikro-orm-module</a></li><li><a href="../modules/module.html">module</a></li><li><a href="module.default.html">default</a></li></ul><h1>Function default</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="default" class="tsd-anchor"></a><span class="tsd-kind-call-signature">default</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">inlineOptions</span>, <span class="tsd-kind-parameter">nuxt</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">_ModuleSetupReturn</span><a href="#default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <span class="tsd-signature-type">void</span></span></li><li><span><span class="tsd-kind-parameter">inlineOptions</span>: <a href="../interfaces/module.ModuleOptions.html" class="tsd-signature-type tsd-kind-interface">ModuleOptions</a></span></li><li><span><span class="tsd-kind-parameter">nuxt</span>: <span class="tsd-signature-type">Nuxt</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">_ModuleSetupReturn</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/boenrobot/nuxt-mikro-orm-module/blob/8e16b1187f9a1881d8ee8aeb1f3c367ea83f2732/src/module.ts#L101">module.ts:101</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>nuxt-mikro-orm-module</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
Loading

0 comments on commit bf07252

Please sign in to comment.