Skip to content

Commit

Permalink
Install and build components on npm post install
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiandouce committed Jul 29, 2013
1 parent 3aba61b commit 5d71152
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18,844 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ npm-debug.log
node_modules

components
public/app*

*.DS_Store
config*.json
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ run: packages

packages:
@echo "Installing dependencies..."
@npm install
@echo "Done.\n"
@echo "Installing components..."
@./node_modules/component/bin/component install
@npm install 2>&1 | grep -v "npm WARN"
# @echo "Done.\n"
# @echo "Installing components..."
# @./node_modules/component/bin/component install
# @echo "Compiling components to ./public..."
# @./bin/demenred build
@echo "Done.\n"

clean:
Expand Down
1 change: 1 addition & 0 deletions bin/demenred
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ var program = require('commander');

program
.version('0.0.1')
.command('build', "Builds client application and compile assets.")
.command('db', "Install a development database")
.parse(process.argv)
20 changes: 20 additions & 0 deletions bin/demenred-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var Builder = require('component-builder');
var templates = require('../lib/build/templates');
var fs = require('fs');
var write = fs.writeFileSync;

var builder = new Builder('.');
builder.addLookup('lib'); // TODO: shouldn't be necessary
builder.copyAssetsTo('public');
builder.use(templates);
builder.build(function(err, res){
if (err) return console.log(err);
write('public/app.js', res.require + res.js);
write('public/app.css', res.css);
});
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"debug": "*",
"nowww": "*",
"component": "~0.16.7",
"component-builder": "~0.8.2",
"component-builder": "~0.8.3",
"string-to-js": "0.0.1",
"passport": "~0.1.17",
"passport-local": "~0.1.6",
Expand All @@ -45,7 +45,7 @@
"imap": "*",
"marked": "~0.2.9",
"commander": "~2.0.0",
"truncate" :"*"
"truncate": "*"
},
"devDependencies": {},
"main": "pdr",
Expand All @@ -54,6 +54,7 @@
"npm": "1.1.x"
},
"scripts": {
"test": ""
"test": "",
"install": "./node_modules/component/bin/component-install && ./bin/demenred-build"
}
}
Loading

0 comments on commit 5d71152

Please sign in to comment.