idangozlan / verdaccio-bitbucket

BitBucket auth plugin for verdaccio
MIT License
7 stars 17 forks source link

babel building to ES6 #18

Closed AceVentura closed 5 years ago

AceVentura commented 5 years ago

I found an issue related to the binary in npm registry. It's missing the .babelrc file. Because of that it's building in ES6 instead of ES5, which afterwards breaks nodejs. The temporary fix I made was placing the file in the verdaccio-bitbucket folder and run a new npm install.

juanpicado commented 5 years ago

@AceVentura I don't get the request. Could you clarify a little bit?

AceVentura commented 5 years ago

@juanpicado Without the .babelrc the js files are compiled to ES6. When you try to access verdaccio it will give you the following error:

(node:5820) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:5820) UnhandledPromiseRejectionWarning: F:\verdaccio\node_modules\verdaccio-bitbucket\lib\index.js:1 (function (exports, require, module, filename, dirname) { import Bitbucket2 from './bitbucket2'; ^^^^^^^^^^

SyntaxError: Unexpected identifier at new Script (vm.js:79:7) at createScript (vm.js:251:10) at Object.runInThisContext (vm.js:303:10) at Module._compile (internal/modules/cjs/loader.js:657:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) (node:5820) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:5820) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

index_es5 index_es6

In V1.0.4 this problem didn't occur by the way (No bazel).

juanpicado commented 5 years ago

Ohh I see, that's bad. It's due https://github.com/idangozlan/verdaccio-bitbucket/commit/cb9a2dfb737118cf3e2516d281b8dfa4ef3b3e5b#diff-e56633f72ecc521128b3db6586074d2c A PR would be on .babelrc

"presets": [
        ["@babel/env", {
          "targets": {
            "node": "6.10"
          }
        }]],

Which is the minimum version supported by Verdaccio.

juanpicado commented 5 years ago

@AceVentura if you PR I guess @idangozlan will be happy to merge and release.

idangozlan commented 5 years ago

Even more than happy 😂

On Thu, Jan 31, 2019 at 9:20 PM Juan Picado @jotadeveloper < notifications@github.com> wrote:

@AceVentura https://github.com/AceVentura if you PR I guess @idangozlan https://github.com/idangozlan will be happy to merge and release.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/idangozlan/verdaccio-bitbucket/issues/18#issuecomment-459609456, or mute the thread https://github.com/notifications/unsubscribe-auth/AB5hbdC2Zn0haZD4RHLESC5P8IRsqH2Hks5vI86JgaJpZM4aYw1H .

P Please consider the environment before printing this email.

AceVentura commented 5 years ago

I can do the PR no problem. The ".npmignore" file also needs to be changed, if I'm not mistaken

juanpicado commented 5 years ago

yes, /lib, LICENSE and README it's all I'd include. Binary should be small. Source code should never shipped with a dependency.

raffaeleguidi commented 5 years ago

...waiting for the update in npm :)

juanpicado commented 5 years ago

@AceVentura

Without the .babelrc the js files are compiled to ES6.

Why would you remove the .babelrc. The project compiles perfectly to ES5 with the current setup.

AceVentura commented 5 years ago

@juanpicado I didn't. The npm package doesn't have it (check the .npmignore)

jdecoster commented 5 years ago

@idangozlan can you create a new release :)

idangozlan commented 5 years ago

Please check version 2.0.0