Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/browser-natives.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
, "Uint8Array"
, "atob"
, "btoa"
// http://www.jslint.com/lint.html#browser
// http://www.jslint.com/jslint.js
, "clearInterval"
, "clearTimeout"
, "document"
Expand Down
54 changes: 9 additions & 45 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"use strict";

var pakman = require('pakman')
//, pakman = require('../../node-pakman')
, fs = require('fs')
, path = require('path')
, nodeNatives = require('./node-natives.js')
Expand All @@ -14,20 +13,7 @@
function noop() {}

function Pakmanager() {
/*
function getEnvironment(params) {
var builtIns
;

if (params.environment === 'node') {
builtIns = nodeNatives;
} else {
builtIns = browserNatives;
}

return builtIns;
}
*/
}

Pakmanager.prototype.build = function (fn, params) {
Expand All @@ -39,21 +25,7 @@
;

fs.writeFile(outPath, outData, 'utf8', fn);
/*
fs.writeFile(path.join(packageRoot, 'pakmanaged.html'), ''
+ '<html>'
+ '\n<head><script src="pakmanaged.js"></script></head>'
+ '\n<head><script src="pakmanaged-test.js"></script></head>'
+ '\n<body>'
+ '\n Open your debug console and check for errors'
+ '\n <br/>'
+ '\n You might also want to throw some tests into pakmanaged-test.js'
+ '\n</body>'
+ '\n</html>'
, 'utf8');
*/
//console.warn('[WARN] iHeartTheBadParts (non-strict mode) on by default\n');
//console.log('wrote pakmanaged.js and pakmanaged.html');

}

me.init(function () {
Expand All @@ -62,8 +34,7 @@
};
Pakmanager.prototype.compile = function (fn) {
var me = this
, builtIns
// ls ~/Code/node/lib/ | grep '' | cut -d'.' -f1 | while read M; do echo , \"${M}\"; done
, builtIns
, loaderJs
, loaderScript
// TODO allow compiling outside of cwd
Expand Down Expand Up @@ -119,8 +90,7 @@
+ '\n var module = { exports: exports }'
;
} else {
newScript += ''
//+ '\n "use strict";'
newScript += ''
+ '\n '
+ '\n var module = { exports: {} }, exports = module.exports'
;
Expand Down Expand Up @@ -168,10 +138,6 @@
newScript += '\n $.ender(module.exports);';
}

//console.log('modulepath:', module.modulepath);
//console.log('module keys:', Object.keys(module));
//console.log('module package:', pkg);

newScript += '\n}(global));';

return newScript;
Expand All @@ -188,15 +154,11 @@
}

pakman.compile(me._packageRoot, builtIns, templateModule, function (err, compiled) {
var outData = ''
//+ '(function () {\n'
+ 'var global = Function("return this;")();\n'
// force users of the framework to use require rather than globals
//+ 'var window, navigator, location, FormData, File, localStorage;\n'
var outData = ''
+ 'var global = Function("return this;")();\n'
+ loaderScript
+ compiled
+ ('node' === me._target ? '\nrequire("pakmanager.main");' : '')
//+ '}());\n'
+ ('node' === me._target ? '\nrequire("pakmanager.main");' : '')
;

fn(outData);
Expand Down Expand Up @@ -282,7 +244,9 @@
if (pm.length) {
console.log('[INFO] The following packages are needed by this package:');
pm.forEach(function (m) {
console.log(' ' + (m.modulepath || m.name));
if (!m === undefined) {
console.log(' ' + (m.modulepath || m.name));
}
});
}

Expand Down