This code is under very active development! Don't use it until this message has been removed from the readme!
Commands for developing, installing, and generally working with Sndicate front-end modules
This tool requires Node >=0.10.30 and grunt-cli (
npm install -g grunt-cli for development)
$ npm install -g sndicate-js
Or build from scratch:
$ git clone https://github.com/Sndicate/sndicate-js.git && cd $_ $ npm install $ grunt build
That's it. The build step will take care of running
npm link so you can run the executable.
It is recommended that all theme developers include sndicate-js as a dependency in their themes. Including this package gives end users and developers access to the
sndjs executable which exposes commands for installing and generally working with third party themes. See the command list below.
The sndicate-js binary exposes an
sndjs command with the following actions and flags that can be used by developers when working on any front-end Sndicate modules slated for inclusion in sndicate-core. This utility is slated to become a dependency of Plastic Icicle and sndicate-dash so there will be no need to install it when working on those projects.
All commands must be run within the root of your module or theme.
package command will prepare a module for production and move it into the correct directory in your Sndicate installation's root.
Arguments and flags:
mode(Optional) - The type of module you are packaging. Options are
module. Defaults to
dist(Optional) - The name of the folder containing your built files (as a result of a Grunt or other build task, for example). Defaults to
installPath(Required) - The path to your Sndicate installation
# Packaging a theme sndjs package ../path/to/sndicate-core # Packaging a module sndjs package module ../path/to/sndicate-core
The following happens in order when running this command:
package.jsonfile from which it generates a valid
_sndManifestobject to your
package.jsonfile. TODO: Document _sndManifest and link to theme docs
distfolder containing your final built theme to
/path/to/sndicate-core/themes/your-theme-name(if type is module, the folder is copied to the corresponding path for the module type)
generate command creates a project skeleton for themes and generic modules with minimal boilerplate code, default directory structure, and required files. Settings for directory structure and some other settings can be overridden in the
_sndManifest object in
package.json after creation. TODO: Document module manifests.
Arguments and flags:
type(Optional) - The type of module to generate. Defaults to theme
name- The name of the module to generate (like the Rails generator or sort of like what Yeoman provides)
When generating a package you will be asked a few questions. Your answers to these will generate a valid
package.json file that's compatible with npm with an additional
_sndManifest object containing information needed to package your module when you're ready to publish it. Note that this is where you'll be able to override some module defaults. Once installed you'll be asked to run two commands (
cd into your new project and run
TODO: Write documentation
Check out Contributing.md for more on this.