-
Notifications
You must be signed in to change notification settings - Fork 0
Deprecate @objectql/core per migration guide #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
904a632
Initial plan
Copilot affda40
deprecate @objectql/core: migrate all imports to @objectstack/objectql
Copilot db48f14
fix: restore bridge-dependent examples, verify build (36/36) and test…
Copilot e82305d
docs: add deprecation notice to @objectql/core docs and migration guide
Copilot 297905d
docs: clarify MetadataFacade async description
Copilot 41f9510
fix: keep local kernel-factory exports, fix migration guide version a…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| "pages": [ | ||
| "error-handling", | ||
| "architecture", | ||
| "migration-v5" | ||
| "migration-v5", | ||
| "objectql-migration" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| --- | ||
| title: "Migrating from @objectql/core" | ||
| description: "Step-by-step guide for migrating from @objectql/core to @objectstack/objectql" | ||
| --- | ||
|
|
||
| # Migrating from `@objectql/core` to `@objectstack/objectql` | ||
|
|
||
| All core functionality previously provided by `@objectql/core` is now available upstream in `@objectstack/objectql`. This guide walks you through migrating your project so that `@objectql/core` can be removed. | ||
|
|
||
| ## Why Migrate? | ||
|
|
||
| | | `@objectql/core` (deprecated) | `@objectstack/objectql` (recommended) | | ||
| | :--- | :--- | :--- | | ||
| | **Engine** | Bridge class extending upstream `ObjectQL` | Canonical `ObjectQL` engine | | ||
| | **Kernel Factory** | `createObjectQLKernel()` | `createObjectQLKernel()` (identical API) | | ||
| | **Introspection** | `toTitleCase`, `convertIntrospectedSchemaToObjects` | Same functions, same signatures | | ||
| | **Registry** | Re-exports from upstream | Direct exports | | ||
| | **MetadataRegistry** | `@objectql/types` `MetadataRegistry` class | `MetadataFacade` (async `IMetadataService`) | | ||
| | **Maintenance** | Planned deprecation | Actively maintained | | ||
|
|
||
| ## Step 1 — Update Dependencies | ||
|
|
||
| ```diff | ||
| // package.json | ||
| { | ||
| "dependencies": { | ||
| - "@objectql/core": "^4.x", | ||
| - "@objectql/types": "^4.x", | ||
| + "@objectstack/objectql": "^3.0.4" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Then re-install: | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| ``` | ||
|
|
||
| ## Step 2 — Update Imports | ||
|
|
||
| ### Engine, Repository & Context | ||
|
|
||
| ```diff | ||
| - import { ObjectQL, ObjectRepository, ScopedContext } from '@objectql/core'; | ||
| + import { ObjectQL, ObjectRepository, ScopedContext } from '@objectstack/objectql'; | ||
| ``` | ||
|
|
||
| ```diff | ||
| - import type { HookHandler, HookEntry, OperationContext, EngineMiddleware } from '@objectql/core'; | ||
| + import type { HookHandler, HookEntry, OperationContext, EngineMiddleware } from '@objectstack/objectql'; | ||
| ``` | ||
|
|
||
| ### Schema Registry | ||
|
|
||
| ```diff | ||
| - import { SchemaRegistry } from '@objectql/core'; | ||
| + import { SchemaRegistry } from '@objectstack/objectql'; | ||
| ``` | ||
|
|
||
| ### Kernel Factory | ||
|
|
||
| ```diff | ||
| - import { createObjectQLKernel } from '@objectql/core'; | ||
| + import { createObjectQLKernel } from '@objectstack/objectql'; | ||
| ``` | ||
|
|
||
| ### Utility Functions | ||
|
|
||
| ```diff | ||
| - import { toTitleCase, convertIntrospectedSchemaToObjects } from '@objectql/core'; | ||
| + import { toTitleCase, convertIntrospectedSchemaToObjects } from '@objectstack/objectql'; | ||
| ``` | ||
|
|
||
| ### Introspection Types | ||
|
|
||
| ```diff | ||
| - import type { IntrospectedSchema, IntrospectedTable } from '@objectql/types'; | ||
| + import type { IntrospectedSchema, IntrospectedTable } from '@objectstack/objectql'; | ||
| ``` | ||
|
|
||
| ## Step 3 — API Differences | ||
|
|
||
| ### `createObjectQLKernel()` | ||
|
|
||
| The function signature is identical. The only change is the return type uses the upstream `ObjectKernel`: | ||
|
|
||
| ```typescript | ||
| import { createObjectQLKernel } from '@objectstack/objectql'; | ||
|
|
||
| const kernel = await createObjectQLKernel({ | ||
| plugins: [myDriverPlugin], | ||
| }); | ||
| await kernel.start(); | ||
| ``` | ||
|
|
||
| ### MetadataRegistry → MetadataFacade | ||
|
|
||
| If you were using `MetadataRegistry` from `@objectql/types`, the upstream equivalent is `MetadataFacade`. The key difference is that `MetadataFacade` methods are **async**: | ||
|
|
||
| ```diff | ||
| - import { MetadataRegistry } from '@objectql/types'; | ||
| - const registry = new MetadataRegistry(); | ||
| - registry.register('object', myObject); | ||
| - const obj = registry.get('object', 'account'); | ||
| + import { MetadataFacade } from '@objectstack/objectql'; | ||
| + const facade = new MetadataFacade(); | ||
| + await facade.register('object', 'account', myObject); | ||
| + const obj = await facade.get('object', 'account'); | ||
| ``` | ||
|
|
||
| ### ObjectQLPlugin | ||
|
|
||
| Both packages export an `ObjectQLPlugin`, but they serve different roles: | ||
|
|
||
| | | `@objectql/core` `ObjectQLPlugin` | `@objectstack/objectql` `ObjectQLPlugin` | | ||
| | :--- | :--- | :--- | | ||
| | Interface | `RuntimePlugin` (from `@objectql/types`) | `Plugin` (from `@objectstack/core`) | | ||
| | Role | Orchestrator composing sub-plugins (validator, formula, query) | Kernel plugin registering ObjectQL as core services | | ||
|
|
||
| If you were using the `@objectql/core` `ObjectQLPlugin` to compose sub-plugins (`ValidatorPlugin`, `FormulaPlugin`, `QueryPlugin`), those downstream plugins are **not** part of this migration — they remain in the `@objectql` ecosystem. | ||
|
|
||
| ## Step 4 — Remove `@objectql/core` | ||
|
|
||
| Once all imports are updated and tests pass: | ||
|
|
||
| ```bash | ||
| pnpm remove @objectql/core @objectql/types | ||
| ``` | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Replace `@objectql/core` dependency with `@objectstack/objectql` in `package.json` | ||
| - [ ] Update all `import` statements (engine, registry, kernel factory, utilities, types) | ||
| - [ ] Replace `MetadataRegistry` usage with `MetadataFacade` (add `await`) | ||
| - [ ] Verify `ObjectQLPlugin` usage matches the upstream interface | ||
| - [ ] Run `pnpm build` and fix any remaining type errors | ||
| - [ ] Run `pnpm test` to verify behavior | ||
| - [ ] Remove `@objectql/core` and `@objectql/types` from dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,29 @@ | ||
| /** | ||
| * ObjectQL | ||
| * ObjectQL Core — DEPRECATED | ||
| * Copyright (c) 2026-present ObjectStack Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @deprecated This package is deprecated. Migrate to `@objectstack/objectql`. | ||
| * See: https://github.com/objectstack-ai/spec/blob/main/content/docs/guides/objectql-migration.mdx | ||
| */ | ||
|
|
||
| // ── Convenience factory ── | ||
| export { createObjectQLKernel, type ObjectQLKernelOptions } from './kernel-factory'; | ||
|
|
||
| // ── Re-export bridge engine (extends upstream with MetadataRegistry + legacy config) ── | ||
| // ── Bridge engine (deprecated — use @objectstack/objectql ObjectQL directly) ── | ||
| /** @deprecated Import ObjectQL from `@objectstack/objectql` instead. This bridge class will be removed in a future version. */ | ||
| export { ObjectQL, type ObjectQLConfig } from './app'; | ||
|
|
||
| // ── Convenience factory (local implementation — wraps upstream kernel) ── | ||
| export { createObjectQLKernel } from './kernel-factory'; | ||
| export type { ObjectQLKernelOptions } from './kernel-factory'; | ||
|
|
||
| // ── Re-exports from @objectstack/objectql (deprecated — import directly from upstream) ── | ||
| /** @deprecated Import from `@objectstack/objectql` instead. */ | ||
| export { ObjectRepository, ScopedContext, SchemaRegistry } from '@objectstack/objectql'; | ||
| /** @deprecated Import from `@objectstack/objectql` instead. */ | ||
| export { toTitleCase, convertIntrospectedSchemaToObjects } from '@objectstack/objectql'; | ||
| /** @deprecated Import from `@objectstack/objectql` instead. */ | ||
| export type { HookHandler, HookEntry, OperationContext, EngineMiddleware, ObjectQLHostContext } from '@objectstack/objectql'; | ||
|
|
||
| // ── Plugin orchestration ── | ||
| // ── Plugin orchestration (downstream — stays in @objectql ecosystem) ── | ||
| export * from './plugin'; | ||
|
|
||
| // ── Utilities ── | ||
| export * from './util'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright notice states "2026-present" but according to the system time, we're currently in February 2026. This is technically correct, but it's unusual to see a copyright starting from the current year without any past years included.
If ObjectQL code existed before 2026, the copyright should reflect the original year (e.g., "2024-present" or "2025-present"). If this is truly new code from 2026, then "2026-present" is fine, though you might consider just using "2026" until we enter 2027.