Modularize Validator and Formula Engine as ObjectStack plugins#157
Modularize Validator and Formula Engine as ObjectStack plugins#157huangyiirene merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
| */ | ||
|
|
||
| import { FormulaPlugin } from '../src/formula-plugin'; | ||
| import { ObjectStackKernel } from '@objectstack/runtime'; |
| */ | ||
|
|
||
| import { ValidatorPlugin } from '../src/validator-plugin'; | ||
| import { ObjectStackKernel } from '@objectstack/runtime'; |
|
There was a problem hiding this comment.
Pull request overview
This PR modularizes the Validator and Formula Engine as ObjectStack plugins, completing Phase 3.4-3.5 of the core refactoring. The changes extract these features into standalone, lifecycle-aware plugins that integrate with the ObjectStack Runtime protocol.
Changes:
- Created
ValidatorPluginandFormulaPluginas first-class RuntimePlugin implementations - Refactored
ObjectQLPluginto conditionally install sub-plugins instead of direct registration - Extended configuration interfaces to support granular feature enablement
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/foundation/core/src/validator-plugin.ts | New standalone validator plugin with lifecycle hooks and conditional middleware registration |
| packages/foundation/core/src/formula-plugin.ts | New standalone formula plugin with provider registration and auto-evaluation middleware |
| packages/foundation/core/src/plugin.ts | Refactored to use sub-plugin installation pattern instead of direct registration methods |
| packages/foundation/core/src/index.ts | Added exports for new plugin modules |
| packages/foundation/core/test/validator-plugin.test.ts | Comprehensive test suite for validator plugin behavior |
| packages/foundation/core/test/formula-plugin.test.ts | Comprehensive test suite for formula plugin behavior |
| packages/foundation/core/test/plugin-integration.test.ts | Integration tests for conditional plugin loading |
|
@copilot fix test build and ... |
The build and test infrastructure is working correctly. The TypeScript project references ensure that Could you clarify what specific issue you're encountering? The comment appears incomplete ("and ..."). If there's a specific CI failure or test issue, please share the error message so I can address it. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Completes Phase 3.4-3.5 of core refactoring: wraps
ValidatorandFormulaEngineinto standalone plugins implementing ObjectStack Runtime protocol.Changes
ValidatorPlugin (
validator-plugin.ts)beforeQueryandbeforeMutationmiddleware hooksenableQueryValidationandenableMutationValidationValidatorclassFormulaPlugin (
formula-plugin.ts)kernel.registerFormulaProvider()with fallback to direct property assignmentafterQuery(configurable)FormulaEngineclassObjectQLPlugin refactor (
plugin.ts)validatorConfigandformulaConfigUsage
Architecture
Each feature is now a first-class plugin with lifecycle hooks, enabling modular composition and independent configuration. Gracefully degrades when kernel lacks middleware/provider support.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.