@oipage/cli 0.1.0 → 0.2.0-alpha.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 CHANGED
@@ -3,3 +3,14 @@ v0.1.0:
3
3
  changes:
4
4
  - 初始化版本
5
5
  (承接原OIPagev1.x的命令行相关功能: https://github.com/oi-contrib/OIPage/tree/v1.x)
6
+ v0.2.0:
7
+ date:
8
+ changes:
9
+ - 修复bug
10
+ 1、修复部分服务器日志用户设置name未生效问题
11
+ - 优化改造
12
+ 1、暴露更多有用的插件
13
+ * ZipaperIntercept
14
+ * VISLiteIntercept
15
+ * ScssLoader
16
+ * HtmlLoader
package/README.md CHANGED
@@ -110,6 +110,19 @@ serve({
110
110
  });
111
111
  ```
112
112
 
113
+ ### 可用插件
114
+
115
+ > 0.2.0 新增
116
+
117
+ ```js
118
+ const {
119
+ ZipaperIntercept, // Zipaper框架引入
120
+ VISLiteIntercept, // VISLite库引入
121
+ ScssLoader, // scss文件解析
122
+ HtmlLoader, // html解析成json对象
123
+ } = require("@oipage/cli");
124
+ ```
125
+
113
126
  已有功能或更多功能我们将根据实际情况逐步完善和维护,当然,你可以通过 [issue](https://github.com/oi-contrib/oipage-cli/issues) 给我们留言,告诉我们你的改进意见。
114
127
 
115
128
  ## 版权
package/bin/serve.js CHANGED
@@ -160,7 +160,7 @@ module.exports = function (config) {
160
160
  'Access-Control-Allow-Origin': '*',
161
161
  'Server': 'Powered by ' + name + '@' + version
162
162
  });
163
- response.write(resolve404(filePath, url, website));
163
+ response.write(resolve404(filePath, url, website, config.name || "OIPage"));
164
164
  response.end();
165
165
  }
166
166
 
@@ -12,15 +12,15 @@ const template_404 = readFileSync(join(__dirname, "../template/404.html"), {
12
12
  .replace("${img_folder}", img_folder)
13
13
  .replace("${img_file}", img_file);
14
14
 
15
- module.exports = function (filePath, url, website) {
15
+ module.exports = function (filePath, url, website, name) {
16
16
 
17
17
  let subItems = [];
18
18
 
19
19
  try {
20
20
  subItems = readdirSync(filePath);
21
- console.log("<i> \x1b[1m\x1b[32m[OIPage-http-server] Read Folder: " + url + '\x1b[0m ' + new Date().toLocaleString());
21
+ console.log("<i> \x1b[1m\x1b[32m[" + name + "-http-server] Read Folder: " + url + '\x1b[0m ' + new Date().toLocaleString());
22
22
  } catch (e) {
23
- console.log("<i> \x1b[1m\x1b[32m[OIPage-http-server] Read " + (/\/$/.test(url) ? "Folder" : "File") + ": \x1b[35m" + url + ' 404 Not Found\x1b[0m ' + new Date().toLocaleString());
23
+ console.log("<i> \x1b[1m\x1b[32m[" + name + "-http-server] Read " + (/\/$/.test(url) ? "Folder" : "File") + ": \x1b[35m" + url + ' 404 Not Found\x1b[0m ' + new Date().toLocaleString());
24
24
  try {
25
25
  if (!/\/$/.test(url) || url === "/") {
26
26
  filePath = join(filePath, "../");
@@ -24,7 +24,32 @@ module.exports = {
24
24
  response.write(`let module = { exports: {} };
25
25
  let exports = module.exports;
26
26
  ${source}
27
+ export let Cardinal = module.exports.Cardinal;
28
+ export let Hermite = module.exports.Hermite;
29
+ export let Matrix4 = module.exports.Matrix4;
30
+ export let rotate = module.exports.rotate;
31
+ export let move = module.exports.move;
32
+ export let scale = module.exports.scale;
33
+ export let getLoopColors = module.exports.getLoopColors;
34
+ export let animation = module.exports.animation;
35
+ export let ruler = module.exports.ruler;
36
+ export let SVG = module.exports.SVG;
27
37
  export let Canvas = module.exports.Canvas;
38
+ export let RawCanvas = module.exports.RawCanvas;
39
+ export let getWebGLContext = module.exports.getWebGLContext;
40
+ export let Shader = module.exports.Shader;
41
+ export let Texture = module.exports.Texture;
42
+ export let Buffer = module.exports.Buffer;
43
+ export let Eoap = module.exports.Eoap;
44
+ export let Mercator = module.exports.Mercator;
45
+ export let throttle = module.exports.throttle;
46
+ export let assemble = module.exports.assemble;
47
+ export let MapCoordinate = module.exports.MapCoordinate;
48
+ export let TreeLayout = module.exports.TreeLayout;
49
+ export let PieLayout = module.exports.PieLayout;
50
+ export let BarLayout = module.exports.BarLayout;
51
+ export let initOption = module.exports.initOption;
52
+ export let mergeOption = module.exports.mergeOption;
28
53
  `);
29
54
  response.end();
30
55
  }
package/docs/config.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # 可配置项
2
2
 
3
+ ## name
4
+
5
+ 服务器名称,默认OIPage。
6
+
7
+ ## version
8
+
9
+ 服务器版本,默认使用@oipage/cli版本。
10
+
3
11
  ## devServer
4
12
 
5
13
  ### open
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oipage/cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-alpha.1",
4
4
  "description": "开发快速助手,一个包含常用功能的命令行工具,旨在提升开发效率",
5
5
  "sideEffects": false,
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -20,4 +20,10 @@ exports.serve = function (config) {
20
20
 
21
21
  mergeOption(option, config);
22
22
  require("../bin/serve")(option);
23
- };
23
+ };
24
+
25
+ exports.ZipaperIntercept = require("../bin/website-plugins/intercept/oipage-zipaper-intercept.js");
26
+ exports.VISLiteIntercept = require("../bin/website-plugins/intercept/oipage-vislite-intercept.js");
27
+
28
+ exports.ScssLoader = require("../bin/website-plugins/loader/oipage-scss-loader.js");
29
+ exports.HtmlLoader = require("../bin/website-plugins/loader/oipage-html-loader.js");