NeilFraser / JS-Interpreter

A sandboxed JavaScript interpreter in JavaScript.
Apache License 2.0
1.96k stars 350 forks source link

NPM package (all done) #172

Closed mercmobily closed 4 years ago

mercmobily commented 4 years ago

Hi,

I am very humbly proposing a proper NPM package for js-interpreter. The only NPM package available is this:

https://www.npmjs.com/package/js-interpreter

But it's a 3 year old fork. It's absurd that this is the first contact people have with js-interpreter if they are using NPM (and most people, at least now, are these days; yes @NeilFraser it is the flavour of the month :D )

I VERY humbly created this: https://github.com/mercmobily/js-interpreter

It's just a basic package with a package.json file; it has a shiny generator.sh script that will sandwitch js-interpreter.js with the right things so that it works client side. The "real" js-interpreter is added to the GIT repo as a gitmodule.

Usage is identical.

Client-side, you set the global acorn with the first <script src=> and then you have another <script src=> to load the interpreter. Server-side, wit NPM, you simply do 'require('js-interpreter') and you are done. If you want acorn, you do require('js-interpreter/acorn') Disclaimer: I tested the server side, but I haven't yet loaded "my" version in the client.

The idea is that when you are happy with a version, or make a modification big enough that you want to update the NPM version, you go the the js-interpreter's npm repo, pull the branch you want to have, run ./generator.sh and publish -- that's it.

I am very happy to turn this whole thing over to you. Or I am also happy to run npn publish anytime. I am also happy to give you write access to the repo, and write access in NPM, so that you don't depend on me.

Right now, we would need to talk to the current owner of the npm package and see if he's happy to hand it over. SURELY he would be. Then we take it from there.

Interested?

NeilFraser commented 4 years ago

I give you my blessing to run JS-Interpreter's official NPM package. Thanks!

mercmobily commented 4 years ago

Hi,

I will make sure you have access to everything in case anything goes wrong. I might be offline for a while, might get hit by a bus, you might start hating me... etc. All unlikely events, but you never know :D I will contact the guy who owns the js-interpreter and try and convince him to hand it over. Failing that, I will contact NPM. Failing that, we will just go with "jsinterpreter" without dash.

Let me know if there is anything you don't agree with!

Merc.

On Fri, 17 Jan 2020 at 04:44, Neil Fraser notifications@github.com wrote:

Closed #172 https://github.com/NeilFraser/JS-Interpreter/issues/172.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172?email_source=notifications&email_token=AAQHWXXYU2FFTMBNPQVNLLDQ6DBLZA5CNFSM4KHQEV62YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWAYQUOA#event-2956003896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXXQVUKXY6G7SYRKHYDQ6DBLZANCNFSM4KHQEV6Q .

mercmobily commented 4 years ago

One last note: Shall I add Christopher Allen and/or Ian (not sure who that is) to the list of authors? In the NPM package I talk about Neil Fraser's JS-Interpreter, but I definitely don't want to leave anybody out.

On Fri, 17 Jan 2020 at 05:05, Tony Mobily tonymobily@gmail.com wrote:

Hi,

I will make sure you have access to everything in case anything goes wrong. I might be offline for a while, might get hit by a bus, you might start hating me... etc. All unlikely events, but you never know :D I will contact the guy who owns the js-interpreter and try and convince him to hand it over. Failing that, I will contact NPM. Failing that, we will just go with "jsinterpreter" without dash.

Let me know if there is anything you don't agree with!

Merc.

On Fri, 17 Jan 2020 at 04:44, Neil Fraser notifications@github.com wrote:

Closed #172 https://github.com/NeilFraser/JS-Interpreter/issues/172.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172?email_source=notifications&email_token=AAQHWXXYU2FFTMBNPQVNLLDQ6DBLZA5CNFSM4KHQEV62YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWAYQUOA#event-2956003896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXXQVUKXY6G7SYRKHYDQ6DBLZANCNFSM4KHQEV6Q .

cpcallen commented 4 years ago

