@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.
- package/deploy/helm/templates/virtualService.yaml +3 -2
- package/deploy/helm/values.yaml +4 -4
- package/package.json +4 -5
- package/scripts/build.js +3 -0
- package/scripts/config.js +33 -0
- package/scripts/dev.js +3 -0
- package/scripts/devSSR.js +3 -0
package/deploy/helm/values.yaml
CHANGED
|
@@ -7,10 +7,10 @@ envType: '<<ENV_TYPE>>'
|
|
|
7
7
|
hostPrefix: '<<HOST_PREFIX>>'
|
|
8
8
|
hosts:
|
|
9
9
|
test:
|
|
10
|
-
- '<<HOST_PREFIX>>.
|
|
10
|
+
- '<<HOST_PREFIX>>.pc.t.eshetang.com'
|
|
11
11
|
stage:
|
|
12
|
-
- stage.
|
|
12
|
+
- 'stage.pc.t.eshetang.com'
|
|
13
13
|
prod:
|
|
14
|
-
-
|
|
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.
|
|
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
|
-
"
|
|
78
|
-
"@xfe-repo/
|
|
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
|
@@ -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