Skip to content

Missing exports for client hooks and types in main entry point #49

Description

@TrivCodez

Bug Report

Problem

The main entry point /src/index.ts does not export client hooks and client types, making them inaccessible to users even though they are built and included in the npm package.

Current /src/index.ts

export * from './error';
export * from './request';
export * from './schema/manifest';
export * from './schema/market';
export * from './types';

Missing Exports

  • /src/client/hooks/index.ts - contains useOnStandalonePluginInit, usePluginSettings, usePluginState, useWatchPluginMessage
  • /src/client/index.ts - contains main client exports
  • /src/openapi/index.ts - OpenAPI related exports
  • /src/schema/index.ts - Schema exports

Impact

Users cannot import hooks:

// This fails - hooks not exported
import { usePluginSettings } from '@lobehub/chat-plugin-sdk';

Evidence

  • package.json lists "client.d.ts" and "client.js" in files array
  • client.ts re-exports from /src/client
  • But /src/index.ts (main entry) doesn't export from /src/client

Fix Required

Update /src/index.ts to include:

export * from './client';
export * from './openapi';
export * from './schema';

Environment

  • SDK Version: 1.32.4
  • TypeScript
  • React 18+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions