@oipage/cli 0.3.0-alpha.4 → 0.3.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.
Files changed (74) hide show
  1. package/.github/FUNDING.yml +11 -11
  2. package/AUTHORS.txt +6 -6
  3. package/CHANGELOG +47 -47
  4. package/LICENSE +20 -20
  5. package/README.md +132 -132
  6. package/bin/WebSocket/decodeWsFrame.js +43 -43
  7. package/bin/WebSocket/encodeWsFrame.js +28 -28
  8. package/bin/WebSocket/headersToJSON.js +26 -26
  9. package/bin/WebSocket/index.js +106 -106
  10. package/bin/data/mineTypes.json +104 -104
  11. package/bin/disk.js +42 -42
  12. package/bin/help.js +55 -55
  13. package/bin/intercept.js +15 -15
  14. package/bin/network.js +21 -21
  15. package/bin/notebook/index.js +8 -8
  16. package/bin/proxy.js +82 -82
  17. package/bin/run +146 -146
  18. package/bin/serve.js +318 -318
  19. package/bin/template/404.html +184 -184
  20. package/bin/tools/deleteEmptyFolder.js +33 -33
  21. package/bin/tools/format.js +75 -75
  22. package/bin/tools/isBinary.js +83 -83
  23. package/bin/tools/network.js +42 -42
  24. package/bin/tools/openBrowser.js +34 -34
  25. package/bin/tools/resolve404.js +98 -98
  26. package/bin/tools/resolveImport.js +96 -96
  27. package/bin/website-htmls/components/ui-select-file/index.html +8 -8
  28. package/bin/website-htmls/components/ui-select-file/index.js +42 -42
  29. package/bin/website-htmls/components/ui-select-file/index.scss +44 -44
  30. package/bin/website-htmls/dialogs/imageSize/index.html +54 -54
  31. package/bin/website-htmls/dialogs/imageSize/index.js +53 -53
  32. package/bin/website-htmls/dialogs/imageSize/index.scss +140 -140
  33. package/bin/website-htmls/dialogs/index.js +52 -52
  34. package/bin/website-htmls/images/addFile.svg +1 -1
  35. package/bin/website-htmls/images/img-to-pdf.svg +1 -1
  36. package/bin/website-htmls/index.html +17 -17
  37. package/bin/website-htmls/main.js +13 -13
  38. package/bin/website-htmls/pages/App/index.html +6 -6
  39. package/bin/website-htmls/pages/App/index.js +22 -22
  40. package/bin/website-htmls/pages/App/index.scss +43 -43
  41. package/bin/website-htmls/pages/appStore/index.html +7 -7
  42. package/bin/website-htmls/pages/appStore/index.js +19 -19
  43. package/bin/website-htmls/pages/appStore/index.scss +54 -54
  44. package/bin/website-htmls/pages/chart/index.html +8 -8
  45. package/bin/website-htmls/pages/chart/index.js +72 -72
  46. package/bin/website-htmls/pages/chart/index.scss +71 -71
  47. package/bin/website-htmls/pages/home/index.html +19 -19
  48. package/bin/website-htmls/pages/home/index.js +19 -19
  49. package/bin/website-htmls/pages/home/index.scss +87 -87
  50. package/bin/website-htmls/pages/image-editor/index.html +27 -27
  51. package/bin/website-htmls/pages/image-editor/index.js +106 -106
  52. package/bin/website-htmls/pages/image-editor/index.scss +69 -69
  53. package/bin/website-htmls/pages/img-to-pdf/index.html +3 -3
  54. package/bin/website-htmls/pages/img-to-pdf/index.js +44 -44
  55. package/bin/website-htmls/pages/img-to-pdf/index.scss +9 -9
  56. package/bin/website-htmls/pages/recorder-screen/index.html +15 -15
  57. package/bin/website-htmls/pages/recorder-screen/index.js +227 -227
  58. package/bin/website-htmls/pages/recorder-screen/index.scss +52 -52
  59. package/bin/website-htmls/router.config.js +29 -29
  60. package/bin/website-htmls/styles/common.css +44 -44
  61. package/bin/website-htmls/styles/normalize.css +94 -94
  62. package/bin/website-plugins/intercept/chart.js +33 -33
  63. package/bin/website-plugins/intercept/getPackage.js +17 -17
  64. package/bin/website-plugins/intercept/head.js +8 -8
  65. package/bin/website-plugins/intercept/index.js +8 -8
  66. package/bin/website-plugins/intercept/oipage-vislite-intercept.js +55 -55
  67. package/bin/website-plugins/intercept/oipage-zipaper-intercept.js +36 -36
  68. package/bin/website-plugins/loader/index.js +11 -11
  69. package/bin/website-plugins/loader/oipage-html-loader.js +7 -7
  70. package/bin/website-plugins/loader/oipage-scss-loader.js +149 -149
  71. package/docs/config.md +106 -106
  72. package/package.json +42 -42
  73. package/src/index.js +29 -29
  74. package/types/serve.d.ts +83 -83
@@ -1,141 +1,141 @@
1
- #dialog-root>.content.imageSize {
2
- border: 1px solid gray;
3
- min-height: 300px;
4
- width: 300px;
5
- background-color: white;
6
-
7
- &>h2 {
8
- font-size: 12px;
9
- padding-left: 30px;
10
- background-image: url('./images/image-editor.png');
11
- background-size: auto 80%;
12
- background-repeat: no-repeat;
13
- background-position: 3px center;
14
- border-bottom: 1px solid gray;
15
- line-height: 30px;
16
- height: 30px;
17
- user-select: none;
18
- }
19
-
20
- &>div.right-btn {
21
- display: flex;
22
-
23
- &>div {
24
- &:first-child {
25
- flex-grow: 1;
26
- padding: 10px 0 10px 10px;
27
- }
28
-
29
- &:last-child {
30
- text-align: center;
31
- flex-grow: 0;
32
- flex-shrink: 0;
33
- flex-basis: 70px;
34
-
35
- &>button {
36
- height: 30px;
37
- border-radius: 15px;
38
- width: 60px;
39
- margin-top: 10px;
40
- white-space: nowrap;
41
- padding: 0;
42
-
43
- &:hover {
44
- background-color: rgb(127, 131, 131);
45
- cursor: pointer;
46
- }
47
- }
48
-
49
- }
50
- }
51
- }
52
-
53
- fieldset {
54
- margin-top: 10px;
55
- font-size: 12px;
56
- }
57
-
58
- ul {
59
-
60
- &[lock='yes'] {
61
- background-image: url('./images/lock.png');
62
- background-repeat: no-repeat;
63
- background-position: right;
64
- }
65
-
66
- &>li {
67
- line-height: 2em;
68
- margin-top: 5px;
69
-
70
- &[active='no'] {
71
- display: none;
72
- }
73
-
74
- &>label {
75
- width: 70px;
76
- display: inline-block;
77
- text-align: right;
78
- }
79
-
80
- &>input {
81
- width: 50px;
82
- margin-right: 5px;
83
- }
84
-
85
- .change-type {
86
- font-size: 0;
87
- width: 90px;
88
- display: inline-block;
89
- line-height: 0;
90
- vertical-align: top;
91
- background-image: url('./images/size.png');
92
- background-size: 100% auto;
93
- background-repeat: no-repeat;
94
-
95
- &>span {
96
- display: inline-block;
97
- width: 30px;
98
- height: 30px;
99
- cursor: pointer;
100
- outline: 1px solid #dedede;
101
- }
102
-
103
- &[type='left-top'] {
104
- background-position: -29px -32px;
105
- }
106
-
107
- &[type='center-top'] {
108
- background-position: 1px -32px;
109
- }
110
-
111
- &[type='right-top'] {
112
- background-position: 30px -32px;
113
- }
114
-
115
- &[type='left-middle'] {
116
- background-position: -29px -1px;
117
- }
118
-
119
- &[type='center-middle'] {
120
- background-position: 1px -1px;
121
- }
122
-
123
- &[type='right-middle'] {
124
- background-position: 30px -1px;
125
- }
126
-
127
- &[type='left-bottom'] {
128
- background-position: -29px 30px;
129
- }
130
-
131
- &[type='center-bottom'] {
132
- background-position: 1px 30px;
133
- }
134
-
135
- &[type='right-bottom'] {
136
- background-position: 30px 30px;
137
- }
138
- }
139
- }
140
- }
1
+ #dialog-root>.content.imageSize {
2
+ border: 1px solid gray;
3
+ min-height: 300px;
4
+ width: 300px;
5
+ background-color: white;
6
+
7
+ &>h2 {
8
+ font-size: 12px;
9
+ padding-left: 30px;
10
+ background-image: url('./images/image-editor.png');
11
+ background-size: auto 80%;
12
+ background-repeat: no-repeat;
13
+ background-position: 3px center;
14
+ border-bottom: 1px solid gray;
15
+ line-height: 30px;
16
+ height: 30px;
17
+ user-select: none;
18
+ }
19
+
20
+ &>div.right-btn {
21
+ display: flex;
22
+
23
+ &>div {
24
+ &:first-child {
25
+ flex-grow: 1;
26
+ padding: 10px 0 10px 10px;
27
+ }
28
+
29
+ &:last-child {
30
+ text-align: center;
31
+ flex-grow: 0;
32
+ flex-shrink: 0;
33
+ flex-basis: 70px;
34
+
35
+ &>button {
36
+ height: 30px;
37
+ border-radius: 15px;
38
+ width: 60px;
39
+ margin-top: 10px;
40
+ white-space: nowrap;
41
+ padding: 0;
42
+
43
+ &:hover {
44
+ background-color: rgb(127, 131, 131);
45
+ cursor: pointer;
46
+ }
47
+ }
48
+
49
+ }
50
+ }
51
+ }
52
+
53
+ fieldset {
54
+ margin-top: 10px;
55
+ font-size: 12px;
56
+ }
57
+
58
+ ul {
59
+
60
+ &[lock='yes'] {
61
+ background-image: url('./images/lock.png');
62
+ background-repeat: no-repeat;
63
+ background-position: right;
64
+ }
65
+
66
+ &>li {
67
+ line-height: 2em;
68
+ margin-top: 5px;
69
+
70
+ &[active='no'] {
71
+ display: none;
72
+ }
73
+
74
+ &>label {
75
+ width: 70px;
76
+ display: inline-block;
77
+ text-align: right;
78
+ }
79
+
80
+ &>input {
81
+ width: 50px;
82
+ margin-right: 5px;
83
+ }
84
+
85
+ .change-type {
86
+ font-size: 0;
87
+ width: 90px;
88
+ display: inline-block;
89
+ line-height: 0;
90
+ vertical-align: top;
91
+ background-image: url('./images/size.png');
92
+ background-size: 100% auto;
93
+ background-repeat: no-repeat;
94
+
95
+ &>span {
96
+ display: inline-block;
97
+ width: 30px;
98
+ height: 30px;
99
+ cursor: pointer;
100
+ outline: 1px solid #dedede;
101
+ }
102
+
103
+ &[type='left-top'] {
104
+ background-position: -29px -32px;
105
+ }
106
+
107
+ &[type='center-top'] {
108
+ background-position: 1px -32px;
109
+ }
110
+
111
+ &[type='right-top'] {
112
+ background-position: 30px -32px;
113
+ }
114
+
115
+ &[type='left-middle'] {
116
+ background-position: -29px -1px;
117
+ }
118
+
119
+ &[type='center-middle'] {
120
+ background-position: 1px -1px;
121
+ }
122
+
123
+ &[type='right-middle'] {
124
+ background-position: 30px -1px;
125
+ }
126
+
127
+ &[type='left-bottom'] {
128
+ background-position: -29px 30px;
129
+ }
130
+
131
+ &[type='center-bottom'] {
132
+ background-position: 1px 30px;
133
+ }
134
+
135
+ &[type='right-bottom'] {
136
+ background-position: 30px 30px;
137
+ }
138
+ }
139
+ }
140
+ }
141
141
  }
@@ -1,53 +1,53 @@
1
- import { createApp } from "zipaper";
2
-
3
- const dialogs = {
4
- imageSize: () => import("./imageSize/index.js")
5
- };
6
-
7
- let dialogsResolve = [];
8
- export default {
9
- install(Zipaper) {
10
-
11
- // 打开弹框
12
- Zipaper.prototype.$openDialog = function (dialogName, data) {
13
- let el = document.createElement("div");
14
-
15
- dialogs[dialogName]().then(App => {
16
-
17
- // 准备好挂载点
18
- el.setAttribute("class", "content " + dialogName);
19
-
20
- // 创建并挂载
21
- document.getElementById("dialog-root").appendChild(el);
22
-
23
- if (data) {
24
- let props = {};
25
- for (let key in data) {
26
- props[key] = {
27
- default: data[key]
28
- };
29
- }
30
- App.default.props = props;
31
- } else {
32
- App.default.props = {};
33
- }
34
-
35
- createApp(App.default).mount(el);
36
- });
37
-
38
- return new Promise((resolve) => {
39
- dialogsResolve.push({
40
- resolve,
41
- el
42
- });
43
- });
44
- };
45
-
46
- // 关闭弹框
47
- Zipaper.prototype.$closeDialog = function (data) {
48
- let dialog = dialogsResolve.pop();
49
- dialog.el.parentNode.removeChild(dialog.el);
50
- dialog.resolve(data);
51
- };
52
- }
1
+ import { createApp } from "zipaper";
2
+
3
+ const dialogs = {
4
+ imageSize: () => import("./imageSize/index.js")
5
+ };
6
+
7
+ let dialogsResolve = [];
8
+ export default {
9
+ install(Zipaper) {
10
+
11
+ // 打开弹框
12
+ Zipaper.prototype.$openDialog = function (dialogName, data) {
13
+ let el = document.createElement("div");
14
+
15
+ dialogs[dialogName]().then(App => {
16
+
17
+ // 准备好挂载点
18
+ el.setAttribute("class", "content " + dialogName);
19
+
20
+ // 创建并挂载
21
+ document.getElementById("dialog-root").appendChild(el);
22
+
23
+ if (data) {
24
+ let props = {};
25
+ for (let key in data) {
26
+ props[key] = {
27
+ default: data[key]
28
+ };
29
+ }
30
+ App.default.props = props;
31
+ } else {
32
+ App.default.props = {};
33
+ }
34
+
35
+ createApp(App.default).mount(el);
36
+ });
37
+
38
+ return new Promise((resolve) => {
39
+ dialogsResolve.push({
40
+ resolve,
41
+ el
42
+ });
43
+ });
44
+ };
45
+
46
+ // 关闭弹框
47
+ Zipaper.prototype.$closeDialog = function (data) {
48
+ let dialog = dialogsResolve.pop();
49
+ dialog.el.parentNode.removeChild(dialog.el);
50
+ dialog.resolve(data);
51
+ };
52
+ }
53
53
  }
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 12v-2h1v2h2v1h-2v2h-1v-2h-2v-1h2zm5 8H6V4H5v17h13v-1zm1 0v2H4V3h2V1h10l5 5v14h-2zM7 2v17h13V6l-4-4H7zm9 0l4 4h-4V2z"></path></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 12v-2h1v2h2v1h-2v2h-1v-2h-2v-1h2zm5 8H6V4H5v17h13v-1zm1 0v2H4V3h2V1h10l5 5v14h-2zM7 2v17h13V6l-4-4H7zm9 0l4 4h-4V2z"></path></svg>
@@ -1 +1 @@
1
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z" fill="#FFB700"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.99992 8L13.9999 14.5625L16.9544 11.7927L24 17.5625V20L17.0455 14.3589L13.9999 17.2141L6.99992 10.6517L0 17.1875V14.5625L6.99992 8Z" fill="white"></path><circle cx="18" cy="6" r="3" fill="white"></circle></svg>
1
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z" fill="#FFB700"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.99992 8L13.9999 14.5625L16.9544 11.7927L24 17.5625V20L17.0455 14.3589L13.9999 17.2141L6.99992 10.6517L0 17.1875V14.5625L6.99992 8Z" fill="white"></path><circle cx="18" cy="6" r="3" fill="white"></circle></svg>
@@ -1,18 +1,18 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-cn">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>@oipage/cli 应用市场</title>
8
- <link rel="shortcut icon" href="./images/logo.png">
9
- <link rel="stylesheet" href="./styles/normalize.css">
10
- <link rel="stylesheet" href="./styles/common.css">
11
- </head>
12
-
13
- <body>
14
- <div id="root"></div>
15
- <script type="module" src="./main.js"></script>
16
- </body>
17
-
1
+ <!DOCTYPE html>
2
+ <html lang="zh-cn">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>@oipage/cli 应用市场</title>
8
+ <link rel="shortcut icon" href="./images/logo.png">
9
+ <link rel="stylesheet" href="./styles/normalize.css">
10
+ <link rel="stylesheet" href="./styles/common.css">
11
+ </head>
12
+
13
+ <body>
14
+ <div id="root"></div>
15
+ <script type="module" src="./main.js"></script>
16
+ </body>
17
+
18
18
  </html>
@@ -1,14 +1,14 @@
1
- import { createApp } from "zipaper"
2
-
3
- import App from "./pages/App/index.js"
4
- import router from "./router.config.js"
5
- import dialogs from "./dialogs/index.js"
6
- import uiSelectFile from "./components/ui-select-file/index.js"
7
-
8
- // https://oi-contrib.github.io/Zipaper/index.html
9
-
10
- createApp(App)
11
- .use(router) // 路由
12
- .use(dialogs) // 弹框
13
- .component("ui-select-file", uiSelectFile)
1
+ import { createApp } from "zipaper"
2
+
3
+ import App from "./pages/App/index.js"
4
+ import router from "./router.config.js"
5
+ import dialogs from "./dialogs/index.js"
6
+ import uiSelectFile from "./components/ui-select-file/index.js"
7
+
8
+ // https://oi-contrib.github.io/Zipaper/index.html
9
+
10
+ createApp(App)
11
+ .use(router) // 路由
12
+ .use(dialogs) // 弹框
13
+ .component("ui-select-file", uiSelectFile)
14
14
  .mount(document.getElementById("root")) // 挂载到页面
@@ -1,7 +1,7 @@
1
- <router></router>
2
- <div id="dialog-root">
3
- <div class="mask" z-on:click="closeDialog"></div>
4
- </div>
5
- <a class="fork" href="https://github.com/oi-contrib/oipage-cli" target="_blank">
6
- Fork me on Github
1
+ <router></router>
2
+ <div id="dialog-root">
3
+ <div class="mask" z-on:click="closeDialog"></div>
4
+ </div>
5
+ <a class="fork" href="https://github.com/oi-contrib/oipage-cli" target="_blank">
6
+ Fork me on Github
7
7
  </a>
@@ -1,23 +1,23 @@
1
- import { defineElement } from "zipaper"
2
- import template from "./index.html"
3
- import style from "./index.scss"
4
-
5
- export default defineElement({
6
- template,
7
- data() {
8
- return {
9
-
10
- }
11
- },
12
- methods: {
13
-
14
- // 点击遮罩关闭弹框
15
- closeDialog() {
16
- this.$closeDialog()
17
- }
18
-
19
- },
20
- style: {
21
- content: style
22
- }
1
+ import { defineElement } from "zipaper"
2
+ import template from "./index.html"
3
+ import style from "./index.scss"
4
+
5
+ export default defineElement({
6
+ template,
7
+ data() {
8
+ return {
9
+
10
+ }
11
+ },
12
+ methods: {
13
+
14
+ // 点击遮罩关闭弹框
15
+ closeDialog() {
16
+ this.$closeDialog()
17
+ }
18
+
19
+ },
20
+ style: {
21
+ content: style
22
+ }
23
23
  })
@@ -1,44 +1,44 @@
1
- #dialog-root {
2
- width: 0;
3
- height: 0;
4
- position: fixed;
5
- left: 0;
6
- top: 0;
7
- z-index: 101;
8
-
9
- .mask {
10
- width: 100vw;
11
- height: 100vh;
12
- background-color: #0000004f;
13
-
14
- &:last-child {
15
- display: none;
16
- }
17
- }
18
-
19
- .content {
20
- display: none;
21
- position: absolute;
22
- left: 50vw;
23
- top: 50vh;
24
- transform: translateX(-50%) translateY(-50%);
25
-
26
- &:last-child {
27
- display: block;
28
- }
29
- }
30
- }
31
-
32
- .fork {
33
- line-height: 30px;
34
- position: fixed;
35
- background-color: #607D8B;
36
- text-align: center;
37
- color: white;
38
- outline: 2px dashed #607D8B;
39
- width: 200px;
40
- transform: rotate(45deg);
41
- right: -45px;
42
- top: 45px;
43
- z-index: 1;
1
+ #dialog-root {
2
+ width: 0;
3
+ height: 0;
4
+ position: fixed;
5
+ left: 0;
6
+ top: 0;
7
+ z-index: 101;
8
+
9
+ .mask {
10
+ width: 100vw;
11
+ height: 100vh;
12
+ background-color: #0000004f;
13
+
14
+ &:last-child {
15
+ display: none;
16
+ }
17
+ }
18
+
19
+ .content {
20
+ display: none;
21
+ position: absolute;
22
+ left: 50vw;
23
+ top: 50vh;
24
+ transform: translateX(-50%) translateY(-50%);
25
+
26
+ &:last-child {
27
+ display: block;
28
+ }
29
+ }
30
+ }
31
+
32
+ .fork {
33
+ line-height: 30px;
34
+ position: fixed;
35
+ background-color: #607D8B;
36
+ text-align: center;
37
+ color: white;
38
+ outline: 2px dashed #607D8B;
39
+ width: 200px;
40
+ transform: rotate(45deg);
41
+ right: -45px;
42
+ top: 45px;
43
+ z-index: 1;
44
44
  }
@@ -1,8 +1,8 @@
1
- <div class="appstore-view">
2
- <header>
3
- <span title="返回首页" class="btn" z-on:click="goto('/appStore/home')">
4
- 应用市场
5
- </span>
6
- </header>
7
- <router></router>
1
+ <div class="appstore-view">
2
+ <header>
3
+ <span title="返回首页" class="btn" z-on:click="goto('/appStore/home')">
4
+ 应用市场
5
+ </span>
6
+ </header>
7
+ <router></router>
8
8
  </div>
@@ -1,20 +1,20 @@
1
- import { defineElement, ref } from "zipaper"
2
- import template from "./index.html"
3
- import style from "./index.scss"
4
-
5
- export default defineElement({
6
- template,
7
- data() {
8
- return {
9
-
10
- }
11
- },
12
- methods: {
13
- goto(url) {
14
- this.$goto(url)
15
- }
16
- },
17
- style: {
18
- content: style
19
- }
1
+ import { defineElement, ref } from "zipaper"
2
+ import template from "./index.html"
3
+ import style from "./index.scss"
4
+
5
+ export default defineElement({
6
+ template,
7
+ data() {
8
+ return {
9
+
10
+ }
11
+ },
12
+ methods: {
13
+ goto(url) {
14
+ this.$goto(url)
15
+ }
16
+ },
17
+ style: {
18
+ content: style
19
+ }
20
20
  })