Installation and project setup. You'll be coding in minutes.
Mimosa is a NPM module and so it must be used with node.js or io.js. Mimosa is tested against node v0.10, v0.12 and the latest io.js, so you will need to download and install one of those.
Use npm to install Mimosa.
$ npm install -g mimosa
The -g
flag installs Mimosa globally so it can be run from the command line anywhere. You may need to use sudo
to install this depending on your system's setup.
You've got four choices all detailed below. Which you choose depends on where you want to start.
mimosa new
command?If you want to build an app from scratch, or just play around with Mimosa, start here.
Inside the desired folder, create an app by executing mimosa new
.
$ mimosa new nameOfApplicationHere
Follow the prompts and choose the desired transpilers/pre-processors, server, and server view technologies. If you aren't sure which ones to choose, that's perfect. Mimosa is a great tool to learn them.
Change into the directory that was created and execute:
$ mimosa watch --server
Navigate to http://localhost:3000 in a browser to see the sample app. Mimosa will watch the assets directory of the project and compile changed files to the public directory. The web app serves assets in the public directory.
All set! To get the project started, Mimosa has delivered a bare bones web app with some code using the chosen technologies. Head over to the Commands tab to learn how to interact with Mimosa. If you want to play around with something meatier than the codebase that mimosa new
delivers, try out a demo app.
If you want to use Mimosa with an existing app, start here.
Inside your project, create a mimosa-config.js
file. To start, the contents of the file should look like this:
exports.config = { "modules": [] }
The next step is to marry your project with Mimosa's defaults by changing either the config or your project. For instance, if you keep your code in a src
directory instead of an assets
directory, something will need to change because by default Mimosa expects an assets
directory.
Then you need to decide what modules you want to use. There are plenty! For starters, you probably need the copy compiler which performs the simple task of copying files of certain types from assets
to public
where compiled code lives. To add the copy compiler, simply add the string "copy"
to the modules
array.
Execute mimosa watch
and Mimosa will build and watch project assets. Mimosa will generate errors if something is wrong with the config.
A skeleton is a small application that includes and configures a group of UI libraries and technologies along with the necessary Mimosa modules and configuration to get you started.
Mimosa maintains a "skeleton registry" that you can pull from to start your application. From the command line execute mimosa skel:list
to get a list of pre-built skeletons. Follow the instructions to install one of your choosing!
Mimosa needs more skeletons! Check out the documentation and whip something up real quick using the technologies you love so that others can benefit.
Before creating your own app, play around with someone else's! Download an app from GitHub and use Mimosa's command line interface to play with the code and get comfortable with Mimosa and the technologies inside the demo apps.
As more demo apps are built, they'll get added here. If you put a little something together using Mimosa let us know so we can add it to the list! Either open an issue or shoot a message to @mimosajs.