Fix CI build failures: lockfile mismatch and TypeScript type errors#587
Fix CI build failures: lockfile mismatch and TypeScript type errors#587
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes CI failures caused by an out-of-date pnpm lockfile (missing new workspace importer) and resolves TypeScript type errors in @objectstack/objectql related to discovery endpoint typing and SchemaRegistry API usage.
Changes:
- Regenerate
pnpm-lock.yamlto includeexamples/metadata-objectqlas a workspace importer. - Update ObjectQL protocol discovery response to build
endpointsas a properly typedApiRoutes. - Replace non-existent
SchemaRegistry.listObjects()usage withSchemaRegistry.getAllObjects().
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds workspace importer entry for examples/metadata-objectql and updates dependency snapshot resolution accordingly. |
| packages/objectql/src/protocol.ts | Fixes discovery endpoints typing by constructing an ApiRoutes object and mapping service names to route keys. |
| packages/objectql/src/plugin.ts | Fixes runtime/type error by switching from listObjects() to getAllObjects() for registry counts. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| // Map service names to ApiRoutes keys | ||
| const serviceToEndpointKey: Record<string, keyof ApiRoutes> = { |
There was a problem hiding this comment.
serviceToEndpointKey is typed as Record<string, keyof ApiRoutes>, which implies every service name maps to a valid ApiRoutes key. Only a subset is actually mapped (unknown services yield undefined at runtime). Consider typing this as a partial mapping (e.g. Partial<Record<string, keyof ApiRoutes>> or a satisfies-based object) so the type matches behavior and keeps type-safety as services are added.
| // Map service names to ApiRoutes keys | |
| const serviceToEndpointKey: Record<string, keyof ApiRoutes> = { | |
| // Map service names to ApiRoutes keys (only a subset of services are mapped) | |
| const serviceToEndpointKey: Partial<Record<string, keyof ApiRoutes>> = { |
CI broken after merging #586 —
pnpm install --frozen-lockfilefails and@objectstack/objectqlhas two type errors.examples/metadata-objectql/package.jsonwas added to the workspace butpnpm-lock.yamlwas never regeneratedprotocol.tstype mismatch:endpointstyped asRecord<string, string>butGetDiscoveryResponseSchemaexpectsApiRoutes(requireddata+metadatakeys). Replaced with properly typed object and explicit service→endpoint key mapping:plugin.tsmissing method:SchemaRegistry.listObjects()does not exist →SchemaRegistry.getAllObjects()💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.