Skip to content
Browse files

- add JSHint for ensuring we didn't break this mo'

  • Loading branch information...
1 parent 11be388 commit f673fc0876d58aa1d32ebba75527e06768452d0b @ded ded committed Sep 16, 2011
Showing with 45 additions and 13 deletions.
  1. +1 −0 .gitignore
  2. +4 −0 Makefile
  3. +3 −3 README.md
  4. +1 −1 ender.js
  5. +24 −0 make.js
  6. +12 −9 package.json
View
1 .gitignore
@@ -0,0 +1 @@
+node_modules
View
4 Makefile
@@ -0,0 +1,4 @@
+.PHONY: boosh
+
+boosh:
+ node make.js
View
6 README.md
@@ -68,7 +68,7 @@ If you're building a Mobile Webkit or Android application, it may be a good idea
$._select = function (selector, root) {
return (root || document).querySelectorAll(selector);
- };
+ }
<h3>CommonJS like Module system</h3>
@@ -77,11 +77,11 @@ Ender exposes a module API which is based on CommonJS Modules spec v1.1.1. There
The first method is require. Require takes a string which corresponds to a package name and returns a package object. For example:
- var _ = require('underscore'); //return the underscore object
+ var _ = require('underscore') //return the underscore object
To register a package use the provide method. The provide method looks like this:
- provide("myPackage", myPackageObj);
+ provide("myPackage", myPackageObj)
These methods are particularly useful when working with microlibs which are already CommonJS compliant (like underscore, backbone, etc.). It is also great when you run into libs who are competing for the same namespace. So for example, if microlib "foo" and microlib "bar" both expose a method <code>baz</code> -- you could use require to gain access to the method being overridden -- as well as set which method you would prefer to be on ender's internal chain... for example:
View
2 ender.js
@@ -25,7 +25,7 @@
}
function provide (name, what) {
- return modules[name] = what
+ return (modules[name] = what)
}
context['provide'] = provide
View
24 make.js
@@ -0,0 +1,24 @@
+require('smoosh').config({
+ "JAVASCRIPT": {
+ "DIST_DIR": "./"
+ , "ender": ["./ender.js"]
+ }
+ , "JSHINT_OPTS": {
+ "boss": true
+ , "forin": false
+ , "curly": false
+ , "debug": false
+ , "devel": false
+ , "evil": false
+ , "regexp": false
+ , "undef": false
+ , "sub": true
+ , "white": false
+ , "indent": 2
+ , "whitespace": true
+ , "asi": true
+ , "laxbreak": true
+ , "eqeqeq": false
+ , "eqnull": true
+ }
+}).run().analyze()
View
21 package.json
@@ -1,12 +1,15 @@
{
- "name": "ender-js",
- "description": "no-library library",
- "version": "0.3.2",
- "authors": ["Dustin Diaz <@ded>", "Jacob Thornton <@fat>"],
- "keywords": ["ender", "modules", "library", "framework", "packager"],
- "main": "./ender.js",
- "homepage": "http://ender.no.de",
- "engines": {
- "node": ">= 0.4.0"
+ "name": "ender-js"
+ , "description": "no-library library"
+ , "version": "0.3.2"
+ , "authors": ["Dustin Diaz <@ded>", "Jacob Thornton <@fat>"]
+ , "keywords": ["ender", "modules", "library", "framework", "packager"]
+ , "main": "./ender.js"
+ , "homepage": "http://ender.no.de"
+ , "engines": {
+ "node": ">= 0.4.0"
+ }
+ , "devDependencies": {
+ "smoosh": "*"
}
}

0 comments on commit f673fc0

Please sign in to comment.
Something went wrong with that request. Please try again.