sumor 1.1.2 → 1.2.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.
@@ -0,0 +1,389 @@
1
+ html{
2
+ //--color-blue: #50a1ff;
3
+ //--color-indigo: #6610f2;
4
+ //--color-purple: #926dde;
5
+ //--color-pink: #e83e8c;
6
+ //--color-red: #ff4954;
7
+ //--color-orange: #ffbe00;
8
+ //--color-yellow: #ffba00;
9
+ //--color-green: #3cd458;
10
+ //--color-teal: #20c997;
11
+ //--color-cyan: #17a2b8;
12
+ //--color-white: #fff;
13
+ //--color-gray: #868e96;
14
+ //--color-gray-dark: #343a40;
15
+ //--color-primary: #3f51b5;
16
+ //--color-secondary: #e9ecf0;
17
+ //--color-success: #3cd458;
18
+ //--color-info: #926dde;
19
+ //--color-warning: #ffba00;
20
+ //--color-danger: #ff4954;
21
+ //--color-light: #f8f9fa;
22
+ //--color-dark: #273343;
23
+ //--color-background: #f8f8f8;
24
+ //--font-size: 14px;
25
+ //--font-size-small: 12px;
26
+ //--font-size-large: 16px;
27
+ //--border-radius: 2px;
28
+ }
29
+ *{
30
+ box-sizing: border-box;
31
+ outline: none;
32
+ }
33
+ html,body {
34
+ width: 100%;
35
+ height: 100%
36
+ }
37
+
38
+ input::-ms-clear,input::-ms-reveal {
39
+ display: none
40
+ }
41
+
42
+ *,*:before,*:after {
43
+ box-sizing: border-box
44
+ }
45
+
46
+ html {
47
+ font-family: sans-serif;
48
+ line-height: 1.15;
49
+ -webkit-text-size-adjust: 100%;
50
+ -ms-text-size-adjust: 100%;
51
+ -ms-overflow-style: scrollbar;
52
+ -webkit-tap-highlight-color: rgba(0,0,0,0)
53
+ }
54
+
55
+ body {
56
+ margin: 0;
57
+ font-size: 14px;
58
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";
59
+ font-variant: tabular-nums;
60
+ line-height: 1.5715;
61
+ font-feature-settings: "tnum";
62
+ transition: background 1s cubic-bezier(.075,.82,.165,1);
63
+ overflow-x: hidden;
64
+ font-weight: 400;
65
+ }
66
+
67
+ body { /*IOS禁止微信调整字体大小 */
68
+ -webkit-text-size-adjust:100% !important;
69
+ text-size-adjust:100% !important;
70
+ -moz-text-size-adjust:100% !important;
71
+ }
72
+
73
+ [tabindex="-1"]:focus {
74
+ outline: none!important
75
+ }
76
+
77
+ hr {
78
+ box-sizing: content-box;
79
+ height: 0;
80
+ overflow: visible
81
+ }
82
+
83
+ h1,h2,h3,h4,h5,h6 {
84
+ margin-top: 0;
85
+ margin-bottom: .5em;
86
+ color: $color-dark;
87
+ font-weight: 500;
88
+ transition: color 0.3s ease;
89
+ }
90
+ html.dark{
91
+ h1, h2, h3, h4, h5, h6 {
92
+ color: $color-light;
93
+ }
94
+ }
95
+
96
+ p {
97
+ margin-top: 0;
98
+ margin-bottom: 1em
99
+ }
100
+
101
+ abbr[title],abbr[data-original-title] {
102
+ text-decoration: underline;
103
+ -webkit-text-decoration: underline dotted;
104
+ text-decoration: underline dotted;
105
+ border-bottom: 0;
106
+ cursor: help
107
+ }
108
+
109
+ address {
110
+ margin-bottom: 1em;
111
+ font-style: normal;
112
+ line-height: inherit
113
+ }
114
+
115
+ input[type=text],input[type=password],input[type=number],textarea {
116
+ -webkit-appearance: none
117
+ }
118
+
119
+ ol,ul,dl {
120
+ margin-top: 0;
121
+ margin-bottom: 1em
122
+ }
123
+
124
+ ol ol,ul ul,ol ul,ul ol {
125
+ margin-bottom: 0
126
+ }
127
+
128
+ dt {
129
+ font-weight: 500
130
+ }
131
+
132
+ dd {
133
+ margin-bottom: .5em;
134
+ margin-left: 0
135
+ }
136
+
137
+ blockquote {
138
+ margin: 0 0 1em
139
+ }
140
+
141
+ dfn {
142
+ font-style: italic
143
+ }
144
+
145
+ b,strong {
146
+ font-weight: bolder
147
+ }
148
+
149
+ small {
150
+ font-size: 80%
151
+ }
152
+
153
+ sub,sup {
154
+ position: relative;
155
+ font-size: 75%;
156
+ line-height: 0;
157
+ vertical-align: baseline
158
+ }
159
+
160
+ sub {
161
+ bottom: -.25em
162
+ }
163
+
164
+ sup {
165
+ top: -.5em
166
+ }
167
+
168
+ a {
169
+ text-decoration: none;
170
+ outline: none;
171
+ cursor: pointer;
172
+ transition: color .3s;
173
+ -webkit-text-decoration-skip: objects
174
+ }
175
+
176
+
177
+ a:active,a:hover {
178
+ text-decoration: none;
179
+ outline: 0
180
+ }
181
+
182
+ a:focus {
183
+ text-decoration: none;
184
+ outline: 0
185
+ }
186
+
187
+ a[disabled] {
188
+ color: $color-dark;
189
+ cursor: not-allowed
190
+ }
191
+
192
+ pre,code,kbd,samp {
193
+ font-size: 1em;
194
+ font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace
195
+ }
196
+
197
+ pre {
198
+ margin-top: 0;
199
+ margin-bottom: 1em;
200
+ overflow: auto
201
+ }
202
+
203
+ figure {
204
+ margin: 0 0 1em
205
+ }
206
+
207
+ img {
208
+ vertical-align: middle;
209
+ border-style: none
210
+ }
211
+
212
+ a,area,button,[role=button],input:not([type="range"]),label,select,summary,textarea {
213
+ touch-action: manipulation
214
+ }
215
+
216
+ table {
217
+ border-collapse: collapse
218
+ }
219
+
220
+ caption {
221
+ padding-top: .75em;
222
+ padding-bottom: .3em;
223
+ color: $color-dark;
224
+ text-align: left;
225
+ caption-side: bottom
226
+ }
227
+
228
+ input,button,select,optgroup,textarea {
229
+ margin: 0;
230
+ color: inherit;
231
+ font-size: inherit;
232
+ font-family: inherit;
233
+ line-height: inherit
234
+ }
235
+
236
+ button,input {
237
+ overflow: visible
238
+ }
239
+
240
+ button,select {
241
+ text-transform: none
242
+ }
243
+
244
+ button,html [type=button],[type=reset],[type=submit] {
245
+ -webkit-appearance: button
246
+ }
247
+
248
+ button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner {
249
+ padding: 0;
250
+ border-style: none
251
+ }
252
+
253
+ input[type=radio],input[type=checkbox] {
254
+ box-sizing: border-box;
255
+ /* padding:0; */
256
+ }
257
+
258
+ input[type=date],input[type=time],input[type=datetime-local],input[type=month] {
259
+ -webkit-appearance: listbox
260
+ }
261
+
262
+ textarea {
263
+ overflow: auto;
264
+ resize: vertical
265
+ }
266
+
267
+ fieldset {
268
+ min-width: 0;
269
+ margin: 0;
270
+ padding: 0;
271
+ border: 0
272
+ }
273
+
274
+ legend {
275
+ display: block;
276
+ width: 100%;
277
+ max-width: 100%;
278
+ margin-bottom: .5em;
279
+ padding: 0;
280
+ color: inherit;
281
+ font-size: 1.5em;
282
+ line-height: inherit;
283
+ white-space: normal
284
+ }
285
+
286
+ progress {
287
+ vertical-align: baseline
288
+ }
289
+
290
+ [type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button {
291
+ height: auto
292
+ }
293
+
294
+ [type=search] {
295
+ outline-offset: -2px;
296
+ -webkit-appearance: none
297
+ }
298
+
299
+ [type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration {
300
+ -webkit-appearance: none
301
+ }
302
+
303
+ ::-webkit-file-upload-button {
304
+ font: inherit;
305
+ -webkit-appearance: button
306
+ }
307
+
308
+ output {
309
+ display: inline-block
310
+ }
311
+
312
+ summary {
313
+ display: list-item
314
+ }
315
+
316
+ template {
317
+ display: none
318
+ }
319
+
320
+ [hidden] {
321
+ display: none!important
322
+ }
323
+
324
+ mark {
325
+ padding: .2em;
326
+ background-color: $color-light;
327
+ }
328
+
329
+ html{
330
+ -ms-text-size-adjust: 100%;
331
+ -webkit-font-smoothing: antialiased;
332
+ -moz-osx-font-smoothing: grayscale;
333
+ line-height: 1.5;
334
+ text-align: left;
335
+ }
336
+ a{
337
+ transition: color .3s ease;
338
+ }
339
+
340
+ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
341
+ margin: 0;
342
+ padding: 0
343
+ }
344
+
345
+ ul,ol {
346
+ list-style: none
347
+ }
348
+
349
+
350
+
351
+ html.rtl {
352
+ direction: rtl
353
+ }
354
+
355
+ html{
356
+ font-size: $font-size;
357
+ color: $color-dark;
358
+ background-color: $color-light;
359
+ a{
360
+ color:$color-dark;
361
+ background-color: transparent;
362
+
363
+ &:hover {
364
+ color:rgba($color-dark, .9);
365
+ }
366
+ &:active {
367
+ color:rgba($color-dark, .8);
368
+ }
369
+ }
370
+ }
371
+ html.dark{
372
+ color: $color-light;
373
+ background-color: $color-dark;
374
+ a{
375
+ color:$color-light;
376
+
377
+ &:hover {
378
+ color:rgba($color-light, .9);
379
+ }
380
+ &:active {
381
+ color:rgba($color-light, .8);
382
+ }
383
+ }
384
+ }
385
+
386
+ #app{
387
+ width: 100%;
388
+ height: 100%;
389
+ }
@@ -0,0 +1,64 @@
1
+ import { defineConfig } from 'vite'
2
+ import vuePlugin from '@vitejs/plugin-vue';
3
+ import styleImport from "vite-plugin-style-import";
4
+ import customStyle from "./styleVars.js";
5
+ import fs from "fs";
6
+ import path from 'path'
7
+ import { fileURLToPath } from 'url'
8
+ import pluginRewriteAll from 'vite-plugin-rewrite-all';
9
+
10
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
+
12
+ let pkg = fs.readFileSync(process.cwd()+"/package.json", "utf-8");
13
+ pkg = JSON.parse(pkg);
14
+ const styleImportLibs = [];
15
+ if(pkg.dependencies){
16
+ for(let dep in pkg.dependencies){
17
+ switch (dep) {
18
+ case "ant-design-vue":
19
+ styleImportLibs.push({
20
+ libraryName: "ant-design-vue",
21
+ esModule: true,
22
+ resolveStyle: (name) => `ant-design-vue/es/${name}/style/index.less`
23
+ });
24
+ }
25
+ }
26
+ }
27
+
28
+ const getSSL = (url)=>{
29
+ let ssl = undefined;
30
+ try{
31
+ ssl = fs.readFileSync(url, 'utf-8');
32
+ }catch (e) {
33
+ ssl = undefined;
34
+ }
35
+ return ssl;
36
+ };
37
+
38
+ export default defineConfig({
39
+ root: process.cwd()+"/tmp/web",
40
+ base: '/',
41
+ publicDir: process.cwd()+"/web/public",
42
+ cacheDir: process.cwd()+"/tmp/web/.vite",
43
+ plugins: [
44
+ pluginRewriteAll(),
45
+ vuePlugin(),
46
+ styleImport({
47
+ libs: styleImportLibs
48
+ })
49
+ ],
50
+ resolve: {
51
+ alias: {
52
+ '@': path.resolve(__dirname, './web'),
53
+ },
54
+ },
55
+ server: {
56
+ server: { middlewareMode: 'html' },
57
+ // HTTPS-PLACEHOLDER
58
+ // PORT-PLACEHOLDER
59
+ proxy: {
60
+ // SERVICE-PLACEHOLDER
61
+ },
62
+ },
63
+ css: customStyle
64
+ });
package/README.md DELETED
@@ -1,197 +0,0 @@
1
- # sumor
2
- Sumor Command Line Tool.
3
-
4
- [![NPM version](https://img.shields.io/npm/v/sumor.svg)](https://www.npmjs.com/package/sumor)
5
- [![NPM downloads](https://img.shields.io/npm/dm/sumor.svg)](https://www.npmjs.com/package/sumor)
6
-
7
- A [Sumor Cloud](https://www.sumor.com) Tool.
8
- [More Documentation](https://www.sumor.com/help)
9
-
10
- ## Installation
11
-
12
- ```shell
13
- npm install -D sumor
14
- ```
15
-
16
- Now, you can use the `sumor` command to use the builder tool.
17
-
18
- ## Usage
19
-
20
- ### Initialization
21
-
22
- Quickly initialize the project, generate sample programs and test cases, as well as build configuration files.
23
-
24
- ```shell
25
- sumor init
26
- ```
27
-
28
- ### Code Checking
29
-
30
- It will check the code style and code format. and it will generate a report into `output/lint` folder.
31
-
32
- ```shell
33
- sumor lint
34
- ```
35
-
36
- ##### Automatically fix code style and code format issues
37
-
38
- ```shell
39
- sumor lint --fix
40
- ```
41
-
42
- ### Unit Testing
43
-
44
- It will run the unit test cases which are under `test` folder and suffix with `.test.js`.
45
- Then generate an unit test report into `output/unit` folder. A coverage report into `output/coverage` folder.
46
-
47
- ```shell
48
- sumor test
49
- ```
50
-
51
- ##### --scenario
52
- You can add `--scenario=< case >` to specify the test case which locate in this folder.
53
-
54
- ### Packaging
55
-
56
- Aim to package the library into a single file, and prepare files for publishing to NPM.
57
- It will copy `static` folder into output folder.
58
- It will package the library into output folder. By default, package entry is `src/index.js`.
59
- output folder is `output/production`.
60
-
61
- ```shell
62
- sumor build
63
- ```
64
-
65
- ##### packaging for debugging
66
-
67
- output folder is `output/development`.
68
-
69
- ```shell
70
- sumor build --mode=development
71
- ```
72
-
73
- ##### README Generation
74
- As NPM library should have name and description in package.json. And README file should have the same content as package.json.
75
- It will automatically generate full README.md file into output folder.
76
-
77
- You need to specify the name and description in package.json.
78
- Then specify the document into `README.md`.
79
- And License info into `LICENSE.md`, if no license file, it will load from package.json.
80
-
81
-
82
- ### License Report
83
-
84
- It will generate a license report into `output/license.md`.
85
-
86
- ```shell
87
- sumor license
88
- ```
89
-
90
- ### Publish
91
-
92
- Publish the library to the public repository
93
-
94
- ```shell
95
- sumor publish <version>
96
- ```
97
-
98
- Publish the beta version
99
-
100
- ```shell
101
- sumor publish <version> -b
102
- ```
103
-
104
- Publish the library to the private repository
105
-
106
- ```shell
107
- sumor publish <version> -r <registry> -u <username> -p <password>
108
- ```
109
-
110
- ### Clean
111
-
112
- Clean the dependencies, in case of some dependencies expired.
113
-
114
- ```shell
115
- sumor clean
116
- ```
117
-
118
- ##### --scope
119
-
120
- Specify scope which will be cleaned, example: @sumor-cloud
121
-
122
- ```shell
123
- sumor clean --scope @sumor-cloud
124
- ```
125
-
126
-
127
- ### One-time Deployment
128
- It will deploy the application to the cloud.
129
- ```shell
130
- scd deploy
131
- ```
132
-
133
- ### Continuous Deployment
134
- It will deploy the application to the cloud, and then listen to the changes of the local files, and automatically deploy the application to the cloud when the files are changed.
135
- ```shell
136
- scd deploy --watch
137
- ```
138
-
139
- ### Specify Type
140
- It specifies the configuration file type. If there has different type available, it will automatically convert to the desired target type.
141
- ```shell
142
- scd deploy --type=yaml
143
- ```
144
-
145
- ### Display Logs
146
- It will display the logs of the deployment.
147
- ```shell
148
- scd logs
149
- ```
150
-
151
- ## Deploy Configuration
152
-
153
- ### scope
154
- It defines the scope of the deployment.
155
-
156
- ##### source
157
- * ___< source name >___
158
- * url: git repository url
159
- * username: git username
160
- * password: git password
161
- ##### server
162
- * ___< server name >___
163
- * host: external host
164
- * iHost: internal host
165
- * port: default 22
166
- * username: server username
167
- * password: server password
168
-
169
- ##### env
170
- * ___< environment name >___
171
- * ___< app name >___
172
- * domain: expose domain, like example.com
173
- * entry: should be server name
174
- ### scale
175
- It defines the scale of the deployment. Include env, instance size and instance count.
176
-
177
- * ___< environment name >___
178
- * ___< app name >___
179
- * ___< version >___
180
- * live: if true, it will be available to the public
181
- * instance
182
- * ___< server name >___: instance count
183
-
184
- ## Contributing & Issues
185
-
186
- You can use this tool for free.
187
- But we are a commercial company, to ensure stability, we currently don't offer a joint contribution mechanism.
188
- You can report issues through [Report Library Issue Ticket](https://www.sumor.com/ticket/library), and we will fix them as soon as possible.
189
-
190
- ## License
191
-
192
- In consideration of the chaotic situation in the open source community, we provide obfuscated code for use and security analysis.
193
- However, we do not provide the source code in its original form in order to protect the ongoing maintenance and creative interests and motivations.
194
- The released code in [NPMJS](https://www.npmjs.com) is based on MIT. The source code is closed-source.
195
-
196
- Our tools are free to use in order to help build cloud applications more efficiently. Our commercial purpose is to improve the ecosystem of business websites.
197
- If there are any innovations that greatly benefit the open source community, it will be separated and contributed to the open source community.
package/index.js DELETED
@@ -1 +0,0 @@
1
- !function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var r=o();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var e={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return e.d(r,{a:r}),r},d:(o,r)=>{for(var n in r)e.o(r,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:r[n]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)},o={};e.d(o,{default:()=>f});const r=require("commander");var n=e.n(r);const t=require("fs-extra");var s=e.n(t);const a=require("@sumor-cloud/builder");var c=e.n(a);const i=require("@sumor-cloud/deployer");var d=e.n(i);const l=__dirname,u=process.cwd(),f={cli:e=>{const o=s().readJson(l+"/package.json");console.log(`当前使用的轻呈云部署库位于${l}`),console.log(`当前使用的轻呈云工作目录位于${u}`),n().program.name("sumor").version(o.version||"0.0.0","-v, --version"),c().cli(n()),d().cli(n()),n().program.parse(process.argv)}};return o.default})()));