Skip to content

Commit 2e3a699

Browse files
author
cletqui
committed
v0.8.1
1 parent 7189764 commit 2e3a699

File tree

5 files changed

+78
-67
lines changed

5 files changed

+78
-67
lines changed

package-lock.json

Lines changed: 38 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "petithub",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"private": false,
55
"description": "PetitHub - Explore obscure GitHub repositories",
66
"author": {
@@ -30,16 +30,16 @@
3030
"deploy": "$npm_execpath run build && wrangler pages deploy"
3131
},
3232
"dependencies": {
33-
"@hono/swagger-ui": "^0.3.0",
33+
"@hono/swagger-ui": "^0.4.0",
3434
"@hono/zod-openapi": "^0.14.9",
35-
"hono": "^4.4.13",
35+
"hono": "^4.5.0",
3636
"octokit": "^4.0.2"
3737
},
3838
"devDependencies": {
3939
"@cloudflare/workers-types": "^4.20240712.0",
4040
"@hono/vite-cloudflare-pages": "^0.4.2",
41-
"@hono/vite-dev-server": "^0.12.2",
42-
"vite": "^5.3.3",
41+
"@hono/vite-dev-server": "^0.13.1",
42+
"vite": "^5.3.4",
4343
"vitest": "^2.0.3",
4444
"wrangler": "^3.64.0"
4545
}

src/components/repository.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Repository = async ({
1313
>;
1414
}) => {
1515
return (
16-
<Suspense fallback={<div>{"prout"}</div>}>
16+
<Suspense fallback={<div>{"error"}</div>}>
1717
<Container repository={await repository} />
1818
</Suspense>
1919
);
@@ -200,7 +200,7 @@ const Container = ({
200200
{description && <p>{description}</p>}
201201
{topics && topics?.length > 0 && (
202202
<div>
203-
{topics.map((topic: any) => (
203+
{topics.map((topic: string) => (
204204
<a
205205
class="topic"
206206
target="_blank"

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ app.get(
5555
);
5656

5757
/* DEFAULT */
58-
/* app.get(
58+
app.get(
5959
"*",
6060
(c: Context<{ Bindings: Bindings; Variables: Variables }>): Response => {
6161
return c.redirect("/", 301);
6262
}
63-
); */
63+
);
6464

6565
export default app;

src/routes/api.tsx

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Context } from "hono";
22
import { poweredBy } from "hono/powered-by";
33
import { prettyJSON } from "hono/pretty-json";
4+
import { trimTrailingSlash } from 'hono/trailing-slash'
45
import { cors } from "hono/cors";
56
import { createRoute, OpenAPIHono } from "@hono/zod-openapi";
67
import { swaggerUI } from "@hono/swagger-ui";
@@ -18,6 +19,7 @@ const app = new OpenAPIHono<{ Bindings: Bindings; Variables: Variables }>();
1819
/* MIDDLEWARES */
1920
app.use(poweredBy());
2021
app.use(prettyJSON());
22+
app.use(trimTrailingSlash())
2123
app.use(cors({ origin: "*", allowMethods: ["GET"], credentials: true }));
2224
app.use(handleMaxId);
2325
app.use(handleTokens);
@@ -31,31 +33,36 @@ app.openAPIRegistry.registerComponent("securitySchemes", "Bearer", {
3133

3234
/* SWAGGER */
3335
app.get("/swagger", swaggerUI({ url: `/api/swagger.json`, version: "3.1" }));
34-
app.doc31("/swagger.json", (c) => {
35-
return {
36-
openapi: "3.1.0",
37-
info: {
38-
title: "API",
39-
version: version,
40-
description: "PetitHub - [GitHub](https://github.com/cletqui/petithub)",
41-
contact: {
42-
name: "cletqui",
43-
url: "https://github.com/cletqui/petithub/issues",
44-
},
45-
license: {
46-
name: "MIT",
47-
url: "https://opensource.org/license/MIT",
48-
},
49-
},
50-
servers: [{ url: `${new URL(c.req.url).origin}/api`, description: "API" }],
51-
tags: [
52-
{
53-
name: "API",
54-
description: "Default API",
36+
app.doc31(
37+
"/swagger.json",
38+
(c: Context<{ Bindings: Bindings; Variables: Variables }>) => {
39+
return {
40+
openapi: "3.1.0",
41+
info: {
42+
title: "API",
43+
version: version,
44+
description: "PetitHub - [GitHub](https://github.com/cletqui/petithub)",
45+
contact: {
46+
name: "cletqui",
47+
url: "https://github.com/cletqui/petithub/issues",
48+
},
49+
license: {
50+
name: "MIT",
51+
url: "https://opensource.org/license/MIT",
52+
},
5553
},
56-
],
57-
};
58-
});
54+
servers: [
55+
{ url: `${new URL(c.req.url).origin}/api`, description: "API" },
56+
],
57+
tags: [
58+
{
59+
name: "API",
60+
description: "Default API",
61+
},
62+
],
63+
};
64+
}
65+
);
5966

6067
/* ROUTES */
6168
const route = createRoute({

0 commit comments

Comments
 (0)