@xfe-repo/web-app 1.6.2 → 1.6.4

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/README.md CHANGED
@@ -1,3 +1,7 @@
1
1
  # `@xfe-repo/web-app`
2
2
 
3
3
  web框架基础库
4
+
5
+ 构建会先加载 `react-app-polyfill/stable`,并在应用原有 browserslist 的基础上,补充 Edge 18、Chrome 64、Firefox 60、Safari/iOS 12 及以上的 JS 编译目标,业务代码和第三方依赖使用同一目标。
6
+
7
+ 这是 JS 兼容基线;具体组件样式和浏览器 Web API 仍需在目标浏览器验证。
@@ -88,6 +88,16 @@ module.exports = function (webpackEnv) {
88
88
  const isEnvDevelopment = webpackEnv === 'development'
89
89
  const isEnvProduction = webpackEnv === 'production'
90
90
 
91
+ // 保留应用声明的目标,补充不随市场占有率淘汰的旧浏览器基线。
92
+ const browserTargets = [
93
+ ...require('browserslist')(undefined, { path: paths.appPath, env: process.env.BROWSERSLIST_ENV || webpackEnv }),
94
+ 'edge >= 18',
95
+ 'chrome >= 64',
96
+ 'firefox >= 60',
97
+ 'safari >= 12',
98
+ 'ios_saf >= 12',
99
+ ]
100
+
91
101
  // Variable used for enabling profiling in Production
92
102
  // passed into alias object. Uses a flag if passed into the build command
93
103
  const isEnvProductionProfile = isEnvProduction && process.argv.includes('--profile')
@@ -185,7 +195,7 @@ module.exports = function (webpackEnv) {
185
195
  }
186
196
 
187
197
  return {
188
- target: ['browserslist'],
198
+ target: `browserslist:${browserTargets.join(',')}`,
189
199
  // Webpack noise constrained to errors and warnings
190
200
  stats: 'errors-warnings',
191
201
  mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
@@ -194,7 +204,7 @@ module.exports = function (webpackEnv) {
194
204
  devtool: isEnvProduction ? (shouldUseSourceMap ? 'source-map' : false) : isEnvDevelopment && 'cheap-module-source-map',
195
205
  // These are the "entry points" to our application.
196
206
  // This means they will be the "root" imports that are included in JS bundle.
197
- entry: paths.appIndexJs,
207
+ entry: [require.resolve('react-app-polyfill/stable'), paths.appIndexJs],
198
208
  output: {
199
209
  // The build folder.
200
210
  path: paths.appBuild,
@@ -390,6 +400,7 @@ module.exports = function (webpackEnv) {
390
400
  include: paths.appSrc,
391
401
  loader: require.resolve('babel-loader'),
392
402
  options: {
403
+ targets: browserTargets,
393
404
  customize: require.resolve('babel-preset-react-app/webpack-overrides'),
394
405
  presets: [
395
406
  [
@@ -418,9 +429,11 @@ module.exports = function (webpackEnv) {
418
429
  // Unlike the application JS, we only compile the standard ES features.
419
430
  {
420
431
  test: /\.(js|mjs)$/,
421
- exclude: /@babel(?:\/|\\{1,2})runtime/,
432
+ // 保留完整 polyfill,避免 CRA 按 core-js 3.0 裁掉较新的运行时 API。
433
+ exclude: /@babel(?:\/|\\{1,2})runtime|core-js|react-app-polyfill/,
422
434
  loader: require.resolve('babel-loader'),
423
435
  options: {
436
+ targets: browserTargets,
424
437
  babelrc: false,
425
438
  configFile: false,
426
439
  compact: false,
package/deploy/.drone.yml CHANGED
@@ -138,7 +138,7 @@ steps:
138
138
  include:
139
139
  - refs/tags/release-*
140
140
 
141
- - name: package-and-push-chart
141
+ - name: push-helm-chart
142
142
  image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
143
143
  environment:
144
144
  USERNAME:
@@ -154,6 +154,11 @@ steps:
154
154
  - set +x
155
155
  - printf '%s' "$PASSWORD" | helm registry login xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com --username "$USERNAME" --password-stdin
156
156
  - helm push "$chartName-$chartVersion.tgz" oci://xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image
157
+ - >-
158
+ curl -i --fail-with-body
159
+ https://deploy.eshetang.com/deploy.v1.DeployExternalService/UpdateGitOpsChartVersion
160
+ -H 'Content-Type: application/json'
161
+ -d "{\"service\":\"$${chartName}\",\"chartVersion\":\"$${chartVersion}\"}"
157
162
  when:
158
163
  ref:
159
164
  include:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-app",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "bin": {
5
5
  "xfe-web": "./bin/index.js"
6
6
  },