198 lines · 14.4 KB · Markdown
RawDownload

Effect.fn Refactor Checklist

Generated from a repo scan for non-test wrapper-style candidates matching either => Effect.gen(function* ...) or return Effect.gen(function* ...).

Refactor Method:

// Old
function old () {
    return Effect.gen(function* () {
        ...
    });
}

const old2 = () => Effect.gen(function* () {
    ...
});
// New
const new = Effect.fn('functionName')(function* () {
    ...
})
  • Use Effect.fn('name')(function* (input: Input): Effect.fn.Return<A, E, R> {}) to annotate the return type of the function if needed.

  • The 2nd argument works as a pipe, and it gets the effect and input as arguments:

Effect.fn("name")(
  function* (input: Input): Effect.fn.Return<A, E, R> {},
  (effect, input) => Effect.catch(effect, (reason) => Effect.logWarning("Err", { input, reason })),
);

Summary

  • Total non-test candidates: 322

Suggested Order

  • apps/server/src/provider/Layers/ProviderService.ts
  • apps/server/src/provider/Layers/ClaudeAdapter.ts
  • apps/server/src/provider/Layers/CodexAdapter.ts
  • apps/server/src/git/Layers/GitCore.ts
  • apps/server/src/git/Layers/GitManager.ts
  • apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
  • apps/server/src/orchestration/Layers/ProjectionPipeline.ts
  • apps/server/src/orchestration/Layers/OrchestrationEngine.ts
  • apps/server/src/provider/Layers/EventNdjsonLogger.ts
  • Everything else

Checklist

apps/server/src/provider/Layers/ClaudeAdapter.ts (62)

apps/server/src/git/Layers/GitCore.ts (58)

apps/server/src/git/Layers/GitManager.ts (28)

apps/server/src/orchestration/Layers/ProjectionPipeline.ts (25)

apps/server/src/provider/Layers/ProviderService.ts (24)

apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts (14)

apps/server/src/provider/Layers/CodexAdapter.ts (12)

apps/server/src/checkpointing/CheckpointStore.ts (10)

apps/server/src/provider/Layers/EventNdjsonLogger.ts (9)

apps/server/scripts/cli.ts (8)

  • Command handlers around cli.ts
  • Command handlers around cli.ts
  • Resource callbacks around cli.ts
  • Resource callbacks around cli.ts

apps/server/src/orchestration/Layers/OrchestrationEngine.ts (7)

apps/server/src/orchestration/projector.ts (5)

Smaller clusters