-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add dependency injection overview page
- Loading branch information
Showing
89 changed files
with
1,053 additions
and
53 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+36.6 KB
.yarn/cache/@shikijs-vitepress-twoslash-npm-1.6.2-4920b4a5a9-75130eca1e.zip
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.
Binary file added
BIN
+29.4 KB
.yarn/cache/@ungap-structured-clone-npm-1.2.0-648f0b82e0-8209c937cb.zip
Binary file not shown.
Binary file added
BIN
+19.7 KB
.yarn/cache/@volar-language-core-npm-1.11.1-e30e50203f-92c4439e3a.zip
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.
Binary file added
BIN
+10.4 KB
.yarn/cache/decode-named-character-reference-npm-1.0.2-db17a755fd-66a9fc5d9b.zip
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.
Binary file not shown.
Binary file added
BIN
+24 KB
.yarn/cache/mdast-util-find-and-replace-npm-3.0.1-284ae6ddf8-1faca98c4e.zip
Binary file not shown.
Binary file added
BIN
+108 KB
.yarn/cache/mdast-util-from-markdown-npm-2.0.1-37ffa6064d-496596bc64.zip
Binary file not shown.
Binary file added
BIN
+23.8 KB
.yarn/cache/mdast-util-gfm-autolink-literal-npm-2.0.0-620ccef115-821ef91db1.zip
Binary file not shown.
Binary file added
BIN
+22.5 KB
.yarn/cache/mdast-util-gfm-footnote-npm-2.0.0-4a167ca606-c673b22bea.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+19.1 KB
.yarn/cache/mdast-util-gfm-strikethrough-npm-2.0.0-d16d95c318-b053e93d62.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+19.6 KB
.yarn/cache/mdast-util-gfm-task-list-item-npm-2.0.0-cb1270a10f-258d725288.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+163 KB
.yarn/cache/mdast-util-to-markdown-npm-2.1.0-450939723c-8bd37a9627.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+314 KB
.yarn/cache/micromark-core-commonmark-npm-2.0.1-47bd3ea994-a0b280b1b6.zip
Binary file not shown.
Binary file added
BIN
+20.1 KB
.yarn/cache/micromark-factory-destination-npm-2.0.0-1b8de67781-b73492f687.zip
Binary file not shown.
Binary file added
BIN
+17.3 KB
.yarn/cache/micromark-factory-label-npm-2.0.0-9e92e5cd87-8ffad00487.zip
Binary file not shown.
Binary file added
BIN
+13.4 KB
.yarn/cache/micromark-factory-space-npm-2.0.0-715185b38a-103ca954da.zip
Binary file not shown.
Binary file added
BIN
+16.3 KB
.yarn/cache/micromark-factory-title-npm-2.0.0-9107a1e877-2b2188e7a0.zip
Binary file not shown.
Binary file added
BIN
+11.9 KB
.yarn/cache/micromark-factory-whitespace-npm-2.0.0-53940ab034-4e91baab0c.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+34.1 KB
.yarn/cache/micromark-util-character-npm-2.1.0-86cf4a520e-fc37a76aaa.zip
Binary file not shown.
Binary file added
BIN
+15.3 KB
.yarn/cache/micromark-util-chunked-npm-2.0.0-97063efe7b-043b5f2abc.zip
Binary file not shown.
Binary file added
BIN
+11.1 KB
.yarn/cache/micromark-util-classify-character-npm-2.0.0-a260c97f86-2bf5fa5050.zip
Binary file not shown.
Binary file added
BIN
+11.7 KB
.yarn/cache/micromark-util-combine-extensions-npm-2.0.0-6af1824ca7-cd4c8d1a85.zip
Binary file not shown.
Binary file added
BIN
+11.5 KB
...che/micromark-util-decode-numeric-character-reference-npm-2.0.1-2db25e156f-3f6d684ee8.zip
Binary file not shown.
Binary file added
BIN
+10.6 KB
.yarn/cache/micromark-util-decode-string-npm-2.0.0-111ff2ba19-f5413bebb2.zip
Binary file not shown.
Binary file added
BIN
+7.18 KB
.yarn/cache/micromark-util-encode-npm-2.0.0-c2e70ee7cb-ebdaafff23.zip
Binary file not shown.
Binary file added
BIN
+9.77 KB
.yarn/cache/micromark-util-html-tag-name-npm-2.0.0-b09431e16f-988aa26367.zip
Binary file not shown.
Binary file added
BIN
+12 KB
.yarn/cache/micromark-util-normalize-identifier-npm-2.0.0-1bfb89b3be-93bf8789b8.zip
Binary file not shown.
Binary file added
BIN
+9.83 KB
.yarn/cache/micromark-util-resolve-all-npm-2.0.0-113e659bd2-3b912e8845.zip
Binary file not shown.
Binary file added
BIN
+17.3 KB
.yarn/cache/micromark-util-sanitize-uri-npm-2.0.0-6c6c9b7f33-74763ca1c9.zip
Binary file not shown.
Binary file added
BIN
+53.4 KB
.yarn/cache/micromark-util-subtokenize-npm-2.0.1-6236be35f3-000cefde82.zip
Binary file not shown.
Binary file added
BIN
+39.1 KB
.yarn/cache/micromark-util-symbol-npm-2.0.0-dbed08e1a1-4e76186c18.zip
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+14.6 KB
.yarn/cache/unist-util-stringify-position-npm-4.0.0-2362acd217-dfe1dbe79b.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+34.4 KB
.yarn/cache/unist-util-visit-parents-npm-6.0.1-29ba152125-51b1a5b0aa.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+571 KB
.yarn/cache/vue-template-compiler-npm-2.7.16-f59aa20e7d-66667ffd50.zip
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
:root { | ||
--vp-c-brand: hsl(215, 70%, 60%); | ||
--vp-c-brand-light: hsl(215 70% 70%); | ||
--vp-c-brand-lighter: hsl(215 70% 80%); | ||
--vp-c-brand-dark: hsl(215 70% 60%); | ||
--vp-c-brand-darker: hsl(215 70% 50%); | ||
|
||
--vp-home-hero-name-color: transparent; | ||
--vp-home-hero-name-background: -webkit-linear-gradient( | ||
120deg, | ||
hsl(250, 100%, 60%), | ||
hsl(260, 100%, 60%) 35%, | ||
hsl(275, 96%, 62%) 45%, | ||
hsl(260 100% 60%) 65%, | ||
hsl(287, 58%, 47%) | ||
); | ||
--vp-home-hero-image-background-image: linear-gradient( | ||
-45deg, | ||
hsl(0 100% 60% / 80%), | ||
hsl(15 100% 60% / 80%) 40%, | ||
hsl(23 96% 62% / 80%) 45%, | ||
hsl(0 100% 60% / 80%) 60%, | ||
hsl(358 58% 47% / 80%) | ||
); | ||
--vp-home-hero-image-filter: blur(40px); | ||
|
||
--vp-c-gray-light-3: #d1d1d1; | ||
--vp-c-gray-light-5: #f2f2f2; | ||
--vp-c-gray-dark-2: #484848; | ||
--vp-c-gray-dark-3: #3a3a3a; | ||
} | ||
|
||
@media (min-width: 640px) { | ||
:root { | ||
--vp-home-hero-image-filter: blur(56px); | ||
} | ||
} | ||
|
||
@media (min-width: 960px) { | ||
:root { | ||
--vp-home-hero-image-filter: blur(72px); | ||
} | ||
} | ||
|
||
/* .vp-doc h4 { | ||
margin-top: 24px; | ||
} | ||
.vp-doc tr.transposed-table:nth-child(2n) { | ||
background: transparent; | ||
} | ||
.vp-doc tr.transposed-table:nth-child(2n + 1) { | ||
background: var(--vp-c-bg-soft); | ||
} | ||
.vp-doc tr.transposed-table > th { | ||
white-space: nowrap; | ||
} | ||
svg[id^="mermaid-"] { | ||
line-height: 1.5; | ||
background-color: transparent !important; | ||
} | ||
svg[id^="mermaid-"] .edgeLabel { | ||
padding: 0 !important; | ||
} | ||
.dark svg[id^="mermaid-"] .flowchart-link { | ||
stroke: lightgrey !important; | ||
} | ||
.dark svg[id^="mermaid-"] .marker { | ||
stroke: lightgrey !important; | ||
fill: lightgrey !important; | ||
} | ||
.dark svg[id^="mermaid-"] .edgeLabel { | ||
background-color: #585858 !important; | ||
} | ||
.dark svg[id^="mermaid-"] span { | ||
color: #ccc !important; | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Theme from "vitepress/theme"; | ||
import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client"; | ||
import "@shikijs/vitepress-twoslash/style.css"; | ||
import type { EnhanceAppContext } from "vitepress"; | ||
import "./custom.css"; | ||
|
||
export default { | ||
extends: Theme, | ||
enhanceApp({ app }: EnhanceAppContext) { | ||
app.use(TwoslashFloatingVue); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"private": true, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@shikijs/vitepress-twoslash": "^1", | ||
"vitepress": "^1", | ||
"vue": "^3" | ||
}, | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
## Overview | ||
|
||
`@wroud/di` is a powerful dependency injection (DI) library inspired by the .NET framework and implemented in pure JavaScript. It leverages modern JavaScript features, including optional decorators and explicit resource management, to provide a robust and flexible DI system suitable for a wide range of applications. It also supports legacy decorators from TypeScript, ensuring broad compatibility. | ||
|
||
## Key Features | ||
|
||
- **Small Bundle Size**: Only 5kB (minified), ensuring minimal overhead. | ||
- **Flexible DI**: Supports multiple service injections, disposals, and various lifetimes. | ||
- **Modern Decorators**: Clean and maintainable code with powerful decorators. | ||
- **Service Lifetimes**: Singleton, transient, and scoped lifetimes. | ||
- **Ease of Use**: Quick start without extensive knowledge. | ||
- **Environment Compatibility**: Works in any JavaScript environment (browser, Node.js, etc.). | ||
|
||
## Advanced Features | ||
|
||
### Multiple Service Injection | ||
|
||
Inject multiple services seamlessly for flexible dependency management. | ||
|
||
### Resource Management and Disposal | ||
|
||
Efficiently manage and dispose of services, adhering to TC39 proposal for explicit resource management, ensuring predictable resource handling and proper cleanup. | ||
|
||
### Decorator Support | ||
|
||
Optional use of TC39 proposal-decorators (stage 3) for intuitive dependency management. Also supports legacy decorators from TypeScript for broad compatibility. | ||
|
||
## Polyfills | ||
|
||
You may need the following polyfills for full compatibility: | ||
|
||
- **Decorators**: Required for environments without native decorator support. [Learn more](https://github.com/tc39/proposal-decorators) | ||
- **WeakMap**: For environments that do not support WeakMap. | ||
- **Promise**: For environments that do not support modern Promises. | ||
- **Dispose**: For explicit resource management. [Learn more](https://github.com/tc39/proposal-explicit-resource-management) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# Packages | ||
|
||
This page demonstrates usage of some of the runtime APIs provided by VitePress. | ||
|
||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# Packages | ||
|
||
This page demonstrates usage of some of the runtime APIs provided by VitePress. | ||
|
||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: |
Oops, something went wrong.
a566eda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
6 tests passing in 2 suites.
Report generated by 🧪jest coverage report action from a566eda