1.2.1 • Published 7 years ago

amaris v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Amaris

Minimalist scaffolding for quick, MEAN apps.

Installation

Use amaris from the command line, by installing it globally like so:

sudo npm install -g amaris

Overview

Amaris is a node-based tool to quickly and easily create blank project templates, and then create instances of those projects with a single command. Setup your project "blueprint" however you like, and then Amaris will do all the work of setting up new projects using the given "blueprint".

Basics

Call an existing blueprint on the command line:

amaris <name-of-blueprint> [<blueprint-required-arg>...]

...and Amaris will build an empty project from your template in the current working directory.

For example, Amaris comes with an "angular" and "basic" blueprint to start. It requires name and author parameters. Pass them with the -n and -a arguments, respectively.

amaris frontend -n 'MyApp' -a 'Dominic Cobb <dom@cobolengineering.com>'

First, Amaris checks its /blueprints directory for a match to your specified blueprint, which in this case is 'frontend'. It require()s a file inside called amaris.config.js, which contains the specific configuration for Amaris to recreate the project.

Here's an example amaris.config.js

module.exports = {
  name: 'example-blueprint',
  description: 'An example app with simple website setup.',
  require: ['name', 'author'],
  mkdir: ['js', 'html', 'css', 'assets/photos'],
  copy: [
    'index.html',
    'bower.json',
    'gulpfile.js',
    'package.json',
    'js/myScript.js',
    'css/stylesheet.css'
  ],
  bower: {
    deps: ['jquery'],
    devDeps: ['compass']
  },
  npm: {
    deps: ['asdf']
  },
  commands: ['gulp']
}

If the required paramaters have been passed, Amaris starts with creating the directories specified in mkdir. Nested folders here are allowed, and do not require that parent folders be created beforehand (in the above example, the 'assets' folder is created automatically and populated with a 'photos' folder).

Next, Amaris copies the files specified in copy from the blueprint's directory to your working directory, overwriting any existing files of the same name. This is where you may make use of the parameters required in your configuration. The file contents of all copied files are processed to resolve parameterized variables using ERB syntax. For example, your index.html file might include the following line:

<title><%= name %></title>

If you pass -n Supercool when you call Amaris, "Supercool" will be used as the name, and replace all instances of <%= name %> in your code. This will result in the following line in your new project's index.html file:

<title>Supercool</title>

Next, Amaris installs the necessary NPM Dependencies and Development Dependencies, as specified in the configuration's npm.deps and npm.devDeps arrays. Note: a package.json file is not automatically created in the new directory, so make sure one is created before using Amaris, or, better yet, include one as part of the copy process above. Then, this process is repeated for Bower, using bower.deps and bower.devDeps.

Finally, any commands listed in the commands array are executed in their given order.