moonflower 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Moonflower is a TypeScript-first [Koa Router](https://www.npmjs.com/package/koa-router) extension that allows for automatic [OpenAPI](https://www.openapis.org/what-is-openapi) spec generation directly from backend code, without any extra work. Combined with an ORM like [Prisma.js](https://www.npmjs.com/package/prisma) and an API client generator on frontend, it allows for creation of end-to-end type safe REST API.
|
|
6
6
|
|
|
7
|
-
Moonflower provides type safe 'hooks' that handle runtime validation and return clean types with minimal boilerplate.
|
|
7
|
+
Moonflower provides type safe 'hooks' that handle runtime validation and return clean types with minimal boilerplate.
|
|
8
8
|
|
|
9
9
|
## Feature Overview
|
|
10
10
|
|
|
@@ -15,6 +15,8 @@ Moonflower provides type safe 'hooks' that handle runtime validation and return
|
|
|
15
15
|
|
|
16
16
|
## Usage example
|
|
17
17
|
|
|
18
|
+
For a more detailed example, see the [Moonflower Example App](https://github.com/Tenebrie/moonflower-example).
|
|
19
|
+
|
|
18
20
|
Every variable and parameter in this example is fully typed.
|
|
19
21
|
|
|
20
22
|
```ts
|
|
@@ -177,7 +179,7 @@ const rawBody = useRequestRawBody(ctx, {...})
|
|
|
177
179
|
|
|
178
180
|
# Validators
|
|
179
181
|
|
|
180
|
-
Validators are run for every parameter received from the client. Failed validation or an error thrown during validation will return 400 Bad Request to the user.
|
|
182
|
+
Validators are a primary way to define and validate user input. A validator is run for every parameter received from the client, checking it for validity and transforming it from a plain string to a value of a correct type. Failed validation or an error thrown during validation will return 400 Bad Request to the user.
|
|
181
183
|
|
|
182
184
|
**Example:**
|
|
183
185
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fromZodSchema.d.ts","sourceRoot":"","sources":["../../../src/utils/fromZodSchema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YAEzB,CAAA"}
|