arloliu / copy-node-modules

Fast deploy Node.js modules from local source folder to distination folder
26 stars 14 forks source link

Latest release 1.1.0 breaks backwards compatibility #16

Closed shusak closed 5 years ago

shusak commented 5 years ago

Since the code switched to use export, this broke backwards compatibility for existing implementations.

Now instead of const copyNodeModules = require('copy-node-modules'); one needs to use const copyNodeModules = require('copy-node-modules').default;

Why didn't the semver change to 2.x to indicate this breaking change?

factoidforrest commented 5 years ago

I have a feeling this API change was unintentional. It's not in the examples..

ezze commented 5 years ago

@shusak, thanks for reporting this. @light24bulbs, yes, it was unintentional, sorry for that, guys. I submitted a commit that should fix backward compatibility. It should be possible to require a module by any of both methods:

const copyNodeModules = require('copy-node-modules');

or

const copyNodeModules = require('copy-node-modules').default;

@arloliu, can you check it and publish a fix to NPM?

arloliu commented 5 years ago

@ezze, sure, I had published v1.1.1 for this backward compatibility issue.