t3-oss / t3-env

https://env.t3.gg
MIT License
2.67k stars 86 forks source link

Support for key nesting #230

Closed ScreamZ closed 4 months ago

ScreamZ commented 5 months ago

Hi,

I like having a config like this one:

Before using T3-env, I was splitting my config in two file one for local and one for shared.

const ServerConfigSchema = z.object({
  auth: z.object({
    secret: z.string(),
    /**
     * How many time in seconds the link should be considered valid.
     **/
    magicLinkTTL: z.number().default(Duration.fromObject({ hours: 1 }).as("seconds")),
  }),
  notifications: z.object({
    resend: z.object({
      apiKey: z.string(),
      fromAddress: z.string().default("NoReply <noreply@resend.dev>"),
    }),
  }),
}

I was wondering could we add some kind of nesting / namespacing support?

juliusmarminge commented 4 months ago

Should be solved in #169. Gonna track it there