flex-combo
Advanced tools
Comparing version 0.5.9 to 0.5.10
var http = require('http') | ||
, url = require('url') | ||
, fs = require('fs') | ||
@@ -87,2 +88,6 @@ , path = require('path') | ||
} | ||
if (type == 'Error') { | ||
console.log('%s<=Error : %s%s%s %s',red, reset, yellow, c, reset); | ||
return; | ||
} | ||
console.log(green+'<='+type+': ' + reset + gray + ' ' + c + ' ' + reset); | ||
@@ -119,2 +124,6 @@ return; | ||
fns:[], | ||
// define: '', | ||
// anonymous: true, | ||
define: 'KISSY.add', | ||
anonymous: false, | ||
hosts:{'a.tbcdn.cn':'122.225.67.241', 'g.tbcdn.cn':'115.238.23.250'} | ||
@@ -183,7 +192,7 @@ }; | ||
var dirs = map[longestMatchPos].split(','); | ||
for (var i = 0, len = dirs.length; i < len; i++){ | ||
for (var i = 0, len = dirs.length; i < len; i++) { | ||
var dir = dirs[i]; | ||
var revPath = fullPath.slice(longestMatchPos.length, fullPath.length); | ||
var revPath = path.join('/', fullPath.slice(longestMatchPos.length, fullPath.length)); | ||
var absPath = ''; | ||
debug('The rev path is %s', revPath); | ||
//如果是绝对路径,直接使用 | ||
@@ -204,5 +213,10 @@ if(dir.indexOf('/') === 0 || /^\w{1}:\\.*$/.test(dir)){ | ||
var tpl = iconv.decode(buff, charset); | ||
var compiled = juicer(tpl)._render.toString().replace(/^function anonymous[^{]*?{([\s\S]*?)}$/igm, function($, fn_body) { | ||
return 'function(_, _method) {' + method_body + fn_body + '};\n'; | ||
}); | ||
try { | ||
var compiled = juicer(tpl)._render.toString().replace(/^function anonymous[^{]*?{([\s\S]*?)}$/igm, function($, fn_body) { | ||
return 'function(_, _method) {' + method_body + fn_body + '};\n'; | ||
}); | ||
} catch(e) { | ||
cosoleResp('Error', 'Compile failed with error '+ e.message); | ||
return ''; | ||
} | ||
@@ -214,4 +228,23 @@ //允许为某个url特别指定编码 | ||
} | ||
var tempalteFunction = 'window["'+revPath+'"] = ' + compiled; | ||
var tempalteFunction; | ||
param.define = param.define || ''; | ||
// 未声明需要哪个定义模块 | ||
// 或者声明的错误 | ||
// 或者声明的是 `window` | ||
if ( | ||
!param.define || | ||
'string' !== typeof param.define || | ||
!!~['window', 'global', 'self', 'parent','Window','Global'].indexOf(param.define) | ||
) { | ||
debug('The package define is undefined or not a string'); | ||
tempalteFunction = 'window["'+revPath+'"] = ' + compiled; | ||
} else { | ||
if (param.anonymous) { | ||
debug('Define a anonymous module'); | ||
tempalteFunction = param.define + '(function(){return ' + compiled + '});'; | ||
} else { | ||
debug('Define a module with id'); | ||
tempalteFunction = param.define + '("' + revPath + '", function () {return ' + compiled + '});'; | ||
} | ||
} | ||
cosoleResp('Local Juicer Compile', htmlName); | ||
@@ -376,3 +409,3 @@ fs.writeFile(absPath, tempalteFunction); | ||
} | ||
var url = req.url.replace(/http:\/\/.+?\//,'/');//兼容windows,windows平台下取得的req.url带http://部分 | ||
var url = path.resolve(req.url.replace(/http:\/\/.+?\//,'/'));//兼容windows,windows平台下取得的req.url带http://部分 | ||
var prefix = url.indexOf(param.servlet + '?'); | ||
@@ -379,0 +412,0 @@ |
{ | ||
"name": "flex-combo", | ||
"version": "0.5.9", | ||
"version": "0.5.10", | ||
"description": "The Flex-combo is combo tool designed for web front-end developer. It support various kinds of combo format by modify configuration(eg. yahoo combo).", | ||
@@ -20,3 +20,3 @@ "main": "flex-combo.js", | ||
"juicer":"0.6.5-stable-p2", | ||
"less":"" | ||
"less":"~1.7.3" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": {}, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
87353
16
1687
1
+ Addedamdefine@1.0.1(transitive)
+ Addedasn1@0.1.11(transitive)
+ Addedassert-plus@0.1.5(transitive)
+ Addedasync@0.9.2(transitive)
+ Addedaws-sign2@0.5.0(transitive)
+ Addedboom@0.4.2(transitive)
+ Addedclean-css@2.2.23(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedcommander@2.2.0(transitive)
+ Addedcryptiles@0.2.2(transitive)
+ Addedctype@0.5.3(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedforever-agent@0.5.2(transitive)
+ Addedform-data@0.1.4(transitive)
+ Addedgraceful-fs@3.0.12(transitive)
+ Addedhawk@1.1.1(transitive)
+ Addedhoek@0.9.1(transitive)
+ Addedhttp-signature@0.10.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedless@1.7.5(transitive)
+ Addedmime@1.2.11(transitive)
+ Addedmime-types@1.0.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednatives@1.1.6(transitive)
+ Addednode-uuid@1.4.8(transitive)
+ Addedoauth-sign@0.3.0(transitive)
+ Addedqs@1.0.2(transitive)
+ Addedrequest@2.40.0(transitive)
+ Addedsntp@0.2.4(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addedstringstream@0.0.6(transitive)
+ Addedtldts@6.1.66(transitive)
+ Addedtldts-core@6.1.66(transitive)
+ Addedtough-cookie@5.0.0(transitive)
+ Addedtunnel-agent@0.4.3(transitive)
- Removedcopy-anything@2.0.6(transitive)
- Removederrno@0.1.8(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedimage-size@0.5.5(transitive)
- Removedis-what@3.14.1(transitive)
- Removedless@4.2.1(transitive)
- Removedmake-dir@2.1.0(transitive)
- Removedmime@1.6.0(transitive)
- Removedneedle@3.3.1(transitive)
- Removedparse-node-version@1.0.1(transitive)
- Removedpify@4.0.1(transitive)
- Removedprr@1.0.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsax@1.4.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedtslib@2.8.1(transitive)
Updatedless@~1.7.3