diff --git a/src/arguments/environment.mts b/src/arguments/environment.mts index 1aa0904..bc212bb 100644 --- a/src/arguments/environment.mts +++ b/src/arguments/environment.mts @@ -6,6 +6,6 @@ export const EnvironmentArg = { description: 'Apply environment-specific overrides to the configuration. See https://github.com/unjs/c12#environment-specific-configuration for more information.', type: 'string', - valueHint: 'prod | dev | test | ...', + valueHint: 'production | development | test | ...', }, } satisfies ArgsDef diff --git a/src/config/define-config.mts b/src/config/define-config.mts index e41c0ee..d433f2d 100644 --- a/src/config/define-config.mts +++ b/src/config/define-config.mts @@ -1,4 +1,7 @@ -import { createDefineConfig } from 'c12' +import type { C12InputConfig } from 'c12' +import type { PartialDeep } from 'type-fest' import type { KyselyCTLConfig } from './kysely-ctl-config.mjs' -export const defineConfig = createDefineConfig() +export const defineConfig = ( + input: KyselyCTLConfig & C12InputConfig>, +): KyselyCTLConfig & C12InputConfig> => input diff --git a/src/config/kysely-ctl-config.mts b/src/config/kysely-ctl-config.mts index a1aa94c..47ef1c0 100644 --- a/src/config/kysely-ctl-config.mts +++ b/src/config/kysely-ctl-config.mts @@ -134,7 +134,7 @@ type MigratorlessMigrationsConfig = MigrationsBaseConfig & type SeederfulSeedsConfig = Pick & { provider?: never seeder: Seeder - seedsFolder?: never + seedFolder?: never } type SeederlessSeedsConfig = SeedsBaseConfig & diff --git a/tests/define-config.test-d.ts b/tests/define-config.test-d.ts index 8a63305..c666aee 100644 --- a/tests/define-config.test-d.ts +++ b/tests/define-config.test-d.ts @@ -428,6 +428,22 @@ describe('defineConfig', () => { }) }) }) + + it('environment override issue - https://github.com/kysely-org/kysely-ctl/issues/53', () => { + defineConfig({ + dialect: dialect, + plugins: plugins, + migrations: { + migrationFolder: './src/db/migrations', + }, + $development: { + seeds: { + // this type-errored before the fix + seedFolder: './src/db/seeds/development', + }, + }, + }) + }) }) function init() {