Skip to content

refactor(render): resolve config from object only, no disk read#1744

Merged
cossssmin merged 1 commit into
masterfrom
refactor/render-config-object
Jun 8, 2026
Merged

refactor(render): resolve config from object only, no disk read#1744
cossssmin merged 1 commit into
masterfrom
refactor/render-config-object

Conversation

@cossssmin

@cossssmin cossssmin commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Bug Fixes

  • The render function now respects programmatically provided configuration exclusively, preventing unintended interference from on-disk configuration files during rendering operations.

render() no longer scans cwd for maizzle.config.{ts,js}; it merges the
passed config over defaults. CLI build/serve still load the file via
resolveConfig and pass the resolved object down.
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fa96fbef-c8bd-408b-9c62-224687543c05

📥 Commits

Reviewing files that changed from the base of the PR and between 352c0db and 53a7dca.

📒 Files selected for processing (3)
  • src/config/index.ts
  • src/render/index.ts
  • src/tests/render/config.test.ts

📝 Walkthrough

Walkthrough

This PR refactors configuration resolution by introducing resolveConfigObject for synchronous programmatic-only config handling and updating the render function to use it instead of async filesystem-aware resolution. The changes include updated normalizeConfig documentation, resolveConfig delegation, and a test validating config file isolation.

Changes

Synchronous Programmatic Config

Layer / File(s) Summary
Synchronous programmatic config resolver
src/config/index.ts
New exported resolveConfigObject(config?, cwd) returns normalized config without reading filesystem. Updated normalizeConfig documentation clarifies merging programmatic over file config over defaults and resolving filesystem paths relative to cwd.
Config delegation refactoring
src/config/index.ts
resolveConfig delegates final result to normalizeConfig(programmaticConfig, fileConfig, cwd) directly.
Render integration
src/render/index.ts
Import updated to resolveConfigObject. Render function calls resolveConfigObject(config) synchronously instead of await resolveConfig(config), removing async filesystem config loading from the render pipeline.
Config isolation validation
src/tests/render/config.test.ts
New test writes on-disk maizzle.config.js with css.safe: false and verifies render ignores it, confirming programmatic defaults override filesystem config.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: refactoring the render function to resolve config from a programmatic object only, without reading from the filesystem.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/render-config-object

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cossssmin cossssmin merged commit 7d5bf1e into master Jun 8, 2026
6 checks passed
@cossssmin cossssmin deleted the refactor/render-config-object branch June 10, 2026 13:01
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