GithubHelp home page GithubHelp logo

princejwesley / mancy Goto Github PK

View Code? Open in Web Editor NEW
2.6K 2.6K 134.0 13.7 MB

>_ Electron based NodeJS REPL :see_no_evil:

Home Page: http://mancy-re.pl

License: MIT License

JavaScript 83.84% HTML 0.19% CSS 15.97%

mancy's People

Contributors

antonyr avatar boneskull avatar bragboy avatar imperat avatar nfcampos avatar princejwesley avatar senthilporunan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mancy's Issues

Does async/await work in Mancy?

I assumed async/await works in Mancy after reading the wiki. But I'm having some problems with it.

I'm new to async/await, so I'm probably at fault here somehow.

I tried to get the following example into Mancy:

async function getValues() {
return [1,2,3,4];
}

From this primer: http://code.tutsplus.com/tutorials/a-primer-on-es7-async-functions--cms-22367

I get this error:

SyntaxError: Unexpected token function

I also tried the following alternatives which yield the same error:

getValues = async function () { return [1,2,3,4]; }

var getValues = async function () { return [1,2,3,4]; }

I also tried this alternative:

let getValues = async function () { return [1,2,3,4]; }

Which gave this error:

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Any ideas what's wrong here?

Click on prompt (">")

When you click on prompt (">"), it only changes its orientation. Tooltip says "expand command", should it work like minimize/maximize buttom?

Bug: Async/await returns promise object vs. resolved value

The value in the async/await pattern is that it allows us to work with async values like we would sync values vs. nesting callback or then blocks. Given that, thanks for adding this sugar to Mancy. However, these await statements return promise objects vs. the resolved values, so we still need to call then on them to access the resolved value.

Test:

let request = require('request-promise');
let todos = await request('http://jsonplaceholder.typicode.com/todos');
console.log(todos);
// Promise {}
// [[PromiseStatus]]: fulfilled
// [[PromiseValue]]:
// '[
//   {
//     "userId": 1,
//     "id": 1,
//     "title": "delectus aut autem",
//     "completed": false
//   }
//   ...
// ]'
todos.then(res => console.log(res));
// '[
//   {
//     "userId": 1,
//     "id": 1,
//     "title": "delectus aut autem",
//     "completed": false
//   }
//   ...
// ]'

Which ends up looking the same as a vanilla promise:

let todos = request('http://jsonplaceholder.typicode.com/todos');
todos.then(res => console.log(res));
// '[
//   {
//     "userId": 1,
//     "id": 1,
//     "title": "delectus aut autem",
//     "completed": false
//   }
//   ...
// ]'

When I test this in my own environment using Babel and babel-preset-stage-0, it works, so I'm nor sure what the problem is...

Chat room (gitter)

As long as Mancy community is growing, I suggest to create a chat room. With Gitter is very easy and it's well integrated with GitHub.

Clear screen shortcut

