simontonsoftware / s-libs

A collection of libraries for any of javascript, rxjs, or angular.
MIT License
43 stars 5 forks source link

`tslib` and `utility-types` should be devDependencies? #115

Closed benallfree closed 7 months ago

benallfree commented 7 months ago

I think these should be devDependencies, as they have no use after compilation. Is that right?

https://github.com/simontonsoftware/s-libs/blob/055a94d9f18baf900dbbb7a86ea23499fe6dd946/projects/micro-dash/package.json#L13

ersimont commented 7 months ago

End-users of the library will need to have them available while they are compiling their projects. If they were devDependencies npm would not include them for end-users, then builds would fail.

For applications, where the end user does not need to compile anything, these would be dev dependencies. But because this is a library where my end-users WILL need to have them installed, they are regular dependencies.

benallfree commented 7 months ago

I'm not sure I understand, aren't these build-time deps? If micro-dash ships as esm, where in the toolchain are end users referencing these deps?

ersimont commented 6 months ago

Sorry for my delay. These dependencies can be used at build time by end users, if they are using Typescript. For a little test I just created a fresh ng new project, added micro-dash, and used isMatch() in a console.log. npm build - everything is great.

Then I deleted node_modules/utility-types. Now building gives a few errors like this:

Error: node_modules/@s-libs/micro-dash/lib/array/compact.d.ts:1:24 - error TS2307: Cannot find module 'utility-types' or its corresponding type declarations.

1 import { Falsey } from 'utility-types';