Skip to content

fix: emit named exports in generated env configs - #20

Merged
flipvh merged 1 commit into
mainfrom
fix/env-config-named-exports
Aug 8, 2026
Merged

flipvh merged 1 commit into
mainfrom
fix/env-config-named-exports

Conversation

@flipvh

@flipvh flipvh commented Aug 8, 2026

Copy link
Copy Markdown
Member

Problem

A fresh pnpm create cellajs/cella scaffold fails its first pnpm generate:

SyntaxError: The requested module '../../config/config.development' does not provide an export named 'development'

Cella's config-builder/app-config.ts now imports each environment config by name (import { development } from '../../config/config.development') and config.default via the named config export, but generateEnvConfigs still emitted the old export default shape with import type _default from './config.default'.

Fix

  • Emit export const <mode> = { ... } for every environment file
  • Import the default config type as import type { config as _default } from './config.default'
  • Use the named { development } import in the generated test config
  • Header before extra imports, matching cella's file layout

Tests

  • Added a regression test asserting every generated mode file uses the named-export shape (and contains no export default)
  • Updated the test-config import assertion
  • Verified end-to-end: patched an affected scaffold's config files the same way and pnpm generate runs clean

🤖 Generated with Claude Code

Cella's config-builder now imports each environment config by name
(import { development } from './config.development') and config.default
via a named export. generateEnvConfigs still emitted the old
export-default shape, so a fresh scaffold failed its first pnpm generate
with "does not provide an export named 'development'".

Emit export const <mode> with the named _default type import, and add a
regression test asserting the named-export shape for every mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@flipvh
flipvh merged commit efb3300 into main Aug 8, 2026
7 checks passed
@flipvh
flipvh deleted the fix/env-config-named-exports branch August 8, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant