@xfe-repo/web-app 1.3.16 → 1.5.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/.eslintrc.js +1 -0
- package/deploy/.drone.yml +0 -6
- package/dist/{chunk-TFIAHV2G.mjs → chunk-75BJNL7E.mjs} +23 -22
- package/dist/cli.js +33 -32
- package/dist/cli.mjs +17 -17
- package/dist/config.js +35 -30
- package/dist/config.mjs +1 -1
- package/package.json +14 -13
package/.eslintrc.js
CHANGED
package/deploy/.drone.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// src/config.ts
|
|
2
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3
2
|
try {
|
|
4
3
|
var info = gen[key](arg);
|
|
@@ -29,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
function _ts_generator(thisArg, body) {
|
|
32
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
33
32
|
label: 0,
|
|
34
33
|
sent: function() {
|
|
35
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -37,13 +36,17 @@ function _ts_generator(thisArg, body) {
|
|
|
37
36
|
},
|
|
38
37
|
trys: [],
|
|
39
38
|
ops: []
|
|
40
|
-
};
|
|
41
|
-
return g
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
40
|
+
return d(g, "next", {
|
|
41
|
+
value: verb(0)
|
|
42
|
+
}), d(g, "throw", {
|
|
43
|
+
value: verb(1)
|
|
44
|
+
}), d(g, "return", {
|
|
45
|
+
value: verb(2)
|
|
46
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
47
|
+
value: function() {
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
47
50
|
}), g;
|
|
48
51
|
function verb(n) {
|
|
49
52
|
return function(v) {
|
|
@@ -55,7 +58,7 @@ function _ts_generator(thisArg, body) {
|
|
|
55
58
|
}
|
|
56
59
|
function step(op) {
|
|
57
60
|
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while(_)try {
|
|
61
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
59
62
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
60
63
|
if (y = 0, t) op = [
|
|
61
64
|
op[0] & 2,
|
|
@@ -123,18 +126,19 @@ function _ts_generator(thisArg, body) {
|
|
|
123
126
|
};
|
|
124
127
|
}
|
|
125
128
|
}
|
|
129
|
+
// src/config.ts
|
|
126
130
|
import path from "path";
|
|
127
131
|
import fs from "fs";
|
|
128
132
|
import yaml from "yaml";
|
|
129
|
-
var loadXfeConfig = function() {
|
|
133
|
+
var loadXfeConfig = function loadXfeConfig() {
|
|
130
134
|
var xfeConfigPath = "./xfe.json";
|
|
131
135
|
if (!fs.existsSync(xfeConfigPath)) {
|
|
132
|
-
throw new Error("xfe.json
|
|
136
|
+
throw new Error("xfe.json \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5728\u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u521B\u5EFA\u8BE5\u6587\u4EF6\u3002");
|
|
133
137
|
}
|
|
134
138
|
var xfeConfigContent = fs.readFileSync(xfeConfigPath, "utf8");
|
|
135
139
|
return JSON.parse(xfeConfigContent);
|
|
136
140
|
};
|
|
137
|
-
var configDeploy = function() {
|
|
141
|
+
var configDeploy = function configDeploy() {
|
|
138
142
|
var xfeConfig = loadXfeConfig();
|
|
139
143
|
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.deploy)) return;
|
|
140
144
|
var droneConfigFilePath = path.resolve(__dirname, "../deploy/.drone.yml");
|
|
@@ -165,16 +169,16 @@ var configDeploy = function() {
|
|
|
165
169
|
});
|
|
166
170
|
fs.writeFileSync(valuesYamlFilePath, valuesYamlStr, "utf8");
|
|
167
171
|
};
|
|
168
|
-
var getJwtEnv = function() {
|
|
169
|
-
|
|
172
|
+
var getJwtEnv = function getJwtEnv() {
|
|
173
|
+
return _async_to_generator(function() {
|
|
170
174
|
var xfeConfig, _xfeConfig_jwt, _xfeConfig_jwt_aud, aud, jwkRes, JwkResponseJson, err, _, _1, _2, _ref, keyId, privateKeyPkcs8;
|
|
171
175
|
return _ts_generator(this, function(_state) {
|
|
172
176
|
switch(_state.label){
|
|
173
177
|
case 0:
|
|
174
178
|
xfeConfig = loadXfeConfig();
|
|
175
|
-
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.jwt)) throw new Error("xfe.json
|
|
179
|
+
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.jwt)) throw new Error("xfe.json \u4E2D\u672A\u914D\u7F6E jwt \u4FE1\u606F\uFF0C\u8BF7\u68C0\u67E5\u914D\u7F6E\u6587\u4EF6\u3002");
|
|
176
180
|
_xfeConfig_jwt = xfeConfig.jwt, _xfeConfig_jwt_aud = _xfeConfig_jwt.aud, aud = _xfeConfig_jwt_aud === void 0 ? "" : _xfeConfig_jwt_aud;
|
|
177
|
-
if (!aud) throw new Error("xfe.json
|
|
181
|
+
if (!aud) throw new Error("xfe.json \u4E2D\u7684 jwt \u914D\u7F6E\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u786E\u4FDD\u5305\u542B aud \u5B57\u6BB5\u3002");
|
|
178
182
|
return [
|
|
179
183
|
4,
|
|
180
184
|
fetch("https://app.eshetang.com/jwk?appId=".concat(aud))
|
|
@@ -230,9 +234,6 @@ var getJwtEnv = function() {
|
|
|
230
234
|
];
|
|
231
235
|
}
|
|
232
236
|
});
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
return _ref.apply(this, arguments);
|
|
236
|
-
};
|
|
237
|
-
}();
|
|
237
|
+
})();
|
|
238
|
+
};
|
|
238
239
|
export { loadXfeConfig, configDeploy, getJwtEnv };
|
package/dist/cli.js
CHANGED
|
@@ -94,6 +94,10 @@ function _object_spread(target) {
|
|
|
94
94
|
function _sliced_to_array(arr, i) {
|
|
95
95
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
96
96
|
}
|
|
97
|
+
function _type_of(obj) {
|
|
98
|
+
"@swc/helpers - typeof";
|
|
99
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
100
|
+
}
|
|
97
101
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
98
102
|
if (!o) return;
|
|
99
103
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -103,7 +107,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
103
107
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
104
108
|
}
|
|
105
109
|
function _ts_generator(thisArg, body) {
|
|
106
|
-
var f, y, t,
|
|
110
|
+
var f, y, t, _ = {
|
|
107
111
|
label: 0,
|
|
108
112
|
sent: function() {
|
|
109
113
|
if (t[0] & 1) throw t[1];
|
|
@@ -111,13 +115,17 @@ function _ts_generator(thisArg, body) {
|
|
|
111
115
|
},
|
|
112
116
|
trys: [],
|
|
113
117
|
ops: []
|
|
114
|
-
};
|
|
115
|
-
return g
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
|
|
118
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
119
|
+
return d(g, "next", {
|
|
120
|
+
value: verb(0)
|
|
121
|
+
}), d(g, "throw", {
|
|
122
|
+
value: verb(1)
|
|
123
|
+
}), d(g, "return", {
|
|
124
|
+
value: verb(2)
|
|
125
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
126
|
+
value: function() {
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
121
129
|
}), g;
|
|
122
130
|
function verb(n) {
|
|
123
131
|
return function(v) {
|
|
@@ -129,7 +137,7 @@ function _ts_generator(thisArg, body) {
|
|
|
129
137
|
}
|
|
130
138
|
function step(op) {
|
|
131
139
|
if (f) throw new TypeError("Generator is already executing.");
|
|
132
|
-
while(_)try {
|
|
140
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
133
141
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
134
142
|
if (y = 0, t) op = [
|
|
135
143
|
op[0] & 2,
|
|
@@ -203,14 +211,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
203
211
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
204
212
|
var __getProtoOf = Object.getPrototypeOf;
|
|
205
213
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
206
|
-
var __copyProps = function(to, from, except, desc) {
|
|
207
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
214
|
+
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
215
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
208
216
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
209
217
|
try {
|
|
210
218
|
var _loop = function() {
|
|
211
219
|
var key = _step.value;
|
|
212
220
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
213
|
-
get: function() {
|
|
221
|
+
get: function get() {
|
|
214
222
|
return from[key];
|
|
215
223
|
},
|
|
216
224
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
@@ -234,7 +242,7 @@ var __copyProps = function(to, from, except, desc) {
|
|
|
234
242
|
}
|
|
235
243
|
return to;
|
|
236
244
|
};
|
|
237
|
-
var __toESM = function(mod, isNodeMode, target) {
|
|
245
|
+
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
238
246
|
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
239
247
|
// file that has been converted to a CommonJS file using a Babel-
|
|
240
248
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -252,15 +260,15 @@ var import_path2 = __toESM(require("path"));
|
|
|
252
260
|
var import_path = __toESM(require("path"));
|
|
253
261
|
var import_fs = __toESM(require("fs"));
|
|
254
262
|
var import_yaml = __toESM(require("yaml"));
|
|
255
|
-
var loadXfeConfig = function() {
|
|
263
|
+
var loadXfeConfig = function loadXfeConfig() {
|
|
256
264
|
var xfeConfigPath = "./xfe.json";
|
|
257
265
|
if (!import_fs.default.existsSync(xfeConfigPath)) {
|
|
258
|
-
throw new Error("xfe.json
|
|
266
|
+
throw new Error("xfe.json \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5728\u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u521B\u5EFA\u8BE5\u6587\u4EF6\u3002");
|
|
259
267
|
}
|
|
260
268
|
var xfeConfigContent = import_fs.default.readFileSync(xfeConfigPath, "utf8");
|
|
261
269
|
return JSON.parse(xfeConfigContent);
|
|
262
270
|
};
|
|
263
|
-
var configDeploy = function() {
|
|
271
|
+
var configDeploy = function configDeploy() {
|
|
264
272
|
var xfeConfig = loadXfeConfig();
|
|
265
273
|
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.deploy)) return;
|
|
266
274
|
var droneConfigFilePath = import_path.default.resolve(__dirname, "../deploy/.drone.yml");
|
|
@@ -291,16 +299,16 @@ var configDeploy = function() {
|
|
|
291
299
|
});
|
|
292
300
|
import_fs.default.writeFileSync(valuesYamlFilePath, valuesYamlStr, "utf8");
|
|
293
301
|
};
|
|
294
|
-
var getJwtEnv = function() {
|
|
295
|
-
|
|
302
|
+
var getJwtEnv = function getJwtEnv() {
|
|
303
|
+
return _async_to_generator(function() {
|
|
296
304
|
var xfeConfig, _xfeConfig_jwt, _xfeConfig_jwt_aud, aud, jwkRes, JwkResponseJson, err, _, _1, _2, _ref, keyId, privateKeyPkcs8;
|
|
297
305
|
return _ts_generator(this, function(_state) {
|
|
298
306
|
switch(_state.label){
|
|
299
307
|
case 0:
|
|
300
308
|
xfeConfig = loadXfeConfig();
|
|
301
|
-
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.jwt)) throw new Error("xfe.json
|
|
309
|
+
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.jwt)) throw new Error("xfe.json \u4E2D\u672A\u914D\u7F6E jwt \u4FE1\u606F\uFF0C\u8BF7\u68C0\u67E5\u914D\u7F6E\u6587\u4EF6\u3002");
|
|
302
310
|
_xfeConfig_jwt = xfeConfig.jwt, _xfeConfig_jwt_aud = _xfeConfig_jwt.aud, aud = _xfeConfig_jwt_aud === void 0 ? "" : _xfeConfig_jwt_aud;
|
|
303
|
-
if (!aud) throw new Error("xfe.json
|
|
311
|
+
if (!aud) throw new Error("xfe.json \u4E2D\u7684 jwt \u914D\u7F6E\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u786E\u4FDD\u5305\u542B aud \u5B57\u6BB5\u3002");
|
|
304
312
|
return [
|
|
305
313
|
4,
|
|
306
314
|
fetch("https://app.eshetang.com/jwk?appId=".concat(aud))
|
|
@@ -356,21 +364,15 @@ var getJwtEnv = function() {
|
|
|
356
364
|
];
|
|
357
365
|
}
|
|
358
366
|
});
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
return _ref.apply(this, arguments);
|
|
362
|
-
};
|
|
363
|
-
}();
|
|
367
|
+
})();
|
|
368
|
+
};
|
|
364
369
|
// src/cli.ts
|
|
365
370
|
var argv = (0, import_minimist.default)(process.argv.slice(2));
|
|
366
371
|
var commands = argv._;
|
|
367
372
|
var _commands = _sliced_to_array(commands, 1), command = _commands[0];
|
|
368
373
|
var appPackageRoot = import_path2.default.resolve(__dirname, "../");
|
|
369
374
|
function main() {
|
|
370
|
-
return
|
|
371
|
-
}
|
|
372
|
-
function _main() {
|
|
373
|
-
_main = _async_to_generator(function() {
|
|
375
|
+
return _async_to_generator(function() {
|
|
374
376
|
var jwtEnv, jwtEnv1;
|
|
375
377
|
return _ts_generator(this, function(_state) {
|
|
376
378
|
switch(_state.label){
|
|
@@ -423,10 +425,9 @@ function _main() {
|
|
|
423
425
|
];
|
|
424
426
|
}
|
|
425
427
|
});
|
|
426
|
-
});
|
|
427
|
-
return _main.apply(this, arguments);
|
|
428
|
+
})();
|
|
428
429
|
}
|
|
429
430
|
main().catch(function(err) {
|
|
430
|
-
console.error("XFE Web CLI
|
|
431
|
+
console.error("XFE Web CLI \u6267\u884C\u51FA\u9519:", err);
|
|
431
432
|
process.exit(1);
|
|
432
433
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -102,7 +102,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
102
102
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
103
103
|
}
|
|
104
104
|
function _ts_generator(thisArg, body) {
|
|
105
|
-
var f, y, t,
|
|
105
|
+
var f, y, t, _ = {
|
|
106
106
|
label: 0,
|
|
107
107
|
sent: function() {
|
|
108
108
|
if (t[0] & 1) throw t[1];
|
|
@@ -110,13 +110,17 @@ function _ts_generator(thisArg, body) {
|
|
|
110
110
|
},
|
|
111
111
|
trys: [],
|
|
112
112
|
ops: []
|
|
113
|
-
};
|
|
114
|
-
return g
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
113
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
114
|
+
return d(g, "next", {
|
|
115
|
+
value: verb(0)
|
|
116
|
+
}), d(g, "throw", {
|
|
117
|
+
value: verb(1)
|
|
118
|
+
}), d(g, "return", {
|
|
119
|
+
value: verb(2)
|
|
120
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
121
|
+
value: function() {
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
120
124
|
}), g;
|
|
121
125
|
function verb(n) {
|
|
122
126
|
return function(v) {
|
|
@@ -128,7 +132,7 @@ function _ts_generator(thisArg, body) {
|
|
|
128
132
|
}
|
|
129
133
|
function step(op) {
|
|
130
134
|
if (f) throw new TypeError("Generator is already executing.");
|
|
131
|
-
while(_)try {
|
|
135
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
132
136
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
133
137
|
if (y = 0, t) op = [
|
|
134
138
|
op[0] & 2,
|
|
@@ -196,7 +200,7 @@ function _ts_generator(thisArg, body) {
|
|
|
196
200
|
};
|
|
197
201
|
}
|
|
198
202
|
}
|
|
199
|
-
import { configDeploy, getJwtEnv } from "./chunk-
|
|
203
|
+
import { configDeploy, getJwtEnv } from "./chunk-75BJNL7E.mjs";
|
|
200
204
|
// src/cli.ts
|
|
201
205
|
import minimist from "minimist";
|
|
202
206
|
import { execSync } from "child_process";
|
|
@@ -206,10 +210,7 @@ var commands = argv._;
|
|
|
206
210
|
var _commands = _sliced_to_array(commands, 1), command = _commands[0];
|
|
207
211
|
var appPackageRoot = path.resolve(__dirname, "../");
|
|
208
212
|
function main() {
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
function _main() {
|
|
212
|
-
_main = _async_to_generator(function() {
|
|
213
|
+
return _async_to_generator(function() {
|
|
213
214
|
var jwtEnv, jwtEnv1;
|
|
214
215
|
return _ts_generator(this, function(_state) {
|
|
215
216
|
switch(_state.label){
|
|
@@ -262,10 +263,9 @@ function _main() {
|
|
|
262
263
|
];
|
|
263
264
|
}
|
|
264
265
|
});
|
|
265
|
-
});
|
|
266
|
-
return _main.apply(this, arguments);
|
|
266
|
+
})();
|
|
267
267
|
}
|
|
268
268
|
main().catch(function(err) {
|
|
269
|
-
console.error("XFE Web CLI
|
|
269
|
+
console.error("XFE Web CLI \u6267\u884C\u51FA\u9519:", err);
|
|
270
270
|
process.exit(1);
|
|
271
271
|
});
|
package/dist/config.js
CHANGED
|
@@ -28,8 +28,12 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
function _type_of(obj) {
|
|
32
|
+
"@swc/helpers - typeof";
|
|
33
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
34
|
+
}
|
|
31
35
|
function _ts_generator(thisArg, body) {
|
|
32
|
-
var f, y, t,
|
|
36
|
+
var f, y, t, _ = {
|
|
33
37
|
label: 0,
|
|
34
38
|
sent: function() {
|
|
35
39
|
if (t[0] & 1) throw t[1];
|
|
@@ -37,13 +41,17 @@ function _ts_generator(thisArg, body) {
|
|
|
37
41
|
},
|
|
38
42
|
trys: [],
|
|
39
43
|
ops: []
|
|
40
|
-
};
|
|
41
|
-
return g
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
44
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
45
|
+
return d(g, "next", {
|
|
46
|
+
value: verb(0)
|
|
47
|
+
}), d(g, "throw", {
|
|
48
|
+
value: verb(1)
|
|
49
|
+
}), d(g, "return", {
|
|
50
|
+
value: verb(2)
|
|
51
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
52
|
+
value: function() {
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
47
55
|
}), g;
|
|
48
56
|
function verb(n) {
|
|
49
57
|
return function(v) {
|
|
@@ -55,7 +63,7 @@ function _ts_generator(thisArg, body) {
|
|
|
55
63
|
}
|
|
56
64
|
function step(op) {
|
|
57
65
|
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while(_)try {
|
|
66
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
59
67
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
60
68
|
if (y = 0, t) op = [
|
|
61
69
|
op[0] & 2,
|
|
@@ -129,20 +137,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
129
137
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
130
138
|
var __getProtoOf = Object.getPrototypeOf;
|
|
131
139
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
132
|
-
var __export = function(target, all) {
|
|
140
|
+
var __export = function __export(target, all) {
|
|
133
141
|
for(var name in all)__defProp(target, name, {
|
|
134
142
|
get: all[name],
|
|
135
143
|
enumerable: true
|
|
136
144
|
});
|
|
137
145
|
};
|
|
138
|
-
var __copyProps = function(to, from, except, desc) {
|
|
139
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
146
|
+
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
147
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
140
148
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
141
149
|
try {
|
|
142
150
|
var _loop = function() {
|
|
143
151
|
var key = _step.value;
|
|
144
152
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
145
|
-
get: function() {
|
|
153
|
+
get: function get() {
|
|
146
154
|
return from[key];
|
|
147
155
|
},
|
|
148
156
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
@@ -166,7 +174,7 @@ var __copyProps = function(to, from, except, desc) {
|
|
|
166
174
|
}
|
|
167
175
|
return to;
|
|
168
176
|
};
|
|
169
|
-
var __toESM = function(mod, isNodeMode, target) {
|
|
177
|
+
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
170
178
|
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
171
179
|
// file that has been converted to a CommonJS file using a Babel-
|
|
172
180
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -176,7 +184,7 @@ var __toESM = function(mod, isNodeMode, target) {
|
|
|
176
184
|
enumerable: true
|
|
177
185
|
}) : target, mod);
|
|
178
186
|
};
|
|
179
|
-
var __toCommonJS = function(mod) {
|
|
187
|
+
var __toCommonJS = function __toCommonJS(mod) {
|
|
180
188
|
return __copyProps(__defProp({}, "__esModule", {
|
|
181
189
|
value: true
|
|
182
190
|
}), mod);
|
|
@@ -184,13 +192,13 @@ var __toCommonJS = function(mod) {
|
|
|
184
192
|
// src/config.ts
|
|
185
193
|
var config_exports = {};
|
|
186
194
|
__export(config_exports, {
|
|
187
|
-
configDeploy: function() {
|
|
195
|
+
configDeploy: function configDeploy1() {
|
|
188
196
|
return configDeploy;
|
|
189
197
|
},
|
|
190
|
-
getJwtEnv: function() {
|
|
198
|
+
getJwtEnv: function getJwtEnv1() {
|
|
191
199
|
return getJwtEnv;
|
|
192
200
|
},
|
|
193
|
-
loadXfeConfig: function() {
|
|
201
|
+
loadXfeConfig: function loadXfeConfig1() {
|
|
194
202
|
return loadXfeConfig;
|
|
195
203
|
}
|
|
196
204
|
});
|
|
@@ -198,15 +206,15 @@ module.exports = __toCommonJS(config_exports);
|
|
|
198
206
|
var import_path = __toESM(require("path"));
|
|
199
207
|
var import_fs = __toESM(require("fs"));
|
|
200
208
|
var import_yaml = __toESM(require("yaml"));
|
|
201
|
-
var loadXfeConfig = function() {
|
|
209
|
+
var loadXfeConfig = function loadXfeConfig() {
|
|
202
210
|
var xfeConfigPath = "./xfe.json";
|
|
203
211
|
if (!import_fs.default.existsSync(xfeConfigPath)) {
|
|
204
|
-
throw new Error("xfe.json
|
|
212
|
+
throw new Error("xfe.json \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5728\u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u521B\u5EFA\u8BE5\u6587\u4EF6\u3002");
|
|
205
213
|
}
|
|
206
214
|
var xfeConfigContent = import_fs.default.readFileSync(xfeConfigPath, "utf8");
|
|
207
215
|
return JSON.parse(xfeConfigContent);
|
|
208
216
|
};
|
|
209
|
-
var configDeploy = function() {
|
|
217
|
+
var configDeploy = function configDeploy() {
|
|
210
218
|
var xfeConfig = loadXfeConfig();
|
|
211
219
|
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.deploy)) return;
|
|
212
220
|
var droneConfigFilePath = import_path.default.resolve(__dirname, "../deploy/.drone.yml");
|
|
@@ -237,16 +245,16 @@ var configDeploy = function() {
|
|
|
237
245
|
});
|
|
238
246
|
import_fs.default.writeFileSync(valuesYamlFilePath, valuesYamlStr, "utf8");
|
|
239
247
|
};
|
|
240
|
-
var getJwtEnv = function() {
|
|
241
|
-
|
|
248
|
+
var getJwtEnv = function getJwtEnv() {
|
|
249
|
+
return _async_to_generator(function() {
|
|
242
250
|
var xfeConfig, _xfeConfig_jwt, _xfeConfig_jwt_aud, aud, jwkRes, JwkResponseJson, err, _, _1, _2, _ref, keyId, privateKeyPkcs8;
|
|
243
251
|
return _ts_generator(this, function(_state) {
|
|
244
252
|
switch(_state.label){
|
|
245
253
|
case 0:
|
|
246
254
|
xfeConfig = loadXfeConfig();
|
|
247
|
-
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.jwt)) throw new Error("xfe.json
|
|
255
|
+
if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.jwt)) throw new Error("xfe.json \u4E2D\u672A\u914D\u7F6E jwt \u4FE1\u606F\uFF0C\u8BF7\u68C0\u67E5\u914D\u7F6E\u6587\u4EF6\u3002");
|
|
248
256
|
_xfeConfig_jwt = xfeConfig.jwt, _xfeConfig_jwt_aud = _xfeConfig_jwt.aud, aud = _xfeConfig_jwt_aud === void 0 ? "" : _xfeConfig_jwt_aud;
|
|
249
|
-
if (!aud) throw new Error("xfe.json
|
|
257
|
+
if (!aud) throw new Error("xfe.json \u4E2D\u7684 jwt \u914D\u7F6E\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u786E\u4FDD\u5305\u542B aud \u5B57\u6BB5\u3002");
|
|
250
258
|
return [
|
|
251
259
|
4,
|
|
252
260
|
fetch("https://app.eshetang.com/jwk?appId=".concat(aud))
|
|
@@ -302,11 +310,8 @@ var getJwtEnv = function() {
|
|
|
302
310
|
];
|
|
303
311
|
}
|
|
304
312
|
});
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
return _ref.apply(this, arguments);
|
|
308
|
-
};
|
|
309
|
-
}();
|
|
313
|
+
})();
|
|
314
|
+
};
|
|
310
315
|
// Annotate the CommonJS export names for ESM import in node:
|
|
311
316
|
0 && (module.exports = {
|
|
312
317
|
configDeploy: configDeploy,
|
package/dist/config.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { configDeploy, getJwtEnv, loadXfeConfig } from "./chunk-
|
|
1
|
+
import { configDeploy, getJwtEnv, loadXfeConfig } from "./chunk-75BJNL7E.mjs";
|
|
2
2
|
export { configDeploy, getJwtEnv, loadXfeConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xfe-repo/web-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"bin": {
|
|
5
5
|
"xfe-web": "./bin/index.js"
|
|
6
6
|
},
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"@loadable/webpack-plugin": "^5.15.2",
|
|
21
21
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
|
22
22
|
"@svgr/webpack": "^5.5.0",
|
|
23
|
-
"@testing-library/jest-dom": "^
|
|
24
|
-
"@testing-library/react": "^
|
|
25
|
-
"@testing-library/user-event": "^
|
|
23
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
24
|
+
"@testing-library/react": "^16.3.2",
|
|
25
|
+
"@testing-library/user-event": "^14.6.1",
|
|
26
26
|
"@types/minimist": "^1.2.5",
|
|
27
|
-
"@types/node": "^
|
|
27
|
+
"@types/node": "^20.17.0",
|
|
28
28
|
"@types/react": "^18.0.0",
|
|
29
|
-
"babel-jest": "^
|
|
29
|
+
"babel-jest": "^30.2.0",
|
|
30
30
|
"babel-loader": "^8.2.3",
|
|
31
31
|
"babel-plugin-named-asset-import": "^0.3.8",
|
|
32
32
|
"babel-preset-react-app": "^10.0.1",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"css-minimizer-webpack-plugin": "^3.2.0",
|
|
39
39
|
"dotenv": "^10.0.0",
|
|
40
40
|
"dotenv-expand": "^5.1.0",
|
|
41
|
+
"eslint": "8.57.1",
|
|
41
42
|
"eslint-config-react-app": "^7.0.1",
|
|
42
43
|
"eslint-webpack-plugin": "^3.1.1",
|
|
43
44
|
"file-loader": "^6.2.0",
|
|
@@ -46,9 +47,9 @@
|
|
|
46
47
|
"husky": "^9.1.6",
|
|
47
48
|
"identity-obj-proxy": "^3.0.0",
|
|
48
49
|
"ignore-loader": "^0.1.2",
|
|
49
|
-
"jest": "^
|
|
50
|
-
"jest-resolve": "^
|
|
51
|
-
"jest-watch-typeahead": "^
|
|
50
|
+
"jest": "^30.2.0",
|
|
51
|
+
"jest-resolve": "^30.2.0",
|
|
52
|
+
"jest-watch-typeahead": "^3.0.1",
|
|
52
53
|
"less": "^4.1.3",
|
|
53
54
|
"less-loader": "^11.1.0",
|
|
54
55
|
"mini-css-extract-plugin": "^2.4.5",
|
|
@@ -72,14 +73,14 @@
|
|
|
72
73
|
"tailwindcss": "^3.0.2",
|
|
73
74
|
"terser-webpack-plugin": "^5.2.5",
|
|
74
75
|
"web-vitals": "^2.1.4",
|
|
75
|
-
"webpack": "
|
|
76
|
+
"webpack": "~5.64.4",
|
|
76
77
|
"webpack-bundle-analyzer": "^4.8.0",
|
|
77
78
|
"webpack-dev-server": "^4.6.0",
|
|
78
79
|
"webpack-manifest-plugin": "^4.0.2",
|
|
79
80
|
"workbox-webpack-plugin": "^7.0.0",
|
|
80
81
|
"yaml": "^2.3.4",
|
|
81
|
-
"@xfe-repo/
|
|
82
|
-
"@xfe-repo/
|
|
82
|
+
"@xfe-repo/typescript-config": "1.5.1",
|
|
83
|
+
"@xfe-repo/eslint-config": "1.5.1"
|
|
83
84
|
},
|
|
84
85
|
"peerDependencies": {
|
|
85
86
|
"react": "18.2.0",
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
"scripts": {
|
|
92
93
|
"build": "tsup",
|
|
93
94
|
"dev": "tsup --watch",
|
|
94
|
-
"lint": "eslint \"src/**/*.ts*\"",
|
|
95
|
+
"lint": "eslint \"src/**/*.ts*\" --fix",
|
|
95
96
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
96
97
|
}
|
|
97
98
|
}
|