Permalink
Browse files

removed console.logs, added comments

  • Loading branch information...
1 parent 4bccadf commit 556d410e9156737868b9d618011dd3b370998fee @rowoot committed Jul 1, 2012
Showing with 8 additions and 61 deletions.
  1. +0 −56 README
  2. +6 −3 bower.js
  3. +2 −2 index.html
View
56 README
@@ -1,56 +0,0 @@
-README bower.plugin
-===================
-
-1. Install all the dependencies using `bower install`
-2. If you need to add new libraries/dependencies (lib/dep) to the project,
- add in browser.json and run bower install. Voila,
- you`ll get access to that lib/dep
-
-Example:
-
- /* browser.json */
- {
- "name": "test-app",
- "version": "0.0.1",
-
- // Requires JS, config settings defined in browser.json
- "app": {
- "baseUrl": "/assets/js", // Define app assets directory
- "start": ["app"], // Define app start file
- "paths": {
- "jquery": "/browser_modules/jquery/index"
- }
- },
-
- // can be accessed directly via requirejs
- "dependencies": {
- "jquery" : "*",
- "underscore" : "*",
- "backbone": "*"
- }
- }
-
- /* assets/js/app.js */
- define('app',
- ['require',
- 'jquery',
- 'underscore',
- 'backbone'], function ( require ) {
- // Loaded ! Booyah !
- });
-
- /* index.html */
- <script data-main='bower' src='require.js'></script>
-
-About the plugin
-================
-Simple glue plugin to automatically expose lib/deps added in browser.json
-to the requirejs framework to be used.
-
-
-TODO
-====
-1. r.js build script to utilize the same mechanism.
-2. Better way of figuring out library/script dependencies with each other
-perhaps merge all `browser.json` from all the scripts and add them as libraries
-for require js config
View
9 bower.js
@@ -8,8 +8,11 @@ define('bower', ['text!browser.json'], function ( opts ) {
'paths': {}
};
- console.log(app);
-
+ // A better way to build paths config for all dependencies
+ // Example: Backbone depends on Underscore, jQuery
+ // what if user has no included underscore in his browser.json
+ // Todo: Automatically resolve dependencies of dependencies
+ // and add it to the config paths
for ( prop in dependencies ) {
if( !dependencies.hasOwnProperty( prop ) ) return;
if ( app.paths[prop] ) {
@@ -19,7 +22,7 @@ define('bower', ['text!browser.json'], function ( opts ) {
}
}
+ // Need to write a much robust solution with error checking
require.config(config)
-
require({'baseUrl': app.baseUrl}, app.start)
});
View
4 index.html
@@ -1,5 +1,5 @@
-<html>
-
+<!doctype>
+<html>
<head>
<title>Hello world</title>
</head>

0 comments on commit 556d410

Please sign in to comment.