Comparing version 2.5.0 to 2.5.2
@@ -1,4 +0,4 @@ | ||
var path = require('path'), | ||
var debug = require('./debug')('dependencies'), | ||
path = require('path'), | ||
readdir = require('fs').readdir, | ||
debug = require('./debug')('dependencies'), | ||
manifest = require('./manifest'), | ||
@@ -5,0 +5,0 @@ excludeds = require('./excludeds'), |
@@ -1,5 +0,4 @@ | ||
var boxcars = require('boxcars'), | ||
path = require('path'), | ||
fs = require("fs"), | ||
debug = require('./debug')('manifest'); | ||
var debug = require('./debug')('manifest'), | ||
path = require('path'), | ||
fs = require("fs"); | ||
@@ -66,3 +65,3 @@ function paths(pkg, dir){ | ||
boxcars(filename)(function(error, bf){ | ||
fs.readFile(filename, function(error, bf){ | ||
@@ -78,11 +77,7 @@ if(error){ | ||
try { | ||
manifest = JSON.parse(bf); | ||
manifest = JSON.parse(bf.toString()); | ||
debug('Manifest file "%s" loaded and parsed successfully.', filename); | ||
} catch(exc) { | ||
debug('Failed to parse the manifest @ "%s"', filename); | ||
error = exc; | ||
} | ||
@@ -89,0 +84,0 @@ |
@@ -1,16 +0,21 @@ | ||
var functools = require('functools'), | ||
var debug = require('./debug')('modules'), | ||
flatten = require('flatten-array'), | ||
functools = require('functools'), | ||
compose = functools.compose, | ||
combiner = require('combiner'), | ||
glob = require('glob'), | ||
path = require('path'), | ||
readFile = require('fs').readFile, | ||
readFile = require('fs').readFile; | ||
debug = require('./debug')('modules'); | ||
var filters = [], | ||
toInclude = []; | ||
function pass(f, cb){ | ||
return cb(undefined, f); | ||
} | ||
module.exports = modules; | ||
module.exports.filterFilename = filterFilename; | ||
module.exports.loadModule = loadModule; | ||
module.exports.loadModules = loadModules; | ||
module.exports.fixname = fixname; | ||
module.exports.filters = filters; | ||
module.exports.toInclude = toInclude; | ||
@@ -28,3 +33,3 @@ function filter(filenames, callback){ | ||
callback(undefined, copy); | ||
return copy; | ||
} | ||
@@ -37,42 +42,36 @@ | ||
function filterFilenames(filenames, callback){ | ||
callback(undefined, filenames.filter(filterFilename)); | ||
return filenames.filter(filterFilename); | ||
} | ||
function filterIgnoredModules(pkg){ | ||
return function(filenames, callback){ | ||
function filterIgnoredModules(pkg, filenames){ | ||
if(!pkg.ignore) return filenames; | ||
if(!pkg.ignore){ | ||
callback(undefined, filenames); | ||
return; | ||
} | ||
var f = filenames.length, | ||
i, ignore, filename, | ||
ignored, result = []; | ||
var f = filenames.length, | ||
i, ignore, filename, | ||
ignored, result = []; | ||
while( f -- ){ | ||
ignored = false; | ||
while( f -- ){ | ||
ignored = false; | ||
i = pkg.ignore.length; | ||
filename = filenames[f].substring(pkg.wd.length + ( pkg.wd.substring(pkg.wd.length-1) != '/' ? 1 : 0 )); | ||
i = pkg.ignore.length; | ||
filename = filenames[f].substring(pkg.wd.length + ( pkg.wd.substring(pkg.wd.length-1) != '/' ? 1 : 0 )); | ||
while( i -- ){ | ||
while( i -- ){ | ||
ignore = pkg.ignore[i]; | ||
ignore = pkg.ignore[i]; | ||
if( filename.substring( 0, ignore.length ) == ignore ){ | ||
debug('Module "%s" is ignored by the line "%s" at .npmignore', filename, ignore); | ||
ignored = true; | ||
break; | ||
} | ||
if( filename.substring( 0, ignore.length ) == ignore ){ | ||
debug('Module "%s" is ignored by the line "%s" at .npmignore', filename, ignore); | ||
ignored = true; | ||
break; | ||
} | ||
} | ||
} | ||
!ignored && result.push( filenames[f] ); | ||
!ignored && result.push( filenames[f] ); | ||
} | ||
} | ||
return result; | ||
callback(undefined, result); | ||
}; | ||
} | ||
@@ -114,45 +113,38 @@ | ||
function loadModules(pkg, base){ | ||
function loadModules(pkg, base, filenames, callback){ | ||
debug('Found '+filenames.length+' file(s) under the package "'+pkg.name+'"'); | ||
return function(filenames, callback){ | ||
debug('Found '+filenames.length+' file(s) under the package "'+pkg.name+'"'); | ||
var modules = []; | ||
var modules = []; | ||
(function next(i){ | ||
if(i>=filenames.length){ | ||
debug('Loaded %d module(s) under the package "%s"',filenames.length,pkg.name); | ||
callback(undefined, modules); | ||
(function next(i){ | ||
if(i>=filenames.length){ | ||
debug('Loaded %d module(s) under the package "%s"',filenames.length,pkg.name); | ||
callback(undefined, modules); | ||
return; | ||
} | ||
loadModule(filenames[i], function(error, module){ | ||
if(error){ | ||
debug('Failed to load the module "'+filenames[i]+'"'); | ||
callback(error); | ||
return; | ||
} | ||
loadModule(filenames[i], function(error, module){ | ||
if(error){ | ||
debug('Failed to load the module "'+filenames[i]+'"'); | ||
callback(error); | ||
return; | ||
} | ||
//replacing '\' with '/' for Windows based systems | ||
module.filename = module.filename.replace(/\\/g,'/'); | ||
module.filename = module.filename.replace(base+'/', ''); | ||
module.filename.indexOf('/') > 0 && base != '.' && ( module.filename = module.filename.replace(base, '') ); | ||
module.id = module.filename.replace(/\.js$/,''); | ||
//replacing '\' with '/' for Windows based systems | ||
module.filename = module.filename.replace(/\\/g,'/'); | ||
module.filename = module.filename.replace(base+'/', ''); | ||
module.filename.indexOf('/') > 0 && base != '.' && ( module.filename = module.filename.replace(base, '') ); | ||
module.id = module.filename.replace(/\.js$/,''); | ||
if(!error) modules.push(module); | ||
if(!error) modules.push(module); | ||
next(i+1); | ||
next(i+1); | ||
}); | ||
}); | ||
})(0); | ||
}; | ||
})(0); | ||
} | ||
function include(files, cb){ | ||
cb(undefined, files.concat(toInclude)); | ||
} | ||
function modules(pkg, options, callback){ | ||
@@ -184,18 +176,11 @@ debug('Collect modules for the package "'+pkg.name+'"'); | ||
compose.async(combiner.findFiles, | ||
pkg.parents && pkg.parents.length == 0 && include || pass, | ||
combiner.includeDirectories, | ||
combiner.flatten, | ||
filterFilenames, | ||
filterIgnoredModules(pkg), | ||
filter, | ||
loadModules(pkg, base))(dirs, callback); | ||
var files = filterIgnoredModules(pkg, filter(filterFilenames(flatten(dirs.map(function(el){ | ||
return glob.sync(el + '/**/*.js').concat(glob.sync(el)); | ||
}))))); | ||
if(pkg.parents && pkg.parents.length){ | ||
dirs = dirs.concat(toInclude); | ||
} | ||
loadModules(pkg, base, files, callback); | ||
} | ||
module.exports = modules; | ||
module.exports.filterFilename = filterFilename; | ||
module.exports.loadModule = loadModule; | ||
module.exports.loadModules = loadModules; | ||
module.exports.fixname = fixname; | ||
module.exports.filters = filters; | ||
module.exports.toInclude = toInclude; |
@@ -10,3 +10,3 @@ var pkg = require('../package'), | ||
function main(pkg, options, callback){ | ||
var layout = options.plain ? plain : dynamic; | ||
var layout = dynamic; | ||
@@ -13,0 +13,0 @@ var async = {}, |
@@ -1,1 +0,7 @@ | ||
module.exports = new Error('Not Implemented'); | ||
var debug = require("../../debug")('one:static'); | ||
module.exports = bundle; | ||
function bundle(){ | ||
console.log(arguments); | ||
} |
{ | ||
"name": "one", | ||
"version": "2.5.0", | ||
"version": "2.5.2", | ||
"description": "Transform NodeJS packages into single stand-alone script files.", | ||
"author": "Azer Koculu <azer@kodfabrik.com>", | ||
"keywords": [ | ||
"build", | ||
"commonjs", | ||
@@ -21,7 +20,7 @@ "browser" | ||
"optimist": "0.x", | ||
"combiner": "1.2.x", | ||
"hogan.js": "2.x", | ||
"log4js": "0.6.x", | ||
"boxcars": "0.x", | ||
"debug": "*" | ||
"glob": "*", | ||
"debug": "*", | ||
"flatten-array": "*", | ||
"boxcars": "*" | ||
}, | ||
@@ -28,0 +27,0 @@ "devDependencies": { |
@@ -8,11 +8,2 @@ OneJS is a command-line utility for converting CommonJS packages to single, stand-alone JavaScript | ||
# MOTIVATION | ||
* **Reusability** OneJS lets developers code JavaScript for one platform and run everywhere, without requiring any additional effort. | ||
* **Elegant Modularization** Modules and packages specs of CommonJS are what web apps exactly needs: a well designed way to structure your source code. | ||
* **NPM** OneJS moves the revolution of NPM one step forward and makes it available for client-side projects! | ||
* **No Spaghetti Code** No awkward headers, no framework-specific definitions. | ||
* **Reliable code generation** OneJS doesn't change your source code. It generates a container that emulates a simple NodeJS environment. | ||
* **Unobtrusive Code** OneJS puts all the content into an isolated JS object. | ||
![](https://dl.dropbox.com/s/r29fc29iip3mj8u/onejs.jpg) | ||
@@ -19,0 +10,0 @@ |
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 3 instances in 1 package
71235
55
1805
4
407
+ Addedflatten-array@*
+ Addedglob@*
+ Added@isaacs/cliui@8.0.2(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedboxcars@2.0.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedflatten-array@1.0.0(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@11.0.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@4.0.2(transitive)
+ Addedlru-cache@11.0.2(transitive)
+ Addedminimatch@10.0.1(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@2.0.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
- Removedcombiner@1.2.x
- Removedlog4js@0.6.x
- Removedboxcars@0.0.6(transitive)
- Removedcombiner@1.2.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedfunctools@1.1.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.1(transitive)
- Removedlog4js@0.6.38(transitive)
- Removedopts@1.2.1(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedsemver@4.3.6(transitive)
- Removedstring_decoder@0.10.31(transitive)
Updatedboxcars@*