@cloudbase/lowcode-builder 1.5.0 → 1.5.2

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.
@@ -6,8 +6,9 @@ import { BuildType } from '../types/common';
6
6
  * 该函数从 @govcloud/generate 取到需要的模版文件
7
7
  */
8
8
  export declare function generateProjectFiles(buildData: BuildAppProps): Promise<void>;
9
- export declare function generateHTML({ appId, appBuildDir, externalResources, mode, devTool, isBuildApp, buildTypeList, cdnEndpoints, }: {
9
+ export declare function generateHTML({ appId, envId, appBuildDir, externalResources, mode, devTool, isBuildApp, buildTypeList, cdnEndpoints, }: {
10
10
  appId: string;
11
+ envId: string;
11
12
  externalResources: Required<IPlatformApp>['externalResources'];
12
13
  appBuildDir: string;
13
14
  mode: string;
@@ -25,7 +25,7 @@ async function generateProjectFiles(buildData) {
25
25
  }));
26
26
  }
27
27
  exports.generateProjectFiles = generateProjectFiles;
28
- async function generateHTML({ appId, appBuildDir, externalResources = [], mode, devTool, isBuildApp, buildTypeList, cdnEndpoints, }) {
28
+ async function generateHTML({ appId, envId, appBuildDir, externalResources = [], mode, devTool, isBuildApp, buildTypeList, cdnEndpoints, }) {
29
29
  const templatePath = path_1.default.join(config_1.appTemplateDir, 'html', 'index.html.ejs');
30
30
  const dstFilePath = path_1.default.join(appBuildDir, 'index.html');
31
31
  const packageTpl = await fs_extra_1.default.readFile(templatePath, { encoding: 'utf8' });
@@ -54,6 +54,12 @@ async function generateHTML({ appId, appBuildDir, externalResources = [], mode,
54
54
  isBuildApp,
55
55
  isAdminPortal: (0, common_2.buildAsAdminPortalByBuildType)(buildTypeList),
56
56
  cdnEndpoints: (0, config_1.generateCdnEndpoints)(cdnEndpoints),
57
+ /**
58
+ * @deprecated
59
+ * 临时先这么添加白名单
60
+ */
61
+ enableStaticLoading: ['lowcode-4gzdsu5k66946492', 'lowcode-2gay8jgh25c7b1cf', 'lowcode-4g9b78bx94404d85'].includes(envId) &&
62
+ !(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList),
57
63
  }));
58
64
  }
59
65
  exports.generateHTML = generateHTML;
@@ -28,6 +28,7 @@ async function runWebpackCore({ cals, mainAppData, subAppDataList, appBuildDir,
28
28
  console.timeEnd('generateMpJsonConfigFile');
29
29
  await (0, generate_1.generateHTML)({
30
30
  appId: mainAppData.id || appKey,
31
+ envId: mainAppData.envId || '',
31
32
  appBuildDir,
32
33
  externalResources: (cals.externalResources || []).concat(assets.map((url) => ({
33
34
  type: cals_1.EExternalResourceType.CSSUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
5
5
  "author": "yhsunshining@gmail.com",
6
6
  "homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
@@ -38,8 +38,8 @@
38
38
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@cloudbase/cals": "^0.5.16",
42
- "@cloudbase/lowcode-generator": "^1.5.1",
41
+ "@cloudbase/cals": "^0.5.17",
42
+ "@cloudbase/lowcode-generator": "^1.5.2",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
45
45
  "browserify-zlib": "^0.2.0",
@@ -386,7 +386,75 @@
386
386
  </head>
387
387
 
388
388
  <body data-weui-theme="light">
389
- <div id="root" class="main-wrap"></div>
389
+ <div id="root" class="main-wrap">
390
+ <% if(enableStaticLoading){ %>
391
+ <style type="text/css">
392
+ .weda-loading-container {
393
+ position: fixed;
394
+ left: 0;
395
+ top: 0;
396
+ width: 100%;
397
+ display: flex;
398
+ justify-content: center;
399
+ align-items: center;
400
+ flex-direction: column;
401
+ height: 100%;
402
+ padding: 0 20px;
403
+ }
404
+ .weda-loading-container .logo {
405
+ width: 100%;
406
+ display: flex;
407
+ justify-content: center;
408
+ text-align: center;
409
+ margin-bottom: 50px;
410
+ }
411
+
412
+ .weda-loading-container .sp {
413
+ width: 48px;
414
+ height: 48px;
415
+ }
416
+
417
+ .weda-loading-container .sp-circle {
418
+ border: 6px rgba(0, 82, 217, 0.25) solid;
419
+ border-top: 6px rgba(0, 82, 217, 1) solid;
420
+ border-radius: 50%;
421
+ -webkit-animation: spCircRot 0.6s infinite linear;
422
+ animation: spCircRot 0.6s infinite linear;
423
+ }
424
+ @-webkit-keyframes spCircRot {
425
+ from {
426
+ -webkit-transform: rotate(0deg);
427
+ }
428
+ to {
429
+ -webkit-transform: rotate(359deg);
430
+ }
431
+ }
432
+ @keyframes spCircRot {
433
+ from {
434
+ transform: rotate(0deg);
435
+ }
436
+ to {
437
+ transform: rotate(359deg);
438
+ }
439
+ }
440
+ </style>
441
+ <div class="weda-loading-container">
442
+ <div class="logo">
443
+ <div class="sp sp-circle"></div>
444
+ </div>
445
+ <div class="text">初始化中...</div>
446
+ <script>
447
+ const ua = navigator.userAgent.toLowerCase();
448
+ if (ua.indexOf('wxwork') !== -1 && /[?&]code=/.test(location.search) && /[?&]state=/.test(location.search)) {
449
+ var el = document.querySelector('#root .weda-loading-container>.text');
450
+ if (el) {
451
+ el.innerHTML = '数据加载中...';
452
+ }
453
+ }
454
+ </script>
455
+ </div>
456
+ <% }%>
457
+ </div>
390
458
  <% jsApis.forEach(function(jsApi){%>
391
459
  <script src="<%=jsApi %>"></script>
392
460
  <% })%> <% if(canUseVite){ %>
@@ -475,7 +543,7 @@
475
543
  crossorigin
476
544
  src="<%=
477
545
  cdnEndpoints.cdngo
478
- %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.174df5037414faa855d5.bundle.js"
546
+ %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.8f8bf133d289ddd1a8f4.bundle.js"
479
547
  ></script>
480
548
  </body>
481
549
  </html>
@@ -5,7 +5,7 @@
5
5
  "dependencies": {<% if(importJSSDK) {%>
6
6
  "@cloudbase/js-sdk": "2.5.6-beta.1",<% } %>
7
7
  "@cloudbase/oauth": "0.1.1-alpha.5",
8
- "@cloudbase/weda-client": "0.2.47",
8
+ "@cloudbase/weda-client": "0.2.51",
9
9
  "@cloudbase/weda-cloud-sdk": "1.0.26",
10
10
  "mobx": "^5.15.4",
11
11
  "lodash.get": "^4.4.2",