Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

CI was failing with TypeScript errors: Type '{ type: "text" }' is missing the following properties from type 'FieldConfig': name, label. The @objectstack/spec package requires these fields on Field, which FieldConfig extends.

Context

When fields are defined inline in ObjectConfig.fields, the field name is derived from the Record key:

const userObject: ObjectConfig = {
  name: 'user',
  fields: {
    email: { type: 'email', required: true },  // 'email' is the field name
    age: { type: 'number' }                     // 'age' is the field name
  }
};

The runtime already handles this at packages/foundation/core/src/object.ts:15-17:

for (const [key, field] of Object.entries(object.fields)) {
  if (!field.name) {
    field.name = key;  // Auto-assign from Record key
  }
}

Changes

packages/foundation/types/src/field.ts

  • Added 'name' | 'label' to the Omit type in FieldConfig
  • Redeclared both as optional properties with documentation

This aligns the type definition with the runtime behavior where these properties are inferred from context.

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:

  • fastdl.mongodb.org
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/objectql/objectql/node_modules/.pnpm/[email protected]/node_modules/jest-worker/build/processChild.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

引用: https://github.com/objectstack-ai/objectql/actions/runs/21114497143/job/60718589468#step:10:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…mpilation errors

The @objectstack/spec package requires name and label fields on the Field type, but when fields are defined in ObjectConfig.fields as a Record<string, FieldConfig>, the name is inferred from the record key. This change makes name and label optional in FieldConfig to match this usage pattern.

Co-authored-by: huangyiirene <[email protected]>
Copilot AI changed the title [WIP] Fix issue in step 10 of workflow fix: Make FieldConfig.name and FieldConfig.label optional Jan 18, 2026
Copilot AI requested a review from huangyiirene January 18, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants