How do I use electron-compile? - ecmascript-6

I'm having trouble with electron-compile.
The docs state
How does it work? (Easiest Way)
Change your reference to electron-prebuilt to electron-prebuilt-compile. Tada! You did it.
What reference, where? You can't be talking about package.json?
I've always run electron using supervisor -x "electron" -i "./" .
What am I completely missing / what should be the contents of my pull request to make this clearer?
I've installed electron-compile with npm i electron-compile --save-dev
I'd like to have es2015/jsx precompiled to es5, so that I can run a react application in electron. electron-compile appears to solve this problem.

You should install Electron as a dev reference in package.json, yes:
npm install --save-dev electron-prebuilt-compile
Don't install Electron as a global because then other people have to set stuff up to run your app (i.e. they now have to micromanage which version of Electron they have installed globally)

With the recent versions (electron 1.3.5), I was unable to get electron-prebuilt-compile working, well it works for development but packaging for production has no real working examples.
It seems the compiling and packaging needs to be done manually, so in case anyone needs a working example, it's here. Hope to save someone some time and pain.

Related

How to use self-built Electron binaries with electron-builder

I've built my own Electron binaries. I've put those binaries into ./node_modules/electron/dist. Everything works fine when running the app with npm start from the development environment, but when packaging the app with electron-builder, Electron lacks that functionality that I added. It looks like electron-builder does not take whats in node_modules/electron when packaging an app.
Can somebody tell how I can use own Electron binaries with electron-builder?
It can be achieved by using the electronDist property in the electron-builder's build section of package.json.

Getting started with [Wrap]Bootstrap theme with Bower/Grunt

This is my first attempt at using a frontend package that uses Grunt/Bower.
I am specifically referring to a Wrapbootstrap theme.
I followed the instructions as follows:
npm install -g grunt-cli
npm install -g bower
npm install
bower install
I believe the process went fine. There were some deprecation warnings though.
What I ended up was with a file structure like this:
However, now I am lost as how to start.
The instructions says to do grunt live but it just opens up a blank page without anything on it. I opened every index.html in there but no luck.
Would really appreciate if you someone can set me on a path to realizing how to deal with the Grunt/Bower tools and how to troubleshoot this case.
Thank you.

Are there any code complexity metering tools that work well with ES6?

My project is ES6 (webpack + babel). Plato is great, but doesn't work with ES6 yet. I took a look at escomplex and the series of related packages, but it looks like the author is no longer maintaining this and it seems like it doesn't support ES6 anyways.
I'm using the ESLint complexity rule to at least warn me if there's an issue (it's set to warn at 6), but it's not the same as a pretty report.
Any suggestions?
There is a fork created by deedubs that uses espree instead esprima. I've installed it and it runs on ES6 styled code like a charm, in order to install the fork version instead the default distro execute the following command:
npm install -g git+https://github.com/deedubs/es6-plato.git
Whenever you want to uninstall it just do it like you would do it with vanilla plato install by writing
npm uninstall plato
Here's a screenshot for a file report based on a ES6 code after installing the Plato forked version
It's been about 3 weeks since you asked the question so I am not sure if this will be still useful for you but I hope it can help others with the same problem we were facing on using this amazing tool.
I published a version of plato that does this here: https://www.npmjs.com/package/es6-plato
updates lodash and dependencies
fixes some common bugs in plato
properly parses es6
this includes classes
npm install --save es6-plato
read the docs to use it with gulp, or via the js api.

Visual Studio 2015 - Where's the gulp task runner?

I heard Mads Kristensen in his videos mention that Gulp and Grunt are both first class citizens. I thought I even heard mention of the Gulp task runner.
But when I create a gulpfile and right click there's no task runner.
Has anyone been able to get the "native" gulp task runner (if there is one) in Visual Studio 2015 Preview to appear?
View > Other Windows > Task Runner Explorer and click refresh
or just Ctrl + Alt + Bkspace
The Preview version of VS2015 requires Gulp to be installed globally and has a few other issues with auto-discovery of the gulpfile.js. These issues will all be addressed by the time VS2015 ships.
I had this same problem with VS2015 - TRX was showing "no tasks found" even though I had a valid, linted, gulpfile.js in the site root. I found the answer here: http://www.roelvanlisdonk.nl/?p=4258
Steps: Close VS. Open a cmd prompt from the site root and run npm install. Re-open VS and you should see your tasks in TRX. It worked for me.
EDIT: I had gulp installed globally but still encountered this "error." The above steps resolved the issue though.
Well I solved the problem with several restarts of VS2015. Finally the task runner appeared for my gulpfile. I still have no idea why it did not appear from the start but it's a preview version so maybe something is not quite right yet.
Barryman9000's answer helped me on the right track. I started with an empty ASP.NET 5 project in VS2015 and had no package.json file at the project root. Running npm install gave me an error message about missing package.json. After adding that file with the default dependencies from another ASP.NET 5 project, the Dependencies started downloading and my gulpfile tasks appeared in the Task Runner Explorer.
In your bash, go to the directory gulpfile.js is installed in and run:
npm install gulp
Why the downvotes? Please read the OP's question and the comments beneath it. Also, note that the answer with, currently, the most points has nothing to do with the question. Also please note that Mads Kristensen himself said that the issue was to install gulp.
Also, as for the commenter "Bonner" of this answer, note that Bash doesn't mean Linux. You can install git bash for Windows and run all of your NPM and Git commands there. Most developers I know use that bash on windows for all npm needs.
Lastly, if your Gulp Task Runner is not working, that is most likely because it is not recognizing your gulpfile. That is due to gulp not being installed. VS2015 didn't always install gulp for you. So the fix was to install gulp globally (As Mads Kristensen said), or directly where your gulpfile is. Also, restarting or re-installing VS sometimes kickstarted the gulp installation if you're lucky.
Conclusion: My answer is the correct answer. I reference the actual OP Question, comments beneath it, Mads Kristensen, and even the accepted answer. Yet, this answer is in the negative and some random answer about how to use the "View" menu in Visual Studio has 40 points.

Local portable grunt distribution?

I am currently creating a portable consolidation of my workflow using Node-Webkit which has node.js embedded. Now my problem is getting grunt/gulp inside the project itself as it depends on the cli somewhat(avoidable, granted), and also is confusing to me on the architecture. Is it possible to find just a .js with grunt in it to include much like Jquery/Handlebars?
Is this all I need to just include and run?
No before that make sure you environment is up, get the package.json, GruntFile.js file. In GruntFile.js you can specify what you want to pre-process. For example jade,Less,coffee. It looks very much like a node function, for sample you can refer to link
Now to make this work you also need to install various contrib plugins as per your requirement. Then register every single task in GruntFile.js. It really speeds up the development.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.registerTask('test', ['jade', 'less','coffee']);
So to process less,jade,coffee, we need to run the module installations such as
npm install grunt --save-dev
npm install grunt <module name> --save-dev
There are many more interesting configurations to learn and documentation is really nice, please refer to getting started guide
This adds the required Grunt and grunt plugins to package.json