generator-kissy-pie
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -12,5 +12,2 @@ 'use strict'; | ||
this.email = Math.random(); | ||
this.author = Math.random(); | ||
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json'))); | ||
@@ -43,2 +40,35 @@ | ||
/** | ||
* Scan Project | ||
*/ | ||
AppGenerator.prototype._scan = function _scan() { | ||
var pages = this.expand('/*/*.*/', { | ||
nomount: true, | ||
root: '.', | ||
mark: true | ||
}); | ||
pages = pages.map(function(path){ | ||
path = path. | ||
replace(/\\/g, '/'). | ||
replace(/(^\/)|(\/$)/g, ''); | ||
var match = path.split('/'); | ||
return { | ||
pageName: match[0], | ||
version: match[1] | ||
} | ||
}); | ||
return { | ||
pages: pages | ||
}; | ||
}; | ||
AppGenerator.prototype.askFor = function askFor() { | ||
@@ -48,2 +78,4 @@ var cb = this.async(); | ||
// welcome message | ||
this.log(this.abcLogo); | ||
var welcome = | ||
@@ -66,2 +98,3 @@ " _ ___ "+ "______ _ ".cyan + | ||
} | ||
if (!abcJSON.author) { | ||
@@ -107,2 +140,3 @@ abcJSON.author = { | ||
this.prompt(prompts, function (err, props) { | ||
if (err) { | ||
@@ -109,0 +143,0 @@ return this.emit('error', err); |
@@ -372,5 +372,3 @@ var KISSYPie = require( 'abc-gruntfile-helper').kissypie; | ||
grunt.registerTask('common', ['ktpl:common', 'kmc:common', 'uglify:common'<% if(enableCSSCombo) { %>, 'css-combo:page'<% } %><% if(enableLess) { %>, 'less:common'<% } %> <% if(enableSass) { %>, 'compass:common'<% } %>, 'cssmin:common']); | ||
grunt.registerTask('debug', ['page', 'debug-xxx']); | ||
// 静态资源代理 + watch | ||
grunt.registerTask('server', ['connect:server', 'watch']); | ||
@@ -377,0 +375,0 @@ |
@@ -0,1 +1,7 @@ | ||
### V0.1.5 | ||
- 1、优化自模板,根据用户选择的样式引擎创建index.less/index.scss/index.css | ||
- 2、去掉Gruntfile.js中的debug命令 | ||
### V0.1.2 | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "generator-kissy-pie", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "kissy generator for kissypie", | ||
@@ -5,0 +5,0 @@ "main": "app/index.js", |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var Base = require('abc-generator').UIBase; | ||
var pkgInfo = require( path.resolve( process.cwd(), 'abc.json' ) ); | ||
@@ -56,3 +57,2 @@ | ||
PageGenerator.prototype.page = function app() { | ||
@@ -66,4 +66,8 @@ console.log('Generating Page. %s', this.pagePath); | ||
this.template('fb.page.json', path.join(pagePath, 'fb.page.json')); | ||
this.template('index.less', path.join(pagePath, 'page', 'index.less')); | ||
this.template('init.js', path.join(pagePath, 'page', 'init.js')); | ||
var styleEngine = pkgInfo._kissy_pie.styleEngine; | ||
var styleMainFilename = styleEngine == 'less' ? 'index.less' : | ||
( styleEngine == 'sass' ? 'index.scss' : 'index.css' ); | ||
this.template('index.less', path.join(pagePath, 'page', styleMainFilename)); | ||
}; |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
26018
631
20
3