@lingxiteam/ebe-utils 0.0.23 → 0.0.25

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/es/index.d.ts CHANGED
@@ -58,6 +58,7 @@ interface IncrementalConstruction {
58
58
  busiCompIds?: string[];
59
59
  globalStoreChange?: boolean;
60
60
  frontendHookChange?: boolean;
61
+ themeCssChange?: boolean;
61
62
  }
62
63
  export declare const setWorkerJsUrl: (url: string) => void;
63
64
  export declare const init: () => Promise<void>;
package/es/index.js CHANGED
@@ -311,7 +311,7 @@ export var fetchData = /*#__PURE__*/function () {
311
311
  // pageTypeMap[o.pageContainerType][o.pageId] = true;
312
312
  });
313
313
  if (isIncrementalConstruction) {
314
- _context3.next = 37;
314
+ _context3.next = 27;
315
315
  break;
316
316
  }
317
317
  _context3.next = 26;
@@ -322,8 +322,13 @@ export var fetchData = /*#__PURE__*/function () {
322
322
  });
323
323
  case 26:
324
324
  attrSpecPage = _context3.sent;
325
- _context3.prev = 27;
326
- _context3.next = 30;
325
+ case 27:
326
+ if (!(!isIncrementalConstruction || incrementalConstruction !== null && incrementalConstruction !== void 0 && incrementalConstruction.themeCssChange)) {
327
+ _context3.next = 38;
328
+ break;
329
+ }
330
+ _context3.prev = 28;
331
+ _context3.next = 31;
327
332
  return Promise.race([new Promise(function (resolve, reject) {
328
333
  services.getThemeCss({
329
334
  appId: appId,
@@ -336,26 +341,26 @@ export var fetchData = /*#__PURE__*/function () {
336
341
  resolve('');
337
342
  }, 5000);
338
343
  })]);
339
- case 30:
344
+ case 31:
340
345
  themeCss = _context3.sent;
341
346
  console.log('====获取主题成功');
342
- _context3.next = 37;
347
+ _context3.next = 38;
343
348
  break;
344
- case 34:
345
- _context3.prev = 34;
346
- _context3.t0 = _context3["catch"](27);
349
+ case 35:
350
+ _context3.prev = 35;
351
+ _context3.t0 = _context3["catch"](28);
347
352
  console.error('====获取主题失败', _context3.t0);
348
- case 37:
353
+ case 38:
349
354
  // 根据 appId 获取当前应用的使用的自定义组件
350
355
  onProgress({
351
356
  log: '获取当前应用的使用的自定义组件',
352
357
  progress: 3
353
358
  });
354
- _context3.next = 40;
359
+ _context3.next = 41;
355
360
  return services.qryPageCompAssetList({
356
361
  appId: appId
357
362
  });
358
- case 40:
363
+ case 41:
359
364
  temCompAssetList = _context3.sent;
360
365
  // 兼容下割接数据,数组前面的自定义组件是新的
361
366
  compAssetList = temCompAssetList.reduce(function (acc, current) {
@@ -368,7 +373,7 @@ export var fetchData = /*#__PURE__*/function () {
368
373
  return acc;
369
374
  }, []);
370
375
  if (!(!isIncrementalConstruction || incrementalConstruction !== null && incrementalConstruction !== void 0 && incrementalConstruction.globalStoreChange)) {
371
- _context3.next = 49;
376
+ _context3.next = 50;
372
377
  break;
373
378
  }
374
379
  // 根据appId 获取全局数据源
@@ -376,12 +381,12 @@ export var fetchData = /*#__PURE__*/function () {
376
381
  log: '获取全局数据源',
377
382
  progress: 4
378
383
  });
379
- _context3.next = 46;
384
+ _context3.next = 47;
380
385
  return services.queryFrontendDatasourcePage({
381
386
  appId: appId,
382
387
  pageSize: 10000
383
388
  });
384
- case 46:
389
+ case 47:
385
390
  globalDataInfo = _context3.sent;
386
391
  dataSourceList = ((_globalDataInfo = globalDataInfo) === null || _globalDataInfo === void 0 ? void 0 : _globalDataInfo.list) || [];
387
392
  dataSourceList.forEach(function (item) {
@@ -394,7 +399,7 @@ export var fetchData = /*#__PURE__*/function () {
394
399
  } catch (err) {}
395
400
  return null;
396
401
  });
397
- case 49:
402
+ case 50:
398
403
  pageIdMapping = {};
399
404
  lastPageId = ''; // 根据 pageId 获得 dsl
400
405
  data = [];
@@ -403,7 +408,7 @@ export var fetchData = /*#__PURE__*/function () {
403
408
  progress: 5
404
409
  });
