t3-oss/t3-env

Support for key nesting

Closed this issue · 1 comments

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?

Should be solved in #169. Gonna track it there