Skip to content

fix: Fix missing Schema and Field classes from API Docs#390

Open
kentkwu wants to merge 1 commit intoapache:mainfrom
kentkwu:fix-docs-missing-schema-and-field
Open

fix: Fix missing Schema and Field classes from API Docs#390
kentkwu wants to merge 1 commit intoapache:mainfrom
kentkwu:fix-docs-missing-schema-and-field

Conversation

@kentkwu
Copy link

@kentkwu kentkwu commented Feb 27, 2026

What's Changed

This PR fixes an issue which causes Schema and Field to be excluded from the public API docs.

The root cause is that this declare module block causes these to register as an exclusion. Everything else in this file is already explicitly ignored, so the config level exclusion is not necessary.

// src/ipc/metadata/message.ts
declare module '../../schema' {
    namespace Field {
        export { encodeField as encode };
        export { decodeField as decode };
        export { fieldFromJSON as fromJSON };
    }
    namespace Schema {
        export { encodeSchema as encode };
        export { decodeSchema as decode };
        export { schemaFromJSON as fromJSON };
    }
}

Closes #181.

@kentkwu kentkwu changed the title Fix missing Schema and Field classes from API Docs fix: Fix missing Schema and Field classes from API Docs Feb 27, 2026
@kentkwu kentkwu force-pushed the fix-docs-missing-schema-and-field branch from 844fbe5 to bca0bea Compare February 27, 2026 23:12
@kou
Copy link
Member

kou commented Feb 28, 2026

Could you check the generated docs (the release-docs artifact in https://github.com/apache/arrow-js/actions/runs/22507469873?pr=390) whether the result is expected or not?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a documentation bug where the Schema and Field classes were missing from the public Arrow.js API docs. The root cause was that src/ipc/metadata/message.ts was listed in the TypeDoc exclude config, which caused the declare module '../../schema' augmentation block in that file to register as an exclusion for Schema and Field themselves.

Changes:

  • Removes src/ipc/metadata/message.ts from the TypeDoc exclude list in typedoc.json, so that the declare module augmentation for Schema and Field is correctly processed (all other symbols in the file are already individually annotated with @ignore/@private).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kou kou requested review from domoritz and trxcllnt February 28, 2026 08:05
@kou
Copy link
Member

kou commented Feb 28, 2026

I'm not familiar with TypeScript but do we need declare module in src/ipc/metadata/message.ts?

declare module '../../schema' {
namespace Field {
export { encodeField as encode };
export { decodeField as decode };
export { fieldFromJSON as fromJSON };
}
namespace Schema {
export { encodeSchema as encode };
export { decodeSchema as decode };
export { schemaFromJSON as fromJSON };
}
}

@kentkwu
Copy link
Author

kentkwu commented Feb 28, 2026

I'm not familiar with TypeScript but do we need declare module in src/ipc/metadata/message.ts?

declare module '../../schema' {
namespace Field {
export { encodeField as encode };
export { decodeField as decode };
export { fieldFromJSON as fromJSON };
}
namespace Schema {
export { encodeSchema as encode };
export { decodeSchema as decode };
export { schemaFromJSON as fromJSON };
}
}

It is not strictly necessary and removing it might make things cleaner. However I don't plan on including it in this PR.

@kentkwu
Copy link
Author

kentkwu commented Feb 28, 2026

Could you check the generated docs (the release-docs artifact in https://github.com/apache/arrow-js/actions/runs/22507469873?pr=390) whether the result is expected or not?

Confirmed that Field and Schema now show up correctly.

Before:

❯ curl -s https://arrow.apache.org/js/current/modules/Arrow.dom.html \
  | grep -o 'classes/Arrow\.dom\.[^"]*\.html' | sort -u

classes/Arrow.dom.Builder.html
classes/Arrow.dom.Data.html
classes/Arrow.dom.DataType.html
classes/Arrow.dom.MapRow.html
classes/Arrow.dom.RecordBatchReader.html
classes/Arrow.dom.RecordBatchWriter.html
classes/Arrow.dom.StructRow.html
classes/Arrow.dom.Table.html
classes/Arrow.dom.Vector.html
classes/Arrow.dom.Visitor.html

After:

❯ gh run download 22507469873 --repo apache/arrow-js --name release-docs --dir /tmp/verify-docs \
&& tar tf /tmp/verify-docs/apache-arrow-js-docs-21.1.0.tar.gz | grep "classes/" | sed 's|[^/]*/||' | sort
classes/
classes/Arrow.dom.Builder.html
classes/Arrow.dom.Data.html
classes/Arrow.dom.DataType.html
classes/Arrow.dom.Field.html
classes/Arrow.dom.MapRow.html
classes/Arrow.dom.RecordBatchReader.html
classes/Arrow.dom.RecordBatchWriter.html
classes/Arrow.dom.Schema.html
classes/Arrow.dom.StructRow.html
classes/Arrow.dom.Table.html
classes/Arrow.dom.Vector.html
classes/Arrow.dom.Visitor.html

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.

Schema class is missing in API docs

3 participants