3rd-Eden / useragent

Useragent parser for Node.js, ported from browserscope.org
MIT License
897 stars 137 forks source link

[Fix] Move yamlparser to prod deps #121

Closed luchillo17 closed 6 years ago

luchillo17 commented 6 years ago

There's a bug where a library that uses this dep fails because it doesn't install the dev deps, this is to move the yamlparser dep into the correct section in package.json.

manuelbieh commented 6 years ago

Yes, please. Having the same issue when using browserslist-useragent.

luchillo17 commented 6 years ago

I didn't wanted to mention the library itself, but is Device.

3rd-Eden commented 6 years ago

You can just manually do npm install yamlparser useragent as npm flattens the node_modules tree, the useragent module will find the yamlparser you manually installed and use that instead. I don't want to bundle it as part of the dependencies as it's optional functionality.

luchillo17 commented 6 years ago

@3rd-Eden bro, if it's optional why do the mentioned libs break? are you suggesting those libs should know it's optional and they should be in charge of installing those deps?

3rd-Eden commented 6 years ago

Yo bro, I have no idea why it breaks. The only part of this library that uses yamlparser is when you call the useragent(true) update API, which mentions that you need to manually install those dependencies in order for that to work.

The browserslist-useragent library does not invoke this, nor does the device parser of this library use yamlparser.

luchillo17 commented 6 years ago

Maybe it's incompatibility with transpilers, i'm using it inside TypeScript, how's supposed to know that the yaml dep is optional if the optional part is decided at runtime?

Anyway i moved away from Device, so it depends on @manuelbieh if he explains his case better.