Comparing version 0.4.5 to 0.4.6
@@ -1,5 +0,6 @@ | ||
var fs, path, async, cached_files, watching, libs, root, parseFile, resolveDepend, resolveDependencyChain, collectDependencies, watchFileFallback, watchFile, watchFiles, compile, extensions, __out = typeof exports != 'undefined' && exports || this; | ||
var fs, path, async, watchFilesOnce, cached_files, watching, libs, root, parseFile, resolveDepend, resolveDependencyChain, collectDependencies, compile, extensions, __out = typeof exports != 'undefined' && exports || this; | ||
fs = require('fs'); | ||
path = require('path'); | ||
async = require('async'); | ||
watchFilesOnce = require('./watch'); | ||
cached_files = {}; | ||
@@ -61,3 +62,3 @@ watching = null; | ||
lib_index = 0; | ||
tryNextLib = function(){ | ||
(tryNextLib = function(){ | ||
var try_lib, resolveWithExt; | ||
@@ -102,4 +103,3 @@ if ((try_lib = libs[lib_index++]) != null) { | ||
} | ||
}; | ||
tryNextLib(); | ||
})(); | ||
}; | ||
@@ -127,3 +127,3 @@ resolveDependencyChain = function(root, doneResolvingDependencyChain){ | ||
} | ||
return async.parallel(funcs, function(err, results){ | ||
async.parallel(funcs, function(err, results){ | ||
files.push(node); | ||
@@ -184,39 +184,2 @@ if (err) { | ||
}; | ||
watchFileFallback = function(filename, options, cb){ | ||
options.interval = 701; | ||
fs.watchFile(filename, options, function(curr, prev){ | ||
if (curr.mtime !== prev.mtime) { | ||
cb('change', filename); | ||
} | ||
}); | ||
return { | ||
close: function(){ | ||
return fs.unwatchFile(filename); | ||
} | ||
}; | ||
}; | ||
watchFile = fs.watch || watchFileFallback; | ||
watchFiles = function(files, cb){ | ||
var watchers, doCallback, file, watcher, __i, __len; | ||
watchers = []; | ||
doCallback = function(event){ | ||
var watcher, __i, __ref, __len; | ||
if (event === "change") { | ||
for (__i = 0, __len = (__ref = watchers).length; __i < __len; ++__i) { | ||
watcher = __ref[__i]; | ||
watcher.close(); | ||
} | ||
cb(); | ||
} | ||
}; | ||
for (__i = 0, __len = files.length; __i < __len; ++__i) { | ||
file = files[__i]; | ||
try { | ||
watcher = fs.watch(file, doCallback); | ||
} catch (err) { | ||
watcher = watchFileFallback(file, doCallback); | ||
} | ||
watchers.push(watcher); | ||
} | ||
}; | ||
__out.compile = compile = function(options, cb){ | ||
@@ -250,5 +213,5 @@ var lib, dep, __ref, __res, __i, __len; | ||
resolveDependencyChain(root, function(err, dependency_chain){ | ||
var dep, output; | ||
var dep, closer, output; | ||
if (watching) { | ||
watchFiles((function(){ | ||
closer = watchFilesOnce((function(){ | ||
var __i, __ref, __len, __results = []; | ||
@@ -277,3 +240,3 @@ for (__i = 0, __len = (__ref = dependency_chain).length; __i < __len; ++__i) { | ||
}()).join("\n"); | ||
cb(null, output); | ||
cb(null, output, closer); | ||
} | ||
@@ -285,2 +248,3 @@ }); | ||
'.coffee': { | ||
require: 'coffee-script', | ||
compile: function(code, options){ | ||
@@ -294,2 +258,3 @@ return require('coffee-script').compile(code, { | ||
'.js': { | ||
require: null, | ||
compile: function(code, options){ | ||
@@ -305,2 +270,3 @@ if (options.bare) { | ||
'.co': { | ||
require: 'coco', | ||
compile: function(code, options){ | ||
@@ -314,2 +280,3 @@ return require('coco').compile(code, { | ||
'.ls': { | ||
require: 'LiveScript', | ||
compile: function(code, options){ | ||
@@ -321,2 +288,11 @@ return require('LiveScript').compile(code, { | ||
depend_re: /^#depend "(.+)"( bare)?$/gm | ||
}, | ||
'.iced': { | ||
require: 'iced-coffee-script', | ||
compile: function(code, options){ | ||
return require('iced-coffee-script').compile(code, { | ||
bare: options.bare | ||
}); | ||
}, | ||
depend_re: /^#depend "(.+)"( bare)?$/gm | ||
} | ||
@@ -323,0 +299,0 @@ }; |
{ | ||
"name": "jspackage", | ||
"description": "build tool which adds client-side import syntax", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"author": { | ||
@@ -22,2 +22,3 @@ "name": "Andrew Kelley", | ||
"LiveScript": "~0.9.11b", | ||
"iced-coffee-script": "~1.3.3d", | ||
"temp": "~0.4.0" | ||
@@ -24,0 +25,0 @@ }, |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
28600
9
832
1
108
5
1
5