@pisell/common 1.0.43 → 3.0.1
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/CHANGELOG.md +3 -130
- package/es/script/aws/index.js +7 -7
- package/lib/script/aws/index.js +3 -3
- package/package.json +2 -2
- package/src/script/aws/index.js +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,143 +1,16 @@
|
|
|
1
1
|
# @pisell/common
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
## 1.0.42
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- Updated dependencies [6f57a4d88]
|
|
14
|
-
- @pisell/utils@1.0.43
|
|
15
|
-
|
|
16
|
-
## 1.0.41
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- Updated dependencies [0267536f]
|
|
21
|
-
- @pisell/utils@1.0.42
|
|
22
|
-
|
|
23
|
-
## 1.0.40
|
|
24
|
-
|
|
25
|
-
### Patch Changes
|
|
26
|
-
|
|
27
|
-
- Updated dependencies [f3ed6fa4]
|
|
28
|
-
- @pisell/utils@1.0.41
|
|
29
|
-
|
|
30
|
-
## 1.0.39
|
|
31
|
-
|
|
32
|
-
### Patch Changes
|
|
33
|
-
|
|
34
|
-
- Updated dependencies [b848ae9a]
|
|
35
|
-
- @pisell/utils@1.0.40
|
|
36
|
-
|
|
37
|
-
## 1.0.38
|
|
38
|
-
|
|
39
|
-
### Patch Changes
|
|
40
|
-
|
|
41
|
-
- Updated dependencies [8640a624]
|
|
42
|
-
- @pisell/utils@1.0.39
|
|
43
|
-
|
|
44
|
-
## 1.0.37
|
|
45
|
-
|
|
46
|
-
### Patch Changes
|
|
47
|
-
|
|
48
|
-
- Updated dependencies [27cdd90e]
|
|
49
|
-
- @pisell/utils@1.0.38
|
|
50
|
-
|
|
51
|
-
## 1.0.36
|
|
52
|
-
|
|
53
|
-
### Patch Changes
|
|
54
|
-
|
|
55
|
-
- Updated dependencies [30136d51]
|
|
56
|
-
- @pisell/utils@1.0.37
|
|
57
|
-
|
|
58
|
-
## 1.0.35
|
|
59
|
-
|
|
60
|
-
### Patch Changes
|
|
61
|
-
|
|
62
|
-
- Updated dependencies [a694c37e]
|
|
63
|
-
- @pisell/utils@1.0.36
|
|
64
|
-
|
|
65
|
-
## 1.0.34
|
|
66
|
-
|
|
67
|
-
### Patch Changes
|
|
68
|
-
|
|
69
|
-
- Updated dependencies [11c9a831]
|
|
70
|
-
- @pisell/utils@1.0.35
|
|
71
|
-
|
|
72
|
-
## 1.0.33
|
|
73
|
-
|
|
74
|
-
### Patch Changes
|
|
75
|
-
|
|
76
|
-
- Updated dependencies [881303a5]
|
|
77
|
-
- @pisell/utils@1.0.34
|
|
78
|
-
|
|
79
|
-
## 1.0.32
|
|
80
|
-
|
|
81
|
-
### Patch Changes
|
|
82
|
-
|
|
83
|
-
- Updated dependencies [fb6b699f]
|
|
84
|
-
- @pisell/utils@1.0.33
|
|
85
|
-
|
|
86
|
-
## 1.0.31
|
|
87
|
-
|
|
88
|
-
### Patch Changes
|
|
89
|
-
|
|
90
|
-
- Updated dependencies [bf60f3ca]
|
|
91
|
-
- @pisell/utils@1.0.32
|
|
92
|
-
|
|
93
|
-
## 1.0.30
|
|
94
|
-
|
|
95
|
-
### Patch Changes
|
|
96
|
-
|
|
97
|
-
- Updated dependencies [f7f80d68]
|
|
98
|
-
- @pisell/utils@1.0.31
|
|
99
|
-
|
|
100
|
-
## 1.0.29
|
|
101
|
-
|
|
102
|
-
### Patch Changes
|
|
103
|
-
|
|
104
|
-
- Updated dependencies [d41cf764]
|
|
105
|
-
- @pisell/utils@1.0.30
|
|
106
|
-
|
|
107
|
-
## 1.0.28
|
|
108
|
-
|
|
109
|
-
### Patch Changes
|
|
110
|
-
|
|
111
|
-
- Updated dependencies [f10f984b]
|
|
112
|
-
- @pisell/utils@1.0.29
|
|
7
|
+
- f8847ef9a: s
|
|
113
8
|
|
|
114
9
|
## 1.0.27
|
|
115
10
|
|
|
116
11
|
### Patch Changes
|
|
117
12
|
|
|
118
|
-
-
|
|
119
|
-
- @pisell/utils@1.0.28
|
|
120
|
-
|
|
121
|
-
## 1.0.26
|
|
122
|
-
|
|
123
|
-
### Patch Changes
|
|
124
|
-
|
|
125
|
-
- Updated dependencies [a45e6cd5]
|
|
126
|
-
- @pisell/utils@1.0.27
|
|
127
|
-
|
|
128
|
-
## 1.0.25
|
|
129
|
-
|
|
130
|
-
### Patch Changes
|
|
131
|
-
|
|
132
|
-
- Updated dependencies [961d44f7]
|
|
133
|
-
- @pisell/utils@1.0.26
|
|
134
|
-
|
|
135
|
-
## 1.0.24
|
|
136
|
-
|
|
137
|
-
### Patch Changes
|
|
138
|
-
|
|
139
|
-
- Updated dependencies [10083f21]
|
|
140
|
-
- @pisell/utils@1.0.25
|
|
13
|
+
- 7b7637320: s
|
|
141
14
|
|
|
142
15
|
## 1.0.26
|
|
143
16
|
|
package/es/script/aws/index.js
CHANGED
|
@@ -23,14 +23,14 @@ var bucketName = '';
|
|
|
23
23
|
* @Date: 2023-11-24 14:05
|
|
24
24
|
*/
|
|
25
25
|
var init = /*#__PURE__*/function () {
|
|
26
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
26
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(directory) {
|
|
27
27
|
var serverConfig, awsConfig;
|
|
28
28
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
31
31
|
_context.prev = 0;
|
|
32
32
|
_context.next = 3;
|
|
33
|
-
return getServerConfig(
|
|
33
|
+
return getServerConfig(directory);
|
|
34
34
|
case 3:
|
|
35
35
|
serverConfig = _context.sent;
|
|
36
36
|
// aws配置
|
|
@@ -68,7 +68,7 @@ var init = /*#__PURE__*/function () {
|
|
|
68
68
|
}
|
|
69
69
|
}, _callee, null, [[0, 16]]);
|
|
70
70
|
}));
|
|
71
|
-
return function init() {
|
|
71
|
+
return function init(_x) {
|
|
72
72
|
return _ref.apply(this, arguments);
|
|
73
73
|
};
|
|
74
74
|
}();
|
|
@@ -113,7 +113,7 @@ var uploadFile = /*#__PURE__*/function () {
|
|
|
113
113
|
}
|
|
114
114
|
}, _callee2, null, [[4, 12]]);
|
|
115
115
|
}));
|
|
116
|
-
return function uploadFile(
|
|
116
|
+
return function uploadFile(_x2, _x3, _x4) {
|
|
117
117
|
return _ref2.apply(this, arguments);
|
|
118
118
|
};
|
|
119
119
|
}();
|
|
@@ -182,7 +182,7 @@ export var uploadFolderContents = /*#__PURE__*/function () {
|
|
|
182
182
|
}
|
|
183
183
|
}, _callee3);
|
|
184
184
|
}));
|
|
185
|
-
return function uploadFolderContents(
|
|
185
|
+
return function uploadFolderContents(_x5) {
|
|
186
186
|
return _ref3.apply(this, arguments);
|
|
187
187
|
};
|
|
188
188
|
}();
|
|
@@ -203,7 +203,7 @@ export var uploadStaticToOSS = /*#__PURE__*/function () {
|
|
|
203
203
|
case 0:
|
|
204
204
|
folderPath = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : path.resolve(__dirname, 'dist');
|
|
205
205
|
_context4.next = 3;
|
|
206
|
-
return init();
|
|
206
|
+
return init(directory);
|
|
207
207
|
case 3:
|
|
208
208
|
return _context4.abrupt("return", uploadFolderContents(directory, folderPath));
|
|
209
209
|
case 4:
|
|
@@ -212,7 +212,7 @@ export var uploadStaticToOSS = /*#__PURE__*/function () {
|
|
|
212
212
|
}
|
|
213
213
|
}, _callee4);
|
|
214
214
|
}));
|
|
215
|
-
return function uploadStaticToOSS(
|
|
215
|
+
return function uploadStaticToOSS(_x6) {
|
|
216
216
|
return _ref4.apply(this, arguments);
|
|
217
217
|
};
|
|
218
218
|
}();
|
package/lib/script/aws/index.js
CHANGED
|
@@ -42,9 +42,9 @@ var filterFiles = ["index.html", "umi.server.js", "umi.server.d.ts"];
|
|
|
42
42
|
var __dirname = process.cwd();
|
|
43
43
|
var s3Client = null;
|
|
44
44
|
var bucketName = "";
|
|
45
|
-
var init = async () => {
|
|
45
|
+
var init = async (directory) => {
|
|
46
46
|
try {
|
|
47
|
-
const serverConfig = await (0, import_utils.getServerConfig)(
|
|
47
|
+
const serverConfig = await (0, import_utils.getServerConfig)(directory);
|
|
48
48
|
let awsConfig = serverConfig.aws;
|
|
49
49
|
if (awsConfig) {
|
|
50
50
|
bucketName = awsConfig.bucketName;
|
|
@@ -115,7 +115,7 @@ var uploadFolderContents = async (directory, folderPath = import_path.default.re
|
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
var uploadStaticToOSS = async (directory, folderPath = import_path.default.resolve(__dirname, "dist")) => {
|
|
118
|
-
await init();
|
|
118
|
+
await init(directory);
|
|
119
119
|
return uploadFolderContents(directory, folderPath);
|
|
120
120
|
};
|
|
121
121
|
// Annotate the CommonJS export names for ESM import in node:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.less"
|
|
6
6
|
],
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"archiver": "^5.3.1",
|
|
21
21
|
"dotenv": "^16.0.3",
|
|
22
22
|
"ssh2": "^1.13.0",
|
|
23
|
-
"@pisell/utils": "1.0.
|
|
23
|
+
"@pisell/utils": "1.0.42"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"father": "^4.1.6"
|
package/src/script/aws/index.js
CHANGED
|
@@ -15,10 +15,10 @@ let bucketName = '';
|
|
|
15
15
|
* @Author: zhiwei.Wang
|
|
16
16
|
* @Date: 2023-11-24 14:05
|
|
17
17
|
*/
|
|
18
|
-
const init = async () => {
|
|
18
|
+
const init = async (directory) => {
|
|
19
19
|
try {
|
|
20
20
|
// 读取本地config
|
|
21
|
-
const serverConfig = await getServerConfig(
|
|
21
|
+
const serverConfig = await getServerConfig(directory);
|
|
22
22
|
|
|
23
23
|
// aws配置
|
|
24
24
|
let awsConfig = serverConfig.aws;
|
|
@@ -84,7 +84,7 @@ const uploadFile = async (directory, fileKey, filePath) => {
|
|
|
84
84
|
*/
|
|
85
85
|
export const uploadFolderContents = async (
|
|
86
86
|
directory,
|
|
87
|
-
folderPath = path.resolve(__dirname, 'dist')
|
|
87
|
+
folderPath = path.resolve(__dirname, 'dist')
|
|
88
88
|
) => {
|
|
89
89
|
const files = fs.readdirSync(folderPath);
|
|
90
90
|
|
|
@@ -129,10 +129,10 @@ export const uploadFolderContents = async (
|
|
|
129
129
|
*/
|
|
130
130
|
export const uploadStaticToOSS = async (
|
|
131
131
|
directory,
|
|
132
|
-
folderPath = path.resolve(__dirname, 'dist')
|
|
132
|
+
folderPath = path.resolve(__dirname, 'dist')
|
|
133
133
|
) => {
|
|
134
134
|
// 初始化aws
|
|
135
|
-
await init();
|
|
135
|
+
await init(directory);
|
|
136
136
|
|
|
137
137
|
return uploadFolderContents(directory, folderPath);
|
|
138
138
|
};
|