launchdarkly / openfeature-node-server

An open feature provider for the LaunchDarkly node SDK.
Other
10 stars 3 forks source link

Type definition were not included in dist (npm package) #17

Closed AlanyTan closed 1 year ago

AlanyTan commented 1 year ago

Is this a support request? This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going here and clicking "submit a request", or by emailing support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

Describe the bug the npm package @launchdarkly@openfeature-node-server does not include type declarations. VSCode typescript linting shows error TS7016 with error message: "Could not find a declaration file for module '@launchdarkly/openfeature-node-server'. '/workspace/project/node_modules/@launchdarkly/openfeature-node-server/dist/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/launchdarkly__openfeature-node-server if it exists or add a new declaration (.d.ts) file containing declare module '@launchdarkly/openfeature-node-server';"

To reproduce

  1. npm install @launchdarkly/openfeature-node-server
  2. open a Typescript file, and type import { LaunchDarklyProvider } from '@launchdarkly/openfeature-node-server';
  3. observe the "Problems" pane with the above message.

Expected behavior VSCode TS intellisense should be able to read types and provide info on the types, and methods.

As a matter of fact, if I download the source code and do tsc --declaration, the index.d.ts and other .d.ts files will be created, and I would be able to use it as Typescript module with intellisense available. SO it seems an issue with the npm packaging, not the source code.

Logs If applicable, add any log output related to your problem.

SDK version @launchdarkly/openfeature-node-server@0.2.0 launchdarkly-node-server-sdk@7.0.1

Language version, developer tools typescript 4.9.5

OS/platform Ubuntu 21.04

Additional context Add any other context about the problem here.

kinyoklion commented 1 year ago

Hello @AlanyTan,

Thank you for reporting this. We will take a look.

Filed internally as 192432

Thanks, Ryan

kinyoklion commented 1 year ago

Hello @AlanyTan,

This is fixed in version 0.3.0.

Thank you! Ryan

AlanyTan commented 1 year ago

Thanks @kinyoklion !