fix: resolve TypeScript build errors in plugin-hono-server and runtime#1142
Merged
fix: resolve TypeScript build errors in plugin-hono-server and runtime#1142
Conversation
- Fixed TypeScript error in plugin-hono-server by using ctx.getService<IDataEngine>('objectql') instead of accessing private context property
- Fixed unused variable errors in runtime package by prefixing unused parameters with underscore
- Removed unused _capitalize method from http-dispatcher
- All builds now pass successfully
- All tests pass (150/150)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Claude created this pull request from a session on behalf of
xuyushun441-sys
April 14, 2026 12:06
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes TypeScript build errors introduced by recent refactoring by removing access to private kernel internals and cleaning up unused runtime parameters/helpers.
Changes:
plugin-hono-server: Switch ObjectQL service lookup to use the publicPluginContext.getService()API withIDataEnginetyping.runtime: Silence unusedcontextparameters by renaming to_contextand remove an unusedcapitalize()helper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runtime/src/http-dispatcher.ts | Renames unused handler parameters to _context and removes an unused helper to resolve TS unused-variable errors. |
| packages/plugins/plugin-hono-server/src/hono-plugin.ts | Updates ObjectQL service access to a typed, public service lookup instead of accessing private kernel context. |
Comments suppressed due to low confidence (1)
packages/plugins/plugin-hono-server/src/hono-plugin.ts:290
PluginContext.getService()throws when the service is missing (or when the service is async), soconst ql = getObjectQL(); if (!ql) ...will never handle the "not available" case and will instead throw and fail the request. Please wrap thectx.getService('objectql')call in a try/catch (returning undefined/null on failure), or switchgetObjectQLto an async helper that usesawait ctx.getKernel().getServiceAsync<IDataEngine>('objectql')and handles rejection, so the 503 response path is reachable.
// Basic CRUD data endpoints — delegate to ObjectQL service directly
const getObjectQL = () => ctx.getService<IDataEngine>('objectql');
// Create
rawApp.post(`${prefix}/data/:object`, async (c: any) => {
const ql = getObjectQL();
if (!ql) return c.json({ error: 'Data service not available' }, 503);
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CI builds were failing due to TypeScript errors introduced by recent refactoring: accessing private
contextproperty inplugin-hono-serverand unused variables inruntime.Changes
plugin-hono-server - Fixed service access pattern
IDataEnginefrom@objectstack/corectx.getKernel().context?.getService('objectql')withctx.getService<IDataEngine>('objectql')runtime/http-dispatcher - Cleaned up unused code
contextparameters with_contextinhandleMetadata,handleData, andhandlePackagesmethodscapitalizehelper methodAll builds pass, 150 tests passing.