In nodej.s REPL or bash we can use `Control + L' to clear the screen. I think it's missing from mancy :).

Ideas for Mancy 3.0

Mancy 2.0 is here! And it's really nice but I'm thinking of Mancy 3.0 from right now. I think the next big thing should be plugins support (like Atom pacakages). There could be the following types of plugins:

  • R (Read). Plugins related to code editor, autosuggestions, etc.
  • E (Eval). Plugins to eval code written at another languages (CoffeScript, TypeScript, etc.).
  • P (Print). Plugins for data visualization.
  • Other plugins.

Part of Mancy itself could be coded as plugins. I'm sure many contributors would create plugins for Mancy, other people do for Atom.
What do you think about?

Thank you for Mancy! It's great!

require(module) => Error: cannot find module

This looks amazing, I look forward to using it more, but one of the basic features I'm not able to get working.

Whenever I tried to to require a module, I always get Error: Cannot find module 'module-name'.

screen shot 2015-11-23 at 1 11 00 pm

It does work when I run from master locally, so it's possible this has already been addressed.

Object output: show constructor name

I know you can expand "Object" item and the expand "proto" item and then you have constructor name. But I think it would be useful look constructor name at first glance.

Example:

class A {}
a = new A();

now you get:

> Object {}

I think it would be better something like this:

> Object (A) {}

Thank you.

Table view for two dimensional data

I like to implement a toString function for each my custom types, to be used to debug print the contents.

Does Mancy support, or are there any plans to support, implicit use of toString when outputting objects on the console?

[Windows 7] Mancy GUI never appears

After upgrading to 2.1.0 on Windows 7 Pro, the REPL GUI does not appear when I start Mancy. I have repeatedly removed and re-downloaded Mancy to no effect. I have also deleted %appdata%\mancy to no effect. If I delete the 2.1.0 installation and run the 2.0.1 build, the GUI starts up.

bring-your-own Node.js optional alternative to Electron-built-in-Node.js

Is it technically feasible to use an external Node.js executable with Mancy?

I ask because Electron comes with Node.js 4.1.1, and I'm using Node.js 5.1.0 with my own projects. It gets a bit confusing trying to remember which syntax is available in which Node.js version.

Is this something that you'd accept a PR for?

Clarification:

  • Mancy continues to come with Electron-supplied-Node.js, whichever version that is
  • but there's a new setting in Mancy that accepts the absolute path to any modern Node.js executable

Evaluation error

Hi!

First, thanks for this great project. I'm learning Javascript (ES6) and React and it's the nicest repl I've found.

I think there's a problem with the evaluation:

function buzz(n) {
  if (n%15 === 0) return 'FizzBuzz';
  if (n%5  === 0) return 'Buzz';
  if (n%3  === 0) return 'Fizz';
  return n;
}

buzz(3)
'Fizz'

buzz(2)
undefined <<<< it should return 2

I tested it on Firefox's console and it works fine.

gif

feature request: custom stylesheets

I'd like to do two things, specifically:

  1. I want to change the fixed-width font to be Menlo.
  2. I want to remove the "watermark" in the background.

I've done this in my fork, but in doing so, I noticed the themes are somewhat tightly coupled.

My suggestion is:

  1. Allow the user to place a custom SCSS theme in an appropriate location (on MacOS X, this may be ~/Library/Application Support/Mancy). May also need a place to put .ttf file(s) or other binary data.
  2. When generating the menus, display all themes found in the core package, and also user-defined ones. This is somewhat more difficult than it sounds--there's too much repetition within the menu definition files (for each platform), though I don't know if this is a limitation of Electron.
  3. Generate whatever hooks are necessary in the React to select the new theme in the menu. I don't know React, so I don't know what this entails.
  4. Ultimately, remove any hardcoded references to the two packaged themes. Given that they are hardcoded everywhere throughout the SCSS files, it's going to take some serious refactoring.

thanks. Great work!

Show transpiled/compiled code

It would be nice if you could show transpiled/compiled code.
For example, if you are using LiveScript and type:

console.log \hello

you could show the generated (and evaluated) JavaScript code:

console.log("hello");

This feature would be easy to implement and it's very useful to debug. You could apply this feature to all languages and transpiler: Babel, CoffeeScript, TypeScript, LiveScript...

Auto fill characters bug

When you type '9', Mancy "autofill" another '9' character. I think it's a issue related to shift keycode and parentheses. When you type "(" or "(quotes), no autofill at all.

Don't use enter to autocomplete

It's kind of a pain to evaluate short variables quickly since the autocomplete gets in the way. For example, I can't quickly type n and then hit enter, since it autocompletes to new. Considering that this is a REPL and you'd expect people to want to hit enter pretty often to evaluate things, doing autocomplete feels wrong to me.

Some problem with npm install

Hi @princejwesley When I try install npm dependencies I got this error:

npm ERR! Cloning into bare repository 'C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-princejwesley-font-manager-git-3684d2cffffd1f08ab15a7fa0f01449f'...
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

Syntax error when closing bracket and closing parenthesis are on different lines

I seem to be getting a syntax error SyntaxError: missing ) after argument list with the following code:

Promise.resolve('finished').then(function(result){
  console.log(result)
}
)

But if I put the closing bracket and parenthesis on the same line, there's no error:

Promise.resolve('finished').then(function(result){
  console.log(result)
})

I'm running Mancy v2.1.0 on OSX 10.11.1.

(thanks for making Mancy btw, it's great)

Provide feedback for unsupported features/unexecutable code

I can find no way to execute const usesRest = (first, ...rest) => console.log(first, rest) in Mancy.

Pressing ENTER behaves like SHIFT+ENTER (adds blank lines).

I looked for documentation on what features were supported (#13), but couldn't find any. I assume rest parameters are not supported because the line is evaluated if I replace ...rest with rest.

There should be some feedback to the user. Either execute the code and throw a SyntaxError, or indicate that the code can't/won't be executed and list the reason.

async/await

[Babel transform: enabled]

Input:

async function x() { return 100 }
await x()

Output:

SyntaxError:  Unexpected token function

Expected output:

100

However if you code only this line:

async function x() { return 100 }

you get no error (right) and x() returns a promise (right).
Then, if you code this line:

await x()

you get another promise (!) and it should return 100.

Multiline code is evaluated multiple times

Multiline code (shift+enter) is evaluated multiple times (as many as lines).

Example:

1+1;
2+2;
2

1+1;
2+2;
4

I think is not necessary Mancy show 1+1 result, only last line (2+2 = 4) that is the global result form entire input code,

Support for history

Support for recalling old command execution. It would be better if the commands are stored in a file so that they can applied between sessions. Props for implementing Ctrl+R for searching through History.

Special support for promises?

I noticed that Mancy already has Auto async wrapper and Promise output tracking.

Would it be possibly to add an synchronous wrapper for promises?

Or does something like this already exist in Mancy?

Example...

The following code pulls json data from a REST API. Data-forge returns a promise that resolves when the async operation has completed:

dataForge.from(http("some/rest/api")
.as(json())
.then(function (dataFrame)) {
// ... do stuff with the data frame ...
});

In Mancy I'd like this to behave like it was synchronous:

var dataFrame = dataForge.from(http(...)).as(json());

Is it possible for Mancy to wrap promises automatically and then resolve them to their values?

Cant save session to file

using ubuntu 14.10
Downloaded from github (not npm)
Tested in similar virtual machines and the problem persisted

Compat table

I think it would be helpful to see, at a glance, what language features are supported in the REPL. Maybe as an added feature have the ability to toggle available features.

custom repl

I like what n_ is doing. Though this module likely is too specific to simply make a user preference, it'd be really swell if Mancy allowed you to wrap its REPL with a custom one.

Would this be possible? Is this something you'd be interested in supporting?

Great work. ๐Ÿ‘

Focus on prompt line

If you click, for example, a minimize buttom, you lose focus on prompt line. So you have to click on prompt line to write again. I think prompt line should be focus all the time or mostly. Click an empty space of main panel, should focus prompt line. Maybe keypress event too.
These are only suggestions. I hope they help you. Mancy is great!

OSX installation instructions not working

Hello! Love the project. Just one issue I had so far:

Running npm install then npm run package does not initiate the application.

I had to run gulp start or npm start.

Collapsable error output

It think error outp should be collapsed by default.

Example (wrong) input:

1+++

Now you get this output:

ReferenceError:  Invalid left-hand side expression in postfix operation
  at exports.createScript (vm.js:24:10)
  at REPLServer.defaultEval (repl.js:137:25)
  at bound (domain.js:250:14)
  at REPLServer.runBound [as eval] (domain.js:263:12)
  at REPLServer.<anonymous> (repl.js:393:12)
  at emitOne (events.js:77:13)
  at REPLServer.emit (events.js:169:7)
  at REPLServer.Interface._onLine (readline.js:210:10)

It would be nicer this way:

> ReferenceError:  Invalid left-hand side expression in postfix operation

click on ( >) to view error details

Date viewer

There is no Date viewer.
Example: new Date()

Enhancement idea: automatically require core node modules

Using the traditional node REPL from the terminal on Mac OS X, I don't have to require core node modules. For example:

> os
{ hostname: [Function: getHostname],
  loadavg: [Function: getLoadAvg],
  uptime: [Function: getUptime],
  freemem: [Function: getFreeMem],
  totalmem: [Function: getTotalMem],
  cpus: [Function: getCPUs],
  type: [Function: getOSType],
  release: [Function: getOSRelease],
  networkInterfaces: [Function: getInterfaceAddresses],
  homedir: [Function: getHomeDirectory],
  arch: [Function],
  platform: [Function],
  tmpdir: [Function],
  tmpDir: [Function],
  getNetworkInterfaces: [Function: deprecated],
  EOL: '\n',
  endianness: [Function] }

But in Mancy that'll throw a ReferenceError. I've always liked that ability in the terminal because it allows for quickly iterating on something, which is what I use REPLs for. Mancy is cool, nice work ๐Ÿ‘

Syntax highlight as you type

Code you type has no syntax highlight until you press enter. I think that if you use codemirror or ace instead highlight.js, you would get live syntax highlight (and maybe another interesting features).
Thank you again.

Secure sandbox (while(true){})

Hi!
I'm thinking about create a Node REPL based on Electron and I've found Mancy! Great job! Very very nice!
I don't know yet how Mancy eval/run input code but I've tried this code

while(true){}

and Mancy hangs completely (Node CLI REPL hangs too). But it would be nice if you could stop/cancel the last execution (infinite loop in this case) and continue working with Mancy. I think Mancy would need to execute input code at another process (child). Parent process (global data) and child process (execution) would have to communicate in order to share global data. So you could kill child process if it hangs and continue working whith Mancy and your current session (global data).
Thank you for Mancy! Go on!

Application exe is crashing in linux

Requiring external module babel-core/register
Using gulpfile ~/JS/Mancy/gulpfile.babel.js
Starting 'user-env'...
Finished 'user-env' after 160 ฮผs
Starting 'start'...
Starting 'build'...
Starting 'clean'...
Finished 'clean' after 224 ms
Starting 'copy'...
Finished 'copy' after 859 ms
Starting 'sass'...
Starting 'react'...
Finished 'sass' after 2.62 s
Finished 'react' after 4.87 s
Finished 'build' after 6.14 s
Starting 'run'...
[5779:1012/214101:ERROR:browser_main_loop.cc(189)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.

Crash dump id: 9a459779-ccf5-4546-95d3-95e5d0b49ef1

Finished 'run' after 9.8 s
Finished 'start' after 16 s

Install Mancy through npm

It would be nice if you could install Mancy this way:

npm i mancy -g

Other electron based applicacions (like iron-node) work this way.

Window Resizing (OSX)

I don't seem to be able to resize the window past certain points. Please see attached gif.

OSX 10.10.5

mancy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.