I am in no way an author of JS Interpreter; I just help out because I've done extensive work on a fork of it, and so I'm probably second most familiar with its internals (when I don't get them confused with my heavily modified version).

mercmobily commented 4 years ago

Just curious... what's your fork for?

On Fri, 17 Jan 2020 at 08:43, Christopher Allen notifications@github.com wrote:

I am in no way an author of JS Interpreter; I just help out because I've done extensive work on a fork of it, and so I'm probably second most familiar with its internals (when I don't get them confused with my heavily modified version).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172?email_source=notifications&email_token=AAQHWXRN7IMY5CLTIOQ7DILQ6D5M5A5CNFSM4KHQEV62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJGB7XY#issuecomment-575414239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXUSY4USYKVRIS3ES23Q6D5M5ANCNFSM4KHQEV6Q .

NeilFraser commented 4 years ago

It's a fork of JavaScript that's multi-user, with quota and access controls on properties.

No idea who Ian is.

hsluoyz commented 4 years ago

Hi. Why did we create a new GitHub repo: https://github.com/mercmobily/js-interpreter instead of using this one?

mercmobily commented 4 years ago

I will be very happy to zap it. The idea is that Neil wants to keep JS-interpreter package-agnostic. There is very very very little code in that package: all it does, is package the interpreter into something that will work fine with npm, whether it's loaded by a browser or by node. I personally think that turning JS-Interpreter into something that is NPN-ready would be very beneficial, and the changes are minimal; however, this is Neil's project and ultimately his decision. I can understand why keeping it agnostic makes sense, but I can also see that NPM does seem to have taken over the world (but then again, so did Dojo for Javascript a while back).

On Sun, 19 Jan 2020 at 12:50, Yang Luo notifications@github.com wrote:

Hi. Why did we create a new GitHub repo: https://github.com/mercmobily/js-interpreter instead of using this one?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172?email_source=notifications&email_token=AAQHWXVANQUFESLN75QAI63Q6PL2NA5CNFSM4KHQEV62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKI7FI#issuecomment-575967125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXRPO4BOOEATXF2FNZDQ6PL2NANCNFSM4KHQEV6Q .

aminmarashi commented 4 years ago

@NeilFraser @mercmobily We are actively using this npm package and it's important for us that it keeps working. I will update the package with the latest changes, you can find the issue here: https://github.com/aminmarashi-binary/JS-Interpreter/issues/2

mercmobily commented 4 years ago

@aminmarashi-binary What frankly concerns me is that your repository is actually a fork of JS-Interpreter, rather than the official package. Most users will be inclined to think that https://www.npmjs.com/package/js-interpreter is the official repository, if anything because of the name. My NPM repository does nothing other than make JS-Interpreter available to the browser and node.

If you really want to keep the fork on that URL, I think you should specify that 1) It is a fork 2) What the differences are 3) A link to the official NPM package.

What do you think?

aminmarashi commented 4 years ago

I will follow your approach to use gitmodule so it's not a fork anymore. And will move the additional functionality to a separate repo. Will definitely update the package descriptions to mention it's not an official package by google. Please feel free to make a PR, otherwise I will make the changes in a few days and will mention you on the PR. Sorry, I just can't risk losing control of this package, it's far too important for my use-case.

mercmobily commented 4 years ago

Wait, if you do follow my approach and have js-interpreter being a packaged version of js-interpreter, then your repository should be the official one. Wouldn't that make sense?

aminmarashi commented 4 years ago

@mercmobily I think it would make sense to clarify that the package is not maintained by Google or anybody affiliated to them. So the word official could be misleading. Anyhow, I'll create a PR and add you to the loop.

mercmobily commented 4 years ago

JS Interpreter is not a Google project. It's Neil's personal project. "Official" here means that that's the package to use if you want to use Neil Frazer's js-interpreter. We don't have to use the word "official" but it would effectively be it.

On Tue, 28 Jan 2020 at 11:05, Amin Marashi notifications@github.com wrote:

@mercmobily https://github.com/mercmobily I think it would make sense to clarify that the package is not maintained by Google or anybody affiliated to them. So the word official could be misleading. Anyhow, I'll create a PR and add you to the loop.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172?email_source=notifications&email_token=AAQHWXU4UZ4SQDU7RCHDGN3Q76OJLA5CNFSM4KHQEV62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKB3USA#issuecomment-579058248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXTKWRTVYUVBYMF36F3Q76OJLANCNFSM4KHQEV6Q .

aminmarashi commented 2 years ago

@mercmobily If you are still interested in maintaining the module, please let me know, I have left the company I was previously working for and don't have any more incentive to maintain the package. Feel free to open an issue and discuss under https://github.com/myuzio/JS-Interpreter

mercmobily commented 2 years ago

Hi,

Yes, I am happy to take over development. Please hand over the git repository and the npm package to "mercmobily". I will liaise with Neil -- I will try to get the NPM package as part of the official distribution. I will try and look after this bug.

On Fri, 13 Aug 2021 at 03:41, Amin @.***> wrote:

@mercmobily https://github.com/mercmobily If you are still interested in maintaining the module, please let me know, I have left the company I was previously working for and don't have any more incentive to maintain the package. Feel free to open an issue and discuss under https://github.com/myuzio/JS-Interpreter

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172#issuecomment-897917357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXQE2SE2VMJENULFCRLT4QPW5ANCNFSM4KHQEV6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

aminmarashi commented 2 years ago

@mercmobily done

mercmobily commented 2 years ago

Hi,

What about the NPM package...?

Merc.

On Sun, 15 Aug 2021 at 17:10, Amin @.***> wrote:

@mercmobily https://github.com/mercmobily done

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NeilFraser/JS-Interpreter/issues/172#issuecomment-899020315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQHWXVJANQC6MAOO7JXFZ3T46AABANCNFSM4KHQEV6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

aminmarashi commented 2 years ago

Hi, What about the NPM package...? Merc.

yup done too

mercmobily commented 2 years ago

Thanks!