K
Kysely•3mo ago
WhyDoThis

defineConfig using --environment type issue with seedFolder

Am I misunderstanding how to use this? I couldn't find docs but saw in recent commit it updated description to point to reference: https://github.com/unjs/c12#environment-specific-configuration Error: "Type 'string' is not assignable to type 'undefined'.ts(2322)"
No description
Solution:
This should be fine now @ 0.8.9
Jump to solution
10 Replies
Igal
Igal•3mo ago
Hey 👋 Sorry for the inconvenience. I think you're using it right. Just escape it with // @ts-ignore or as any I'll look into it.
WhyDoThis
WhyDoThis•3mo ago
Thanks @Igal and no worries at all - let me know if you'd like me to open an issue for tracking purposes
Igal
Igal•3mo ago
Sure thing
WhyDoThis
WhyDoThis•3mo ago
53 in ctl @Igal sorry one more thing - you think I should add to it that it also only lets you use the environment name strings found in c12's C12InputConfig interface? Reason I ask is kysely-ctl's src/arguments/environment.mts has valueHint of 'prod | dev | test | ...' but you actually can't use those abbreviations for production and development without other typescript compilation error.
Object literal may only specify known properties, and '$dev' does not exist in type '(C12InputConfig<KyselyCTLConfig<KyselyDialect>, ConfigLayerMeta> & KyselyCTLConfigBase & { ...; } & { ...; } & { ...; }) | ... 7 more ... | (C12InputConfig<...> & ... 3 more ... & { ...; })'.ts(2353)
WhyDoThis
WhyDoThis•3mo ago
No description
Igal
Igal•3mo ago
Good catch!
WhyDoThis
WhyDoThis•3mo ago
I will add it to the issue - thanks for taking a look
Igal
Igal•3mo ago
You actually can. c12 supports additional environment names. You use $env key in your config:
{
$env: {
dev: {
// ...
}
}
}
{
$env: {
dev: {
// ...
}
}
}
Solution
Igal
Igal•3mo ago
This should be fine now @ 0.8.9
WhyDoThis
WhyDoThis•3mo ago
Thank you!!!
Want results from more Discord servers?
Add your server