oipage 1.3.0-alpha.3 → 1.3.1-alpha.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
@@ -49,12 +49,13 @@ v1.2.1:
49
49
  - 修复bug
50
50
  1、开发服务器
51
51
  * 修复路径不存在时未正确同步修改浏览器地址问题
52
- v1.3.0:
53
- date:
52
+ v1.3.0:(废弃,请用1.3.1代替)
53
+ date:2025-05-18
54
54
  changes:
55
55
  - 修复bug
56
56
  1、开发服务器
57
57
  * 修复服务器根路径判断错误导致node_modules包查找错误问题
58
+ 2、修复animation动画types类型定义错误问题
58
59
  - 新增功能
59
60
  1、API功能(浏览器)
60
61
  * reader 文本分析读取器
@@ -66,3 +67,9 @@ v1.3.0:
66
67
  3、开发服务器
67
68
  * 新增 devServer.intercept 请求拦截
68
69
  * 新增对 if-modified-since和last-modified 之304协商缓存的支持
70
+ v1.3.1:
71
+ date:
72
+ changes:
73
+ - 修复bug
74
+ 1、开发服务器
75
+ * 由于是否入口判断导致import语句未正确解析
package/bin/serve.js CHANGED
@@ -6,7 +6,6 @@ const network = require("./tools/network.js");
6
6
  const mineTypes = require("./data/mineTypes.json");
7
7
  const resolve404 = require("./tools/resolve404.js");
8
8
  const resolveImportFactory = require("./tools/resolveImport.js");
9
- const { formatRawHeaders } = require("./tools/format.js");
10
9
  const { doIntercept } = require("./intercept.js");
11
10
 
12
11
  // 开发服务器
@@ -17,7 +16,7 @@ module.exports = function (config) {
17
16
  const basePath = (/^\./.test(config.devServer.baseUrl)) ? join(process.cwd(), config.devServer.baseUrl) : config.devServer.baseUrl; // 服务器根路径
18
17
 
19
18
  let Server = createServer(function (request, response) {
20
- let headers = formatRawHeaders(request.rawHeaders);
19
+ let headers = request.headers;
21
20
  let url = decodeURIComponent(request.url);
22
21
 
23
22
  let urlArray = url.split("?");
@@ -48,19 +47,19 @@ module.exports = function (config) {
48
47
  'Last-Modified': fileModifiedTime
49
48
  };
50
49
 
51
- if (headers["If-Modified-Since"]) {
52
- let ifModifiedSince = new Date(headers["If-Modified-Since"]).valueOf()
50
+ if (headers["if-modified-since"]) {
51
+ let ifModifiedSince = new Date(headers["if-modified-since"]).valueOf()
53
52
  let lastModified = new Date(fileModifiedTime).valueOf()
54
53
  if (lastModified <= ifModifiedSince) {
55
54
  response.writeHead('304', responseHeader);
56
55
  response.end();
57
- console.log("<i> \x1b[1m\x1b[32m[OIPage-dev-server] Cache File: " + url + "\x1b[0m " + new Date().toLocaleString()+"\x1b[33m\x1b[1m 304\x1b[0m");
56
+ console.log("<i> \x1b[1m\x1b[32m[OIPage-dev-server] Cache File: " + url + "\x1b[0m " + new Date().toLocaleString() + "\x1b[33m\x1b[1m 304\x1b[0m");
58
57
  return;
59
58
  }
60
59
  }
61
60
 
62
61
  let sendType = "";
63
- let entry = headers.Accept !== "*/*";
62
+ let entry = headers.accept !== "*/*";
64
63
 
65
64
  // 如果文件小于10M,认为不大,直接读取
66
65
  if (fileInfo.size < 10 * 1024 * 1024) {
@@ -73,17 +73,4 @@ exports.formatArgv = function (argvs, shorts, isArray) {
73
73
  pushValue();
74
74
 
75
75
  return result;
76
- };
77
-
78
- /**
79
- * 请求头解析
80
- * @param {*} rawHeaders
81
- * @returns
82
- */
83
- exports.formatRawHeaders = function (rawHeaders) {
84
- let headers = {};
85
- for (let i = 0; i < rawHeaders.length - 1; i += 2) {
86
- headers[rawHeaders[i]] = rawHeaders[i + 1];
87
- }
88
- return headers;
89
76
  };
@@ -1,12 +1,20 @@
1
+ interface animationResult {
2
+
3
+ /**
4
+ * 一个函数,调用该函数,可以提前结束动画
5
+ */
6
+ stop(): void
7
+ }
8
+
1
9
  interface animationFun {
2
10
  (deep: number): void
3
11
  }
4
12
 
5
13
  /**
6
- * 轮询动画,返回一个函数,调用该函数,可以提前结束动画
14
+ * 轮询动画
7
15
  */
8
16
  export interface animationType {
9
- (doback: animationFun, duration?: number, callback?: animationFun): Function
17
+ (doback: animationFun, duration?: number, callback?: animationFun): animationResult
10
18
  }
11
19
 
12
20
  export let animation: animationType
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.3.0-alpha.3
2
+ * animation of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * cmdlog of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * disk of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * json of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * logform of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * reader of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * throttle of OIPage v1.3.1-alpha.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.3.0-alpha.3",
3
+ "version": "1.3.1-alpha.0",
4
4
  "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -35,6 +35,6 @@
35
35
  },
36
36
  "homepage": "https://oi-contrib.github.io/OIPage",
37
37
  "dependencies": {
38
- "vislite": "^1.3.0"
38
+ "vislite": "^1.4.0"
39
39
  }
40
40
  }
@@ -1,12 +1,20 @@
1
+ interface animationResult {
2
+
3
+ /**
4
+ * 一个函数,调用该函数,可以提前结束动画
5
+ */
6
+ stop(): void
7
+ }
8
+
1
9
  interface animationFun {
2
10
  (deep: number): void
3
11
  }
4
12
 
5
13
  /**
6
- * 轮询动画,返回一个函数,调用该函数,可以提前结束动画
14
+ * 轮询动画
7
15
  */
8
16
  export interface animationType {
9
- (doback: animationFun, duration?: number, callback?: animationFun): Function
17
+ (doback: animationFun, duration?: number, callback?: animationFun): animationResult
10
18
  }
11
19
 
12
20
  export let animation: animationType
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.3.0-alpha.3
2
+ * animation of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * json of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * onReady of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * performChunk of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * reader of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * style of OIPage v1.3.1-alpha.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.3.0-alpha.3
2
+ * throttle of OIPage v1.3.1-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5