@xfe-repo/mini-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 +21 -0
- package/deploy/nginx.conf +22 -5
- package/package.json +2 -2
package/deploy/.drone.yml
CHANGED
|
@@ -230,6 +230,27 @@ steps:
|
|
|
230
230
|
include:
|
|
231
231
|
- refs/tags/release-*
|
|
232
232
|
|
|
233
|
+
- name: package-and-push-chart
|
|
234
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
235
|
+
environment:
|
|
236
|
+
USERNAME:
|
|
237
|
+
from_secret: username
|
|
238
|
+
PASSWORD:
|
|
239
|
+
from_secret: password
|
|
240
|
+
commands:
|
|
241
|
+
- chartName="${DRONE_REPO//\//-}"
|
|
242
|
+
- chartVersion="0.0.0-$DRONE_TAG"
|
|
243
|
+
- cp deploy/helm/values.prod.yaml deploy/helm/values.yaml
|
|
244
|
+
- sed -i "s/deployment/$chartName/g" deploy/helm/Chart.yaml
|
|
245
|
+
- helm package deploy/helm --version "$chartVersion"
|
|
246
|
+
- set +x
|
|
247
|
+
- printf '%s' "$PASSWORD" | helm registry login xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com --username "$USERNAME" --password-stdin
|
|
248
|
+
- helm push "$chartName-$chartVersion.tgz" oci://xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image
|
|
249
|
+
when:
|
|
250
|
+
ref:
|
|
251
|
+
include:
|
|
252
|
+
- refs/tags/release-*
|
|
253
|
+
|
|
233
254
|
volumes:
|
|
234
255
|
- name: node-modules
|
|
235
256
|
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-
|
|
33
|
+
add_header Cache-Control no-cache always;
|
|
27
34
|
|
|
28
35
|
try_files /release =404;
|
|
29
36
|
}
|
|
30
37
|
|
|
31
|
-
#
|
|
32
|
-
location
|
|
33
|
-
rewrite /
|
|
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/mini-app",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"bin": {
|
|
5
5
|
"xfe-mini": "./bin/index.js"
|
|
6
6
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"webpack": "5.91.0",
|
|
53
53
|
"yaml": "^2.3.4",
|
|
54
54
|
"@xfe-repo/routes-define-webpack-plugin": "1.6.0",
|
|
55
|
-
"@xfe-repo/typescript-config": "1.6.
|
|
55
|
+
"@xfe-repo/typescript-config": "1.6.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": "18.2.0",
|