Skip to content

Commit 502d87d

Browse files
committed
chore(moonapi): move to the moonbitstack org, drop an import moonc 0.10.12 flags as unused, bump to 0.8.1.
Signed-off-by: Leo Cheng (heke1228) <chengkelfan@qq.com>
1 parent 5699f13 commit 502d87d

6 files changed

Lines changed: 13 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
**A typed web framework for MoonBit — `← FastAPI`.**
66

7-
[![Check and Test](https://github.com/Lfan-ke/moonapi/actions/workflows/ci.yml/badge.svg)](https://github.com/Lfan-ke/moonapi/actions/workflows/ci.yml)
7+
[![Check and Test](https://github.com/moonbitstack/moonapi/actions/workflows/ci.yml/badge.svg)](https://github.com/moonbitstack/moonapi/actions/workflows/ci.yml)
88
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
99
[![mooncakes](https://img.shields.io/badge/mooncakes-Lfan--ke%2Fmoonapi-brightgreen)](https://mooncakes.io/docs/Lfan-ke/moonapi)
1010

1111
</div>
1212

13-
`moonapi` builds an [`AsgiApp`](https://github.com/Lfan-ke/moonasgi) from typed routes and generates its own **OpenAPI / Swagger** document — the role FastAPI plays for Python. It depends only on `moonasgi`, so it's backend-agnostic (routing and OpenAPI run in-process on every backend); a server such as [`mooncat`](https://github.com/Lfan-ke/mooncat) runs the resulting app.
13+
`moonapi` builds an [`AsgiApp`](https://github.com/moonbitstack/moonasgi) from typed routes and generates its own **OpenAPI / Swagger** document — the role FastAPI plays for Python. It depends only on `moonasgi`, so it's backend-agnostic (routing and OpenAPI run in-process on every backend); a server such as [`mooncat`](https://github.com/moonbitstack/mooncat) runs the resulting app.
1414

1515
```mermaid
1616
flowchart LR

docs/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@
117117
<a href="#security-extractors"><span class="at">§</span>Security extractors</a>
118118
<a href="#signatures"><span class="at">§</span>Signature primitives</a>
119119
<a href="#di-demo"><span class="at">§</span>Dependency injection worked example</a>
120-
</nav><button class="theme-btn" id="theme">◐ toggle theme</button><div class="side-foot"><a href="https://github.com/Lfan-ke/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Lfan-ke/moonapi/ci.yml?branch=master&label=CI&logo=github"></a><a href="https://mooncakes.io/docs/Lfan-ke/moonapi"><img alt="mooncakes" src="https://img.shields.io/badge/mooncakes-Lfan--ke%2Fmoonapi-1f6feb"></a></div></aside>
121-
<main><header class="hero"><h1>moonapi</h1><p class="tag">A typed web framework for MoonBit &#8212; FastAPI-style routing and multi-version OpenAPI, on the moonasgi SEAM. Backend-agnostic &#8212; the async transport lives in the server (mooncat) that runs the app.</p><div class="badges"><a href="https://github.com/Lfan-ke/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Lfan-ke/moonapi/ci.yml?branch=master&label=CI&logo=github"></a><img alt="tests" src="https://img.shields.io/badge/tests-86%20passing%20%C3%974%20backends-0ca678"><a href="https://github.com/Lfan-ke/moonapi"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-source-24292f?logo=github"></a><img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-6d5efc"></div><div class="install"><span class="prompt">$</span><code>moon add Lfan-ke/moonapi</code><button class="copy" data-copy="moon add Lfan-ke/moonapi">copy</button></div><div class="contract"><h2><span class="spark">&#10038;</span> The contract at a glance</h2><pre><span class="k">let</span> app = <span class="ty">App</span>::new()
120+
</nav><button class="theme-btn" id="theme">◐ toggle theme</button><div class="side-foot"><a href="https://github.com/moonbitstack/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/moonbitstack/moonapi/ci.yml?branch=master&label=CI&logo=github"></a><a href="https://mooncakes.io/docs/Lfan-ke/moonapi"><img alt="mooncakes" src="https://img.shields.io/badge/mooncakes-Lfan--ke%2Fmoonapi-1f6feb"></a></div></aside>
121+
<main><header class="hero"><h1>moonapi</h1><p class="tag">A typed web framework for MoonBit &#8212; FastAPI-style routing and multi-version OpenAPI, on the moonasgi SEAM. Backend-agnostic &#8212; the async transport lives in the server (mooncat) that runs the app.</p><div class="badges"><a href="https://github.com/moonbitstack/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/moonbitstack/moonapi/ci.yml?branch=master&label=CI&logo=github"></a><img alt="tests" src="https://img.shields.io/badge/tests-86%20passing%20%C3%974%20backends-0ca678"><a href="https://github.com/moonbitstack/moonapi"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-source-24292f?logo=github"></a><img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-6d5efc"></div><div class="install"><span class="prompt">$</span><code>moon add Lfan-ke/moonapi</code><button class="copy" data-copy="moon add Lfan-ke/moonapi">copy</button></div><div class="contract"><h2><span class="spark">&#10038;</span> The contract at a glance</h2><pre><span class="k">let</span> app = <span class="ty">App</span>::new()
122122
app.get(&quot;/users/:id&quot;, ctx =&gt; text(200, &quot;user &quot; + ctx.param(&quot;id&quot;).unwrap()))
123123

124124
<span class="k">let</span> spec = app.openapi_json(version=<span class="ty">OpenApi31</span>) // also <span class="ty">OpenApi30</span> / <span class="ty">Swagger20</span>
@@ -412,7 +412,7 @@
412412
<div class="item" data-k="enum"><span class="kind">enum</span><pre class="sig"><span class="k">enum</span> <span class="ty">Dep</span></pre><p class="doc">The dependency value type of the greet app. A sum type wrapping every dependency this app injects — the explicit, exhaustive stand-in for FastAPI resolving heterogeneous <code>Depends</code> values dynamically.</p></div>
413413
<div class="item" data-k="fn"><span class="kind">fn</span><pre class="sig"><span class="k">fn</span> greet_app(container : <span class="ty">Container</span>[<span class="ty">Dep</span>]) <span class="op">-&gt;</span> <span class="ty">App</span></pre><p class="doc">Build the greet application over a caller-supplied dependency <code>container</code>, so a test can register <code>dependency_overrides</code> on the same container before or between requests. <code>POST /greet</code> resolves the <code>&quot;greeting&quot;</code> dependency, reads a validated <code>GreetReq</code> body, and answers <code>{&quot;message&quot;: &quot;&lt;greeting&gt;, &lt;name&gt;&quot;}</code>; a malformed body gets a FastAPI-shaped <code>422</code>. The dependency scope brackets each request, so any <code>yield</code> teardown runs once the handler returns.</p></div>
414414
</section>
415-
<footer>Generated from source <code>///</code> doc-comments · <a href="https://mooncakes.io/docs/Lfan-ke/moonapi">mooncakes</a> · <a href="https://github.com/Lfan-ke/moonapi">GitHub</a> · Apache-2.0 &#169; Leo Cheng</footer>
415+
<footer>Generated from source <code>///</code> doc-comments · <a href="https://mooncakes.io/docs/Lfan-ke/moonapi">mooncakes</a> · <a href="https://github.com/moonbitstack/moonapi">GitHub</a> · Apache-2.0 &#169; Leo Cheng</footer>
416416
</main></div><script>
417417
document.addEventListener("DOMContentLoaded",()=>{
418418
document.querySelectorAll("[data-copy]").forEach(btn=>btn.addEventListener("click",()=>{

examples/18-websocket/moon.pkg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
"Lfan-ke/moonapi",
33
"Lfan-ke/moonasgi",
4-
"moonbitlang/core/encoding/utf8",
54
}
65

76
pkgtype(kind: "executable")

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ moon run examples/01-openapi
1010

1111
Everything runs in-process through `App::handle` / `drive_websocket`, so every
1212
example works on every backend; a server such as
13-
[`mooncat`](https://github.com/Lfan-ke/mooncat) runs the same `App::to_asgi`
13+
[`mooncat`](https://github.com/moonbitstack/mooncat) runs the same `App::to_asgi`
1414
over a real transport.
1515

1616
| # | Example | What it shows | Key API |
@@ -41,6 +41,6 @@ over a real transport.
4141
| 23 | [`lifespan`](23-lifespan/) | Startup and shutdown hooks, run through the moonasgi lifespan core so the order is visible without a server | `App::on_startup`, `App::on_shutdown`, `App::lifespan_handler` |
4242

4343
The document `openapi_json(version=OpenApi31)` prints is the same one a server
44-
([`mooncat`](https://github.com/Lfan-ke/mooncat)) serves at `/openapi.json`
44+
([`mooncat`](https://github.com/moonbitstack/mooncat)) serves at `/openapi.json`
4545
after `App::to_asgi`; swap `OpenApi31` for `OpenApi30` or `Swagger20` to emit the
4646
other spec versions off the identical routes.

moon.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name = "Lfan-ke/moonapi"
22

3-
version = "0.8.0"
3+
version = "0.8.1"
44

55
readme = "README.md"
66

7-
repository = "https://github.com/Lfan-ke/moonapi"
7+
repository = "https://github.com/moonbitstack/moonapi"
88

99
license = "Apache-2.0"
1010

scripts/gen_docs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def main():
311311
side += ['</nav>'
312312
'<button class="theme-btn" id="theme">◐ toggle theme</button>'
313313
'<div class="side-foot">'
314-
'<a href="https://github.com/Lfan-ke/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Lfan-ke/moonapi/ci.yml?branch=master&label=CI&logo=github"></a>'
314+
'<a href="https://github.com/moonbitstack/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/moonbitstack/moonapi/ci.yml?branch=master&label=CI&logo=github"></a>'
315315
'<a href="https://mooncakes.io/docs/Lfan-ke/moonapi"><img alt="mooncakes" src="https://img.shields.io/badge/mooncakes-Lfan--ke%2Fmoonapi-1f6feb"></a>'
316316
'</div></aside>']
317317

@@ -320,9 +320,9 @@ def main():
320320
'multi-version OpenAPI, on the moonasgi SEAM. Backend-agnostic &#8212; the async '
321321
'transport lives in the server (mooncat) that runs the app.</p>'
322322
'<div class="badges">'
323-
'<a href="https://github.com/Lfan-ke/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Lfan-ke/moonapi/ci.yml?branch=master&label=CI&logo=github"></a>'
323+
'<a href="https://github.com/moonbitstack/moonapi/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/moonbitstack/moonapi/ci.yml?branch=master&label=CI&logo=github"></a>'
324324
'<img alt="tests" src="https://img.shields.io/badge/tests-86%20passing%20%C3%974%20backends-0ca678">'
325-
'<a href="https://github.com/Lfan-ke/moonapi"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-source-24292f?logo=github"></a>'
325+
'<a href="https://github.com/moonbitstack/moonapi"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-source-24292f?logo=github"></a>'
326326
'<img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-6d5efc"></div>'
327327
'<div class="install"><span class="prompt">$</span><code>moon add Lfan-ke/moonapi</code>'
328328
'<button class="copy" data-copy="moon add Lfan-ke/moonapi">copy</button></div>'
@@ -343,7 +343,7 @@ def main():
343343
body.append('</section>')
344344
body.append('<footer>Generated from source <code>///</code> doc-comments · '
345345
'<a href="https://mooncakes.io/docs/Lfan-ke/moonapi">mooncakes</a> · '
346-
'<a href="https://github.com/Lfan-ke/moonapi">GitHub</a> · Apache-2.0 &#169; Leo Cheng</footer>')
346+
'<a href="https://github.com/moonbitstack/moonapi">GitHub</a> · Apache-2.0 &#169; Leo Cheng</footer>')
347347
body.append('</main></div><script>' + JS + '</script></body></html>')
348348

349349
out = ROOT / "docs" / "index.html"

0 commit comments

Comments
 (0)