-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade to @objectstack/spec v0.4.1 #23
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
Conversation
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…0.4.1 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>
…0.4.1 compatibility 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Upgrades HotCRM from local placeholder protocol typings to the official @objectstack/spec@0.4.1, updating metadata and hook definitions to the new, more type-safe schema shape (notably fields moving from array → record).
Changes:
- Migrated object and hook typings to new spec names (
ServiceObject,Hook,Dashboard) and updated schema properties (capabilities,maxLength,reference, etc.). - Updated TypeScript configuration to
module/moduleResolution: Node16to support modern Node resolution / subpath imports. - Added
@objectstack/spec@0.4.1across packages and removed placeholderobjectstack-spec.d.tsfiles.
Reviewed changes
Copilot reviewed 28 out of 39 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Switch TS module settings to Node16 for updated resolution behavior. |
| pnpm-lock.yaml | Locks @objectstack/spec@0.4.1 (and its deps) across the workspace. |
| packages/ui/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/ui/src/dashboard/sales_dashboard.dashboard.ts | Updates dashboard typing to new Dashboard type. |
| packages/ui/package.json | Adds @objectstack/spec dependency. |
| packages/support/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/support/package.json | Adds @objectstack/spec dependency. |
| packages/products/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/products/package.json | Adds @objectstack/spec dependency. |
| packages/metadata/src/opportunity.object.ts | Migrates Opportunity object metadata to record-based fields + new capability/property names. |
| packages/metadata/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/metadata/src/contract.object.ts | Migrates Contract object metadata to record-based fields + new capability/property names. |
| packages/metadata/src/contact.object.ts | Migrates Contact object metadata to record-based fields + new capability/property names. |
| packages/metadata/src/account.object.ts | Migrates Account object metadata to record-based fields + new capability/property names. |
| packages/metadata/package.json | Adds @objectstack/spec dependency. |
| packages/hooks/src/opportunity.hook.ts | Updates hook typing to new Hook type. |
| packages/hooks/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/hooks/package.json | Adds @objectstack/spec dependency. |
| packages/finance/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/finance/src/contract.object.ts | Migrates Contract object metadata to record-based fields + new capability/property names. |
| packages/finance/package.json | Adds @objectstack/spec dependency. |
| packages/crm/src/opportunity.object.ts | Migrates Opportunity object metadata to record-based fields + new capability/property names. |
| packages/crm/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/crm/src/lead.object.ts | Migrates Lead object metadata to record-based fields + new capability/property names. |
| packages/crm/src/hooks/opportunity.hook.ts | Updates hook typing to new Hook type. |
| packages/crm/src/hooks/lead.hook.ts | Updates hook typing to new Hook type. |
| packages/crm/src/contact.object.ts | Migrates Contact object metadata to record-based fields + new capability/property names. |
| packages/crm/src/account.object.ts | Migrates Account object metadata to record-based fields + new capability/property names. |
| packages/crm/package.json | Adds @objectstack/spec dependency. |
| packages/core/tsconfig.json | Switch TS module settings to Node16 for updated resolution behavior. |
| packages/core/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/core/package.json | Adds @objectstack/spec dependency. |
| packages/actions/src/objectstack-spec.d.ts | Removes placeholder spec typings now replaced by the real package. |
| packages/actions/package.json | Adds @objectstack/spec dependency. |
| .github/copilot-instructions.md | Updates developer guidance for new spec type names / patterns. |
| .github/agents/testing-agent.md | Updates testing guidance to align with new spec exports (needs fixes to examples). |
| .github/agents/metadata-developer.md | Updates metadata guidance to align with new spec type names (needs schema-shape updates). |
| .github/agents/documentation-agent.md | Updates hook schema naming in docs. |
| .github/agents/business-logic-agent.md | Updates hook schema naming in docs. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| feeds?: boolean, | ||
| files?: boolean | ||
| }, | ||
| fields: FieldDefinition[], // Array of field definitions |
Copilot
AI
Jan 27, 2026
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.
This agent doc still describes fields as an array (FieldDefinition[]), but the PR migrates fields to a record keyed by field API name. Please update the documented shape (and the later field-property examples like length/referenceTo/autoNumber) to match v0.4.1 (maxLength, reference, autonumber, etc.).
| fields: FieldDefinition[], // Array of field definitions | |
| fields: Record<string, FieldDefinition>, // Field definitions keyed by field API name |
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Account: ObjectSchema = { | ||
| const Account = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Opportunity: ObjectSchema = { | ||
| const Opportunity = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Account: ObjectSchema = { | ||
| const Account = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Contact: ObjectSchema = { | ||
| const Contact = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
| import SalesDashboard from './sales_dashboard.dashboard'; | ||
| import { DashboardSchema } from '@objectstack/spec/ui'; | ||
| import { DashboardSchema } // Zod schema for validation from '@objectstack/spec/ui'; | ||
|
|
Copilot
AI
Jan 27, 2026
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.
This example import is not valid TypeScript (import { DashboardSchema } // ... from ...). Please update it to a proper import statement so readers can copy/paste the snippet.
| - **Standard**: Follow the **File Suffix Protocol** (`snake_case` + suffix). | ||
| - **Import**: Always `import type { ObjectSchema } from '@objectstack/spec/data';`. | ||
| - **Import**: Always `import type { ServiceObject } from '@objectstack/spec/data';` (or use Data namespace). | ||
| - **Export**: `export default const ...`. |
Copilot
AI
Jan 27, 2026
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 instructions currently say export default const ..., which is not valid TypeScript syntax. Please update the guidance to reflect the actual pattern used in this repo (define a const and export default it).
| - **Export**: `export default const ...`. | |
| - **Export**: define a `const` and `export default` it, e.g. `const account = { ... }; export default account;`. |
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Contact: ObjectSchema = { | ||
| const Contact = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Lead: ObjectSchema = { | ||
| const Lead = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
| import type { ServiceObject } from '@objectstack/spec/data'; | ||
|
|
||
| const Contract: ObjectSchema = { | ||
| const Contract = { |
Copilot
AI
Jan 27, 2026
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.
ServiceObject is imported but not used (the object no longer has a type annotation). To keep type-safety without losing inference, consider using satisfies ServiceObject on the object literal or remove the unused import.
Description
Migrated from placeholder protocol definitions to official @objectstack/spec v0.4.1 package. Primary breaking change: fields converted from array to record structure for type safety.
Type of Change
Changes Made
Schema Migrations (9 object files)
ObjectSchema→ServiceObject,HookSchema→Hookfeatures→capabilities,length→maxLength,referenceTo→referencetrackFieldHistory→trackHistory,enableActivities→activitiesautoNumber→autonumberTypeScript Configuration (11 files)
moduleResolution: "node"→"node16"(enables subpath imports)module: "commonjs"→"Node16"Package Management
@objectstack/spec@0.4.1to all packagesobjectstack-spec.d.tsfilesDocumentation
Testing
npm test)npm run lint)npm run build)Checklist
Additional Notes
Runtime validation via Zod remains intact despite removed type annotations. Protocol provides proper input/output type separation through
z.input<>andz.infer<>.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.