-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dae1f80
commit f09457e
Showing
12 changed files
with
116 additions
and
98 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@tuyau/client", | ||
"type": "module", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "e2e client for AdonisJS", | ||
"author": "Julien Ripouteau <[email protected]>", | ||
"license": "ISC", | ||
|
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,40 @@ | ||
# @tuyau/inertia | ||
|
||
## 0.0.1 | ||
|
||
### Patch Changes | ||
|
||
- 2da60a7: This PR introduces a new `@tuyau/inertia` package. Goal is to add some components to provide greater type-safety on AdonisJS x InertiaJS apps. | ||
|
||
With this PR, we're only adding the `Link` component, for React and Vue, which is a wrapper of the InertiaJS `Link` component, but type-safe. | ||
|
||
Usage is super easy : just import `Link` from `@tuyau/inertia` rather than `@inertiajs/inertia-react` or `@inertiajs/inertia-vue`. | ||
|
||
```vue | ||
<script setup lang="ts"> | ||
import { Link } from "@tuyau/inertia"; | ||
</script> | ||
<template> | ||
<Link route="posts.edit" :params="{ id: 2 }">Home</Link> | ||
</template> | ||
``` | ||
|
||
Same for React : | ||
|
||
```tsx | ||
import { Link } from "@tuyau/inertia"; | ||
|
||
export function MyComponent() { | ||
return ( | ||
<Link route="posts.edit" params={{ id: 2 }}> | ||
Home | ||
</Link> | ||
); | ||
} | ||
``` | ||
|
||
`Link` component has the same props as the InertiaJS `Link`, except for the `href` and `method` props, which are not needed anymore and replaced by the `route` and `params` props. | ||
|
||
- Updated dependencies [793a775] | ||
- @tuyau/client@0.1.2 |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@tuyau/inertia", | ||
"type": "module", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "", | ||
"author": "Julien Ripouteau <[email protected]>", | ||
"license": "ISC", | ||
|
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,43 @@ | ||
# @tuyau/openapi | ||
|
||
## 0.1.2 | ||
|
||
### Patch Changes | ||
|
||
- 649adc4: First experimental version of @tuyau/openapi. | ||
|
||
## OpenAPI Spec generation | ||
|
||
The concept is quite simple: we generate an openapi spec from the @tuyau/core codegen. This generation is done using ts-morph and the typescript compiler: we analyse and extract the types of requests/replies, and generate the OpenAPI spec based on this. Of course, there are limitations compared to manually written specs. I'll go into more detail about the limitations in the documentation coming soon. | ||
That said, although there are limitations, I think that in many cases it can do the job just fine | ||
|
||
Also, to bypass some of the limitations of the automatic generation, you can add details to the spec using the `detail` macro available on the routes : | ||
|
||
```ts | ||
router | ||
.group(() => { | ||
router | ||
.get("/random", [MiscController, "index"]) | ||
.detail({ description: "Get a random thing" }); | ||
router | ||
.get("/random/:id", [MiscController, "show"]) | ||
.detail({ description: "Get a random thing by id" }); | ||
}) | ||
.prefix("/misc") | ||
.detail({ tags: ["misc"] }); | ||
``` | ||
|
||
These `details` will be merged and added to the auto-generated OpenAPI spec. | ||
|
||
## OpenAPI Viewer | ||
|
||
In addition to auto-generation, the package will automatically expose a `/docs` route on which the openapi spec is served, via either Scalar or Swagger-UI. Everything is configurable. | ||
|
||
![image](https://github.com/Julien-Sponsors/tuyau/assets/8337858/95840899-cbe6-42bf-983e-b968d1d17fe6) | ||
|
||
*** | ||
|
||
This version is very experimental. There are a few things that don't work 100% yet: some types are badly generated. But this is a pretty decent first version. Also, I will detail how to install and use it in the coming documentation | ||
|
||
- Updated dependencies [dae1f80] | ||
- @tuyau/core@0.1.4 |
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