There are many undocumented best practices and workflow improvements for developing in Sails that contributors have established over the years. This section is an attempt to document some of the basics, but be sure and pop into Gitter if you ever have a question about how to set things up or want to share your own tool chain.
The best way to work with Sails core is to fork the repository, git clone
it to your filesystem, and then run npm link
. In addition to writing tests, you'll often want to use a sample project as a harness; to do that, cd
into the sample app and run npm link sails
. This will create a symbolic link in the node_modules
directory of your sample app that points to your local cloned version of Sails. This keeps you from having to copy the framework over every time you make a change. You can force your sample app to use the local Sails dependency by running node app
instead of sails lift
(although sails lift
should use the local dependency, if one exists). If you need to test the command line tool this way, you can access it from your sample app as node node_modules/sails/bin/sails
. For example, if you were working on sails new
, and you wanted to test it manually, you could run node node_modules/sails/bin/sails new testProj
.
Release | Install Command | Build Status |
---|---|---|
latest | npm install sails |
Stable |
edge | npm install sails@git://github.com/balderdashy/sails.git |
In general, you can npm install
Sails directly from Github as follows:
# Install an unreleased branch of Sails in the current directory's `node_modules`
$ npm install sails@git://github.com/balderdashy/sails.git#nameOfDesiredBranch
This is useful for testing/installing hot-fixes and just a good thing to know how to do in general.
master
).