oipage 1.6.0-alpha.1 → 1.6.0-beta.0

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 CHANGED
@@ -118,12 +118,16 @@ v1.5.0:
118
118
  v1.6.0:
119
119
  date:
120
120
  changes:
121
+ - 优化改造
122
+ 1、命令行帮助打印更可读
121
123
  - 新增功能
122
124
  1、命令(oipage-cli)
123
125
  * disk
124
126
  --link 创建磁盘链接
125
127
  --delempty 删除空文件夹
126
128
  * network 网络相关
129
+ * run 支持动态参数
130
+ (关联issue: https://github.com/oi-contrib/OIPage/issues/5 )
127
131
  2、API功能(Node.js)
128
132
  * disk 磁盘相关操作
129
133
  (包括: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/VISLite/issues) 给我们留言,告诉我们你的改进意见。
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
- --baseUrl 服务器根目录
12
- --config|-c 设置配置文件
13
- --cache 是否启用304(默认true表示开启)
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
- --delete|-d 删除文件或文件夹
18
- --delempty 删除空文件夹
19
- --move|-m 移动文件或文件夹
20
- --copy|-c 复制文件或文件夹
21
- --link|-l 创建磁盘链接
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
- Powered by https://github.com/zxl20070701
39
+ --log
40
+ 打印网络信息
41
+ (eg: oipage-cli network --log )
29
42
  \x1b[0m`);
30
43
 
31
44
  };
package/bin/run CHANGED
@@ -68,8 +68,23 @@ 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
+
74
+ // 参数
75
+ if (/^:/.test(argvObj.args[index])) {
76
+ runArgs.push(argvObj.args[index].replace(/^:/, ""));
77
+ }
78
+
79
+ // 任务
80
+ else {
81
+ tasks.push(argvObj.args[index]);
82
+ }
83
+ }
84
+
85
+ for (let index = 0; index < tasks.length; index++) {
86
+
87
+ const child = exec(tasks[index] + (runArgs[index] ? (" " + runArgs[index]) : ""));
73
88
 
74
89
  // 监听子线程的stdout
75
90
  child.stdout.on('data', (data) => {
@@ -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' && (network[index].address != '127.0.0.1' || isAll)) {
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' && network[index].address != '::1') {
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,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.6.0-alpha.1
2
+ * animation of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * cmdlog of OIPage v1.6.0-alpha.1
2
+ * cmdlog of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * disk of OIPage v1.6.0-alpha.1
2
+ * disk of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.6.0-alpha.1
2
+ * format of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.6.0-alpha.1
2
+ * json of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {reader} = require("../reader/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * logform of OIPage v1.6.0-alpha.1
2
+ * logform of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {linelog} = require("../cmdlog/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.6.0-alpha.1
2
+ * reader of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.6.0-alpha.1
2
+ * throttle of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oipage",
3
- "version": "1.6.0-alpha.1",
3
+ "version": "1.6.0-beta.0",
4
4
  "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -39,4 +39,4 @@
39
39
  "xhtml-to-json": "^0.1.0",
40
40
  "zipaper": "^0.2.0"
41
41
  }
42
- }
42
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * XMLHttpRequest of OIPage v1.6.0-alpha.1
2
+ * XMLHttpRequest of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.6.0-alpha.1
2
+ * animation of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.6.0-alpha.1
2
+ * format of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/web/json/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.6.0-alpha.1
2
+ * json of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  import {reader} from "../reader/index.js";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * onReady of OIPage v1.6.0-alpha.1
2
+ * onReady of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * performChunk of OIPage v1.6.0-alpha.1
2
+ * performChunk of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.6.0-alpha.1
2
+ * reader of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * style of OIPage v1.6.0-alpha.1
2
+ * style of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.6.0-alpha.1
2
+ * throttle of OIPage v1.6.0-beta.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5