@xfe-repo/web-app 1.6.0 → 1.6.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/.drone.yml CHANGED
@@ -138,6 +138,27 @@ steps:
138
138
  include:
139
139
  - refs/tags/release-*
140
140
 
141
+ - name: package-and-push-chart
142
+ image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
143
+ environment:
144
+ USERNAME:
145
+ from_secret: username
146
+ PASSWORD:
147
+ from_secret: password
148
+ commands:
149
+ - chartName="${DRONE_REPO//\//-}"
150
+ - chartVersion="0.0.0-$DRONE_TAG"
151
+ - cp deploy/helm/values.prod.yaml deploy/helm/values.yaml
152
+ - sed -i "s/deployment/$chartName/g" deploy/helm/Chart.yaml
153
+ - helm package deploy/helm --version "$chartVersion"
154
+ - set +x
155
+ - printf '%s' "$PASSWORD" | helm registry login xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com --username "$USERNAME" --password-stdin
156
+ - helm push "$chartName-$chartVersion.tgz" oci://xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image
157
+ when:
158
+ ref:
159
+ include:
160
+ - refs/tags/release-*
161
+
141
162
  volumes:
142
163
  - name: node-modules
143
164
  host:
package/deploy/nginx.conf CHANGED
@@ -5,6 +5,13 @@ server {
5
5
  server_name -;
6
6
  root /code/www/deploy/webroot/app/current;
7
7
 
8
+ gzip on;
9
+ gzip_vary on;
10
+ gzip_proxied any;
11
+ gzip_comp_level 5;
12
+ gzip_min_length 1024;
13
+ gzip_types text/plain text/css text/javascript application/javascript application/json application/xml text/xml image/svg+xml;
14
+
8
15
  set $apiEnv test;
9
16
 
10
17
  if ( $host ~* ^(?<hostPrefix>[^.]+)?\.?(?<subDomain>.*?)\.?(?<domain>[^.]+)\.(?<ltd>[a-zA-Z]+)$ ) {
@@ -23,14 +30,24 @@ server {
23
30
  }
24
31
 
25
32
  location /check-update {
26
- add_header Cache-control no-cache;
33
+ add_header Cache-Control no-cache always;
27
34
 
28
35
  try_files /release =404;
29
36
  }
30
37
 
31
- # 兼容v2版本的静态资源
32
- location /v2/static {
33
- rewrite /v2(.*) $1 break;
38
+ # 仅带内容 hash 的资源使用长期缓存
39
+ location ~* "\.[0-9a-f]{8,}(\.chunk)?\.[^./]+$" {
40
+ rewrite ^/v[0-9]+(/(static|js|css)/.*)$ $1 break;
41
+ try_files $uri =404;
42
+
43
+ add_header 'Access-Control-Allow-Origin' '*';
44
+ add_header Cache-Control "public, max-age=31536000, immutable";
45
+ }
46
+
47
+ # 兼容 /v数字/ 前缀下的构建资源
48
+ location ~ ^/v[0-9]+/(static|js|css)/ {
49
+ rewrite ^/v[0-9]+(/.*)$ $1 break;
50
+ add_header Cache-Control no-cache always;
34
51
  }
35
52
 
36
53
  location / {
@@ -39,7 +56,7 @@ server {
39
56
  # 兼容微前端 允许跨域
40
57
  add_header 'Access-Control-Allow-Origin' '*';
41
58
 
42
- add_header Cache-Control no-cache;
59
+ add_header Cache-Control no-cache always;
43
60
  add_header Set-Cookie "apiEnv=${apiEnv}; Max-Age=2626560; Path=/;";
44
61
  }
45
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-app",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "bin": {
5
5
  "xfe-web": "./bin/index.js"
6
6
  },
@@ -79,8 +79,8 @@
79
79
  "webpack-manifest-plugin": "^4.0.2",
80
80
  "workbox-webpack-plugin": "^7.0.0",
81
81
  "yaml": "^2.3.4",
82
- "@xfe-repo/eslint-config": "1.6.0",
83
- "@xfe-repo/typescript-config": "1.6.0"
82
+ "@xfe-repo/typescript-config": "1.6.2",
83
+ "@xfe-repo/eslint-config": "1.6.0"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "react": "18.2.0",
package/tsconfig.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "paths": {
5
5
  "@/*": ["./*"],
6
6
  "@/types/*": ["../types/*"],
7
- "@common/services": ["../node_modules/@xfe-repo/web-service/dist/index"],
7
+ "@common/services": ["../node_modules/@xfe-repo/web-service/dist/index"]
8
8
  }
9
9
  },
10
10
  "exclude": ["node_modules", "build", "dist"]