Skip to content

Commit 1aaa393

Browse files
committed
v0.13.0-alpha.1 - see CHANGELOG for details
1 parent 0b0ce08 commit 1aaa393

36 files changed

+514
-200
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ Temporary Items
2828

2929
cov_profile
3030
cov_profile.lcov
31+
docs

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Unreleased
2+
3+
### Changed
4+
5+
- switched from `deps.ts` and `dev_deps.ts` to `deno.jsonc`
6+
- revamped documentation
7+
- code format
8+
19
## [0.12.2] - 2024-12-06
210

311
### Added

deno.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"imports": {
3+
"@asteasolutions/zod-to-openapi": "npm:@asteasolutions/zod-to-openapi@^7.3.0",
4+
"@dklab/oak-routing-ctrl": "jsr:@dklab/oak-routing-ctrl@^0.12.2",
5+
"@oak/oak": "jsr:@oak/oak@^17.1.3",
6+
"@std/assert": "jsr:@std/assert@^1.0.9",
7+
"@std/io": "jsr:@std/io@^0.225.0",
8+
"@std/path": "jsr:@std/path@^1.0.8",
9+
"@std/testing": "jsr:@std/testing@^1.0.6",
10+
"zod": "npm:zod@^3.23.8"
11+
},
12+
"tasks": {
13+
"pretty": "deno lint --ignore=docs && deno check . && deno fmt",
14+
"test": "deno test -RE",
15+
"check-doc": "deno check --doc .",
16+
"doc": "deno doc --html mod.ts"
17+
}
18+
}

deno.lock

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

dev_deps.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

jsr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "@dklab/oak-routing-ctrl",
3-
"version": "0.12.2",
3+
"version": "0.13.0",
44
"exports": {
55
".": "./mod.ts",
66
"./mod": "./mod.ts"
77
},
88
"exclude": [
9+
"./docs",
910
"./test_utils",
1011
"**/*_test.ts",
1112
"cov_profile",

mod.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export { useOakServer } from "./src/useOakServer.ts";
2-
export { useOakServer as useOak } from "./src/useOakServer.ts";
3-
export { useOas } from "./src/useOas.ts";
2+
export { useOak } from "./src/useOakServer.ts";
3+
export { useOas, type UseOasConfig } from "./src/useOas.ts";
44
export { Controller } from "./src/Controller.ts";
55
export {
66
type ControllerMethodArg,
@@ -14,4 +14,8 @@ export { Delete } from "./src/Delete.ts";
1414
export { Options } from "./src/Options.ts";
1515
export { Head } from "./src/Head.ts";
1616

17-
export { type OakOpenApiSpec, z, type zInfer } from "./deps.ts";
17+
export {
18+
type OakOpenApiSpec,
19+
z,
20+
type zInfer,
21+
} from "./src/utils/schema_utils.ts";

src/Controller.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1+
import { join } from "@std/path";
12
import { debug } from "./utils/logger.ts";
2-
import { join } from "../deps.ts";
33
import { store } from "./Store.ts";
44
import { patchOasPath } from "./oasStore.ts";
55

66
/**
7-
* Just a standard Class, that can be decorated with the `@Controller` decorator
7+
* Just a standard Class, that can be decorated with the {@linkcode Controller} decorator
88
*/
99
export type ControllerClass = new (args?: unknown) => unknown;
1010

11+
type ClassDecorator = (
12+
target: ControllerClass,
13+
context?: ClassDecoratorContext,
14+
) => void;
15+
1116
/**
1217
* Decorator that should be used on the Controller Class
1318
* @NOTE under `experimentalDecorators`, `context` is not available
19+
* @example
20+
* ```ts
21+
* ;@Controller("/api/")
22+
* class ExampleClass {
23+
* // functions that handle endpoints starting with `/api/`
24+
* }
25+
* ```
1426
*/
1527
export const Controller =
16-
(pathPrefix: string = "") =>
17-
(target: ControllerClass, context?: ClassDecoratorContext): void => {
28+
(pathPrefix: string = ""): ClassDecorator => (target, context): void => {
1829
debug(
1930
`invoking ControllerDecorator for ${target.name} -`,
2031
"runtime provides context:",

0 commit comments

Comments
 (0)