@xfe-repo/web-app 1.0.1 → 1.0.2

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.
@@ -10,8 +10,9 @@ spec:
10
10
  - "{{ . }}"
11
11
  {{- end }}
12
12
  gateways:
13
- {{- range $.Values.gateways }}
14
- - {{ . }}
13
+ {{- $gateways := $.Values.gateways }}
14
+ {{- range $gateways }}
15
+ - "{{ . }}"
15
16
  {{- end }}
16
17
  http:
17
18
  - match:
@@ -7,10 +7,10 @@ envType: '<<ENV_TYPE>>'
7
7
  hostPrefix: '<<HOST_PREFIX>>'
8
8
  hosts:
9
9
  test:
10
- - '<<HOST_PREFIX>>.jarvis.t.eshetang.com'
10
+ - '<<HOST_PREFIX>>.pc.t.eshetang.com'
11
11
  stage:
12
- - stage.jarvis.t.eshetang.com
12
+ - 'stage.pc.t.eshetang.com'
13
13
  prod:
14
- - jarvis.eshetang.com
14
+ - 'pc.eshetang.com'
15
15
  gateways:
16
- - common-gateway-eshetang
16
+ - 'common-gateway-eshetang'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-app",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "bin": {
5
5
  "xfe-web": "./bin/index.js"
6
6
  },
@@ -32,7 +32,6 @@
32
32
  "css-minimizer-webpack-plugin": "^3.2.0",
33
33
  "dotenv": "^10.0.0",
34
34
  "dotenv-expand": "^5.1.0",
35
- "eslint": "^8.3.0",
36
35
  "eslint-config-react-app": "^7.0.1",
37
36
  "eslint-webpack-plugin": "^3.1.1",
38
37
  "file-loader": "^6.2.0",
@@ -67,14 +66,14 @@
67
66
  "style-loader": "^3.3.1",
68
67
  "tailwindcss": "^3.0.2",
69
68
  "terser-webpack-plugin": "^5.2.5",
70
- "typescript": "^5.2.2",
71
69
  "web-vitals": "^2.1.4",
72
70
  "webpack": "^5.64.4",
73
71
  "webpack-bundle-analyzer": "^4.8.0",
74
72
  "webpack-dev-server": "^4.6.0",
75
73
  "webpack-manifest-plugin": "^4.0.2",
76
74
  "workbox-webpack-plugin": "^7.0.0",
77
- "@xfe-repo/eslint-config": "0.0.0",
78
- "@xfe-repo/typescript-config": "0.0.0"
75
+ "yaml": "^2.3.4",
76
+ "@xfe-repo/eslint-config": "0.0.1",
77
+ "@xfe-repo/typescript-config": "0.0.2"
79
78
  }
80
79
  }
package/scripts/build.js CHANGED
@@ -11,6 +11,9 @@ process.on("unhandledRejection", (err) => {
11
11
  throw err;
12
12
  });
13
13
 
14
+ // 加载配置
15
+ require("./config");
16
+
14
17
  // Ensure environment variables are read.
15
18
  require("../config/env");
16
19
 
@@ -0,0 +1,33 @@
1
+ // 读取配置并作出相应的处理
2
+ const fs = require('fs')
3
+ const yaml = require('yaml')
4
+ const path = require('path')
5
+
6
+ /* deploy 相关配置写入 */
7
+ const configDeploy = () => {
8
+ // 读取xfe.json
9
+ const xfeConfig = JSON.parse(fs.readFileSync('./xfe.json', 'utf8'))
10
+
11
+ if (!xfeConfig?.deploy) return
12
+
13
+ // 处理写入deploy values配置
14
+ const valuesYamlFilePath = path.resolve(__dirname, '../deploy/helm/values.yaml')
15
+ const valuesYamlFile = fs.readFileSync(valuesYamlFilePath, 'utf8')
16
+ const valuesYaml = yaml.parse(valuesYamlFile)
17
+
18
+ if(!valuesYaml.hosts) valuesYaml.hosts = { test: [], stage: [], prod: [] }
19
+
20
+ valuesYaml.hosts.prod = xfeConfig.deploy.hostsProd || []
21
+ valuesYaml.hosts.stage = xfeConfig.deploy.hostsStage || []
22
+ valuesYaml.hosts.test = xfeConfig.deploy.hostsTest || []
23
+
24
+ // gateways 默认为 common-gateway-eshetang
25
+ valuesYaml.gateways = xfeConfig.deploy.gateways || ["common-gateway-eshetang"]
26
+
27
+ // 写入values.yaml
28
+ const valuesYamlStr = yaml.stringify(valuesYaml, { defaultStringType: 'QUOTE_SINGLE', defaultKeyType: 'PLAIN' })
29
+ fs.writeFileSync(valuesYamlFilePath, valuesYamlStr, 'utf8')
30
+ }
31
+
32
+ /* 其他配置待扩展 */
33
+ configDeploy()
package/scripts/dev.js CHANGED
@@ -11,6 +11,9 @@ process.on("unhandledRejection", (err) => {
11
11
  throw err;
12
12
  });
13
13
 
14
+ // 加载配置
15
+ require("./config");
16
+
14
17
  // Ensure environment variables are read.
15
18
  require("../config/env");
16
19
 
package/scripts/devSSR.js CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  process.env.NODE_ENV = 'development'
4
4
 
5
+ // 加载配置
6
+ require("./config");
7
+
5
8
  const chalk = require('chalk')
6
9
  const webpack = require('webpack')
7
10
  const nodemon = require('nodemon')