crabatool 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +1 -0
- package/index.js +3 -0
- package/lib/utils.js +3 -4
- package/package.json +2 -2
- package/tool/checkjs.js +2 -1
package/.vscode/launch.json
CHANGED
package/index.js
CHANGED
|
@@ -43,6 +43,9 @@ function checkConfig() {
|
|
|
43
43
|
bindConfigByArgv('-webPath');
|
|
44
44
|
bindConfigByArgv('-modName');
|
|
45
45
|
bindConfigByArgv('-ignoreCheck');
|
|
46
|
+
if (config.ignoreCheck && typeof config.ignoreCheck == 'string') {
|
|
47
|
+
config.ignoreCheck = config.ignoreCheck.split(',');
|
|
48
|
+
}
|
|
46
49
|
|
|
47
50
|
if (!config.webPath) {
|
|
48
51
|
throw new Error('请检查craba.js,必须告诉工具当前项目的前端路径地址,填绝对路径哦');
|
package/lib/utils.js
CHANGED
|
@@ -359,18 +359,17 @@ class Utils {
|
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
getFiles(options, fileList) {
|
|
362
|
-
var ignores = options.ignores;
|
|
363
362
|
var exts = options.exts;
|
|
364
363
|
var source = options.source;
|
|
365
|
-
if (ignores && !fileList) {
|
|
366
|
-
ignores = ignores.map((item) => { return path.join(source, item) });
|
|
364
|
+
if (options.ignores && !fileList) {
|
|
365
|
+
options.ignores = options.ignores.map((item) => { return path.join(source, item) });
|
|
367
366
|
}
|
|
368
367
|
|
|
369
368
|
if (!fileList) fileList = [];
|
|
370
369
|
var files = fs.readdirSync(source);
|
|
371
370
|
files.forEach(function(fileName) {
|
|
372
371
|
var filePath = path.join(source, fileName);
|
|
373
|
-
if (ignores && ignores.includes(filePath)) {
|
|
372
|
+
if (options.ignores && options.ignores.includes(filePath)) {
|
|
374
373
|
return;
|
|
375
374
|
}
|
|
376
375
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crabatool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "crabatool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"test": "node ./test/test.js",
|
|
9
9
|
"run": "node ./test/test.js -run",
|
|
10
10
|
"checkjs": "node ./test/test.js -checkjs",
|
|
11
|
-
"webPath": "node ./test/test.js -checkjs -webPath F
|
|
11
|
+
"webPath": "node ./test/test.js -checkjs -webPath F:\\crabaevery\\www -modName crabademo -ignoreCheck ueditor,iconfont,biconfont,js\\math.min.js,js\\es6-promise.auto.min.js,js\\craba.rollup.min.js"
|
|
12
12
|
},
|
|
13
13
|
"author": "wssf",
|
|
14
14
|
"dependencies": {
|
package/tool/checkjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var path = require('path');
|
|
|
8
8
|
var axios = require('axios');
|
|
9
9
|
|
|
10
10
|
module.exports.start = function() {
|
|
11
|
-
var jsFiles = utils.getFiles({ source: config.webPath, exts: '.js', ignores: config.
|
|
11
|
+
var jsFiles = utils.getFiles({ source: config.webPath, exts: '.js', ignores: config.ignoreCheck });
|
|
12
12
|
|
|
13
13
|
var fileSize = 300;
|
|
14
14
|
var errList = [];
|
|
@@ -130,6 +130,7 @@ module.exports.start = function() {
|
|
|
130
130
|
//data.markdown.text = data.markdown.text.replaceAll('\\n', '\n');
|
|
131
131
|
//console.log(data);
|
|
132
132
|
|
|
133
|
+
return;
|
|
133
134
|
axios({
|
|
134
135
|
method: 'post',
|
|
135
136
|
url: config.webhooks,
|