moleculerjs / moleculer-repl

REPL module for Moleculer framework
http://moleculer.services/docs/moleculer-repl.html
MIT License
27 stars 25 forks source link

Complete rewrite of REPL #57

Closed AndreMaz closed 2 years ago

AndreMaz commented 2 years ago

This PR rewrites REPL terminal in a way that it no longer depends on vorpal, which is an old and outdated lib. It uses native REPL + commander.js (for commands) + yargs-parser (for args parsing).

Despite being a complete rewrite it should behave exactly as the old (vorpal-based) REPL

Things that this PR will solve: Fixes #56 Closes #48 Fixes #54 (see https://github.com/AndreMaz/moleculer-repl/blob/4bfbee40f2d556dca05265524ddd6890570b233b/test/call.spec.js#L80-L95) Fixes #47 (see https://github.com/AndreMaz/moleculer-repl/blob/d2c1e8742cb5964650a3cbbcfbb5f89833bcd764/test/call.spec.js#L98-L120) Closes #55 Closes #12

ujwal-setlur commented 2 years ago

So, now repl.exec('some-command') does not work anymore. I use it to programmatically quit from the repl console:

 repl.exec('quit');

I guess that was a vorpal command. What would be the equivalent?

ujwal-setlur commented 2 years ago

Also, the typings have to be updated in index.d.ts of moleculer

AndreMaz commented 2 years ago

@ujwal-setlur to quit you can use

repl.eval("quit");
ujwal-setlur commented 1 year ago

@AndreMaz Thanks!