bundle the sails application into single executable - sails.js

Need help to compile the sails project into single executable(exe) for windows and linux. I already tried with pkg and nexe. Both working with single js file, But not working with sails project.
Need your help guys

Related

Is adapter.js in sails.js present by default?

First of all sorry. i know this would be a silly question, but i am very confused. and need an answer.
Question
I am making a project in sails.js.After running the "sails new myNewProject" command when i looked into the default modules that are formed i could not find the api/adapter in it.
so, i would like to know whether this adapter is created automatically or we will have to create it manually??
Thanks.
The api/adapters directory is not created by default on new projects.
If you need to build a custom adapter, you can start with sails generate adapter myAdapterName, which will create the api/adapters folder for you along with boilerplate files for the new adapter under api/adapters/myAdapterName.
If you're just looking to use one of the existing adapters like sails-mysql, you don't need the api/adapters folder at all. Just use npm to install it in your project:
npm install sails-mysql
A list of more available adapters is here.

phonegap cordova unable to locate blackberry-nativepackager

I am trying to create a blackberry10 project with phonegap cordova command line tool. I am following through the phonegap document (http://cordova.apache.org/docs/en/2.9.0/guide_cli_index.md.html#The%20Cordova%20Command-line%20Interface) but keep running into the same problem.
When I run "cordova platform add blackberry10" in the terminal, it returns [Error: blackberry-nativepackager cannot be found on the path. Aborting]
Does anyone know why and what am I missing? Why is it trying to locate the blackberry-nativepackager, instead of the webwork sdk?
All I want to do its just loading up an external url in bb10. Any better suggestion? Does anyone has any good tutorial/walkthrough on how to create a blackberry10 project?
I'm pretty sure the nativepackager thing is needed to create a package, even with WebWorks. You'll find it in $BBNDK/host_10_x_xx_xxxx/linux/x86/usr/bin/blackberry-nativepackager (adapt to your OS). You'll need to add this folder to your path. Doing this depends on your OS.
The easiest way to do this is to run the bbndk-env script, located in your NDK root directory.
Here's some updated documentation to align with Cordova 3.0. It will cover all the steps needed (including the NDK setup, which seems to be currently missing in your environment).
http://cordova.apache.org/docs/en/3.0.0/guide_platforms_blackberry10_index.md.html#BlackBerry%2010%20Platform%20Guide

Play framework 2 with sass and compass config file

I am testing stuff with scala, play framework 2.1.1 and I wanted to add sass with compass stylesheets using the compass plugin "compass-normalizer". For the sass part I am using the jlitola plugin.
I already got play working with sass and compass but using compass plugins has proven to be a nightmare for me. I have tried adding it as a ruby requirement:
SassPlugin.sassOptions := Seq("--compass","-r","compass-normalizer")
This was just a try and obviously didn't work because normalizer needs compass to be already initialized, however I can make it work from the terminal if I have the contrib.rb compass config file where I call sass #sassfile# --compass.
In that way of thinking I tried adding the contrib.rb file in the play project with no luck. I tried to add it to the app, conf and project folders with the same luck in all of them.
Can someone tell me what am I doing wrong?
It looks like it's just using the "current working directory" when running (see: https://github.com/jlitola/play-sass/blob/master/src/main/scala/SassCompiler.scala#L16). This is using a shady implicit to convert the Seq[String] => ProcessBuilder.
So, you may be able to put the contrib.rb file in the default directory (should be where you're running sbt from) and have the work. If not, according to the JVM docs:
The default value is the current working directory of the current process, usually the directory named by the system property user.dir.
So you could make a task that prints this in sbt to see what it is:
TaskKey[Unit]("show-user-dir") := println(sys.props("user.dir")

Using Soap in Shared Mono Library for WP 7 and Android

I'm currently working on an shared library based on mono, where I want to put as much business logic of my app as possible.
I used this helpful tutorial.
I managed putting the whole logic for rest-requests in this shared library, but now I'm stuck with soap.
I used the wsdl command of mono to generate Client Stubcode from my wsdl (as described here http://www.mono-project.com/Web_Services).
When I put the generated class to my C# library, which is the root project of my shared library, there is a warning that the Reference to System.Web.Services cannot be found.
So I included the System.Web.Services.dll manually.
For the Android Library Project I added a Reference to ...\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Web.Services.dll. It compiles without warnings.
But now it comes to the Windows Phone Library Project.
There is no System.Web.Services.dll for WP 7.5, right? I tried with the Mono-Touch dll but it gives me a lot compilation Errors.
Someone knows how I can get out of this?
I actually had some issues with the generated WSDL myself. Turns out that the classes that were generated through the "Create Web Reference" piece of Visual Studio inside of a Mono for Android project ended up causing some big issues when connected to a WCF Web Service. Not sure where I ran into this information, but this is what I ended up doing.
What you need to do is manually create a Service Reference using the SILVERLIGHT SVCUtil.
On my development system it was located here:
C:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Tools
I called it with the below command line:
slsvcutil.exe http://localhost/<path to WCF service endpoint>/service.svc /directory:"<temp directory to store generated cs file>" /noConfig /namespace:"*,<Full namespace of the generated class>"
That will actually generate a CS file that is saved into the path specified by the /directory tag above. Copy that generated cs file to your project directory and then include it in the project.
The problem that I was having that forced me to look for another option was that I was able to pull the data properly using the WSDL generated through the "Add Web Reference" option in Visual Studio, but as soon as I tried to pass the data back up the wire to the web service, everything blew up. Using the Service Reference generated by the Silverlight Service Util actually generated all the code properly for Async operations and after learning how to properly manage those Async operations everything works like a dream.
Since you are generating this new WSDL using the Silverlight Utility, it should work just fine through Windows Phone 7. I believe that the DLL to reference for all of this is the System.ServiceModel dll.
I wish I could remember where I ran across this information, as I would like to give the original author credit, but unfortunately, I don't recall that.
Hope that helps out!
Chaitanya Marvici

What is the deployment workflow if using CoffeeScript and an IDE for developing a web application?

I've just picked up CoffeeScript and I'm struggling to understand the deployment workflow. It seems you constantly have to compile the .coffee files before using them. (Yes, I'm aware that you can have it embedded in the browser, but that's not recommended for production applications).
Does one have to constantly (manually) compile the files before deploying? (For example, if using Eclipse, a simple Ctrl+S saves and deploys the .war/.ear on the local machine's server.) Do we have to change the build scripts (for a central, possible CI server) for deploying .coffee files? Is there anyway to have integrated compiling via the IDEs (Eclipse/Netbeans)
Any ideas/pointers/examples on this? How/what have you used in the past?
I call browserify in my Cakefile to pre-compile and package my CoffeeScript for the browser. For an example of how I call browserify as well as coffeedoc and coffeedoctest take a look at the Cakefile for my Lumenize project.
If you are using express or some other node based server, you can have your CoffeeScript compiled at request time, using tools like NibJS or as described in The Little Book on CoffeeScript (Applications chapter), you can use Stitch. BTW, I highly recommend, The Little Book. The "Compiling" chapter has information about Cake and compiling that might help you.
Yes, you should have a build script. Most CoffeeScript projects use a Cakefile for this; see, for example, 37signals' pow. With a Cakefile, you can just run
cake build
from the command line to run the build task in the Cakefile.
You can run the Cakefile on a CI server, assuming that you have Node and CoffeeScript installed on that server.
Don't deploy the coffee files, use something like "coffee -cwj" to constantly watch and compile the .coffee files into javascript (.js) files and deploy those.
The options are c=compile, w=watch and j=join the files.
See the coffee-script web site for details of the options you can pass in.