Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Motherload solves the typesafe .env problem (getting autocompletion on process.env), no schemas required. 1. Import a .env file 2. That's it

46,147 görüntüleme • 10 gün önce •via X (Twitter)

28 Yorum

colinhacks profil fotoğrafı
colinhacks10 gün önce

Docs 👇

robby - rbby.dev profil fotoğrafı
robby - rbby.dev10 gün önce

Wonder of this could be a potential attack vector down the line …

Jinjing Liang profil fotoğrafı
Jinjing Liang10 gün önce

Could you show an example using your real .env file? 👀

Tom profil fotoğrafı
Tom10 gün önce

Don’t you want a schema here though? So you can make sure they are what you expect at runtime and fail quickly if they’re not

Rajat profil fotoğrafı
Rajat10 gün önce

I have an idea instead of importing .env file with secrets, let us import .env.schema then replace the schema format of @varlockdev with zod eg: # z.enum(["dev", "prod"]).default("dev") NODE_ENV= # z.string().optional() EXPORT=

Oluwafemi | penv.cloud profil fotoğrafı
Oluwafemi | penv.cloud10 gün önce

Validation and agent-safe?

Adrian Gierakowski profil fotoğrafı
Adrian Gierakowski10 gün önce

No thanks

François Best profil fotoğrafı
François Best10 gün önce

How does it handle different .env (or any data file) contents between where you do the typechecking (dev, CI) and at runtime (prod)? Feels like it's missing a schema for true type-safety: import "./.env" with { schema: z.object({ ... }) }

galmenash profil fotoğrafı
galmenash10 gün önce

But we need Zod to verify validity of content anyway, and it better be a func call rather than a module side effect. Am I missing something here? p.s. except that it’s really cool

Rohan profil fotoğrafı
Rohan10 gün önce

What happens to a variable that only exists in production and is missing from the local .env?

Dhruv Anand profil fotoğrafı
Dhruv Anand10 gün önce

Who needs this anymore?

All In Developer profil fotoğrafı
All In Developer10 gün önce

Why .env import does not use named imports instead? import { port } from './.env'

Spartak profil fotoğrafı
Spartak10 gün önce

importing is cool, type safety is questionable. having runtime safety is more important, like zod validation of env

nori profil fotoğrafı
nori10 gün önce

incredible! is PORT inferred as a number?

Eugene profil fotoğrafı
Eugene10 gün önce

not a replacement for schema validation then?

Suyash profil fotoğrafı
Suyash10 gün önce

does it watch the file or is it a one-time import

Coding in Flow profil fotoğrafı
Coding in Flow10 gün önce

I can't install anything with that name

JC Martin🧧 profil fotoğrafı
JC Martin🧧10 gün önce

It's a little meaningless for builds though that expect a matching env but now have no runtime validation 😢

Adam Genshaft profil fotoğrafı
Adam Genshaft10 gün önce

That’s 🔥

Khushal profil fotoğrafı
Khushal10 gün önce

importing the .env file directly feels illegal in a good way

Prathmesh profil fotoğrafı
Prathmesh10 gün önce

😮

irazz profil fotoğrafı
irazz10 gün önce

This has been a thing for a while. The scope of having typesafe is for the end-user to have the correct variables, enforcing minimum characters etc.

mizuki profil fotoğrafı
mizuki10 gün önce

cooking again

Alfie Ranstead profil fotoğrafı
Alfie Ranstead10 gün önce

This is insanely cool! Obviously orm-less sql is impressive but I hadn't even considered typesafe .envs Ironically had been attempting to find a nice setup with zod for this kind of thing previously.

All In Developer profil fotoğrafı
All In Developer10 gün önce

When doing a `tsc` build, does the imported files reach the `dist` already as modules? Or we need to use node register hook for them to work at runtime?

BreezeOg profil fotoğrafı
BreezeOg10 gün önce

just import the .env and you get autocomplete, no schema at all? nice

RoboKozo profil fotoğrafı
RoboKozo10 gün önce

that's cool but I still would get value from zod for setting defaults, converting things like dates and numbers, and restricting values to a set of things (like log levels or aws regions)

Rishabh Vasudevan profil fotoğrafı
Rishabh Vasudevan10 gün önce

You have made text file parsers and then give auto complete for SQL and now this. Have agents been some kind of unlock for you to be able to do this, or is it just you got to this idea only now?

Benzer Videolar

grwm sin contexto env
0:33

Sensitive content

grwm sin contexto env

Dennis Ngiabi

79,520 görüntüleme • 2 yıl önce