@effect/platform
Advanced tools
Comparing version 0.58.11 to 0.58.12
@@ -336,3 +336,18 @@ "use strict"; | ||
}, | ||
router: Effect.sync(() => router) | ||
router: Effect.sync(() => router), | ||
mount(path, that) { | ||
return Effect.sync(() => { | ||
router = mount(router, path, that); | ||
}); | ||
}, | ||
mountApp(path, app, options) { | ||
return Effect.sync(() => { | ||
router = mountApp(router, path, app, options); | ||
}); | ||
}, | ||
concat(that) { | ||
return Effect.sync(() => { | ||
router = concat(router, that); | ||
}); | ||
} | ||
}; | ||
@@ -339,0 +354,0 @@ }; |
@@ -91,2 +91,7 @@ /** | ||
} | undefined) => Effect.Effect<void>; | ||
readonly mount: (path: `/${string}`, router: HttpRouter<E, R>) => Effect.Effect<void>; | ||
readonly mountApp: (path: `/${string}`, router: App.Default<E, R>, options?: { | ||
readonly includePrefix?: boolean | undefined; | ||
} | undefined) => Effect.Effect<void>; | ||
readonly concat: (router: HttpRouter<E, R>) => Effect.Effect<void>; | ||
} | ||
@@ -96,2 +101,6 @@ /** | ||
*/ | ||
type DefaultServices = Platform.HttpPlatform | Etag.Generator | FileSystem | Path; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
interface TagClass<Self, Name extends string, E, R> extends Context.Tag<Self, Service<E, R>> { | ||
@@ -472,4 +481,4 @@ new (_: never): Context.TagClassShape<Name, Service<E, R>>; | ||
*/ | ||
export declare const Tag: <const Name extends string>(id: Name) => <Self, R = never, E = unknown>() => HttpRouter.TagClass<Self, Name, E, R>; | ||
declare const Default_base: HttpRouter.TagClass<Default, "@effect/platform/HttpRouter/Default", unknown, FileSystem | Etag.Generator | Platform.HttpPlatform | Path>; | ||
export declare const Tag: <const Name extends string>(id: Name) => <Self, R = never, E = unknown>() => HttpRouter.TagClass<Self, Name, E, R | HttpRouter.DefaultServices>; | ||
declare const Default_base: HttpRouter.TagClass<Default, "@effect/platform/HttpRouter/Default", unknown, HttpRouter.DefaultServices>; | ||
/** | ||
@@ -476,0 +485,0 @@ * @since 1.0.0 |
@@ -298,3 +298,18 @@ import * as Schema from "@effect/schema/Schema"; | ||
}, | ||
router: Effect.sync(() => router) | ||
router: Effect.sync(() => router), | ||
mount(path, that) { | ||
return Effect.sync(() => { | ||
router = mount(router, path, that); | ||
}); | ||
}, | ||
mountApp(path, app, options) { | ||
return Effect.sync(() => { | ||
router = mountApp(router, path, app, options); | ||
}); | ||
}, | ||
concat(that) { | ||
return Effect.sync(() => { | ||
router = concat(router, that); | ||
}); | ||
} | ||
}; | ||
@@ -301,0 +316,0 @@ }; |
{ | ||
"name": "@effect/platform", | ||
"version": "0.58.11", | ||
"version": "0.58.12", | ||
"description": "Unified interfaces for common platform-specific services", | ||
@@ -18,4 +18,4 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@effect/schema": "^0.68.10", | ||
"effect": "^3.4.3" | ||
"@effect/schema": "^0.68.11", | ||
"effect": "^3.4.4" | ||
}, | ||
@@ -22,0 +22,0 @@ "publishConfig": { |
@@ -75,5 +75,3 @@ /** | ||
readonly router: Effect.Effect<HttpRouter<E, R>> | ||
readonly addRoute: (route: Route<E, R>) => Effect.Effect<void> | ||
readonly all: ( | ||
@@ -119,2 +117,12 @@ path: PathInput, | ||
) => Effect.Effect<void> | ||
readonly mount: ( | ||
path: `/${string}`, | ||
router: HttpRouter<E, R> | ||
) => Effect.Effect<void> | ||
readonly mountApp: ( | ||
path: `/${string}`, | ||
router: App.Default<E, R>, | ||
options?: { readonly includePrefix?: boolean | undefined } | undefined | ||
) => Effect.Effect<void> | ||
readonly concat: (router: HttpRouter<E, R>) => Effect.Effect<void> | ||
} | ||
@@ -125,2 +133,7 @@ | ||
*/ | ||
export type DefaultServices = Platform.HttpPlatform | Etag.Generator | FileSystem | Path | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
export interface TagClass<Self, Name extends string, E, R> extends Context.Tag<Self, Service<E, R>> { | ||
@@ -744,3 +757,4 @@ new(_: never): Context.TagClassShape<Name, Service<E, R>> | ||
id: Name | ||
) => <Self, R = never, E = unknown>() => HttpRouter.TagClass<Self, Name, E, R> = internal.Tag | ||
) => <Self, R = never, E = unknown>() => HttpRouter.TagClass<Self, Name, E, R | HttpRouter.DefaultServices> = | ||
internal.Tag | ||
@@ -751,5 +765,2 @@ /** | ||
*/ | ||
export class Default extends Tag("@effect/platform/HttpRouter/Default")< | ||
Default, | ||
Platform.HttpPlatform | Etag.Generator | FileSystem | Path | ||
>() {} | ||
export class Default extends Tag("@effect/platform/HttpRouter/Default")<Default>() {} |
@@ -714,3 +714,18 @@ import type { ParseOptions } from "@effect/schema/AST" | ||
}, | ||
router: Effect.sync(() => router) | ||
router: Effect.sync(() => router), | ||
mount(path, that) { | ||
return Effect.sync(() => { | ||
router = mount(router, path, that) | ||
}) | ||
}, | ||
mountApp(path, app, options) { | ||
return Effect.sync(() => { | ||
router = mountApp(router, path, app, options) | ||
}) | ||
}, | ||
concat(that) { | ||
return Effect.sync(() => { | ||
router = concat(router, that) | ||
}) | ||
} | ||
} | ||
@@ -722,3 +737,8 @@ } | ||
<const Name extends string>(id: Name) => | ||
<Self, R = never, E = unknown>(): Router.HttpRouter.TagClass<Self, Name, E, R> => { | ||
<Self, R = never, E = unknown>(): Router.HttpRouter.TagClass< | ||
Self, | ||
Name, | ||
E, | ||
R | Router.HttpRouter.DefaultServices | ||
> => { | ||
const Err = globalThis.Error as any | ||
@@ -725,0 +745,0 @@ const limit = Err.stackTraceLimit |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2211329
37876