mm_statics 1.9.3 → 1.9.5

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.
@@ -0,0 +1,24 @@
1
+ {
2
+ // 路由路径,注意:这里是泛路径,相当于/*
3
+ "path": "${path || '/${name}'}",
4
+ // 名称, 由中英文和下“_”组成, 用于修改或卸载 例如: demo
5
+ "name": "${name || 'static'}",
6
+ // 标题, 用于查询时
7
+ "title": "${title || 'static资源'}",
8
+ // 状态 0未启用,1启用
9
+ "state": 1,
10
+ // 资源缓存寿命,单位:秒
11
+ "max_age": 0,
12
+ // 是否恒久不变,一般资源文件可能变化,所以这里一般是false
13
+ "immutable": false,
14
+ // 是否使用brotli压缩方式
15
+ "brotli": true,
16
+ // 是否启用gzip压缩方式
17
+ "gzip": true,
18
+ // 是否限制访问指定拓展名的文件,多个
19
+ "extensions": null,
20
+ // 是否转换JS、vue代码为amd标准,true的情况下会把es6和commonJS都转成amd格式
21
+ "convert_amd": false,
22
+ // 调用脚本文件,如果请求改路由情况会调用改脚本文件 ./static.js
23
+ "main": ""
24
+ }
@@ -0,0 +1,31 @@
1
+
2
+ module.exports = {
3
+ /**
4
+ * 执行前
5
+ * @param {object} params 请求参数
6
+ * @param {object} ctx 请求上下文
7
+ * @param {object} options 运行选项
8
+ */
9
+ async before(params, ctx, options) { },
10
+
11
+ /**
12
+ * 执行(服务式调用,不接收 next)
13
+ * @param {object} params 请求参数
14
+ * @param {object} ctx 请求上下文
15
+ * @param {object} options 运行选项
16
+ * @returns {Promise<string>} 命中返回物理文件路径,未命中返回空串
17
+ */
18
+ async main(params, ctx, options) {
19
+ return await this.run(params, ctx, options);
20
+ },
21
+
22
+ /**
23
+ * 执行后
24
+ * @param {object} params 请求参数
25
+ * @param {object} ctx 请求上下文
26
+ * @param {object} options 运行选项
27
+ */
28
+ async after(params, ctx, options) {
29
+
30
+ }
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_statics",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
4
4
  "description": "这是超级美眉statics函数模块,用于web服务端statics缓存",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -36,12 +36,14 @@
36
36
  },
37
37
  "homepage": "https://gitee.com/qiuwenwu91/mm_statics#readme",
38
38
  "files": [
39
+ "eslint.config.js",
39
40
  "index.js",
40
- "lib/vue_compiler.js",
41
+ "lib/config.tpl.json",
42
+ "lib/manager.js",
43
+ "lib/script.tpl.js",
41
44
  "lib/static.js",
42
45
  "lib/static_handle.js",
43
- "lib/manager.js",
44
- "eslint.config.js",
46
+ "lib/vue_compiler.js",
45
47
  "static/"
46
48
  ],
47
49
  "dependencies": {
@@ -61,6 +63,7 @@
61
63
  "eslint-plugin-jsdoc": "^65.3.4",
62
64
  "koa": "^3.2.1",
63
65
  "mm_eslint": "^1.7.7",
66
+ "mm_expand": "^2.5.4",
64
67
  "mocha": "^12.0.3",
65
68
  "supertest": "^7.3.1"
66
69
  }