Permalink
Browse files

some reorganizing to prepare for NPM packaging

  • Loading branch information...
1 parent 0aec79c commit aede2abe81071380153377c3bb0090047a34b822 chris committed Feb 28, 2012
View
@@ -0,0 +1,3 @@
+node_modules
+services
+kernel.config.json
File renamed without changes.
@@ -1,3 +1,5 @@
+#!/usr/bin/env node
+
// requirements
var _ = require('underscore')
,util = require('util')
@@ -8,11 +10,11 @@ var _ = require('underscore')
var CONFIG = JSON.parse(fs.readFileSync('kernel.config.json'));
// load core modules
-var eSites = require('./lib/sites.js').createSites(CONFIG.sites);
-var eServices = require('./lib/services.js').createServices(eSites, CONFIG.services);
+var eSites = require('../kernel-lib/sites.js').createSites(CONFIG.sites);
+var eServices = require('../kernel-lib/services.js').createServices(eSites, CONFIG.services);
// instantiate management server
-var eManagementServer = require('./lib/server.js').createServer({
+var eManagementServer = require('../kernel-lib/server.js').createServer({
sites: eSites
,services: eServices
}, CONFIG.server);
File renamed without changes.
@@ -19,7 +19,7 @@ exports.server = function(paths, options) {
me.options = options || {};
me.options.host = me.options.host || '0.0.0.0';
me.options.port = me.options.port || 1337;
- me.options.staticDir = me.options.staticDir || './www';
+ me.options.staticDir = me.options.staticDir || './kernel-www';
// initialize state
}
@@ -15,11 +15,15 @@ exports.ServicesController = function(sites, options) {
// initialize options and apply defaults
me.options = options || {};
me.options.plugins = me.options.plugins || {};
- me.options.logsDir = me.options.logsDir || '/emergence/logs';
- me.options.configDir = me.options.configDir || '/emergence/kernel/etc';
- me.options.runDir = me.options.runDir || '/emergence/kernel/run';
+ me.options.servicesDir = me.options.servicesDir || '/emergence/services';
+ me.options.logsDir = me.options.logsDir || me.options.servicesDir+'/logs';
+ me.options.configDir = me.options.configDir || me.options.servicesDir+'/etc';
+ me.options.runDir = me.options.runDir || me.options.servicesDir+'/run';
// create required directories
+ if(!path.existsSync(me.options.servicesDir))
+ fs.mkdirSync(me.options.servicesDir, 0775);
+
if(!path.existsSync(me.options.logsDir))
fs.mkdirSync(me.options.logsDir, 0775);
@@ -3,8 +3,7 @@ var _ = require('underscore')
,path = require('path')
,util = require('util')
,spawn = require('child_process').spawn
- ,exec = require('child_process').exec
- ,MysqlClient = require('mysql').Client;
+ ,exec = require('child_process').exec;
exports.createService = function(name, controller, options) {
return new exports.mysql(name, controller, options);
@@ -36,11 +35,11 @@ exports.mysql = function(name, controller, options) {
}
// instantiate MySQL client
- me.client = new MysqlClient();
- //me.client.database = 'information_schema';
- me.client.user = me.options.managerUser;
- me.client.password = me.options.managerPassword;
- me.client.port = me.options.socketPath;
+ me.client = require('mysql').createClient({
+ port: me.options.socketPath
+ ,user: me.options.managerUser
+ ,password: me.options.managerPassword
+ });
// check for existing mysqld process
if(path.existsSync(me.options.pidPath))
@@ -228,6 +227,8 @@ exports.mysql.prototype.makeConfig = function() {
exports.mysql.prototype.connectClient = function() {
var me = this;
+ // new mysql client does this automatically now... this routine will probably be removed soon
+/*
me.client.connect(function(error, results) {
if(error)
{
@@ -237,6 +238,7 @@ exports.mysql.prototype.connectClient = function() {
}
console.log(me.name+': mysql client connected');
});
+*/
};
exports.mysql.prototype.onSiteCreated = function(siteData) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -85,6 +85,7 @@ Ext.define('eMan.view.site.CreateForm', {
fields: ['hostname', 'key']
,data: [
{hostname: 'skeleton.mics.me', key: 'm6Q136L0mDsWmShJ'}
+ ,{hostname: 'skeleton.emr.ge', key: '8U6kydil36bl3vlJ'}
]
})
,listeners: {
@@ -94,6 +95,7 @@ Ext.define('eMan.view.site.CreateForm', {
if(hostField.getValue())
{
+ console.log('isHidden?', !keyField.isHidden());
if(!keyField.isHidden())
{
keyField.show();
File renamed without changes.
File renamed without changes.
View
@@ -1,7 +1,14 @@
{
"name": "emergence",
+ "preferGlobal": "true",
"version": "0.0.1",
+ "license": "MIT",
"dependencies": {
- "underscore": "1.3.1"
+ "underscore": "1.3.x",
+ "mysql": "0.9.x",
+ "node-static": "0.5.x"
+ },
+ "bin": {
+ "emergence-kernel": "./bin/kernel"
}
}

0 comments on commit aede2ab

Please sign in to comment.