lack 1.3.13 → 1.3.15
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/assets/js/package.json +5 -5
- package/assets/ts/package.json +5 -5
- package/bin/watch.js +11 -4
- package/package.json +2 -2
package/assets/js/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"description": "插件功能简介",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"koa": "^2.
|
|
7
|
-
"koa-bodyparser": "^4.
|
|
8
|
-
"koa-onerror": "^4.
|
|
9
|
-
"koa-router": "^
|
|
6
|
+
"koa": "^2.15.0",
|
|
7
|
+
"koa-bodyparser": "^4.4.1",
|
|
8
|
+
"koa-onerror": "^4.2.0",
|
|
9
|
+
"koa-router": "^12.0.1",
|
|
10
10
|
"koa-static": "^5.0.0"
|
|
11
11
|
}
|
|
12
|
-
}
|
|
12
|
+
}
|
package/assets/ts/package.json
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"dev": "tsc -w"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"koa": "^2.
|
|
10
|
-
"koa-bodyparser": "^4.
|
|
11
|
-
"koa-onerror": "^4.
|
|
12
|
-
"koa-router": "^
|
|
9
|
+
"koa": "^2.15.0",
|
|
10
|
+
"koa-bodyparser": "^4.4.1",
|
|
11
|
+
"koa-onerror": "^4.2.0",
|
|
12
|
+
"koa-router": "^12.0.1",
|
|
13
13
|
"koa-static": "^5.0.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
"@types/koa-router": "^7.4.4",
|
|
22
22
|
"@types/koa-static": "^4.0.2"
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
package/bin/watch.js
CHANGED
|
@@ -7,6 +7,7 @@ const fse = require('fs-extra');
|
|
|
7
7
|
const HOME_DIR_RE = /^[~~]\//;
|
|
8
8
|
const PLUGIN_NAME_RE = /^(?:@[\w-]+\/)?(whistle\.[a-z\d_-]+)$/;
|
|
9
9
|
const REL_RE = /^\.\.[\\/]+/;
|
|
10
|
+
const SLASH_RE = /[\\/]/;
|
|
10
11
|
|
|
11
12
|
const getWhistlePath = () => {
|
|
12
13
|
const dir = process.env.WHISTLE_PATH;
|
|
@@ -79,7 +80,8 @@ module.exports = (dirs) => {
|
|
|
79
80
|
fs.unlinkSync(logFile); // eslint-disable-line
|
|
80
81
|
} catch (e) {}
|
|
81
82
|
fse.ensureDirSync(DEV_PLUGINS);
|
|
82
|
-
const watchList = ['index.js', 'rules.txt', '_rules.txt', 'reqRules.txt', 'resRules.txt',
|
|
83
|
+
const watchList = ['index.js', 'rules.txt', '_rules.txt', 'reqRules.txt', 'resRules.txt',
|
|
84
|
+
'_values.txt', 'lib', 'dist', 'public', 'initial.js', 'initialize.js'];
|
|
83
85
|
if (dirs && typeof dirs === 'string') {
|
|
84
86
|
dirs.split(',').forEach((dir) => {
|
|
85
87
|
dir = dir.trim();
|
|
@@ -107,14 +109,19 @@ module.exports = (dirs) => {
|
|
|
107
109
|
console.log('\n*********************************************\n'); // eslint-disable-line
|
|
108
110
|
chokidar.watch(watchList, {
|
|
109
111
|
ignored: /(^|[/\\])(\..|node_modules([/\\]|$))/,
|
|
110
|
-
}).on('raw', (_, filename) => {
|
|
111
|
-
if (filename.includes('package.json') || filename.includes('.console.log')
|
|
112
|
+
}).on('raw', (_, filename, details) => {
|
|
113
|
+
if (filename.includes('package.json') || filename.includes('.console.log')) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const watchedPath = (details && details.watchedPath) || filename;
|
|
117
|
+
const hasSlash = SLASH_RE.test(watchedPath);
|
|
118
|
+
if (hasSlash && !inWatchList(watchedPath)) {
|
|
112
119
|
return;
|
|
113
120
|
}
|
|
114
121
|
clearTimeout(timer);
|
|
115
122
|
timer = setTimeout(() => {
|
|
116
123
|
console.log(''); // eslint-disable-line
|
|
117
|
-
console.log(`${filename} is changed.`); // eslint-disable-line
|
|
124
|
+
console.log(`${hasSlash ? watchedPath : filename} is changed.`); // eslint-disable-line
|
|
118
125
|
touch();
|
|
119
126
|
}, 1000);
|
|
120
127
|
}).on('error', () => {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lack",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "whistle extension tools",
|
|
5
5
|
"author": "avenwu <avwu@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node": ">= 8"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"chokidar": "^3.
|
|
31
|
+
"chokidar": "^3.6.0",
|
|
32
32
|
"commander": "^8.1.0",
|
|
33
33
|
"fs-extra": "^10.0.0",
|
|
34
34
|
"inquirer": "^6.5.2",
|