Skip to content

Commit

Permalink
1. QMUI Web 调试模式增加显示 Compass 日志;2. 完善 .gitignore;
Browse files Browse the repository at this point in the history
  • Loading branch information
kayo5994 committed Oct 13, 2016
1 parent 6bcbac7 commit 176aa9b
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 9 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = false

# Matches multiple files with brace expansion notation
# Set default charset
charset = utf-8

# Tab indentation (no size specified)
indent_style = tab
indent_size = 2

# Others
trim_trailing_whitespace = true
46 changes: 45 additions & 1 deletion .gitignore
@@ -1,3 +1,47 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
npm-debug.log
jspm_packages

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

#Others
.DS_Store
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -85,11 +85,11 @@ yo qmui
## 意见反馈
如果有意见反馈或者功能建议,欢迎创建 [Issue](https://github.com/QMUI/qmui_web/issues) 或发送 [Pull Request](https://github.com/QMUI/qmui_web/pulls),感谢你的支持和贡献。

### 内置工作流调试辅助
### 调试辅助

当 QMUI Web 工作流在工作时,会自动检测工作流源码是否有更新并在有更新时发出通知,包括日志通知以及声音通知。

另外为了方便调试,QMUI Web 带有 Debug 模式,通过 Debug 模式开启工作流后,当 QMUI Web 检测到工作流源码有更新时会发出通知并自行重启工作流,方便调试。
另外为了方便调试,QMUI Web 带有 Debug 模式,通过 Debug 模式开启工作流后,当 QMUI Web 检测到工作流源码有更新时会发出通知并自行重启工作流,同时 Compass 在编译时也会输出完整日志,方便调试。

```
#在 UI_dev/qmui_web 中执行以下命令可以开启 Debug 模式工作流
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "qmui_web",
"version": "1.2.5",
"version": "1.2.6",
"description": "一个旨在提高 UI 开发效率、快速产生项目 UI 的前端框架",
"repository": {
"type": "git",
Expand Down
12 changes: 9 additions & 3 deletions workflow/task/compass.js
@@ -1,9 +1,15 @@
// 调用 shell 执行 Compass 命令
var argv = require('yargs').argv;

module.exports = function(gulp, common) {
gulp.task('compass', '编译 Compass(建议调用 watch 任务自动监控文件变化并调用)', common.plugins.shell.task([
'compass compile -q'
],{
var _taskList = [];
if (argv.debug) {
_taskList.push('compass compile');
} else {
_taskList.push('compass compile -q');
}

gulp.task('compass', '编译 Compass(建议调用 watch 任务自动监控文件变化并调用)', common.plugins.shell.task(_taskList, {
cwd: '..'
}));
};
10 changes: 8 additions & 2 deletions workflow/task/start.js
@@ -1,10 +1,12 @@
// Gulp 服务入口
var argv = require('yargs').argv,
spawn = require('child_process').spawn,
os = require('os');
os = require('os');

module.exports = function(gulp, common) {

if (os.platform() === 'linux' || os.platform() === 'darwin') {

gulp.task('start', false, function(){
if (argv.debug) {
common.plugins.util.log(common.plugins.util.colors.green('QMUI Debug: ') + 'QMUI 进入 Debug 模式');
Expand Down Expand Up @@ -39,7 +41,11 @@ module.exports = function(gulp, common) {
});

// 获取第一次进入时 gulp 的进程
_mainTaskProcess = spawn('gulp', ['main'], {stdio: 'inherit'});
if (argv.debug) {
_mainTaskProcess = spawn('gulp', ['main', '--debug'], {stdio: 'inherit'});
} else {
_mainTaskProcess = spawn('gulp', ['main'], {stdio: 'inherit'});
}
});

// 默认任务
Expand Down

0 comments on commit 176aa9b

Please sign in to comment.