lazy-alloy
Write Alloy apps in coffee-script, jade and coffee-css
Last updated 6 years ago by zzzwww .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lazy-alloy 
SYNC missed versions from official npm registry.

lazy-alloy

lazy-alloy is a CoffeeScript & Jade preprocessor for Titanium Alloy Framework.

##What does it do?

It makes you write a tiny bit less code. Perhaps also a bit more readable (¿¿¿) code as well.

Compile from sourcefile To alloy readable output
src/controllers/{{name}}.coffee app/controllers/{{name}}.js
src/styles/{{name}}.coffee app/styles/{{name}}.tss
src/views/{{name}}.jade app/views/{{name}}.xml
src/models/{{name}}.coffee app/models/{{name}}.js
src/lib/{{name}}.coffee app/lib/{{name}}.js

Also, it will compile your widgets from src/widgets stored in the following directories.

From To
src/widgets/{{name}}/controllers/*.coffee app/widgets/{{name}}/controllers/*.js
src/widgets/{{name}}/styles/*.coffee app/widgets/{{name}}/styles/*.tss
src/widgets/{{name}}/views/*.jade app/widgets/{{name}}/views/*.xml

Inspired by coffee-alloy but eventually grew out of its box. Feel free to improve.

Usage

Dependencies

  • nodejs
  • npm
  • titanium (cli)
  • alloy
  • brain (optional)

Installation

  1. Install Titanium Alloy Framework.
  2. npm install -g lazy-alloy

Note regarding the *.coffee –> *.tss conversion

The files need to be valid coffee-script objects; thus the first line of these files needs to be a variable assignment like the following

tss =
  ".container":
    backgroundColor: "red"

  "Label":
	width: Ti.UI.SIZE
	height: Ti.UI.SIZE
	color: "#fff"

Its output will look like this:

".container": {
  backgroundColor: "red"
},
"Label": {
  width: Ti.UI.SIZE,
  height: Ti.UI.SIZE,
  color: "#fff"
}

Perhaps something like stylus would be a better fit for this kind of job. Feel free to help us improve this section!

###Options Usage: lazyalloy [COMMAND] [OPTIONS]

Commands:

  compile                Just compile.
  watch                  Watch file changes & compile.
  build <platform>       Run titanium on `platform`
  new                    Setup the lazy-alloy directory structure.
  generate <type> <name> Generate a new (lazy-)alloy type such as a controller.

Options:

  -h, --help                 output usage information
  -V, --version              output the version number
  -p, --platform [platform]  (watch) When done, run titanium on `platform`
  -d, --directory [dirname]  Set source directory (default `src/`)

AFRICA!

Current Tags

  • 0.0.7                                ...           latest (6 years ago)

7 Versions

  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           7 years ago
  • 0.0.4                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 10
Dependencies (8)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |