APSL / redux-i18n

A simple and powerful package for translate your react applications using react-redux.
MIT License
233 stars 52 forks source link

replace optimist with minimist #150

Closed AndreeWille closed 1 year ago

AndreeWille commented 1 year ago

This replaces optimist with minimist because optimist is no longer maintained and has a security issue related to an older version of minimist. See #133

francescarpi It looks like the tests doesn't cover the import and export scripts so i was not able to test it. Also i am not familiar with redux-i18n so i didn't add new tests. On the other hand i checked with a node script that the behaviour of the two libraries are the same.

var argsOptimist = require('optimist').argv;
console.log('optimist: ', argsOptimist)

var argsMinimist = require('minimist')(process.argv.slice(2));
console.log('minimist:  ', argsMinimist)

then i ran node index.js --foo bar hello world

output:

optimist:  {
  _: [ 'hello', 'world' ],
  foo: 'bar',
  '$0': '../../.nvm/versions/node/v16.18.0/bin/node ./index.js'
}
minimist:  { _: [ 'hello', 'world' ], foo: 'bar' }

The only difference is see is $0 property in the optimist version which is missing in minimist. I am not sure about if this is an issue or if this information is not needed for redux-i18n

francescarpi commented 1 year ago

Hi @AndreeWille .

It seems it works fine! Thanks a lot.

AndreeWille commented 1 year ago

Oh wow! That was quick! Thank you very much!

francescarpi commented 1 year ago

I've got a problem with my "npmjs" credentials and I cannot deploy the new version, yet. It will be solved on Monday.

AndreeWille commented 1 year ago

@francescarpi i just noticed the change is not published yet. Let me know when i can help you with anything.

francescarpi commented 1 year ago

Hi @AndreeWille . Sorry, we had problems with our npm's account. It's solved. I just publish the new version 1.5.25. Thanks