@infly/libs 2.0.44 → 2.0.45
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 +17 -5
- package/adapters/vue2/module/Permission.js +1 -1
- package/{module → adapters/vue2/module}/REST.js +3 -3
- package/{module → adapters/vue2/module}/TokenService.js +1 -1
- package/adapters/vue2/module/file-export.js +18 -0
- package/adapters/vue2/project-preview.js +6 -2
- package/adapters/vue2/script-config.js +1 -1
- package/adapters/vue2/store/modules/user.js +1 -1
- package/adapters/vue2/vite/index.js +95 -0
- package/adapters/vue2/vite/jest.config.js +11 -0
- package/adapters/vue2/{build/webpack5 → webpack5}/webpack.base.js +0 -55
- package/build/build-dist/index.js +2 -2
- package/{script/build → build/build-utils}/command.js +13 -4
- package/{script/build → build/build-utils}/git.js +6 -4
- package/{script/build → build/build-utils}/preview.js +4 -1
- package/module/Uts.js +47 -443
- package/package.json +18 -15
- package/script/git-automation/git-configure.js +29 -0
- package/script/git-automation/index.js +0 -14
- package/script/git-automation/submodule-status.js +113 -0
- package/script/git-automation/submodule-utils.js +18 -0
- package/tools/concurrency.js +30 -0
- package/tools/progress.js +63 -0
- package/tools/project-command.js +5 -1
- package/tools/workspace-config.js +145 -0
- package/adapters/vue2/build/webpack5/remove-legacy-assets-plugin.js +0 -84
- package/build/webpack5/inline-runtime-plugin.js +0 -1
- package/build/webpack5/remove-legacy-assets-plugin.js +0 -1
- package/build/webpack5/webpack.base.js +0 -1
- package/module/Permission.js +0 -1
- package/module/cjs/deep-merge.cjs +0 -38
- package/store/index.js +0 -1
- package/store/modules/user.js +0 -1
- package/tools/file-export.js +0 -167
- /package/{module → adapters/vue2/module}/Router.js +0 -0
- /package/adapters/vue2/{build/webpack5 → webpack5}/inline-runtime-plugin.js +0 -0
- /package/{script/build → build/build-utils}/deps.js +0 -0
- /package/{script/build → build/build-utils}/env.js +0 -0
- /package/{script/webhook/webhook.js → build/build-utils/webhook-single.js} +0 -0
- /package/{script/build → build/build-utils}/webhook.js +0 -0
- /package/module/cjs/{page-config.cjs → page-config.js} +0 -0
- /package/module/cjs/{request-url-rules.cjs → request-url-rules.js} +0 -0
- /package/module/cjs/{rest-error-rules.cjs → rest-error-rules.js} +0 -0
package/module/Uts.js
CHANGED
|
@@ -9,471 +9,75 @@
|
|
|
9
9
|
* import Uts from "@infly/libs/module/Uts.js" 不变,所有 Uts.xxx() 不变。
|
|
10
10
|
*
|
|
11
11
|
* 🚫 新增工具函数请提交到 @infly/ts-libs,不得在本文件或 module/ 下新增原创逻辑。
|
|
12
|
-
*
|
|
12
|
+
* @infly/ts-libs 新增的导出会自动聚合到 Uts 对象,无需手动同步。
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
// ========================
|
|
16
|
-
//
|
|
17
|
-
// ========================
|
|
18
|
-
import {
|
|
19
|
-
isTrue,
|
|
20
|
-
isFunction,
|
|
21
|
-
isDefined,
|
|
22
|
-
isUndefined,
|
|
23
|
-
isBoolean,
|
|
24
|
-
isObject,
|
|
25
|
-
isArray,
|
|
26
|
-
isPureObject,
|
|
27
|
-
isRegExp,
|
|
28
|
-
isNumber,
|
|
29
|
-
isNull,
|
|
30
|
-
isString,
|
|
31
|
-
isDate,
|
|
32
|
-
isError,
|
|
33
|
-
isPresentValue,
|
|
34
|
-
isNaNValue,
|
|
35
|
-
notEmptyString,
|
|
36
|
-
notEmptyArray,
|
|
37
|
-
notEmptyObject,
|
|
38
|
-
safeRegString,
|
|
39
|
-
changeDangerousString,
|
|
40
|
-
startWith,
|
|
41
|
-
endWith,
|
|
42
|
-
toLowerCase,
|
|
43
|
-
toUpperCase,
|
|
44
|
-
parse,
|
|
45
|
-
toJSON,
|
|
46
|
-
match,
|
|
47
|
-
notContainReg,
|
|
48
|
-
getPartStringBySymbolIndex,
|
|
49
|
-
safeDateString,
|
|
50
|
-
hadEncode,
|
|
51
|
-
ifHadEncode,
|
|
52
|
-
hadWord,
|
|
53
|
-
encryptString,
|
|
54
|
-
reorderString,
|
|
55
|
-
min,
|
|
56
|
-
float,
|
|
57
|
-
filterMoney,
|
|
58
|
-
formatMoney,
|
|
59
|
-
digitUppercase,
|
|
60
|
-
exchangeMoneyByUnit,
|
|
61
|
-
getNumberValueByUnit,
|
|
62
|
-
splitMoney,
|
|
63
|
-
formatNumUnit,
|
|
64
|
-
generateEmptyArray,
|
|
65
|
-
parseFloatValue,
|
|
66
|
-
now,
|
|
67
|
-
daysInMonth,
|
|
68
|
-
getWeek,
|
|
69
|
-
getDayStamp,
|
|
70
|
-
getNumDayBefore,
|
|
71
|
-
getTimeFromSymbol,
|
|
72
|
-
getTimeFromMillisecond,
|
|
73
|
-
formatDate,
|
|
74
|
-
validateIDCard,
|
|
75
|
-
validatePhoneNumber,
|
|
76
|
-
isIntPrice,
|
|
77
|
-
TR,
|
|
78
|
-
checkCondition,
|
|
79
|
-
or,
|
|
80
|
-
and,
|
|
81
|
-
pluck,
|
|
82
|
-
pluckMap,
|
|
83
|
-
uniqueArray,
|
|
84
|
-
uniqueObjArray,
|
|
85
|
-
mergeArrayWithoutDuplicate,
|
|
86
|
-
sum,
|
|
87
|
-
countTotalFromArray,
|
|
88
|
-
findIndex,
|
|
89
|
-
index,
|
|
90
|
-
contain,
|
|
91
|
-
findObjByCondition,
|
|
92
|
-
filterObjByCondition,
|
|
93
|
-
filterObjByRegexpCondition,
|
|
94
|
-
sort,
|
|
95
|
-
reorderByArrayIndex,
|
|
96
|
-
getSameBetweenArray,
|
|
97
|
-
removeItemFromArray,
|
|
98
|
-
arrayUpdateEachValue,
|
|
99
|
-
fetchStringArrayToObject,
|
|
100
|
-
generateArray,
|
|
101
|
-
join,
|
|
102
|
-
convertToArray,
|
|
103
|
-
loop,
|
|
104
|
-
generatePathByParent,
|
|
105
|
-
pushArray,
|
|
106
|
-
mergeArray,
|
|
107
|
-
unshiftArray,
|
|
108
|
-
concat,
|
|
109
|
-
getObjectKeys,
|
|
110
|
-
DAO,
|
|
111
|
-
getNestedValue,
|
|
112
|
-
objectIsEqual,
|
|
113
|
-
arrayIsEqual,
|
|
114
|
-
mergeObjectWithReference,
|
|
115
|
-
extend,
|
|
116
|
-
toStr,
|
|
117
|
-
getAutoMatchFromConfig,
|
|
118
|
-
setListToMap,
|
|
119
|
-
filterCommaFields,
|
|
120
|
-
updateObjectByConfig
|
|
121
|
-
} from "@infly/ts-libs";
|
|
122
|
-
|
|
123
|
-
// ========================
|
|
124
|
-
// 浏览器依赖 — 全部来自 @infly/ts-libs/browser/
|
|
16
|
+
// 聚合所有 @infly/ts-libs 导出(命名空间导入,自动跟随 ts-libs 更新)
|
|
125
17
|
// ========================
|
|
18
|
+
import * as tsLibs from "@infly/ts-libs";
|
|
126
19
|
import * as dom from "@infly/ts-libs/browser/dom";
|
|
127
20
|
import * as st from "@infly/ts-libs/browser/storage";
|
|
128
21
|
import * as rt from "@infly/ts-libs/browser/route";
|
|
129
22
|
import * as env from "@infly/ts-libs/browser/env";
|
|
130
23
|
import * as pm from "@infly/ts-libs/browser/permission";
|
|
131
|
-
import
|
|
132
|
-
import
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
setUtsRef as _setExprUtsRef,
|
|
138
|
-
setStorageRef
|
|
139
|
-
} from "@infly/ts-libs/browser/expression";
|
|
140
|
-
import { each, objEach, setIterateUtsRef } from "@infly/ts-libs/browser/iterate";
|
|
141
|
-
import { loopTree, generatePathForTree, randomOrder, setTreeUtsRef } from "@infly/ts-libs/browser/tree";
|
|
142
|
-
import {
|
|
143
|
-
highlightKeyWord,
|
|
144
|
-
autoMatch,
|
|
145
|
-
textConfig,
|
|
146
|
-
checkConfig,
|
|
147
|
-
checkOrgCode,
|
|
148
|
-
changeLanguage,
|
|
149
|
-
compressStr,
|
|
150
|
-
unCompressStr,
|
|
151
|
-
setAutoState,
|
|
152
|
-
getAutoState,
|
|
153
|
-
cleanStateScope,
|
|
154
|
-
changeDomainWhenExternal,
|
|
155
|
-
getGatewayDomain,
|
|
156
|
-
transArrayBufferToObj,
|
|
157
|
-
removeState as _removeState,
|
|
158
|
-
copyText,
|
|
159
|
-
copyHtml,
|
|
160
|
-
copyImage,
|
|
161
|
-
blobToDataURI,
|
|
162
|
-
ce,
|
|
163
|
-
te,
|
|
164
|
-
runCode,
|
|
165
|
-
regHook,
|
|
166
|
-
back,
|
|
167
|
-
noHref,
|
|
168
|
-
generateFlag,
|
|
169
|
-
setExtraRefs,
|
|
170
|
-
saveTempStoreList
|
|
171
|
-
} from "@infly/ts-libs/browser/extra";
|
|
24
|
+
import * as cloneMod from "@infly/ts-libs/browser/clone";
|
|
25
|
+
import * as expression from "@infly/ts-libs/browser/expression";
|
|
26
|
+
import * as iterate from "@infly/ts-libs/browser/iterate";
|
|
27
|
+
import * as treeMod from "@infly/ts-libs/browser/tree";
|
|
28
|
+
import * as extra from "@infly/ts-libs/browser/extra";
|
|
29
|
+
import { create$state } from "@infly/ts-libs/browser/state";
|
|
172
30
|
|
|
173
31
|
// ========================
|
|
174
|
-
// CommonJS
|
|
32
|
+
// CommonJS(page-config 为 CJS 模块)
|
|
175
33
|
// ========================
|
|
176
|
-
const {
|
|
177
|
-
const {
|
|
178
|
-
mergePageConfig: mergePageConfigImpl,
|
|
179
|
-
resolvePlatformPageConfig: resolvePlatformPageConfigImpl
|
|
180
|
-
} = require("./cjs/page-config.cjs");
|
|
34
|
+
const { mergePageConfig, resolvePlatformPageConfig } = require("./cjs/page-config.js");
|
|
181
35
|
|
|
182
36
|
// ========================
|
|
183
|
-
//
|
|
184
|
-
// ========================
|
|
185
|
-
const isNaNImpl = isNaNValue;
|
|
186
|
-
const parseFloatImpl = parseFloatValue;
|
|
187
|
-
const getTimeFromSybol = getTimeFromSymbol;
|
|
188
|
-
const paramsToSearch = _paramsToSearch;
|
|
189
|
-
|
|
190
|
-
import { create$state } from "@infly/ts-libs/browser/state";
|
|
191
|
-
|
|
192
|
-
// ========================
|
|
193
|
-
// Uts 对象组装
|
|
37
|
+
// Uts 对象组装 — 聚合所有 ts-libs 导出
|
|
194
38
|
// ========================
|
|
195
39
|
let Uts = {
|
|
196
|
-
// --
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
objEach,
|
|
220
|
-
|
|
221
|
-
// -- string --
|
|
222
|
-
safeRegString,
|
|
223
|
-
changeDangerousString,
|
|
224
|
-
startWith,
|
|
225
|
-
endWith,
|
|
226
|
-
toLowerCase,
|
|
227
|
-
toUpperCase,
|
|
228
|
-
parse,
|
|
229
|
-
toJSON,
|
|
230
|
-
match,
|
|
231
|
-
notContainReg,
|
|
232
|
-
getPartStringBySymbolIndex,
|
|
233
|
-
safeDateString,
|
|
234
|
-
hadEncode,
|
|
235
|
-
ifHadEncode,
|
|
236
|
-
hadWord,
|
|
237
|
-
encryptString,
|
|
238
|
-
reorderString,
|
|
239
|
-
|
|
240
|
-
// -- condition / expression --
|
|
241
|
-
TR,
|
|
242
|
-
checkCondition,
|
|
243
|
-
or,
|
|
244
|
-
and,
|
|
245
|
-
checkValueByExpression,
|
|
246
|
-
useConfigExpression,
|
|
247
|
-
conditionFunctionRender,
|
|
248
|
-
|
|
249
|
-
// -- math --
|
|
250
|
-
min,
|
|
251
|
-
float,
|
|
252
|
-
parseFloat: parseFloatImpl,
|
|
253
|
-
filterMoney,
|
|
254
|
-
formatMoney,
|
|
255
|
-
digitUppercase,
|
|
256
|
-
exchangeMoneyByUnit,
|
|
257
|
-
getNumberValueByUnit,
|
|
258
|
-
splitMoney,
|
|
259
|
-
formatNumUnit,
|
|
260
|
-
generateEmptyArray,
|
|
261
|
-
|
|
262
|
-
// -- date --
|
|
263
|
-
now,
|
|
264
|
-
daysInMonth,
|
|
265
|
-
getWeek,
|
|
266
|
-
getDayStamp,
|
|
267
|
-
getNumDayBefore,
|
|
268
|
-
getTimeFromSybol,
|
|
269
|
-
getTimeFromMillisecond,
|
|
270
|
-
formatDate,
|
|
271
|
-
|
|
272
|
-
// -- validation --
|
|
273
|
-
validateIDCard,
|
|
274
|
-
validatePhoneNumber,
|
|
275
|
-
isIntPrice,
|
|
276
|
-
|
|
277
|
-
// -- array --
|
|
278
|
-
pluck,
|
|
279
|
-
pluckMap,
|
|
280
|
-
uniqueArray,
|
|
281
|
-
uniqueObjArray,
|
|
282
|
-
mergeArrayWithoutDuplicate,
|
|
283
|
-
sum,
|
|
284
|
-
countTotalFromArray,
|
|
285
|
-
findIndex,
|
|
286
|
-
index,
|
|
287
|
-
contain,
|
|
288
|
-
findObjByCondition,
|
|
289
|
-
filterObjByCondition,
|
|
290
|
-
filterObjByRegexpCondition,
|
|
291
|
-
sort,
|
|
292
|
-
reorderByArrayIndex,
|
|
293
|
-
getSameBetweenArray,
|
|
294
|
-
removeItemFromArray,
|
|
295
|
-
arrayUpdateEachValue,
|
|
296
|
-
fetchObjectArrayToStringArray: pluck,
|
|
297
|
-
fetchStringArrayToObject,
|
|
298
|
-
generateArray,
|
|
299
|
-
join,
|
|
300
|
-
convertToArray,
|
|
301
|
-
loop,
|
|
302
|
-
generatePathByParent,
|
|
303
|
-
pushArray,
|
|
304
|
-
mergeArray,
|
|
305
|
-
unshiftArray,
|
|
306
|
-
concat,
|
|
307
|
-
randomOrder,
|
|
308
|
-
loopTree,
|
|
309
|
-
generatePathForTree,
|
|
310
|
-
pluckArray: pluck,
|
|
311
|
-
|
|
312
|
-
// -- object --
|
|
313
|
-
getObjectKeys,
|
|
314
|
-
DAO,
|
|
315
|
-
getNestedValue,
|
|
316
|
-
objectIsEqual,
|
|
317
|
-
arrayIsEqual,
|
|
318
|
-
mergeObjectWithReference,
|
|
319
|
-
extend,
|
|
320
|
-
toStr,
|
|
321
|
-
getAutoMatchFromConfig,
|
|
322
|
-
setListToMap,
|
|
323
|
-
filterCommaFields,
|
|
324
|
-
deepMerge: deepMergeImpl,
|
|
325
|
-
mergePageConfig: mergePageConfigImpl,
|
|
326
|
-
resolvePlatformPageConfig: resolvePlatformPageConfigImpl,
|
|
327
|
-
copyObj,
|
|
328
|
-
paramsToSearch,
|
|
329
|
-
updateObjectByConfig,
|
|
330
|
-
|
|
331
|
-
// -- 业务/杂项 (uts/extra.js) --
|
|
332
|
-
highlightKeyWord,
|
|
333
|
-
autoMatch,
|
|
334
|
-
textConfig,
|
|
335
|
-
checkConfig,
|
|
336
|
-
checkOrgCode,
|
|
337
|
-
changeLanguage,
|
|
338
|
-
compressStr,
|
|
339
|
-
unCompressStr,
|
|
340
|
-
setAutoState,
|
|
341
|
-
getAutoState,
|
|
342
|
-
cleanStateScope,
|
|
343
|
-
changeDomainWhenExternal,
|
|
344
|
-
getGatewayDomain,
|
|
345
|
-
transArrayBufferToObj,
|
|
346
|
-
removeState: _removeState,
|
|
347
|
-
copyText,
|
|
348
|
-
copyHtml,
|
|
349
|
-
copyImage,
|
|
350
|
-
blobToDataURI,
|
|
351
|
-
ce,
|
|
352
|
-
te,
|
|
353
|
-
runCode,
|
|
354
|
-
regHook,
|
|
355
|
-
back,
|
|
356
|
-
noHref,
|
|
357
|
-
generateFlag,
|
|
358
|
-
saveTempStoreList,
|
|
359
|
-
|
|
360
|
-
// -- DOM (uts/dom.js) --
|
|
361
|
-
E: dom.E,
|
|
362
|
-
createDom: dom.createDom,
|
|
363
|
-
addDom: dom.addDom,
|
|
364
|
-
removeDom: dom.removeDom,
|
|
365
|
-
hasClass: dom.hasClass,
|
|
366
|
-
addClass: dom.addClass,
|
|
367
|
-
removeClass: dom.removeClass,
|
|
368
|
-
toggleClass: dom.toggleClass,
|
|
369
|
-
closest: dom.closest,
|
|
370
|
-
hasParentWithPartClass: dom.hasParentWithPartClass,
|
|
371
|
-
html: dom.html,
|
|
372
|
-
getTagName: dom.getTagName,
|
|
373
|
-
getTagValue: dom.getTagValue,
|
|
374
|
-
setStyle: dom.setStyle,
|
|
375
|
-
getStyle: dom.getStyle,
|
|
376
|
-
getPS: dom.getPS,
|
|
377
|
-
getElementOffset: dom.getElementOffset,
|
|
378
|
-
getPointAtElement: dom.getPointAtElement,
|
|
379
|
-
getTextWidth: dom.getTextWidth,
|
|
380
|
-
setAttr: dom.setAttr,
|
|
381
|
-
setAttrs: dom.setAttrs,
|
|
382
|
-
removeAttr: dom.removeAttr,
|
|
383
|
-
addScript: dom.addScript,
|
|
384
|
-
loadStyleSheet: dom.loadStyleSheet,
|
|
385
|
-
loadIframe: dom.loadIframe,
|
|
386
|
-
stripTag: dom.stripTag,
|
|
387
|
-
setFavicon: dom.setFavicon,
|
|
388
|
-
isDom: dom.isDom,
|
|
389
|
-
|
|
390
|
-
// -- Storage (uts/storage.js) --
|
|
391
|
-
getCookie: st.getCookie,
|
|
392
|
-
setCookie: st.setCookie,
|
|
393
|
-
removeCookie: st.removeCookie,
|
|
394
|
-
setCookieMt: st.setCookieMt,
|
|
395
|
-
cookiesMap: st.cookiesMap,
|
|
396
|
-
storage: st.storage,
|
|
397
|
-
ssStorage: st.ssStorage,
|
|
398
|
-
|
|
399
|
-
// -- Route (uts/route.js) --
|
|
400
|
-
$stateTo: rt.$stateTo,
|
|
401
|
-
$stateGo: rt.$stateGo,
|
|
402
|
-
href: rt.href,
|
|
403
|
-
getRouterSearch: rt.getRouterSearch,
|
|
404
|
-
getParamsFormSearch: rt.getParamsFormSearch,
|
|
405
|
-
pushState: rt.pushState,
|
|
406
|
-
repleaceState: rt.repleaceState,
|
|
407
|
-
initHashCache: rt.initHashCache,
|
|
408
|
-
cleanState: rt.cleanState,
|
|
409
|
-
|
|
410
|
-
// -- Env (uts/env.js) --
|
|
411
|
-
getEnv: env.getEnv,
|
|
412
|
-
getOrigin: env.getOrigin,
|
|
413
|
-
isDevMode: env.isDevMode,
|
|
414
|
-
isDebugMode: env.isDebugMode,
|
|
415
|
-
isIe: env.isIe,
|
|
416
|
-
isWeiXin: env.isWeiXin,
|
|
417
|
-
initUA: env.initUA,
|
|
418
|
-
isTablet: env.isTablet,
|
|
419
|
-
isUA: env.isUA,
|
|
420
|
-
toggleMobileViewport: env.toggleMobileViewport,
|
|
421
|
-
getClientPX: env.getClientPX,
|
|
422
|
-
hasPhysicalHomeKey: env.hasPhysicalHomeKey,
|
|
423
|
-
getWwwFile: env.getWwwFile,
|
|
424
|
-
normalizeEnvUrl: env.normalizeEnvUrl,
|
|
425
|
-
getWapDomain: env.getWapDomain,
|
|
426
|
-
getUrlParam: env.getUrlParam,
|
|
427
|
-
removeParamByRegex: env.removeParamByRegex,
|
|
428
|
-
|
|
429
|
-
// -- Permission (uts/permission.js) --
|
|
430
|
-
getCurrentProject: pm.getCurrentProject,
|
|
431
|
-
getProjectTokenName: pm.getProjectTokenName,
|
|
432
|
-
getTokenForProject: pm.getTokenForProject,
|
|
433
|
-
isLogin: pm.isLogin,
|
|
434
|
-
setPM: pm.setPM,
|
|
435
|
-
getPM: pm.getPM,
|
|
436
|
-
getPMBySettings: pm.getPMBySettings,
|
|
437
|
-
filterPM: pm.filterPM,
|
|
438
|
-
routeToDomain: pm.routeToDomain,
|
|
439
|
-
clearCacheForLogout: pm.clearCacheForLogout,
|
|
440
|
-
clearAllCookiesAndStorage: pm.clearAllCookiesAndStorage,
|
|
441
|
-
|
|
442
|
-
// -- 遗留配置 --
|
|
443
|
-
FINDDOMAINEXP: /[^.]+\.[^.]+$/,
|
|
444
|
-
TAGNAMEEXP: /<([^\s>]+)(\s|>)+/,
|
|
445
|
-
allTagEXP: /<[^>]+>/gim,
|
|
446
|
-
TAGVALUEEXP(tagName) {
|
|
447
|
-
return new RegExp("^<" + tagName + "[^>]{0,}>|</" + tagName + ">$", "g");
|
|
448
|
-
},
|
|
449
|
-
EVERYDAYCACHE: "EveryDayArr",
|
|
450
|
-
removeHashSiteList: ["bio"],
|
|
451
|
-
tokenNameConfig: {
|
|
452
|
-
www: "accrosToken",
|
|
453
|
-
oms: "omsLoginToken",
|
|
454
|
-
sp: "SPAccrosToken",
|
|
455
|
-
hms: "accrosToken",
|
|
456
|
-
bio: "bioLoginToken",
|
|
457
|
-
lab: "labLoginToken",
|
|
458
|
-
exam: "examLoginToken",
|
|
459
|
-
srs: "srsLoginToken"
|
|
460
|
-
},
|
|
461
|
-
permissionsConfig: {},
|
|
462
|
-
UI6PageLists: [],
|
|
463
|
-
keeyCookieWhenLogOut: [],
|
|
464
|
-
keepStoreListWhenLogOut: [],
|
|
465
|
-
autoKeepSessionWhenLogOut: []
|
|
40
|
+
// -- 纯逻辑 + 浏览器依赖(spread 自动聚合,ts-libs 新增导出无需手动同步)--
|
|
41
|
+
...tsLibs,
|
|
42
|
+
...dom,
|
|
43
|
+
...st,
|
|
44
|
+
...rt,
|
|
45
|
+
...env,
|
|
46
|
+
...pm,
|
|
47
|
+
...cloneMod,
|
|
48
|
+
...expression,
|
|
49
|
+
...iterate,
|
|
50
|
+
...treeMod,
|
|
51
|
+
...extra,
|
|
52
|
+
|
|
53
|
+
// -- 向后兼容别名(ts-libs 用不同名称避免 shadow 全局名;历史拼写兼容)--
|
|
54
|
+
isNaN: tsLibs.isNaNValue,
|
|
55
|
+
parseFloat: tsLibs.parseFloatValue,
|
|
56
|
+
getTimeFromSybol: tsLibs.getTimeFromSymbol,
|
|
57
|
+
fetchObjectArrayToStringArray: tsLibs.pluck,
|
|
58
|
+
pluckArray: tsLibs.pluck,
|
|
59
|
+
|
|
60
|
+
// -- CJS page-config --
|
|
61
|
+
mergePageConfig,
|
|
62
|
+
resolvePlatformPageConfig,
|
|
466
63
|
};
|
|
467
64
|
|
|
65
|
+
// 删除浏览器模块的内部函数(仅用于引用注入,不应暴露给消费者)
|
|
66
|
+
delete Uts.setIterateUtsRef; // iterate 模块
|
|
67
|
+
delete Uts.setTreeUtsRef; // tree 模块
|
|
68
|
+
delete Uts.setUtsRef; // expression 模块
|
|
69
|
+
delete Uts.setStorageRef; // expression 模块
|
|
70
|
+
delete Uts.setExtraRefs; // extra 模块
|
|
71
|
+
|
|
468
72
|
// ========================
|
|
469
73
|
// 注入引用链(解除循环依赖)
|
|
470
74
|
// ========================
|
|
471
75
|
global.Uts = Uts;
|
|
472
76
|
create$state(Uts);
|
|
473
|
-
setIterateUtsRef(Uts);
|
|
474
|
-
setTreeUtsRef(Uts);
|
|
475
|
-
|
|
476
|
-
setStorageRef(st);
|
|
477
|
-
setExtraRefs(Uts, st, env);
|
|
77
|
+
iterate.setIterateUtsRef(Uts);
|
|
78
|
+
treeMod.setTreeUtsRef(Uts);
|
|
79
|
+
expression.setUtsRef(Uts);
|
|
80
|
+
expression.setStorageRef(st);
|
|
81
|
+
extra.setExtraRefs(Uts, st, env);
|
|
478
82
|
|
|
479
83
|
export default Uts;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infly/libs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.45",
|
|
4
4
|
"description": "不受前端框架限制的独立工具库",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"files": [
|
|
7
8
|
"index.js",
|
|
8
9
|
"bin/",
|
|
@@ -10,22 +11,20 @@
|
|
|
10
11
|
"adapters/vue2/",
|
|
11
12
|
"build/",
|
|
12
13
|
"module/",
|
|
13
|
-
"script/build/",
|
|
14
14
|
"script/git-automation/",
|
|
15
15
|
"script/index.js",
|
|
16
|
-
"script/webhook/",
|
|
17
|
-
"store/",
|
|
18
16
|
"tools/",
|
|
19
17
|
"README.md",
|
|
20
18
|
"LICENSE",
|
|
21
19
|
"!**/*.test.js",
|
|
22
|
-
"!**/*.test.cjs",
|
|
23
20
|
"!**/*.test.mjs"
|
|
24
21
|
],
|
|
25
22
|
"scripts": {
|
|
26
|
-
"test": "
|
|
27
|
-
"test:coverage": "
|
|
28
|
-
"
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:coverage": "vitest run --coverage",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"check": "vitest run core-entry.test.js",
|
|
27
|
+
"prepublishOnly": "pnpm test",
|
|
29
28
|
"lint": "eslint .",
|
|
30
29
|
"lint:strict": "eslint . --max-warnings 0",
|
|
31
30
|
"postinstall": "node adapters/vue2/postinstall.js",
|
|
@@ -43,14 +42,15 @@
|
|
|
43
42
|
"./adapters/vue2/*": "./adapters/vue2/*",
|
|
44
43
|
"./adapters/vue2/build/*": "./adapters/vue2/build/*",
|
|
45
44
|
"./module/*": "./module/*",
|
|
45
|
+
"./store/*": "./adapters/vue2/store/*",
|
|
46
46
|
"./tools/*": "./tools/*",
|
|
47
|
-
"./store/*": "./store/*",
|
|
48
47
|
"./build/*": "./build/*",
|
|
49
|
-
"./
|
|
48
|
+
"./build/build-utils/*": "./build/build-utils/*",
|
|
49
|
+
"./script/git-automation/*": "./script/git-automation/*"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
53
|
-
"url": "https://gitee.com/
|
|
53
|
+
"url": "https://gitee.com/gdinfly_1/admin-monorepo.git"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"infly",
|
|
@@ -64,16 +64,19 @@
|
|
|
64
64
|
"connect": "^3.7.0",
|
|
65
65
|
"enquirer": "^2.4.1",
|
|
66
66
|
"path-browserify": "^1.0.1",
|
|
67
|
-
"serve-static": "^1.15.0"
|
|
67
|
+
"serve-static": "^1.15.0",
|
|
68
|
+
"yaml": "^2.3.4"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@babel/core": "^7.23.3",
|
|
71
72
|
"@babel/preset-env": "^7.23.3",
|
|
72
73
|
"@babel/preset-typescript": "^7.23.3",
|
|
73
74
|
"babel-loader": "^10.0.0",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
75
|
+
"vite": "7.0.0",
|
|
76
|
+
"vitest": "^4.0.0",
|
|
77
|
+
"eslint": "^9.0.0",
|
|
78
|
+
"@eslint/js": "^9.0.0",
|
|
79
|
+
"globals": "^15.0.0"
|
|
77
80
|
},
|
|
78
81
|
"peerDependencies": {
|
|
79
82
|
"axios": "^0.27.2",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { execSync } = require("node:child_process");
|
|
2
|
+
|
|
3
|
+
function configureMergeDriver() {
|
|
4
|
+
try {
|
|
5
|
+
const current = execSync("git config --global merge.ours.driver").toString().trim();
|
|
6
|
+
if (current) {
|
|
7
|
+
console.log(" -> merge.ours.driver 已配置:", current);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
} catch (_) {
|
|
11
|
+
// 未配置,继续设置。
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
execSync("git config --global merge.ours.driver true");
|
|
16
|
+
console.log(" √ merge.ours.driver 配置成功");
|
|
17
|
+
return true;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error(" × merge.ours.driver 配置失败:", error.message);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function configureGitAliases() {
|
|
25
|
+
// 预留:后续可在此配置 git alias
|
|
26
|
+
console.log(" -> git aliases 配置完成");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = { configureGitAliases, configureMergeDriver };
|
|
@@ -521,20 +521,6 @@ function checkAndUpdateRootPackages(packagesDir, targetBranch = "master") {
|
|
|
521
521
|
stdio: "inherit"
|
|
522
522
|
});
|
|
523
523
|
|
|
524
|
-
// 只同步共享内容,保留当前分支配置和子模块集合
|
|
525
|
-
const mergeScriptPath = path.join(rootDir, "script", "sync-from-branch.sh");
|
|
526
|
-
if (fs.existsSync(mergeScriptPath)) {
|
|
527
|
-
execSync(`bash "${mergeScriptPath}" ${targetBranch}`, {
|
|
528
|
-
cwd: rootDir,
|
|
529
|
-
stdio: "inherit"
|
|
530
|
-
});
|
|
531
|
-
} else {
|
|
532
|
-
// 如果脚本不存在,使用基本的 merge 命令
|
|
533
|
-
execSync(`git merge origin/${targetBranch} --no-edit`, {
|
|
534
|
-
cwd: rootDir,
|
|
535
|
-
stdio: "inherit"
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
524
|
|
|
539
525
|
console.log(global.logColor.success, `✅ admin-monorepo[${currentBranch}]: 已合并 ${targetBranch} 的最新更改到 packages、docs 等目录`);
|
|
540
526
|
return [{ module: "admin-monorepo", success: true }];
|