Skip to content

Commit b0f1dd5

Browse files
author
Maciej Łyskawiński
committed
feat(hono-decorators): initial release
1 parent ce3ee02 commit b0f1dd5

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

packages/hono-decorators/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "@longucodes/hono-decorators",
33
"version": "0.0.2",
44
"dependencies": {
5-
"hono": "~4.7.9"
5+
"hono": "~4.7.9",
6+
"reflect-metadata": "^0.2.2"
67
},
78
"repository": {
89
"url": "https://github.com/LonguCodes/packages",
@@ -14,4 +15,4 @@
1415
"url": "https://github.com/LonguCodes/packages/issues"
1516
},
1617
"license": "MIT"
17-
}
18+
}

packages/hono-decorators/src/di/di-store.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type {Type} from "../types.ts";
2-
import {isConstructor} from "../type-checks.ts";
1+
import type {Type} from "../types";
2+
import {isConstructor} from "../type-checks";
33
import { v4 } from "uuid";
4-
import {INJECT_METADATA_KEY} from "./decorators.ts";
4+
import {INJECT_METADATA_KEY} from "./decorators";
55

66
const DI_TOKEN = Symbol("di-token");
77

@@ -39,4 +39,4 @@ export class DIStore {
3939
Object.defineProperty(instance, key, { value });
4040
}
4141
}
42-
}
42+
}

packages/hono-decorators/src/http/decorators.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {httpConfigStore, type HttpPath} from "./http.config-store.ts";
2-
import type {Type} from "../types.ts";
1+
import {httpConfigStore, type HttpPath} from "./http.config-store";
2+
import type {Type} from "../types";
33

44
export function Route(method: HttpPath['method'], path: string){
55
return (target: object, property: string, descriptor: TypedPropertyDescriptor<any>) => {
@@ -23,4 +23,4 @@ export function Patch(path: string){
2323
}
2424
export function Put(path: string){
2525
return Route('put', path);
26-
}
26+
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
export * from './di/decorators.ts';
2-
export * from './http/decorators.ts';
3-
export * from './http/http.ts';
1+
import 'reflect-metadata';
2+
export * from './di/decorators';
3+
export * from './http/decorators';
4+
export * from './http/http';

0 commit comments

Comments
 (0)