-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Role: ObjectStack Senior Architect
Mission: Protocol Migration & Type Alignment
We are refactoring the objectql monorepo to strictly adhere to the new upstream protocol definition.
The package @objectstack/spec (v0.1.1) is now the "Constitution" for all Metadata/AST interfaces.
Context
I have installed @objectstack/spec in packages/foundation/core and plan to install it in packages/foundation/types.
Currently, packages/foundation/types contains duplicate manual definitions of what is now in the Spec.
Your Task
Execute the following "Atomic Workflow" to align the codebase:
-
Analyze the Spec
- Check the exports of
@objectstack/spec. - Identify which interfaces in
packages/foundation/types/src/*.tsoverlap with the Spec (e.g.,ObjectConfig,FieldConfig,ActionConfig).
- Check the exports of
-
Refactor "The Constitution" (@objectql/types)
- Modify
packages/foundation/types/package.json: Add dependency@objectstack/spec. - Update
packages/foundation/types/src/index.ts: Re-export common types from the Spec. - Refactor individual files (e.g.,
object.ts):- DELETE local interfaces that duplicate the Spec.
- EXTEND Spec interfaces if we have runtime-specific properties that are not part of the wire protocol.
- Example pattern:
import { ObjectSpecification } from '@objectstack/spec'; // Only add properties that exist in Runtime but NOT in Spec export interface ObjectConfig extends ObjectSpecification { // runtime_cache_key?: string; }
- Modify
-
Update the Engine (@objectql/core)
- Ensure
coreimports strictly from@objectql/types(which now bridges the Spec) or directly from@objectstack/speconly if needed for value objects/constants. - Fix any type errors resulting from the switch (e.g., strict null checks or changed property names).
- Ensure
Constraints
- Strict Typing: No
any. Useunknownwith type guards if necessary. - Zero Duplication: If a type exists in
@objectstack/spec, do not redefine it. - Backwards Compatibility: If the Spec explicitly changes a field name, mark the old one as
@deprecatedin our local type if needed, or update the Core to use the new standard.
Start by listing the files in packages/foundation/types/src that need to be modified based on the standard *.object.yml or *.field.yml patterns.
Describe the solution you'd like
Describe alternatives you've considered
No response
Copilot
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request