Migrate from local @objectstack/spec stub to published package v0.3.1#178
Migrate from local @objectstack/spec stub to published package v0.3.1#178
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Removed local @objectstack/spec package - Updated all package.json files to use @objectstack/spec@^0.3.1 - Updated import statements to use namespaced API (@objectstack/spec/data, /ui, /system) - Updated tsconfig to use bundler module resolution for package.json exports support - Extracted IndexSchema type from ServiceObject (not exported by published package) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
|
@copilot fix build |
Changed from subpath exports (@objectstack/spec/data) to namespaced imports from main export (import { Data } from '@objectstack/spec') to maintain compatibility with standard Node.js module resolution.
The published package exports namespaces (Data, UI, System) from the main entry point, which works with moduleResolution: 'node' without requiring 'node16', 'nodenext', or 'bundler'.
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Fixed in a809390. Changed from subpath exports to namespaced imports from the main entry point to maintain compatibility with standard Node.js module resolution. All packages now build successfully and tests pass. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
- Add missing query capability properties to localstorage, fs, excel, and redis drivers - Remove DriverInterface from implements clause to avoid signature conflicts - All drivers now only implement Driver interface from @objectql/types Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…tep-references
|
There was a problem hiding this comment.
Pull request overview
This pull request migrates from a local workspace stub package @objectstack/spec to the officially published npm package version 0.3.1. The migration includes removing the local stub package, updating dependencies across 11 packages, and converting all imports to use the new namespaced export pattern from the published package.
Changes:
- Removed the local
packages/objectstack/spec/workspace package and all TypeScript project references - Updated 11 packages to depend on the published
@objectstack/spec@^0.3.1instead ofworkspace:* - Migrated all imports to use namespace-based pattern (e.g.,
import { Data } from '@objectstack/spec'thentype QueryAST = Data.QueryAST) - Added
queryFilters,queryAggregations,querySorting,queryPagination,queryWindowFunctions, andquerySubqueriesproperties to thesupportsobject in drivers that previously only had partial capability declarations - Removed explicit
DriverInterfacefrom driver class declarations while keeping only theDriverinterface
Reviewed changes
Copilot reviewed 37 out of 39 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Removed TypeScript project reference to deleted spec package |
| pnpm-lock.yaml | Updated package resolution from local stub v0.2.0 to published v0.3.1 |
| packages/objectstack/spec/* | Deleted entire local stub package directory |
| packages/foundation/types/package.json | Updated peerDependencies and devDependencies to use published package |
| packages/foundation/types/tsconfig.json | Removed project reference to deleted spec package |
| packages/foundation/types/src/*.ts | Migrated to namespace-based imports (Data, UI) |
| packages/foundation/core/tsconfig.json | Removed project reference to deleted spec package |
| packages/foundation/core/package.json | Updated dependency to published package |
| packages/foundation/core/src/*.ts | Migrated to namespace-based imports (Data, System) |
| packages/foundation/platform-node/package.json | Updated dependency to published package |
| packages/foundation/platform-node/src/plugin.ts | Migrated to namespace-based imports (System) |
| packages/drivers/*/package.json | Updated dependencies across 8 driver packages to published package |
| packages/drivers/*/src/index.ts | Migrated to namespace-based imports and added complete supports properties |
| examples/showcase/enterprise-erp/package.json | Updated devDependency to published package |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (4)
packages/drivers/memory/src/index.ts:535
- Unused variable conditions.
const conditions: Record<string, any>[] = [];
packages/foundation/core/src/query/query-service.ts:368
- Unused variable driverOptions.
const driverOptions = {
packages/foundation/core/src/repository.ts:435
- Unused variable driver.
const driver = this.getDriver();
packages/drivers/redis/src/index.ts:346
- This use of variable 'filters' always evaluates to true.
if (filters && !Array.isArray(filters) && filters.filters) {
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; |
| type DriverInterface = System.DriverInterface; | ||
| /** | ||
| * ObjectQL | ||
| * Copyright (c) 2026-present ObjectStack Inc. |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; | |
| /** | |
| * ObjectQL | |
| * Copyright (c) 2026-present ObjectStack Inc. | |
| /** | |
| * ObjectQL | |
| * Copyright (c) 2026-present ObjectStack Inc. | |
| * Copyright (c) 2026-present ObjectStack Inc. |
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; |
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; |
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; |
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; |
| type ServiceObject = Data.ServiceObject; | ||
|
|
||
| // Extract IndexSchema type from ServiceObject | ||
| type IndexSchema = NonNullable<ServiceObject['indexes']>[number]; |
There was a problem hiding this comment.
The IndexSchema extraction pattern NonNullable<ServiceObject['indexes']>[number] assumes that indexes is an array type. However, based on the deleted stub package code, ServiceObject['indexes'] was defined as Record<string, IndexSchema>. If the published package v0.3.1 also uses a Record type, this extraction should use NonNullable<ServiceObject['indexes']>[string] or extract the value type using a utility type like NonNullable<ServiceObject['indexes']>[keyof NonNullable<ServiceObject['indexes']>]. Please verify that the published package's ServiceObject.indexes type is indeed an array and not a Record.
| type QueryAST = Data.QueryAST; | ||
| type FilterNode = Data.FilterNode; | ||
| type SortNode = Data.SortNode; | ||
| type DriverInterface = System.DriverInterface; |
There was a problem hiding this comment.
The DriverInterface type is imported but never used. After the migration, driver classes only implement the Driver interface and no longer explicitly implement DriverInterface. This import should be removed to keep the code clean.
| type DriverInterface = System.DriverInterface; |
| @@ -8,7 +8,10 @@ | |||
|
|
|||
| import { ObjectQLContext, IObjectQL, ObjectConfig, Driver, UnifiedQuery, ActionContext, HookAPI, RetrievalHookContext, MutationHookContext, UpdateHookContext, ValidationContext, ValidationError, ValidationRuleResult, FormulaContext, Filter } from '@objectql/types'; | |||
There was a problem hiding this comment.
Unused import Filter.
| import { ObjectQLContext, IObjectQL, ObjectConfig, Driver, UnifiedQuery, ActionContext, HookAPI, RetrievalHookContext, MutationHookContext, UpdateHookContext, ValidationContext, ValidationError, ValidationRuleResult, FormulaContext, Filter } from '@objectql/types'; | |
| import { ObjectQLContext, IObjectQL, ObjectConfig, Driver, UnifiedQuery, ActionContext, HookAPI, RetrievalHookContext, MutationHookContext, UpdateHookContext, ValidationContext, ValidationError, ValidationRuleResult, FormulaContext } from '@objectql/types'; |
Replaces the workspace stub package with the officially published
@objectstack/spec@0.3.1from npm.Changes
Package Removal
packages/objectstack/spec/and its TypeScript project referencesDependency Updates
@objectstack/spec@^0.3.1(foundation, drivers, examples)workspace:*to published version in dependenciesdevDependencyin@objectql/typesto satisfy build-time resolutionImport Migration
The published package exports namespaces from the main entry point. Updated all imports to use namespaced style:
TypeScript Configuration
moduleResolution: 'node'configuration for compatibility with Node.js built-in modulesType Extraction Workaround
IndexSchemais not exported as a type in the published package (only as Zod schema). Extracted fromServiceObject:Verification
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.