Skip to content

Commit

Permalink
Fix building and minor updates to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
blikblum committed Nov 12, 2023
1 parent 56f6c6d commit 0fa9ddb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
&nbsp; &nbsp; ✓ Builtin ContextProvider ([Reactive Controller](https://lit.dev/docs/composition/controllers/)) with primitives for lazy loading<br>
&nbsp; &nbsp; ✓ Builtin context-provider and context-consumer elements<br>
&nbsp; &nbsp; ✓ Conforms with the [Context protocol](https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md)<br>
&nbsp; &nbsp; ✓ Full code coverage<br>

### Live example

- Lit integration: [Shadow DOM](https://codesandbox.io/p/sandbox/wc-context-example-shadow-dom-vite-nkymx3) /
- Lit integration: [Shadow DOM](https://codesandbox.io/p/sandbox/wc-context-example-shadow-dom-vite-nkymx3) /

### Usage

Expand All @@ -27,4 +28,4 @@ Check the documentation https://blikblum.github.io/wc-context/
### License

MIT
Copyright © 2022 Luiz Américo Pereira Câmara
Copyright © 2023 Luiz Américo Pereira Câmara aka blikblum
6 changes: 5 additions & 1 deletion docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
title: 'wc-context',
description: 'Context for web components',
base: 'wc-context',
base: '/wc-context/',
themeConfig: {
sidebar: [
{
Expand Down Expand Up @@ -30,5 +30,9 @@ export default {
],
},
],
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2018-present Luiz Américo Pereira Câmara',
},
},
}
14 changes: 14 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: About
---

# wc-context

wc-context is a Javascript library that implements a way to share data between Web Components (in fact, between any HTMLElement). While is inspired by React Context, hence the name, it is designed to fit the most common usage patterns in Web Components ecosystem.
Expand Down Expand Up @@ -37,3 +41,13 @@ When the context is deep in the node tree or are not linked to a property use Li
### Lazy loading context data

With `ContextProvider` ([Reactive Controller](https://lit.dev/docs/composition/controllers/)) is possible to implement [data lazy loading](./controllers.md#subclassing-contextprovider).

### Well tested

100% code coverage

## License

MIT

Copyright © 2018 - present Luiz Américo Pereira Câmara aka blikblum
3 changes: 1 addition & 2 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Components that use contexts can be tested with minimal, if none, adaptations wh

## TLDR

Check [Vitest](https://vitest.dev/) and [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) test suites at [testing example folder](../examples/testing/). The library itself is [tested](../test/) with [Jest](https://jestjs.io/).
Check [Vitest](https://vitest.dev/) and [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) test suites at [testing example folder](https://github.com/blikblum/wc-context/tree/master/examples/testing). The library itself is [tested](https://github.com/blikblum/wc-context/tree/master/test) with [Jest](https://jestjs.io/).

> The examples use @open-wc/testing that provides time saving utilities
Expand Down Expand Up @@ -73,7 +73,6 @@ it('test foo property that consumes a context', async () => {
})
```


Provide context using `registerContext` in a parent node

```js
Expand Down

0 comments on commit 0fa9ddb

Please sign in to comment.