qrcode-terminal icon indicating copy to clipboard operation
qrcode-terminal copied to clipboard

Convert to ES6

Open jantimon opened this issue 3 years ago • 7 comments

hey :)

this PR is a major upgrade for qrcode-terminal:

  • upgrade es5 to es6
  • dosen't change any logic
  • doesn't add any depencies
  • fixes tests (duto sinon upgrade)

ES6 and ESModules require Node12. I hope that is fine - now that Node14 is the current long term support version: https://nodejs.org/en/about/releases/

jantimon avatar Jan 28 '22 07:01 jantimon

Incredible work @jantimon! Thank you for taking the time to upgrade the package while retaining the logic and avoiding new dependencies.

I'm happy to merge this PR. I'll just give it a few moments to see if @gtanner has anything to add.

mwbrooks avatar Jan 29 '22 04:01 mwbrooks

Looks ok to me as well @mwbrooks !

gtanner avatar Feb 10 '22 18:02 gtanner

Awesome @gtanner!

@jantimon I'm running into 2 failed tests on my end and I'm curious if you can help me through it.

$ node --version
v12.19.0

$ npm test
...
  6 passing (92ms)
  2 failing

  1) in the main module
       the generate method
         when not providing a callback
           "after each" hook for "logs to the console":
     TypeError: Cannot read property 'restore' of undefined
      at Context.<anonymous> (test/main.js:13:31)
      at processImmediate (internal/timers.js:461:21)

  2) in the main module
       the generate method
         when providing a callback
           will not call the console.log method:
     Error: expected true to equal false
      at Assertion.assert (node_modules/expect.js/index.js:96:13)
      at Assertion.be.Assertion.equal (node_modules/expect.js/index.js:216:10)
      at Assertion.<computed> [as be] (node_modules/expect.js/index.js:69:24)
      at Context.<anonymous> (test/main.js:32:47)
      at processImmediate (internal/timers.js:461:21)

The first error is that sinon.sandbox.restore is undefined. It looks like a fresh npm install used [email protected]:

cat node_modules/sinon/package.json | grep version
    "postversion": "./scripts/postversion.sh",
    "preversion": "./scripts/preversion.sh",
    "version": "./scripts/version.sh"
  "version": "13.0.1"

mwbrooks avatar Feb 11 '22 03:02 mwbrooks

Hope this pr gets merged

Cansiny0320 avatar Mar 02 '22 12:03 Cansiny0320

Any idea on when this will be merged?

maukoese avatar Apr 21 '23 19:04 maukoese

Would love to see ES6 support and the updates.

ctsstc avatar Apr 05 '24 22:04 ctsstc

can someone merge this asap?

coolRoger avatar Sep 15 '24 04:09 coolRoger