Skip to content

Commit

Permalink
Merge branch 'master' of github.com:azproduction/lmd
Browse files Browse the repository at this point in the history
  • Loading branch information
azproduction committed Dec 11, 2012
2 parents 20fd4e6 + 45dd637 commit 5c689d7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
25 changes: 21 additions & 4 deletions README.md
Expand Up @@ -7,9 +7,10 @@ LMD is inspired by AMD and provides similar module interface
## Why LMD? Why not AMD (RequireJS)? ## Why LMD? Why not AMD (RequireJS)?


- Module design is similar to Node.js - Module design is similar to Node.js
- Actually LMD can work with any JavaScript modules
- There is no define wrapper! - There is no define wrapper!
- You can use node modules without dirty hacks like `typeof exports ? :` - You can use node modules without dirty hacks like `typeof exports ? :`
- But you can use old-school function-wrapped-modules. Like IEFE? - Good! - But you can use old-school function-wrapped-modules. Like IIFE? - Good!
- You can use strings as string without any "template" plugins - You can use strings as string without any "template" plugins
- You can use JSON file as Object - You can use JSON file as Object
- Total and honest isolation - Total and honest isolation
Expand Down Expand Up @@ -47,6 +48,22 @@ LMD is inspired by AMD and provides similar module interface
- Can load CSS - Can load CSS
- Can work with Node.js and Worker environment - Can work with Node.js and Worker environment



## What's on the board

* All builders/loaders stuff bla-bla-bla
* Build Analyzer (1-click code coverage, depends, startup perfomance)

![](https://raw.github.com/azproduction/lmd/master/images/coverage_package.png)

* Smart and simple CLI tool

![](https://raw.github.com/azproduction/lmd/master/images/lmd_cli.png)

* GUI for LMD (in development)

![](https://raw.github.com/azproduction/lmd/master/images/lmd_gui_prototype.png)

## Other features ## Other features


1. Modules are similar to AMD: there is a require, but no define 1. Modules are similar to AMD: there is a require, but no define
Expand Down Expand Up @@ -114,15 +131,15 @@ See [LMD CLI](https://github.com/azproduction/lmd/blob/master/docs/cli.md)


## Grunt integration and task ## Grunt integration and task


Install this grunt plugin next to your project's [grunt.js gruntfile](https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md) with: `npm install grunt-contrib-lmd` Install this grunt plugin next to your project's [grunt.js gruntfile](https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md) with: `npm install grunt-lmd`


Then add this line to your project's `grunt.js` gruntfile: Then add this line to your project's `grunt.js` gruntfile:


```javascript ```javascript
grunt.loadNpmTasks('grunt-contrib-lmd'); grunt.loadNpmTasks('grunt-lmd');
``` ```


See [grunt-contrib-lmd](https://github.com/azproduction/grunt-contrib-lmd) for details See [grunt-lmd](https://github.com/azproduction/grunt-lmd) for details


## Running tests ## Running tests


Expand Down
14 changes: 7 additions & 7 deletions docs/getting_started.md
Expand Up @@ -2,7 +2,7 @@


```bash ```bash
# Your dir structure is # Your dir structure is
+-gettring_started/ +-getting_started/
+-i18n/ +-i18n/
| +-en.json | +-en.json
+-js/ +-js/
Expand All @@ -11,7 +11,7 @@
| +-name.html | +-name.html
+-index.html +-index.html


# 0. install LMD # 0. Install LMD
npm install lmd -g npm install lmd -g


# 1. List all files # 1. List all files
Expand Down Expand Up @@ -59,7 +59,7 @@ $ cat .lmd/index.lmd.json
"main": "main" "main": "main"
} }


# 4. Lets add our modules # 4. Let's add our modules
$ lmd up index --modules.main=js/main.js --modules.i18n=i18n/en.json --modules.name=tpls/name.html $ lmd up index --modules.main=js/main.js --modules.i18n=i18n/en.json --modules.name=tpls/name.html
info: info:
info: Build `index` (.lmd/index.lmd.json) updated info: Build `index` (.lmd/index.lmd.json) updated
Expand All @@ -69,7 +69,7 @@ info:
info: modules {"main":"js/main.js","i18n":"i18n/en.json","template":"tpls/name.html"} info: modules {"main":"js/main.js","i18n":"i18n/en.json","template":"tpls/name.html"}
info: info:


# 5. Lets tweak a bit: desable ie optimisations, enable, verbose logs, warnings and module compression # 5. Let's tweak a bit: disable ie optimisations, enable verbose logs, warnings and module compression
$ lmd up index --no-ie --warn --log --pack --no-lazy $ lmd up index --no-ie --warn --log --pack --no-lazy
info: info:
info: Build `index` (.lmd/index.lmd.json) updated info: Build `index` (.lmd/index.lmd.json) updated
Expand All @@ -88,21 +88,21 @@ $ lmd build index
info: Building `index` (.lmd/index.lmd.json) info: Building `index` (.lmd/index.lmd.json)
info: Writing LMD Package to index.lmd.js info: Writing LMD Package to index.lmd.js


# 7. Lets start HTTP server and see results # 7. Let's start HTTP server and see results
$ http-server $ http-server
Starting up http-server, serving ./ on port: 8080 Starting up http-server, serving ./ on port: 8080
http-server successfully started: http://localhost:8080 http-server successfully started: http://localhost:8080
Hit CTRL-C to stop the server Hit CTRL-C to stop the server


# 8. Lets start LMD Watcher # 8. Let's start LMD Watcher
$ lmd watch index $ lmd watch index
info: Now watching 4 module files. Ctrl+C to stop info: Now watching 4 module files. Ctrl+C to stop
info: Rebuilding... info: Rebuilding...
info: Writing LMD Package to index.lmd.js info: Writing LMD Package to index.lmd.js


# 9. Change i18n/en.json a bit... # 9. Change i18n/en.json a bit...


# 10. And wuala! LMD Watcher automatically rebuilds your index.lmd.js file # 10. And voila! LMD Watcher automatically rebuilds your index.lmd.js file
info: Change detected in en.json at Thu Oct 25 2012 22:11:19 GMT+0600 (ALMT) Rebuilding... info: Change detected in en.json at Thu Oct 25 2012 22:11:19 GMT+0600 (ALMT) Rebuilding...
info: Writing LMD Package to index.lmd.js info: Writing LMD Package to index.lmd.js


Expand Down
Binary file added images/lmd_cli.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/lmd_gui_prototype.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c689d7

Please sign in to comment.