simplyhexagonal / short-unique-id

Short Unique ID (UUID) generation library. Available in NPM.

Home Page:https://www.npmjs.com/package/short-unique-id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript Compile fails

michaelkrone opened this issue · comments

Hi,

when using short-unique-id 3.0.1 as a dependency, the typescript compile fails with:

../../node_modules/short-unique-id/short_uuid/mod.ts(2,21): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './version' instead.

Further either the Options Definition changed or the typings are not correct:

error TS2345: Argument of type '{ dictionary: any; skipShuffle: boolean; debug: false; length: any; }' is not assignable to parameter of type 'Partial<Options>'. Object literal may only specify known properties, and 'skipShuffle' does not exist in type 'Partial<Options>'.

Thank you for this library.

OK, I see skipShuffle is renamed to shuffle. This might be a doc bug then.

This seems to be related to #28 since in https://github.com/jeanlescure/short_uuid/blob/b4d1164a8903be7e77d9b54e24ee1f55227a8caa/mod.ts#L2 versions.ts is imported. I would provide a PR but since this is in another repo I have no idea to test any affected things.

Sorry for the noise. Just realising that the 3.0.1 release is not stated as a Node.js release, so I assume this is a Deno only release.
IMHO this is a confusing strategy that will break any semantic versioning. I would suggest not to publish Deno only releases to NPM.

Hi @michaelkrone , thanks for the report. Every release we are pushing is tested on Node, Deno and browser. No such thing as a runtime specific version, so please don't worry we will ever do that 🙂

I've been trying to reproduce the issue reported on #28 as well as the one you are reporting to no avail. Version 3.0.1 was a blind shot to see if it fixes the missing typings issue.

To help out with reproduction of these TypeScript issues, could you help me out by filling out this template (specially the context section would be helpful to us)?:

Expected Behavior

[screenshot, logs, or example]

Current Behavior

[screenshot, logs, or example]

Steps to Reproduce

Context (Environment)

[OS including version (i.e. Mac OSX Catalina 10.15.3)]
[Javascript runtime including version (i.e. Node v13.13)]
[Any other relevant notes regarding the context in which the issue is experienced
(i.e. using TypeScript or Babel)]

Detailed Description

Provide a detailed description about the issue at hand

BTW, @michaelkrone thanks for pointing out the miss-documentation of the options, I've gone ahead and renamed the shuffle option in the tsdoc comments. As soon as I'm able to reproduce TS2691: An import path cannot end with a '.ts' extension. error I can fix it and release v3.0.2.

Cheers