Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Extracted formula engine and validator from monolithic @objectql/core into dedicated plugins, improving modularity and bundle size with clean separation of concerns.

Changes

New Packages

  • @objectql/plugin-formula - FormulaEngine and FormulaPlugin (573 LOC, 109 tests)
  • @objectql/plugin-validator - Validator and ValidatorPlugin (744 LOC, 52 tests)

Core Package Updates

  • Added dependencies on new plugins (for internal use)
  • No re-exports - enforces explicit dependencies
  • Updated internal imports (repository.ts, ai-agent.ts, plugin.ts)
  • Removed 1,317 lines (moved to plugins)

Migration Path

Breaking Change: Applications must update imports to use dedicated packages:

// Before
import { FormulaEngine, Validator } from '@objectql/core';

// After
import { FormulaEngine } from '@objectql/plugin-formula';
import { Validator } from '@objectql/plugin-validator';

const kernel = new ObjectStackKernel([
  myApp,
  new FormulaPlugin({ enable_cache: false }),
  new ValidatorPlugin({ language: 'en' })
]);

Architecture

Before:

@objectql/core (monolithic)
├── Repository + Query
├── Formula Engine
└── Validator

After:

@objectql/plugin-formula (focused)
@objectql/plugin-validator (focused)
@objectql/core (lean, focused on core repository logic)

Follows existing pattern from @objectql/plugin-security. Enables tree-shaking and optional feature inclusion. Enforces clean architectural boundaries with explicit dependencies.

Testing

  • All 282 tests passing (no regressions)
  • CodeQL security scan: 0 alerts

Documentation

  • MIGRATION_GUIDE.md with migration instructions
  • Comprehensive READMEs for both plugins
  • PLUGIN_REFACTORING_SUMMARY.md with metrics
Original prompt

公式引擎和validator是否建议分拆为单独的插件软件包。


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectql Ready Ready Preview, Comment Jan 29, 2026 4:45pm

Request Review

- Created @objectql/plugin-formula package with FormulaEngine and FormulaPlugin
- Created @objectql/plugin-validator package with Validator and ValidatorPlugin
- Updated @objectql/core to depend on and re-export from new plugins
- Moved all source files and tests to appropriate plugin packages
- Updated imports throughout the codebase
- All packages build successfully

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI and others added 2 commits January 29, 2026 12:23
…ixes

- Fixed test imports and added mock-driver to plugin test directories
- Created comprehensive MIGRATION_GUIDE.md
- Fixed code formatting issues identified in review
- All 282 tests passing (109 formula, 52 validator, 121 core)
- CodeQL security scan passed with no alerts
- Backward compatibility maintained through core package re-exports

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Evaluate splitting official engine and validator into separate plugins Refactor formula engine and validator into separate plugin packages Jan 29, 2026
Copilot AI requested a review from xuyushun441-sys January 29, 2026 12:28
@hotlong
Copy link
Contributor

hotlong commented Jan 29, 2026

不需要Re-exports components for backward compatibility @copilot

Per feedback, the @objectql/core package no longer re-exports components from
plugin-formula and plugin-validator. Users must now explicitly import from the
plugin packages they use, enforcing clean separation of concerns.

Breaking change: Applications must update imports:
- Before: import { FormulaEngine, Validator } from '@objectql/core';
- After: import { FormulaEngine } from '@objectql/plugin-formula';
         import { Validator } from '@objectql/plugin-validator';

Updated MIGRATION_GUIDE.md and PLUGIN_REFACTORING_SUMMARY.md to reflect
this change and remove references to backward compatibility.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

不需要Re-exports components for backward compatibility @copilot

Done. Removed backward compatibility re-exports from @objectql/core. Users must now explicitly import from @objectql/plugin-formula and @objectql/plugin-validator. This enforces clean separation of concerns.

Updated documentation (MIGRATION_GUIDE.md and PLUGIN_REFACTORING_SUMMARY.md) to reflect this breaking change.

All 282 tests still passing. Commit: 73822a4

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:

  • fastdl.mongodb.org
    • Triggering command: /usr/local/bin/node node ./postinstall.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 4 commits January 29, 2026 16:33
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
- Add plugin-validator and plugin-formula to root tsconfig references
- Update core package tsconfig to reference plugin packages
- Fix CLI import to use plugin-validator directly
- Add plugin-validator dependency to CLI package

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@github-actions
Copy link
Contributor

⚠️ No Changeset Found

This PR does not include a changeset file.
If this PR includes user-facing changes, please add a changeset by running:

pnpm changeset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants