meixifrontserve 0.6.99 → 0.7.12

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.
@@ -1,41 +1,41 @@
1
- const urlConfig = {
2
- // 开发环境需要具体的ip地址与端口号
3
- serveByDev: {
4
- urlPrefixes: [],
5
- authUrl: 'auth.wubangtu.xyz/login',
6
- wsUrl: 'ws://gateway.wubangtu.xyz:9999/ws/websocket/mxapp'
7
- },
8
- serveByTest: {
9
- urlPrefixes: [],
10
- authUrl: 'testauth.wubangtu.xyz/login',
11
- wsUrl: 'ws://gateway.wubangtu.xyz:9999/ws/websocket/mxapp'
12
- },
13
- beta: {
14
- urlPrefixes: ['wubangtu', 'xyz'],
15
- authUrl:'auth.wubangtu.xyz/login',
16
- wsUrl: 'ws://gateway.wubangtu.xyz:9999/ws/websocket/mxapp'
17
- },
18
- pre: {
19
- urlPrefixes: ['pre', 'meixioa', 'com'],
20
- authUrl: 'pre.auth.meixioa.com/login',
21
- wsUrl: 'ws://pre.gateway.meixioa.com/ws/websocket/mxapp'
22
- },
23
- testing: {
24
- urlPrefixes: ['test', 'meixioa', 'com'],
25
- authUrl: 'testauth.wubangtu.xyz/login',
26
- wsUrl: 'ws://pre.gateway.meixioa.com/ws/websocket/mxapp'
27
- },
28
- test2ing: {
29
- urlPrefixes: ['test2', 'meixioa', 'com'],
30
- authUrl: 'test2auth.wubangtu.xyz/login',
31
- wsUrl: 'ws://pre.gateway.meixioa.com/ws/websocket/mxapp'
32
- },
33
- prod: {
34
- urlPrefixes: ['meixioa', 'com'],
35
- authUrl: 'auth.meixioa.com/login',
36
- wsUrl: 'wss://ws.gateway.meixioa.com/ws/websocket/mxapp'
37
- }
38
- }
39
-
40
-
41
- module.exports = urlConfig
1
+ const urlConfig = {
2
+ // 开发环境需要具体的ip地址与端口号
3
+ serveByDev: {
4
+ urlPrefixes: [],
5
+ authUrl: 'auth.wubangtu.xyz/login',
6
+ wsUrl: 'ws://gateway.wubangtu.xyz:9999/ws/websocket/mxapp'
7
+ },
8
+ serveByTest: {
9
+ urlPrefixes: [],
10
+ authUrl: 'testauth.wubangtu.xyz/login',
11
+ wsUrl: 'ws://gateway.wubangtu.xyz:9999/ws/websocket/mxapp'
12
+ },
13
+ beta: {
14
+ urlPrefixes: ['wubangtu', 'xyz'],
15
+ authUrl:'auth.wubangtu.xyz/login',
16
+ wsUrl: 'ws://gateway.wubangtu.xyz:9999/ws/websocket/mxapp'
17
+ },
18
+ pre: {
19
+ urlPrefixes: ['pre', 'meixioa', 'com'],
20
+ authUrl: 'pre.auth.meixioa.com/login',
21
+ wsUrl: 'ws://pre.gateway.meixioa.com/ws/websocket/mxapp'
22
+ },
23
+ testing: {
24
+ urlPrefixes: ['test', 'meixioa', 'com'],
25
+ authUrl: 'testauth.wubangtu.xyz/login',
26
+ wsUrl: 'ws://pre.gateway.meixioa.com/ws/websocket/mxapp'
27
+ },
28
+ test2ing: {
29
+ urlPrefixes: ['test2', 'meixioa', 'com'],
30
+ authUrl: 'test2auth.wubangtu.xyz/login',
31
+ wsUrl: 'ws://pre.gateway.meixioa.com/ws/websocket/mxapp'
32
+ },
33
+ prod: {
34
+ urlPrefixes: ['meixioa', 'com'],
35
+ authUrl: 'auth.meixioa.com/login',
36
+ wsUrl: 'wss://ws.gateway.meixioa.com/ws/websocket/mxapp'
37
+ }
38
+ }
39
+
40
+
41
+ module.exports = urlConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixifrontserve",
3
- "version": "0.6.99",
3
+ "version": "0.7.12",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -1,19 +1,19 @@
1
- const EnvByBuildController = require('./envByBuildController')
2
-
3
- class EnvByBetaController extends EnvByBuildController {
4
- constructor(projectName, envType) {
5
- super(projectName, envType);
6
- this.envName = 'beta'
7
- this.envType = 'beta'
8
- this.verName = 'beta'
9
- }
10
-
11
-
12
- getSystemUrl() {
13
- this.urlConfig.urlPrefixes.splice(0, 0, this.projectParams.urlPrefix[`${this.envType}`]);
14
- return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
15
- }
16
- }
17
-
18
-
19
- module.exports = EnvByBetaController;
1
+ const EnvByBuildController = require('./envByBuildController')
2
+
3
+ class EnvByBetaController extends EnvByBuildController {
4
+ constructor(projectName, envType) {
5
+ super(projectName, envType);
6
+ this.envName = 'beta'
7
+ this.envType = 'beta'
8
+ this.verName = 'beta'
9
+ }
10
+
11
+
12
+ getSystemUrl() {
13
+ this.urlConfig.urlPrefixes.splice(0, 0, this.projectParams.urlPrefix[`${this.envType}`]);
14
+ return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
15
+ }
16
+ }
17
+
18
+
19
+ module.exports = EnvByBetaController;
@@ -1,93 +1,93 @@
1
- #! /usr/bin/env node
2
- const ServerController = require('./serveController')
3
- const urlConfig = require('../config/urlConfig');
4
-
5
- const getEnvFileTemplate = require('../config/envFileTemplate')
6
- const path = require("path");
7
- const fs = require('fs');
8
- const packageJson = require("../config/package.json");
9
- const childProcess = require("child_process");
10
- const {exec} = childProcess;
11
- const shell = require('shelljs');
12
-
13
- // 打包环境
14
- class EnvByBuildController extends ServerController {
15
-
16
- constructor(projectName, envType) {
17
- super(projectName);
18
- this.port = 8888;
19
- this.envName = '';
20
- this.envType = envType;
21
-
22
- this.urlConfig = null;
23
-
24
- }
25
-
26
- async onStart() {
27
- await super.onStart();
28
- this.onRunServe();
29
- }
30
-
31
-
32
- async createEnvFiles() {
33
- this.urlConfig = urlConfig[`${this.verName}`];
34
-
35
- console.log(this.urlConfig);
36
-
37
- let envFileParams = {
38
- envName: this.envName,
39
- proxy: '/proxy',
40
- systemId: this.projectParams.systemId,
41
- systemName: this.projectParams.systemName,
42
- apiUrl: '/api/',
43
- systemUrl: this.getSystemUrl(),
44
- authUrl: this.urlConfig.authUrl,
45
- wsUrl: this.urlConfig.wsUrl,
46
- verName: this.verName,
47
- }
48
- return getEnvFileTemplate(envFileParams);
49
-
50
- }
51
-
52
-
53
- async getServerPort() {
54
-
55
- let flag = await this.isPortAvailable(this.port);
56
-
57
- if (!flag) {
58
- this.port += 1;
59
- return false;
60
- }
61
- return true;
62
-
63
- }
64
-
65
-
66
- writeEnvFile(fileContent) {
67
- const press = process.cwd();
68
- const fileUrl = path.join(press, `./.env.${this.envType}`);
69
- fs.writeFileSync(fileUrl, fileContent);
70
-
71
- }
72
-
73
-
74
- onRunServe() {
75
- console.log('正在下载依赖');
76
- exec('npm install --legacy-peer-deps', async (error, stdout, stderr) => {
77
- console.log(error);
78
- if (!error) {
79
- shell.exec(`npm run build:${this.envType}`, (error, stdout, stderr) => {
80
- console.log(error);
81
- })
82
- } else {
83
- console.error('依赖下载失败!')
84
- }
85
- });
86
-
87
- }
88
-
89
-
90
- }
91
-
92
-
93
- module.exports = EnvByBuildController;
1
+ #! /usr/bin/env node
2
+ const ServerController = require('./serveController')
3
+ const urlConfig = require('../config/urlConfig');
4
+
5
+ const getEnvFileTemplate = require('../config/envFileTemplate')
6
+ const path = require("path");
7
+ const fs = require('fs');
8
+ const packageJson = require("../config/package.json");
9
+ const childProcess = require("child_process");
10
+ const {exec} = childProcess;
11
+ const shell = require('shelljs');
12
+
13
+ // 打包环境
14
+ class EnvByBuildController extends ServerController {
15
+
16
+ constructor(projectName, envType) {
17
+ super(projectName);
18
+ this.port = 8888;
19
+ this.envName = '';
20
+ this.envType = envType;
21
+
22
+ this.urlConfig = null;
23
+
24
+ }
25
+
26
+ async onStart() {
27
+ await super.onStart();
28
+ this.onRunServe();
29
+ }
30
+
31
+
32
+ async createEnvFiles() {
33
+ this.urlConfig = urlConfig[`${this.verName}`];
34
+
35
+ console.log(this.urlConfig);
36
+
37
+ let envFileParams = {
38
+ envName: this.envName,
39
+ proxy: '/proxy',
40
+ systemId: this.projectParams.systemId,
41
+ systemName: this.projectParams.systemName,
42
+ apiUrl: '/api/',
43
+ systemUrl: this.getSystemUrl(),
44
+ authUrl: this.urlConfig.authUrl,
45
+ wsUrl: this.urlConfig.wsUrl,
46
+ verName: this.verName,
47
+ }
48
+ return getEnvFileTemplate(envFileParams);
49
+
50
+ }
51
+
52
+
53
+ async getServerPort() {
54
+
55
+ let flag = await this.isPortAvailable(this.port);
56
+
57
+ if (!flag) {
58
+ this.port += 1;
59
+ return false;
60
+ }
61
+ return true;
62
+
63
+ }
64
+
65
+
66
+ writeEnvFile(fileContent) {
67
+ const press = process.cwd();
68
+ const fileUrl = path.join(press, `./.env.${this.envType}`);
69
+ fs.writeFileSync(fileUrl, fileContent);
70
+
71
+ }
72
+
73
+
74
+ onRunServe() {
75
+ console.log('正在下载依赖');
76
+ exec('npm install --legacy-peer-deps', async (error, stdout, stderr) => {
77
+ console.log(error);
78
+ if (!error) {
79
+ shell.exec(`npm run build:${this.envType}`, (error, stdout, stderr) => {
80
+ console.log(error);
81
+ })
82
+ } else {
83
+ console.error('依赖下载失败!')
84
+ }
85
+ });
86
+
87
+ }
88
+
89
+
90
+ }
91
+
92
+
93
+ module.exports = EnvByBuildController;
@@ -1,21 +1,21 @@
1
- const EnvByBuildController = require('./envByBuildController');
2
-
3
-
4
- class EnvByPreController extends EnvByBuildController {
5
- constructor(projectName, envType) {
6
- super(projectName, envType);
7
- this.envName = 'preview'
8
- this.envType = 'pre'
9
- this.verName = 'pre'
10
- }
11
-
12
-
13
- getSystemUrl() {
14
- this.urlConfig.urlPrefixes.splice(1, 0, this.projectParams.urlPrefix[`${this.envType}`]);
15
- return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
16
- }
17
-
18
- }
19
-
20
-
21
- module.exports = EnvByPreController;
1
+ const EnvByBuildController = require('./envByBuildController');
2
+
3
+
4
+ class EnvByPreController extends EnvByBuildController {
5
+ constructor(projectName, envType) {
6
+ super(projectName, envType);
7
+ this.envName = 'preview'
8
+ this.envType = 'pre'
9
+ this.verName = 'pre'
10
+ }
11
+
12
+
13
+ getSystemUrl() {
14
+ this.urlConfig.urlPrefixes.splice(1, 0, this.projectParams.urlPrefix[`${this.envType}`]);
15
+ return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
16
+ }
17
+
18
+ }
19
+
20
+
21
+ module.exports = EnvByPreController;
@@ -1,20 +1,20 @@
1
- const EnvByBuildController = require('./envByBuildController');
2
-
3
-
4
- class EnvByProdController extends EnvByBuildController {
5
- constructor(projectName, envType) {
6
- super(projectName, envType);
7
- this.envName = 'production'
8
- this.envType = 'prod'
9
- this.verName = 'prod'
10
- }
11
-
12
-
13
- getSystemUrl() {
14
- this.urlConfig.urlPrefixes.splice(0, 0, this.projectParams.urlPrefix[`${this.envType}`]);
15
- return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
16
- }
17
- }
18
-
19
-
20
- module.exports = EnvByProdController
1
+ const EnvByBuildController = require('./envByBuildController');
2
+
3
+
4
+ class EnvByProdController extends EnvByBuildController {
5
+ constructor(projectName, envType) {
6
+ super(projectName, envType);
7
+ this.envName = 'production'
8
+ this.envType = 'prod'
9
+ this.verName = 'prod'
10
+ }
11
+
12
+
13
+ getSystemUrl() {
14
+ this.urlConfig.urlPrefixes.splice(0, 0, this.projectParams.urlPrefix[`${this.envType}`]);
15
+ return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
16
+ }
17
+ }
18
+
19
+
20
+ module.exports = EnvByProdController
@@ -1,21 +1,21 @@
1
- const EnvByBuildController = require('./envByBuildController');
2
-
3
-
4
- class EnvByTest2Controller extends EnvByBuildController {
5
- constructor(projectName, envType) {
6
- super(projectName, envType);
7
- this.envName = 'testing'
8
- this.envType = 'testing'
9
- this.verName = 'test2ing'
10
- }
11
-
12
-
13
- getSystemUrl() {
14
- this.urlConfig.urlPrefixes.splice(1, 0, this.projectParams.urlPrefix[`${this.envType}`]);
15
- return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
16
- }
17
-
18
- }
19
-
20
-
21
- module.exports = EnvByTest2Controller;
1
+ const EnvByBuildController = require('./envByBuildController');
2
+
3
+
4
+ class EnvByTest2Controller extends EnvByBuildController {
5
+ constructor(projectName, envType) {
6
+ super(projectName, envType);
7
+ this.envName = 'testing'
8
+ this.envType = 'testing'
9
+ this.verName = 'test2ing'
10
+ }
11
+
12
+
13
+ getSystemUrl() {
14
+ this.urlConfig.urlPrefixes.splice(1, 0, this.projectParams.urlPrefix[`${this.envType}`]);
15
+ return this.urlConfig.urlPrefixes.toString().replace(/,/g, '.');
16
+ }
17
+
18
+ }
19
+
20
+
21
+ module.exports = EnvByTest2Controller;