Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Nov 2, 2024
1 parent 973aa06 commit 6beb76e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getRequestContext } from "@effect-app/infra/api/setupRequest"
import { generate } from "@effect-app/infra/test"
import { matchFor } from "api/lib/routing.js"
import { User } from "api/User/User.js"
import { UserRepo } from "api/User/UserRepo.js"
import { Effect, S } from "effect-app"
import { HelloWorldResources } from "resources.js"
import { User } from "./User/User.js"
import { UserRepo } from "./User/UserRepo.js"

export default matchFor(HelloWorldResources)([
UserRepo.Default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RequestContext } from "@effect-app/infra/RequestContext"
import { S } from "api/lib.js"
import { UserView } from "./User/UserView.js"
import { UserView } from "api/User/UserView.js"

class Response extends S.Class<Response>()({
now: S.Date.withDefault,
Expand All @@ -14,6 +14,6 @@ export class GetHelloWorld extends S.Req<GetHelloWorld>()("GetHelloWorld", {
echo: S.String
}, { allowAnonymous: true, allowRoles: ["user"], success: Response }) {}

// codegen:start {preset: meta, sourcePrefix: src/}
// codegen:start {preset: meta, sourcePrefix: src/HelloWorld/}
export const meta = { moduleName: "HelloWorld.resources" } as const
// codegen:end
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { OperationsDefault } from "api/lib.js"
import { matchFor } from "api/lib/routing.js"
import { Operations } from "api/services.js"
import { Effect } from "effect-app"
import { OperationsResources } from "resources.js"
import { OperationsDefault } from "./lib/layers.js"

export default matchFor(OperationsResources)([
OperationsDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class FindOperation extends S.Req<FindOperation>()("FindOperation", {
id: OperationId
}, { allowAnonymous: true, allowRoles: ["user"], success: S.NullOr(Operation) }) {}

// codegen:start {preset: meta, sourcePrefix: src/}
// codegen:start {preset: meta, sourcePrefix: src/Operations/}
export const meta = { moduleName: "Operations.resources" } as const
// codegen:end

Expand Down
17 changes: 13 additions & 4 deletions api/src/controllers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// codegen:start {preset: barrel, include: ./*.controllers.ts, import: default}
import helloWorldControllers from "./HelloWorld.controllers.js"
import operationsControllers from "./Operations.controllers.js"
// codegen:start {preset: barrel, include: ./**/*.controllers.ts, import: default}
import blogBlogControllers from "./Blog/Blog.controllers.js"
import helloWorldHelloWorldControllers from "./HelloWorld/HelloWorld.controllers.js"
import operationsOperationsControllers from "./Operations/Operations.controllers.js"
import userMeControllers from "./User/Me.controllers.js"
import userUsersControllers from "./User/Users.controllers.js"

export { helloWorldControllers, operationsControllers }
export {
blogBlogControllers,
helloWorldHelloWorldControllers,
operationsOperationsControllers,
userMeControllers,
userUsersControllers
}
// codegen:end
4 changes: 2 additions & 2 deletions api/src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export { ClientEvents } from "./Events.js"

// codegen:start {preset: barrel, include: ./**/*.resources.ts, exclude: [./resources/index.ts, ./resources/lib.ts, ./resources/integrationEvents.ts, ./resources/Messages.ts, ./resources/views.ts, ./resources/Events.ts], export: { as: 'PascalCase' }}
export * as BlogResources from "./Blog/Blog.resources.js"
export * as HelloWorldResources from "./HelloWorld.resources.js"
export * as OperationsResources from "./Operations.resources.js"
export * as HelloWorldResources from "./HelloWorld/HelloWorld.resources.js"
export * as OperationsResources from "./Operations/Operations.resources.js"
export * as MeResources from "./User/Me.resources.js"
export * as UsersResources from "./User/Users.resources.js"
// codegen:end

0 comments on commit 6beb76e

Please sign in to comment.