Skip to content

Update typing exports for chat components #178

Description

@janis-me

Hey!

We're trying to migrate some parts of the insights UI to this chat-comonents package to make everything more consistent.

We noticed that the exports field of the package.json doesn't export types, and instead there is an extra types entry in package.json. Typescript complains about this, stating

Could not find a declaration file for module '@cognigy/chat-components'. '.../node_modules/@cognigy/chat-components/dist/chat-components.js' implicitly has an 'any' type.
  There are types at '.../node_modules/@cognigy/chat-components/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@cognigy/chat-components' library may need to update its package.json or typings.ts(7016)

I think updating exports to something like

"exports": {
	"import": "./dist/chat-components.js",
	"require": "./dist/chat-components.js"
	"types": "./dist/index.d.ts",
},

Would fix this. What do you think?

Cheers,
Janis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions