Type Auth and Mail stage parameters from deployStage#216

open1
dev
deslop/stage-type
opened20d agobyAAviddaram
View on GitHubTwo-way sync enabledPR last imported 20d ago

Auth.layer, its providers helper and Mail.layer each spelled out the stage union "production" | "staging" | "dev" by hand. deployStage already produces that type. A fourth stage added to deployStage would have compiled fine while these three signatures quietly rejected it. docs/CONVENTIONS.md says types come from values.

All three now take Effect.Success<typeof deployStage>, the way billing.ts and polar.ts already type polarAccess.

diff
1 infrastructure/stage.ts deployStage: Effect<"production" | "staging" | "dev">
2 infrastructure/auth.ts
3- providers(stage: "production" | "staging" | "dev", ...)
4- Auth.layer(stage: "production" | "staging" | "dev", ...)
5+ providers(stage: Effect.Success<typeof deployStage>, ...)
6+ Auth.layer(stage: Effect.Success<typeof deployStage>, ...)
7 infrastructure/email.ts
8- Mail.layer(stage: "production" | "staging" | "dev", ...)
9+ Mail.layer(stage: Effect.Success<typeof deployStage>, ...)

This is a type-only change with no runtime effect. Checks: vp check --quiet, vp run test, vp run build.

Checks

5 successful · 2 skipped · 1 neutral
All checks passed
d331652

Added 1 commit

  • Type the stage parameters from deployStage instead of restating the uniond331652
Synced from GitHub

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4251d447-a716-4934-9a7e-19e155ad8790

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.