cos-wx-sdk-v5 1.2.1 → 1.3.0

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/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env"]
3
+ }
package/CHANGELOG.md CHANGED
@@ -7,6 +7,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
9
 
10
+ ## [v1.2.1](https://github.com/tencentyun/cos-wx-sdk-v5/compare/v1.2.0...v1.2.1) - 2022-07-21
11
+
12
+ feat
13
+ - 初始化支持HttpDNSServiceId参数,填写后代表开启 HttpDNS 服务。HttpDNS 用法详见https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html
14
+
15
+ ### Merged
16
+
17
+ - feat: 1.2.1 [`#70`](https://github.com/tencentyun/cos-wx-sdk-v5/pull/70)
18
+ - Feat/1.2.0 [`#69`](https://github.com/tencentyun/cos-wx-sdk-v5/pull/69)
19
+
20
+ ### Commits
21
+
22
+ - Merge https://github.com/livehigh/cos-wx-sdk-v5 into feat/1.2.1 [`982305a`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/982305a2f4ce6b5d6e55e8dc96f1b14eedcc9297)
23
+ - upd 去掉ForcePathStyle处理 [`6ed7dcc`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/6ed7dccc092cde1e43c54101870191fce7eaba49)
24
+ - upd 补充HttpDNS使用说明 [`c80f440`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/c80f440d2d75be962433250e824a331c7142979c)
25
+
26
+ ## [v1.2.0](https://github.com/tencentyun/cos-wx-sdk-v5/compare/v1.1.8...v1.2.0) - 2022-06-30
27
+
28
+ fix
29
+ - 修复使用postObject不能正确的pauseTask,cancelTask问题
30
+ - 签名回调里使用SecurityToken代替并兼容XCosSecurityToken
31
+
32
+ ### Merged
33
+
34
+ - 完善内容审核demo [`#68`](https://github.com/tencentyun/cos-wx-sdk-v5/pull/68)
35
+ - Feat/1.1.8 [`#67`](https://github.com/tencentyun/cos-wx-sdk-v5/pull/67)
36
+
37
+ ### Commits
38
+
39
+ - feat 1.2.0 [`0fc7281`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/0fc7281a43a6d9f3bf1f125c04fabdf63bcc9f4c)
40
+ - upd demo [`8e198e3`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/8e198e3742c778844e82ebc8c6bca777d0ae58e6)
41
+ - upd [`8f6170f`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/8f6170f15972c479963c1b78816d4a8a13dd8fd8)
42
+ - del [`c12abe9`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/c12abe9e93dd07607d46f2e61286a16dfb17721e)
43
+ - upd [`2035c54`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/2035c54193d7c96030bc5b364c100b952f62d627)
44
+ - upd [`a8142cc`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/a8142cca3aa5e822b2509bf2c3a2a96402a343d8)
45
+
46
+ ## [v1.1.8](https://github.com/tencentyun/cos-wx-sdk-v5/compare/v1.1.7...v1.1.8) - 2022-06-23
47
+
48
+ feat
49
+ - putBucketCors支持ResponseVary
50
+ - 提高签名时Expires参数的优先级
51
+
52
+ ### Merged
53
+
54
+ - feat:更换依赖xmldom->@xmldom/xmldom [`#66`](https://github.com/tencentyun/cos-wx-sdk-v5/pull/66)
55
+
56
+ ### Commits
57
+
58
+ - feat 1.1.8 [`aad1bad`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/aad1badffefc14d06a1d7f0851bc7aeec09bcd51)
59
+ - upd [`42134c3`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/42134c36def10a6a84d9b9c45dc56fe5e67e880a)
60
+
61
+ ## [v1.1.7](https://github.com/tencentyun/cos-wx-sdk-v5/compare/v1.1.6...v1.1.7) - 2022-04-26
62
+
63
+ feat:更换依赖xmldom->@xmldom/xmldom
64
+
65
+ ### Commits
66
+
67
+ - feat:更换依赖xmldom->@xmldom/xmldom [`ca08986`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/ca08986fb0577e96fa2a924aa8ddd9e13bb5a82a)
68
+ - Updated CHANGELOG.md [`3c2359a`](https://github.com/tencentyun/cos-wx-sdk-v5/commit/3c2359a2f95df088fec2ae221f43be6c58b27537)
69
+
10
70
  ## [v1.1.6](https://github.com/tencentyun/cos-wx-sdk-v5/compare/v1.1.5...v1.1.6) - 2022-04-25
11
71
 
12
72
  feat:getObjectUrl支持全球加速参数
package/build.js CHANGED
@@ -2,6 +2,7 @@ var webpack = require('webpack');
2
2
  var path = require('path');
3
3
  var fs = require('fs');
4
4
  var pkg = require('./package.json');
5
+ const TerserPlugin = require('terser-webpack-plugin');
5
6
 
6
7
  var replaceVersion = function () {
7
8
  var filePath = path.resolve(__dirname, 'src/cos.js');
@@ -32,6 +33,8 @@ var replaceDevCode = function (list) {
32
33
  replaceVersion();
33
34
 
34
35
  var config = {
36
+ mode: process.env.NODE_ENV,
37
+ devtool: "none",
35
38
  watch: true,
36
39
  entry: path.resolve(__dirname, './index.js'),
37
40
  output: {
@@ -46,11 +49,20 @@ var config = {
46
49
  {
47
50
  test: /\.m?js$/,
48
51
  loader: 'babel-loader',
49
- options: {
50
- presets: ['es2015']
51
- }
52
+ exclude: /node_modules/,
52
53
  }
53
- ]
54
+ ],
55
+ },
56
+ optimization: {
57
+ minimize: false,
58
+ minimizer: [
59
+ new TerserPlugin({
60
+ cache: true,
61
+ parallel: true,
62
+ sourceMap: true,
63
+ extractComments: false,
64
+ }),
65
+ ],
54
66
  },
55
67
  devServer: {
56
68
  historyApiFallback: true,
@@ -70,24 +82,29 @@ if (process.env.NODE_ENV === 'production') {
70
82
  ]);
71
83
  config.watch = false;
72
84
  config.output.filename = 'cos-wx-sdk-v5.min.js';
85
+ config.optimization = {
86
+ minimize: true,
87
+ minimizer: [
88
+ new TerserPlugin({
89
+ cache: true,
90
+ parallel: true,
91
+ sourceMap: true,
92
+ extractComments: false,
93
+ terserOptions: {
94
+ compress: {
95
+ drop_debugger: true,
96
+ drop_console: true,
97
+ }
98
+ },
99
+ }),
100
+ ],
101
+ };
73
102
  config.plugins = (config.plugins || []).concat([
74
103
  new webpack.DefinePlugin({
75
104
  'process.env': {
76
105
  NODE_ENV: '"production"'
77
106
  }
78
107
  }),
79
- new webpack.optimize.UglifyJsPlugin({
80
- sourceMap: true,
81
- output: {
82
- ascii_only: true,
83
- },
84
- compress: {
85
- warnings: false,
86
- },
87
- }),
88
- new webpack.LoaderOptionsPlugin({
89
- minimize: true
90
- }),
91
108
  ]);
92
109
  }
93
110
 
@@ -95,10 +112,12 @@ webpack(config, function (err, stats) {
95
112
  // 每次运行 npm run build,将 sourcePath 代码复制一份放入 targetPath
96
113
  var sourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.js');
97
114
  var targetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.js');
98
- var minSourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.min.js');
99
- var mintTargetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.min.js');
100
115
  fs.createReadStream(sourcePath).pipe(fs.createWriteStream(targetPath));
101
- fs.createReadStream(minSourcePath).pipe(fs.createWriteStream(mintTargetPath));
116
+ if (process.env.NODE_ENV === 'production') {
117
+ var minSourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.min.js');
118
+ var mintTargetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.min.js');
119
+ fs.createReadStream(minSourcePath).pipe(fs.createWriteStream(mintTargetPath));
120
+ }
102
121
  if (err) throw err
103
122
  process.stdout.write(stats.toString({
104
123
  colors: true,