diff --git a/.changeset/wise-apricots-sniff.md b/.changeset/wise-apricots-sniff.md new file mode 100644 index 00000000000..afc663bfe16 --- /dev/null +++ b/.changeset/wise-apricots-sniff.md @@ -0,0 +1,5 @@ +--- +"@effect/platform": patch +--- + +add Route to RouteContext diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3c1daff2104..4f20372e14b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,18 +1,16 @@ -* @mikearnaldi - /packages/effect/ @mikearnaldi -/packages/cli/ @IMax153 @tim-smart -/packages/opentelemetry/ @tim-smart @mikearnaldi +/packages/cli/ @IMax153 +/packages/opentelemetry/ @tim-smart /packages/platform/ @tim-smart /packages/platform-browser/ @tim-smart /packages/platform-bun/ @tim-smart /packages/platform-node/ @tim-smart -/packages/printer/ @IMax153 @mikearnaldi -/packages/printer-ansi/ @IMax153 @mikearnaldi +/packages/printer/ @IMax153 +/packages/printer-ansi/ @IMax153 /packages/rpc/ @tim-smart /packages/rpc-http/ @tim-smart /packages/rpc-http-node/ @tim-smart /packages/rpc-nextjs/ @tim-smart /packages/rpc-workers/ @tim-smart /packages/schema/ @gcanti -/packages/typeclass/ @tim-smart @gcanti +/packages/typeclass/ @gcanti diff --git a/packages/platform/src/Http/Router.ts b/packages/platform/src/Http/Router.ts index 0f681e0b395..a298f901f2c 100644 --- a/packages/platform/src/Http/Router.ts +++ b/packages/platform/src/Http/Router.ts @@ -111,6 +111,7 @@ export type RouteContextTypeId = typeof RouteContextTypeId export interface RouteContext { readonly [RouteContextTypeId]: RouteContextTypeId readonly params: Readonly> + readonly route: Route readonly searchParams: Readonly> } diff --git a/packages/platform/src/internal/http/router.ts b/packages/platform/src/internal/http/router.ts index efe931a3704..29a78018e52 100644 --- a/packages/platform/src/internal/http/router.ts +++ b/packages/platform/src/internal/http/router.ts @@ -137,7 +137,7 @@ const toHttpApp = ( Context.add( Context.add(context, ServerRequest.ServerRequest, request), RouteContext, - new RouteContextImpl(result!.params, result!.searchParams) + new RouteContextImpl(route, result!.params, result!.searchParams) ) as Context.Context ) } @@ -164,6 +164,7 @@ class RouteImpl implements Router.Route { class RouteContextImpl implements Router.RouteContext { readonly [RouteContextTypeId]: Router.RouteContextTypeId constructor( + readonly route: Router.Route, readonly params: Readonly>, readonly searchParams: Readonly> ) {