Closed ghost closed 4 years ago
I don't think that using "latest" is the best option, as each future install of this plugin will possibly install different versions of javascript-obfuscator
, and those might have a different API and break this plugin.
Ideally the user installing grunt-contrib-obfuscator
might add a different version of javascript-obfuscator
to their package.json
and this plugin would use that version. I'm not sure if that's possible or not.
I'm facing this same issue. I would like to use the latest version 0.18.1 in my grunt tasks. Is there any known reasons why this version would not be compatible with grunt-contrib-obfuscator?
Hi,
I'm thinking of setting the javascript-obfuscator
in the peerDependencies
. What do you think?
That may make it easier to maintain while satisfying update requests.
This reference gives a general rule to help decide when to use peerDependencies
.
if the type of a function in a package’s public interface somehow depends on a dependency, it should be a peer dependency.
I think I saw something elsewhere to use it with plugins like grunt.
In my case I simply specify the required version of javascript-obfuscator
in the package.json
file, for example below is a piece of the JSON file:
{
"devDependencies": {
"grunt": "^1.0.4",
"grunt-contrib-obfuscator": "^4.0.0",
"javascript-obfuscator": "^0.18.8"
}
}
And all works fine. It worked with different 0.18.x versions (0.23.2 tested, also fine). I think it can work the same way with the newer versions of javascript-obfuscator
.
P.S. Using peerDependencies
is a great idea!
Updated. Should wait for the release
@slig can you release a new version?
Hi! Thanks for updating this package.
Can I invite you to the NPM package and later transfer it to you? I'm not at my machine at this moment.
It will be good
Done.
JavaScript-obfuscator is now on 0.17.x , while your package.JSON is at ^0.10.0. Please update it to "latest" so it remains up-to-date.