refactor: remove remaining default layer aliases (#34660)
This commit is contained in:
parent
3af9f64265
commit
6636683323
6 changed files with 8 additions and 10 deletions
|
|
@ -18,11 +18,11 @@ export type Info = {
|
|||
}
|
||||
|
||||
export class Config extends Context.Service<Config, Info>()("@opencode/ServerAuthConfig") {
|
||||
static layer(input: Info) {
|
||||
static configLayer(input: Info) {
|
||||
return Layer.succeed(this, this.of(input))
|
||||
}
|
||||
|
||||
static get defaultLayer() {
|
||||
static get layer() {
|
||||
return Layer.effect(
|
||||
this,
|
||||
Effect.gen(function* () {
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@ const applicationServices = LayerNode.group([
|
|||
export function createRoutes(password?: string) {
|
||||
return makeRoutes(
|
||||
password
|
||||
? ServerAuth.Config.layer({ username: "opencode", password: Option.some(password) })
|
||||
: ServerAuth.Config.defaultLayer,
|
||||
? ServerAuth.Config.configLayer({ username: "opencode", password: Option.some(password) })
|
||||
: ServerAuth.Config.layer,
|
||||
)
|
||||
}
|
||||
|
||||
export function createEmbeddedRoutes() {
|
||||
return makeRoutes(ServerAuth.Config.layer({ username: "opencode", password: Option.none() }))
|
||||
return makeRoutes(ServerAuth.Config.configLayer({ username: "opencode", password: Option.none() }))
|
||||
}
|
||||
|
||||
function makeRoutes<AuthError, AuthServices>(auth: Layer.Layer<ServerAuth.Config, AuthError, AuthServices>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue