Skip to content

feat(config): implement unified configuration system#26

Merged
amondnet merged 2 commits into
mainfrom
feat/unified-config-system
Dec 18, 2025
Merged

feat(config): implement unified configuration system#26
amondnet merged 2 commits into
mainfrom
feat/unified-config-system

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

Implement a unified configuration system replacing legacy config file names (opencode.json, dora.json) with a modern .please/config.json or .please/config.yml approach.

This PR centralizes configuration management across the format and LSP packages with:

  • LSP Configuration: Enable/disable servers, custom root paths, and custom commands
  • Shared Settings: Language preference (en/ko) and ignore patterns
  • LSPManager Integration: Supports config via constructor or static fromProject() method
  • Schema Validation: Zod-based schemas for type safety and documentation

Changes

  • packages/format/src/config/loader.ts: Updated search paths to .please/config.(json|yml)
  • packages/format/src/config/schema.ts: Added LspConfigSchema and unified Config schema
  • packages/format/package.json: Added subpath export for config module
  • packages/lsp/src/config.ts: New module with LSP config utilities (loadLspConfig, isServerEnabled, etc.)
  • packages/lsp/src/index.ts: Integrated config loading in LSPManager
  • packages/lsp/package.json: Added @pleaseai/code-format dependency
  • CLAUDE.md: Updated documentation with configuration examples
  • bun.lock: Updated dependencies

Example Configuration

```json
{
"language": "en",
"ignore_patterns": ["node_modules", "dist"],
"formatter": {
"biome": { "disabled": false },
"prettier": { "disabled": false }
},
"lsp": {
"typescript": { "enabled": true },
"prisma": { "enabled": true, "root": "./apps/api" }
}
}
```

Test plan

  • Schema validation passes for new config structure
  • Config loader finds .please/config.json and .please/config.yml
  • LSP servers respect config enable/disable settings
  • LSP servers use custom root paths when configured
  • Backward compatibility: Missing config defaults to all servers enabled
  • Documentation updated with configuration examples

Implement a unified configuration system replacing legacy config file names:
- Config location: .please/config.json or .please/config.yml
- Added LSP configuration schema with server enable/disable and custom root paths
- Added shared settings: language (en/ko) and ignore_patterns
- LSPManager now supports config via constructor or static fromProject() method
- Updated format loader to search new config location
- Removed legacy opencode.json and dora.json references

Changes:
- packages/format/src/config/loader.ts: Updated search paths
- packages/format/src/config/schema.ts: Added LspConfigSchema and unified Config
- packages/format/package.json: Added subpath export for config
- packages/lsp/src/config.ts: New module with LSP config utilities
- packages/lsp/src/index.ts: Integrated config loading
- packages/lsp/package.json: Added @pleaseai/code-format dependency
- CLAUDE.md: Added configuration documentation
- bun.lock: Updated dependencies
@codecov

codecov Bot commented Dec 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.51852% with 132 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.14%. Comparing base (02a1ae6) to head (482e3af).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/format/src/config/loader.ts 7.86% 82 Missing ⚠️
packages/lsp/src/config.ts 11.42% 31 Missing ⚠️
packages/lsp/src/index.ts 24.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
- Coverage   33.09%   32.14%   -0.95%     
==========================================
  Files          13       14       +1     
  Lines        2798     2946     +148     
==========================================
+ Hits          926      947      +21     
- Misses       1872     1999     +127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add ConfigValidationError and ConfigLoadError custom error classes
- Throw errors instead of silently falling back to defaults
- Only catch SyntaxError in JSON/YAML parsing to avoid swallowing errors
- Add proper error context for file read/parse operations
- Add min(1) validation to LspItemSchema for root and command fields
- Clarify isServerEnabled logic with explicit boolean checks
- Integrate getServerRoot into LSPManager for custom root paths
- Update packages/lsp/CLAUDE.md with config documentation
- Use stderr for config loading message to avoid JSON output interference
@amondnet
amondnet merged commit 1fe9cab into main Dec 18, 2025
3 checks passed
@amondnet
amondnet deleted the feat/unified-config-system branch December 18, 2025 16:19
@passionfactory-bot passionfactory-bot Bot mentioned this pull request Dec 18, 2025
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