UNPKG

4.64 kBMarkdownView Raw
1[![NPM version](https://badge.fury.io/js/compy.png)](http://badge.fury.io/js/compy)
2[![Dependency Status](https://gemnasium.com/edjafarov/compy.png)](https://gemnasium.com/edjafarov/compy)
3[![Build Status](https://travis-ci.org/edjafarov/compy.png?branch=master)](https://travis-ci.org/edjafarov/compy)
4compy - lightweight app builder/compiller
5=====
6Compy is a lightweight approach for developing web apps (framework/lib agnostic). Based on TJ's [component](https://github.com/component/component) package manager it allows you to install components and use them in your code right away.
7Compy makes your development fun by:
8
9* allowing you to use installed components without any configurations by just requiring them.
10* providing local ```require```
11* supporting coffeescript, sass, jade and other [plugins](#plugins)
12* giving you livereload with simple static server
13
14watch [screencast](http://www.youtube.com/watch?v=IYSPHvw2KSk) for details [some of functionality was changed in 0.1.3]
15
16##plugins
17compy can use component's [plugins](https://github.com/component/component/wiki/Plugins) to extend it's functionality. For example if you want to use coffee in your project, you need to ```npm install component-coffee``` in your project's folder.
18
19compy was tested with following plugins:
20- [rschmukler/component-stylus-plugin](https://github.com/rschmukler/component-stylus-plugin) — precompile stylus
21- [segmentio/component-jade](https://github.com/segmentio/component-jade) — precompile jade templates
22- [anthonyshort/component-coffee](https://github.com/anthonyshort/component-coffee) - require CoffeeScript files as scripts
23- [anthonyshort/component-sass](https://github.com/anthonyshort/component-sass) - compile Sass files using node-sass
24- [kewah/component-builder-handlebars](https://github.com/kewah/component-builder-handlebars) - precompile Handlebars templates
25- [ericgj/component-hogan](https://github.com/ericgj/component-hogan) - Mustache transpiler for component (using Hogan)
26- [segmentio/component-sass](https://github.com/segmentio/component-sass) — Sass transpiler for component
27- [segmentio/component-json](https://github.com/segmentio/component-json) — Require JSON files as Javascript.
28- [queckezz/component-roole](https://github.com/queckezz/component-roole) — Compile [Roole](http://roole.org) files
29- [bscomp/component-lesser](https://github.com/bscomp/component-lesser) - [LESS](https://github.com/less/less.js) transpiler for compy
30- [segmentio/component-markdown](https://github.com/segmentio/component-markdown) - Compile Markdown templates and make them available as Javascript strings.
31
32##install
33
34```$ npm install compy -g```
35
36## cli comands
37```
38 Usage: compy <command> [options]
39
40 Options:
41
42 -h, --help output usage information
43 -V, --version output the version number
44
45 Commands:
46
47 install [name ...] install dependencies or component
48 compile compile app (in dist folder by default)
49 build build the app (compile and minify sources)
50 server [watch] run static server. If "watch" option enabled - watch changes, recompile and push livereload
51 test run karma tests
52 watch watch and rebuild assets on change
53```
54## config
55The configuration for compy sits in package.json inside compy namespace. ```main``` is an entry point of your app and the only required property.
56
57```json
58{
59 "name": "appName",
60 "version": "0.0.0",
61 "description": "my awesome app",
62 "main": "index.js",
63 "license": "BSD",
64 "compy": {
65 "dependencies": {
66 "component/jquery": "*"
67 },
68 "main": "app.js"
69 }
70}
71```
72
73## what's about grunt?
74Compy is basically a grunt file that does all the magic. You can check it [here](https://github.com/edjafarov/compy/blob/master/Gruntfile.js)
75That also mean that is you want to use grunt in your project, you need to know some details.
76
77You can create local ```Grintfile.js``` inside your project. To run tasks though instead of ```grunt <taskname>``` you need to do ```compy <taskname>```
78
79There are ```compile``` and ```build``` tasks which you can extend/change. Original tasks have aliases ```compy-compile``` and ```compy-build``` ([src](https://github.com/edjafarov/compy/blob/588028693f1762cc1f59e9464f7824a2bdafd1ba/Gruntfile.js#L239-L241))
80
81So if you want to precompile something, your grunt file will look like:
82
83```javascript
84 ...
85 grunt.registerTask('compile',['<precompileTask>','compy-compile'])
86 ...
87```
88
89## license
90
91MIT
92