405
410
  needFindDataPages = isIncrementalConstruction ? incrementalConstructionPageList : appPageList;
406
- _context3.next = 56;
411
+ _context3.next = 57;
407
412
  return Promise.all(needFindDataPages.map(function (i) {
408
413
  lastPageId = i.pageId;
409
414
  pageIdMapping[i.pagePath] = i.pageId;
@@ -412,11 +417,11 @@ export var fetchData = /*#__PURE__*/function () {
412
417
  pageId: i.pageId
413
418
  });
414
419
  }));
415
- case 56:
420
+ case 57:
416
421
  data = _context3.sent;
417
422
  pages = getPageDsls(data);
418
423
  if (isIncrementalConstruction) {
419
- _context3.next = 69;
424
+ _context3.next = 70;
420
425
  break;
421
426
  }
422
427
  onProgress({
@@ -425,7 +430,7 @@ export var fetchData = /*#__PURE__*/function () {
425
430
  });
426
431
 
427
432
  // 业务组件从被使用才生成改为全部生成
428
- _context3.next = 62;
433
+ _context3.next = 63;
429
434
  return services.qryBusiCompPage({
430
435
  appIds: [appId],
431
436
  appId: appId,
@@ -434,10 +439,10 @@ export var fetchData = /*#__PURE__*/function () {
434
439
  pageSize: 999999,
435
440
  terminalType: platform
436
441
  });
437
- case 62:
442
+ case 63:
438
443
  _yield$services$qryBu = _context3.sent;
439
444
  itemLists = _yield$services$qryBu.list;
440
- _context3.next = 66;
445
+ _context3.next = 67;
441
446
  return Promise.all(itemLists.map(function (i) {
442
447
  return services.findBusiCompById({
443
448
  busiCompId: i.busiCompId,
@@ -445,11 +450,11 @@ export var fetchData = /*#__PURE__*/function () {
445
450
  pageId: lastPageId
446
451
  });
447
452
  }));
448
- case 66:
453
+ case 67:
449
454
  busiData = _context3.sent;
450
- _context3.next = 76;
455
+ _context3.next = 77;
451
456
  break;
452
- case 69:
457
+ case 70:
453
458
  // busiCompId 过滤重复
454
459
  itemHash = {}; // 找到所有页面使用到的 业务组件
455
460
  findAllItem(pages, function (item) {
@@ -457,7 +462,7 @@ export var fetchData = /*#__PURE__*/function () {
457
462
  }, itemHash);
458
463
  _itemLists = Object.keys(itemHash); // 请求所有业务组件的 dsl
459
464
  alllBusiComp = ((_incrementalConstruct = incrementalConstruction === null || incrementalConstruction === void 0 ? void 0 : incrementalConstruction.busiCompIds) !== null && _incrementalConstruct !== void 0 ? _incrementalConstruct : []).concat(_itemLists);
460
- _context3.next = 75;
465
+ _context3.next = 76;
461
466
  return Promise.all(alllBusiComp.map(function (i) {
462
467
  return services.findBusiCompById({
463
468
  busiCompId: i,
@@ -465,9 +470,9 @@ export var fetchData = /*#__PURE__*/function () {
465
470
  pageId: lastPageId
466
471
  });
467
472
  }));
468
- case 75:
469
- busiData = _context3.sent;
470
473
  case 76:
474
+ busiData = _context3.sent;
475
+ case 77:
471
476
  // 过滤为空
472
477
  busiPages = busiData.filter(Boolean).map(function (i, index) {
473
478
  var _i$busiCompVersion;
@@ -540,14 +545,14 @@ export var fetchData = /*#__PURE__*/function () {
540
545
  });
541
546
  translateNames = {};
542
547
  if (!(chinese.length > 0)) {
543
- _context3.next = 84;
548
+ _context3.next = 85;
544
549
  break;
545
550
  }
546
- _context3.next = 83;
551
+ _context3.next = 84;
547
552
  return getTranslateName(appId, chinese, 'UPPER_CAMEL');
548
- case 83:
549
- translateNames = _context3.sent;
550
553
  case 84:
554
+ translateNames = _context3.sent;
555
+ case 85:
551
556
  // 翻译业务组件的名字
552
557
  for (key = 0; key < busiPages.length; key++) {
553
558
  onProgress({
@@ -559,7 +564,7 @@ export var fetchData = /*#__PURE__*/function () {
559
564
  }
560
565
  pagePathEnglishMapping = {};
561
566
  if (!needTranslatePagePathToEnglish) {
562
- _context3.next = 97;
567
+ _context3.next = 98;
563
568
  break;
564
569
  }
565
570
  pagePathEnglishSet = {};
@@ -581,14 +586,14 @@ export var fetchData = /*#__PURE__*/function () {
581
586
  });
582
587
  pagesTranslateNames = {};
583
588
  if (!(pagesChinese.length > 0)) {
584
- _context3.next = 95;
589
+ _context3.next = 96;
585
590
  break;
586
591
  }
587
- _context3.next = 94;
592
+ _context3.next = 95;
588
593
  return getTranslateName(appId, pagesChinese, 'UPPER_CAMEL');
589
- case 94:
590
- pagesTranslateNames = _context3.sent;
591
594
  case 95:
595
+ pagesTranslateNames = _context3.sent;
596
+ case 96:
592
597
  findPageKeyByPageId = function findPageKeyByPageId(id, arrs) {
593
598
  for (var _key = 0; _key < arrs.length; _key++) {
594
599
  var _arrs$_key;
@@ -614,7 +619,7 @@ export var fetchData = /*#__PURE__*/function () {
614
619
  pages[pageKey].pagePath = safeTranslateName;
615
620
  }
616
621
  }
617
- case 97:
622
+ case 98:
618
623
  // 合并页面,生成器那边支持页面类型和业务组件类型
619
624
  pageDSLS = [].concat(_toConsumableArray(pages), _toConsumableArray(busiPages));
620
625
  getPlatform = function getPlatform(platFormtype) {
@@ -657,11 +662,11 @@ export var fetchData = /*#__PURE__*/function () {
657
662
  options: options,
658
663
  cleanedTree: cleanedTree
659
664
  });
660
- case 104:
665
+ case 105:
661
666
  case "end":
662
667
  return _context3.stop();
663
668
  }
664
- }, _callee3, null, [[27, 34]]);
669
+ }, _callee3, null, [[28, 35]]);
665
670
  }));
666
671
  return function fetchData(_x) {
667
672
  return _ref5.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/ebe-utils",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -17,7 +17,7 @@
17
17
  "@babel/parser": "^7.12.12",
18
18
  "@babel/traverse": "^7.12.12",
19
19
  "@babel/types": "^7.12.12",
20
- "@lingxiteam/ebe": "0.0.23",
20
+ "@lingxiteam/ebe": "0.0.25",
21
21
  "cac": "^6.7.14",
22
22
  "fs-extra": "9.x"
23
23
  },