Browse Source
* Dependency workflow add dependency correction value * Download workflow instance map width adjustment and change "desc" field to "description" * The third-party library that builds the dependency is recommended to be placed in 'devDependencies' * Tree chart and Gantt chart style modification * The workflow instance can be deleted only when its status is success, failure, stop and pause. * change desc to description * Maximum width of tooltip is set to 500px, note the copyright number of login page * Delete copyright number * No tenant in the list of selected tenants the default is default, and the status not shown in the repair page * repair * Repair security center module prompt * Remove blank character during verification * Remove blank character during verification * Non admin users cannot create users, tenants, alarm groups, queues and worker groups * Remove CI windows detection * The value of loadaverage should be two decimal places * Add license * delete docs * update package.json * delete LICENSE * Display icon when there is no data in process definition * Worker group add IP format verification * Modify MySQL page of monitoring center * DB page rename and background color modification * IO build replace with source code * Replace ans charts with source code * delete component-compiler-utils * delete progress-webpack-pluginpull/2/head
break60
5 years ago
committed by
qiaozhanwei
5 changed files with 1 additions and 103 deletions
@ -1,81 +0,0 @@ |
|||||||
/** |
|
||||||
* Add by allex to display compilation progress |
|
||||||
*/ |
|
||||||
'use strict'; |
|
||||||
|
|
||||||
var _ = require('lodash'); |
|
||||||
var webpack = require('webpack'); |
|
||||||
var istty = process.env.MSYSTEM === 'MINGW64' || !!process.stdout.isTTY; |
|
||||||
var print = process.stderr.write.bind(process.stderr); |
|
||||||
|
|
||||||
module.exports = function (options) { |
|
||||||
options = _.merge({ profile: true }, options); |
|
||||||
|
|
||||||
var chars = 0, |
|
||||||
lastState = void 0, |
|
||||||
lastStateTime = void 0, |
|
||||||
ts = void 0; |
|
||||||
|
|
||||||
return new webpack.ProgressPlugin(function (percentage, msg) { |
|
||||||
var state = msg; |
|
||||||
|
|
||||||
if (percentage === 0) { |
|
||||||
lastState = null; |
|
||||||
lastStateTime = +new Date(); |
|
||||||
ts = lastStateTime; |
|
||||||
} |
|
||||||
|
|
||||||
if (percentage < 1) { |
|
||||||
msg = Math.floor(percentage * 100) + '% ' + msg; |
|
||||||
if (percentage < 1) { |
|
||||||
msg = ' ' + msg; |
|
||||||
} |
|
||||||
if (percentage < 0.1) { |
|
||||||
msg = ' ' + msg; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
if (options.profile) { |
|
||||||
state = state.replace(/^\d+\/\d+\s+/, ''); |
|
||||||
if (state !== lastState || percentage === 1) { |
|
||||||
var now = +new Date(); |
|
||||||
if (lastState) { |
|
||||||
var stateMsg = now - lastStateTime + 'ms ' + lastState; |
|
||||||
if (istty) { |
|
||||||
goToLineStart(stateMsg); |
|
||||||
print(stateMsg + '\n'); |
|
||||||
} else { |
|
||||||
print('>'); |
|
||||||
} |
|
||||||
chars = 0; |
|
||||||
} |
|
||||||
lastState = state; |
|
||||||
lastStateTime = now; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
if (istty) { |
|
||||||
goToLineStart(msg); |
|
||||||
print(msg); |
|
||||||
} else { |
|
||||||
if (Date.now() - ts > 200) { |
|
||||||
print('.'); |
|
||||||
ts = Date.now(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
if (percentage === 1) { |
|
||||||
print('\n'); // completed.
|
|
||||||
} |
|
||||||
}); |
|
||||||
|
|
||||||
function goToLineStart(nextMessage) { |
|
||||||
var str = ''; |
|
||||||
for (; chars > nextMessage.length; chars--) { |
|
||||||
str += '\b \b'; |
|
||||||
}chars = nextMessage.length; |
|
||||||
for (var i = 0; i < chars; i++) { |
|
||||||
str += '\b'; |
|
||||||
}if (str) print(str); |
|
||||||
} |
|
||||||
}; |
|
@ -1,17 +0,0 @@ |
|||||||
{ |
|
||||||
"name": "@fedor/progress-webpack-plugin", |
|
||||||
"version": "1.0.0", |
|
||||||
"description": "", |
|
||||||
"main": "lib/index.js", |
|
||||||
"scripts": { |
|
||||||
"build": "babel -d lib/ src/", |
|
||||||
"prepublish": "npm run build", |
|
||||||
"test": "tap test/*.js", |
|
||||||
"watch": "babel -w -d lib/ src/" |
|
||||||
}, |
|
||||||
"author": "allex", |
|
||||||
"license": "ISC", |
|
||||||
"dependencies": { |
|
||||||
"lodash": "^4.17.4" |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue