oipage 1.6.0-alpha.2 → 1.6.0-beta.1
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/CHANGELOG +7 -0
- package/README.md +2 -2
- package/bin/help.js +26 -13
- package/bin/run +25 -17
- package/bin/tools/network.js +2 -2
- package/nodejs/animation/index.js +1 -1
- package/nodejs/cmdlog/index.js +1 -1
- package/nodejs/disk/index.js +1 -1
- package/nodejs/format/index.js +1 -1
- package/nodejs/json/index.js +1 -1
- package/nodejs/logform/index.js +1 -1
- package/nodejs/reader/index.js +1 -1
- package/nodejs/throttle/index.js +1 -1
- package/package.json +5 -3
- package/web/XMLHttpRequest/index.js +1 -1
- package/web/animation/index.js +1 -1
- package/web/format/index.js +1 -1
- package/web/json/index.js +1 -1
- package/web/onReady/index.js +1 -1
- package/web/performChunk/index.js +1 -1
- package/web/reader/index.js +1 -1
- package/web/style/index.js +1 -1
- package/web/throttle/index.js +1 -1
package/CHANGELOG
CHANGED
|
@@ -118,12 +118,19 @@ v1.5.0:
|
|
|
118
118
|
v1.6.0:
|
|
119
119
|
date:
|
|
120
120
|
changes:
|
|
121
|
+
- 修复bug
|
|
122
|
+
1、修复logform在run下无法正常使用问题
|
|
123
|
+
(关联issue: https://github.com/oi-contrib/OIPage/issues/4 )
|
|
124
|
+
- 优化改造
|
|
125
|
+
1、命令行帮助打印更可读
|
|
121
126
|
- 新增功能
|
|
122
127
|
1、命令(oipage-cli)
|
|
123
128
|
* disk
|
|
124
129
|
--link 创建磁盘链接
|
|
125
130
|
--delempty 删除空文件夹
|
|
126
131
|
* network 网络相关
|
|
132
|
+
* run 支持动态参数
|
|
133
|
+
(关联issue: https://github.com/oi-contrib/OIPage/issues/5 )
|
|
127
134
|
2、API功能(Node.js)
|
|
128
135
|
* disk 磁盘相关操作
|
|
129
136
|
(包括:linkDisk)
|
package/README.md
CHANGED
|
@@ -86,10 +86,10 @@ oipage-cli serve -p 8080
|
|
|
86
86
|
|
|
87
87
|
<img src="./snipping/image-editor.png" />
|
|
88
88
|
|
|
89
|
-
已有功能或更多功能我们将根据实际情况逐步完善和维护,当然,你可以通过 [issue](https://github.com/oi-contrib/
|
|
89
|
+
已有功能或更多功能我们将根据实际情况逐步完善和维护,当然,你可以通过 [issue](https://github.com/oi-contrib/OIPage/issues) 给我们留言,告诉我们你的改进意见。
|
|
90
90
|
|
|
91
91
|
## 版权
|
|
92
92
|
|
|
93
93
|
MIT License
|
|
94
94
|
|
|
95
|
-
Copyright (c) [zxl20070701](https://zxl20070701.github.io/notebook/home.html) 走一步,再走一步
|
|
95
|
+
Copyright (c) [zxl20070701](https://zxl20070701.github.io/notebook/home.html) 走一步,再走一步
|
package/bin/help.js
CHANGED
|
@@ -7,25 +7,38 @@ OIPage@v${packageValue.version}
|
|
|
7
7
|
可以使用的命令如下:
|
|
8
8
|
|
|
9
9
|
【1】oipage-cli serve 开发服务器
|
|
10
|
-
--port|-p 端口号
|
|
11
|
-
|
|
12
|
-
--
|
|
13
|
-
|
|
10
|
+
--port|-p [端口号]
|
|
11
|
+
默认8080
|
|
12
|
+
--baseUrl [文件夹地址]
|
|
13
|
+
服务器根目录
|
|
14
|
+
--config|-c [配置文件地址]
|
|
15
|
+
设置配置文件,相对地址是相对当前命令行
|
|
16
|
+
--cache [true|false]
|
|
17
|
+
是否启用304(默认true表示开启)
|
|
18
|
+
(eg: oipage-cli serve -p 20000 )
|
|
14
19
|
|
|
15
20
|
【2】oipage-cli disk 磁盘操作
|
|
16
|
-
--force|-f
|
|
17
|
-
|
|
18
|
-
--
|
|
19
|
-
|
|
20
|
-
--
|
|
21
|
-
|
|
21
|
+
--force|-f
|
|
22
|
+
强制执行,如果目标地址已有内容,会直接强制删除已有内容
|
|
23
|
+
--delete|-d [文件或文件夹地址]
|
|
24
|
+
删除文件或文件夹
|
|
25
|
+
--delempty [文件夹地址]
|
|
26
|
+
删除空文件夹
|
|
27
|
+
--move|-m [源地址] [软链接地址]
|
|
28
|
+
移动文件或文件夹
|
|
29
|
+
--copy|-c [源地址] [目标地址]
|
|
30
|
+
复制文件或文件夹
|
|
31
|
+
--link|-l [源地址] [软链接地址]
|
|
32
|
+
创建磁盘链接
|
|
33
|
+
(eg: oipage-cli disk -m ./test.js ~/test.js -f )
|
|
22
34
|
|
|
23
35
|
【3】oipage-cli run "任务一" "任务二" ... 运行多命令
|
|
36
|
+
( 如果希望动态给任务传递参数,可以查看: https://github.com/oi-contrib/OIPage/issues/5 )
|
|
24
37
|
|
|
25
38
|
【4】oipage-cli network 网络相关
|
|
26
|
-
--log
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
--log
|
|
40
|
+
打印网络信息
|
|
41
|
+
(eg: oipage-cli network --log )
|
|
29
42
|
\x1b[0m`);
|
|
30
43
|
|
|
31
44
|
};
|
package/bin/run
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
process.title = 'OIPage';
|
|
6
6
|
|
|
7
|
-
const {
|
|
7
|
+
const { spawn } = require('child_process');
|
|
8
8
|
const { join } = require("path");
|
|
9
9
|
const { existsSync, lstatSync } = require("fs");
|
|
10
10
|
const { mergeOption } = require("vislite");
|
|
@@ -68,27 +68,35 @@ else if (process.argv[2] === "run") {
|
|
|
68
68
|
|
|
69
69
|
let argvObj = formatArgv(process.argv, {});
|
|
70
70
|
|
|
71
|
+
let tasks = [], runArgs = [];
|
|
71
72
|
for (let index = 0; index < argvObj.args.length; index++) {
|
|
72
|
-
const child = exec(argvObj.args[index]);
|
|
73
73
|
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
74
|
+
// 参数
|
|
75
|
+
if (/^:/.test(argvObj.args[index])) {
|
|
76
|
+
runArgs.push(argvObj.args[index].replace(/^:/, ""));
|
|
77
|
+
}
|
|
78
78
|
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
79
|
+
// 任务
|
|
80
|
+
else {
|
|
81
|
+
tasks.push(argvObj.args[index]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
for (let index = 0; index < tasks.length; index++) {
|
|
86
|
+
|
|
87
|
+
// 补充动态参数的支持
|
|
88
|
+
// npm run bug:issue5 ":-p 9090"
|
|
89
|
+
// 2025年12月1日 于南京
|
|
90
|
+
let task = (tasks[index] + (runArgs[index] ? (" " + runArgs[index]) : "")).split(" ");
|
|
91
|
+
let command = task.shift();
|
|
92
|
+
|
|
93
|
+
// 修复exec无法正常使用logform问题
|
|
94
|
+
// npm run bug:issue4
|
|
95
|
+
// 2025年12月2日 于南京
|
|
96
|
+
spawn(command, task, {
|
|
88
97
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
console.error(`子线程${index + 1}错误: ${error.message}`);
|
|
98
|
+
// https://nodejs.org/api/child_process.html#child_process_options_stdio
|
|
99
|
+
stdio: 'inherit'
|
|
92
100
|
});
|
|
93
101
|
}
|
|
94
102
|
|
package/bin/tools/network.js
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = function (isAll) {
|
|
|
16
16
|
let network = networks[typeName]
|
|
17
17
|
for (let index = 0; index < network.length; index++) {
|
|
18
18
|
if (network[index].mac != "00:00:00:00:00:00" || isAll) {
|
|
19
|
-
if (network[index].family == 'IPv4'
|
|
19
|
+
if (network[index].family == 'IPv4') {
|
|
20
20
|
if (!IPv4Had[network[index].mac]) {
|
|
21
21
|
infomation.IPv4.push({
|
|
22
22
|
address: network[index].address,
|
|
@@ -25,7 +25,7 @@ module.exports = function (isAll) {
|
|
|
25
25
|
|
|
26
26
|
IPv4Had[network[index].mac] = true;
|
|
27
27
|
}
|
|
28
|
-
} else if (network[index].family == 'IPv6'
|
|
28
|
+
} else if (network[index].family == 'IPv6') {
|
|
29
29
|
if (!IPv6Had[network[index].mac]) {
|
|
30
30
|
infomation.IPv6.push({
|
|
31
31
|
address: network[index].address,
|
package/nodejs/cmdlog/index.js
CHANGED
package/nodejs/disk/index.js
CHANGED
package/nodejs/format/index.js
CHANGED
package/nodejs/json/index.js
CHANGED
package/nodejs/logform/index.js
CHANGED
package/nodejs/reader/index.js
CHANGED
package/nodejs/throttle/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oipage",
|
|
3
|
-
"version": "1.6.0-
|
|
3
|
+
"version": "1.6.0-beta.1",
|
|
4
4
|
"description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "node ./build/index.js watch",
|
|
8
8
|
"build": "node ./build/index.js",
|
|
9
|
-
"serve": "node ./bin/run serve --config ./oipage.config.js"
|
|
9
|
+
"serve": "node ./bin/run serve --config ./oipage.config.js",
|
|
10
|
+
"bug:issue5": "node ./bin/run run \"node ./bin/run serve\"",
|
|
11
|
+
"bug:issue4": "node ./bin/run run \"node ./test/logform/index.spec.js\""
|
|
10
12
|
},
|
|
11
13
|
"bin": {
|
|
12
14
|
"oipage-cli": "bin/run"
|
|
@@ -39,4 +41,4 @@
|
|
|
39
41
|
"xhtml-to-json": "^0.1.0",
|
|
40
42
|
"zipaper": "^0.2.0"
|
|
41
43
|
}
|
|
42
|
-
}
|
|
44
|
+
}
|
package/web/animation/index.js
CHANGED
package/web/format/index.js
CHANGED
package/web/json/index.js
CHANGED
package/web/onReady/index.js
CHANGED
package/web/reader/index.js
CHANGED
package/web/style/index.js
CHANGED
package/web/throttle/index.js
CHANGED