Skip to content

Commit

Permalink
doc: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed May 20, 2024
1 parent 580acd0 commit 407df09
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
10 changes: 6 additions & 4 deletions .github/deno_readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ import { Logger } from "@libs/logger"
const logger = new Logger({ level: Logger.level.debug })
const root = fromFileUrl(import.meta.resolve("../"))
const document = new DOMParser().parseFromString(await Deno.readTextFile(fromFileUrl(import.meta.resolve("./deno_readme.html"))), "text/html")!
let table = "<table><!-- Generated by deno_readme.ts, do not edit manually -->"
let table = `<table><!-- Generated by deno_readme.ts, do not edit manually --><tr><td colspan="3"></td></tr>`
for await (const { path } of expandGlob(`*/deno.jsonc`, { root })) {
const { icon, supported = [], playground } = JSONC.parse(await Deno.readTextFile(path)) as Record<string, unknown>
const { icon, description, supported = [], playground } = JSONC.parse(await Deno.readTextFile(path)) as Record<string, unknown>
const name = basename(dirname(path))
const log = logger.with({ name, icon, supported, playground })
const features = document.querySelector(`[data-for="${name}"]`)?.outerHTML!
log.info()
log.debug(features)
table += `
<tr><th colspan="3"><h2><a href="https://jsr.io/@libs/${name}"><code>${icon} @libs/${name}</code></a></h2></th></tr>
<tr><th colspan="3"><h2><a href="https://jsr.io/@libs/${name}"><code>${icon} @libs/${name}</code></a></h2>${description}</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/${name}"><img src="https://jsr.io/badges/@libs/${name}"></a></th>
<th rowspan="3">${(supported as string[]).map((platform) => `<img height="18px" src="https://jsr.io/logos/${platform}.svg">`).join("")}</th>
<td rowspan="3">${features}</td>
</tr>
<tr><th>${playground ? `<a href="${playground}"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a>` : ""}</th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/${name}"><img src="https://libs-coverage.lecoq.io/${name}/badge.svg"></a></th></tr>`.trim()
<tr><th><a href="https://libs-coverage.lecoq.io/${name}"><img src="https://libs-coverage.lecoq.io/${name}/badge.svg"></a></th></tr>
`.trim()
}
table += "</table>"

Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ This is a collection of carefully crafted _TypeScript_ libraries. These try to b
Most of them are written with [deno](https://deno.com) in mind, but most packages in this repository honors [web standards](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/The_web_and_web_standards) which means they can be used with other runtimes such
as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.

<table><!-- Generated by deno_readme.ts, do not edit manually --><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/bundle"><code>📦 @libs/bundle</code></a></h2></th></tr>
> [!TIP]\
> Click on a:
> - *JSR badge* to access the package's page on [jsr.io](https://jsr.io)
> - *Playground badge* to access the package's interactive playground
> - *Coverage badge* to access the package's coverage repor.
<table><!-- Generated by deno_readme.ts, do not edit manually --><tr><td colspan="3"></td></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/bundle"><code>📦 @libs/bundle</code></a></h2>Code bundlers, formatters, minifiers and others tools.</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/bundle"><img src="https://jsr.io/badges/@libs/bundle"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"></th>
Expand All @@ -20,8 +27,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th><a href="https://libs-bundle.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/bundle"><img src="https://libs-coverage.lecoq.io/bundle/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/crypto"><code>🧮 @libs/crypto</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/bundle"><img src="https://libs-coverage.lecoq.io/bundle/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/crypto"><code>🧮 @libs/crypto</code></a></h2>Features based upon Web Crypto APIs</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/crypto"><img src="https://jsr.io/badges/@libs/crypto"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -31,8 +39,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th><a href="https://libs-crypto.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/crypto"><img src="https://libs-coverage.lecoq.io/crypto/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/diff"><code>➕ @libs/diff</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/crypto"><img src="https://libs-coverage.lecoq.io/crypto/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/diff"><code>➕ @libs/diff</code></a></h2>Diff (patience algorithm)</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/diff"><img src="https://jsr.io/badges/@libs/diff"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -41,8 +50,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th><a href="https://libs-diff.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/diff"><img src="https://libs-coverage.lecoq.io/diff/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/logger"><code>📰 @libs/logger</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/diff"><img src="https://libs-coverage.lecoq.io/diff/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/logger"><code>📰 @libs/logger</code></a></h2>Simple logger</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/logger"><img src="https://jsr.io/badges/@libs/logger"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -58,8 +68,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th><a href="https://libs-logger.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/logger"><img src="https://libs-coverage.lecoq.io/logger/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/qrcode"><code>🔳 @libs/qrcode</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/logger"><img src="https://libs-coverage.lecoq.io/logger/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/qrcode"><code>🔳 @libs/qrcode</code></a></h2>Pure TypeScript QRcode generator with no dependencies.</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/qrcode"><img src="https://jsr.io/badges/@libs/qrcode"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -69,8 +80,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th><a href="https://libs-qrcode.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/qrcode"><img src="https://libs-coverage.lecoq.io/qrcode/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/reactive"><code>🎯 @libs/reactive</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/qrcode"><img src="https://libs-coverage.lecoq.io/qrcode/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/reactive"><code>🎯 @libs/reactive</code></a></h2>Reactive utilities for observable objects.</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/reactive"><img src="https://jsr.io/badges/@libs/reactive"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -80,8 +92,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th><a href="https://libs-reactive.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/reactive"><img src="https://libs-coverage.lecoq.io/reactive/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/testing"><code>🧪 @libs/testing</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/reactive"><img src="https://libs-coverage.lecoq.io/reactive/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/testing"><code>🧪 @libs/testing</code></a></h2>Testing utilities for cross-platform testing on Deno, Node.js and Bun.</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/testing"><img src="https://jsr.io/badges/@libs/testing"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"></th>
Expand All @@ -99,8 +112,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/testing"><img src="https://libs-coverage.lecoq.io/testing/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/typing"><code>🧰 @libs/typing</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/testing"><img src="https://libs-coverage.lecoq.io/testing/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/typing"><code>🧰 @libs/typing</code></a></h2>Utility types.</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/typing"><img src="https://jsr.io/badges/@libs/typing"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -109,8 +123,9 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
</ul></td>
</tr>
<tr><th></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/typing"><img src="https://libs-coverage.lecoq.io/typing/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/xml"><code>📃 @libs/xml</code></a></h2></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/typing"><img src="https://libs-coverage.lecoq.io/typing/badge.svg"></a></th></tr><tr><th colspan="3"><h2><a href="https://jsr.io/@libs/xml"><code>📃 @libs/xml</code></a></h2>XML parser/stringifier with no dependencies.</th></tr>
<tr><th colspan="2">Metadata and compatibility</th><th>Features</th></tr>
<tr><td colspan="3"></td></tr>
<tr>
<th><a href="https://jsr.io/@libs/xml"><img src="https://jsr.io/badges/@libs/xml"></a></th>
<th rowspan="3"><img height="18px" src="https://jsr.io/logos/deno.svg"><img height="18px" src="https://jsr.io/logos/node.svg"><img height="18px" src="https://jsr.io/logos/bun.svg"><img height="18px" src="https://jsr.io/logos/cloudflare-workers.svg"><img height="18px" src="https://jsr.io/logos/browsers.svg"></th>
Expand All @@ -137,9 +152,6 @@ as [Node.js](https://nodejs.org), [bun](https://bun.sh) and even browsers.
<tr><th><a href="https://libs-xml.deno.dev"><img src="https://img.shields.io/badge/Playground--black?style=flat&logo=deno&labelColor=black"></a></th></tr>
<tr><th><a href="https://libs-coverage.lecoq.io/xml"><img src="https://libs-coverage.lecoq.io/xml/badge.svg"></a></th></tr></table>

> [!TIP]\
> You can click on a JSR badge to access the package page and on a coverage badge to access the coverage report.
## 🧑‍💻 Cli utilities

A set of useful CLI scripts are also provided. Please note that these can only be run on deno runtime.
Expand Down

0 comments on commit 407df09

Please sign in to comment.