@cloudbase/lowcode-builder 1.4.2 → 1.4.4

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.
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -20,6 +43,7 @@ const mp_1 = require("../mp");
20
43
  const common_2 = require("../../utils/common");
21
44
  const config_1 = require("../config");
22
45
  const fs_extra_1 = __importDefault(require("fs-extra"));
46
+ const junk = __importStar(require("../util/junk"));
23
47
  async function buildH5App({ buildContext, i18nConfig, extraData, cals, buildTypeList = [common_1.BuildType.WEB], subAppCalsList, mode, devTool, runtime = types_1.RUNTIME.NONE, deployMode = types_1.DEPLOY_MODE.PREVIEW, ignoreInstall = false, cdnEndpoints, }) {
24
48
  var _a, _b, _c;
25
49
  const { projDir: buildDir, domain, materialLibs: dependencies, appId: appKey, isPrivateMode } = buildContext;
@@ -136,10 +160,23 @@ async function buildH5App({ buildContext, i18nConfig, extraData, cals, buildType
136
160
  }
137
161
  });
138
162
  });
163
+ const MAINIFAST_FILENAME = 'weda-manifest.json';
164
+ const preHeatUrls = fs_extra_1.default
165
+ .readdirSync(path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR))
166
+ .filter((file) => junk.not(file) && file !== MAINIFAST_FILENAME)
167
+ .map((file) => {
168
+ return path_1.default.posix.join(basename, file);
169
+ });
139
170
  // 普通 web 模式,且非hash模式,根据页面生成多份入口
140
171
  if (!((_c = cals.extra) === null || _c === void 0 ? void 0 : _c.historyType) || cals.extra.historyType === types_1.HISTORY_TYPE.BROWSER) {
141
- await Promise.all((cals.items || []).map((page) => fs_extra_1.default.copy(path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, 'index.html'), path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, page.id, 'index.html'))));
172
+ preHeatUrls.push(path_1.default.posix.join(basename));
173
+ await Promise.all((cals.items || []).map((page) => {
174
+ preHeatUrls.push(path_1.default.posix.join(basename, page.id));
175
+ preHeatUrls.push(path_1.default.posix.join(basename, page.id, '/'));
176
+ return fs_extra_1.default.copy(path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, 'index.html'), path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, page.id, 'index.html'));
177
+ }));
142
178
  }
179
+ await fs_extra_1.default.writeFile(path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, 'weda-manifest.json'), JSON.stringify({ preHeatUrls }, undefined, 2));
143
180
  return h5BuildDir;
144
181
  }
145
182
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
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,7 +38,7 @@
38
38
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@cloudbase/cals": "^0.5.12",
41
+ "@cloudbase/cals": "^0.5.14",
42
42
  "@cloudbase/lowcode-generator": "^1.4.0",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
@@ -453,7 +453,7 @@
453
453
  crossorigin="anonymous"
454
454
  src="<%=
455
455
  cdnEndpoints.cdngo
456
- %>/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.19/dist/h5.browser.js"
456
+ %>/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.27-alpha.0/dist/h5.browser.js"
457
457
  ></script>
458
458
  <script>
459
459
  // zxing polifill
@@ -475,7 +475,7 @@
475
475
  crossorigin
476
476
  src="<%=
477
477
  cdnEndpoints.cdngo
478
- %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.efbaa5f34f9a013bf4b1.bundle.js"
478
+ %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.39b933e356640041bb42.bundle.js"
479
479
  ></script>
480
480
  </body>
481
481
  </html>
@@ -790,12 +790,13 @@ class UserWidget {
790
790
  }
791
791
 
792
792
  get custom() {
793
- const instance = this._widget._getInstanceRef?.()?.current || {};
793
+ const widget = this._widget;
794
+ const instance = widget._getInstanceRef?.()?.current || {};
794
795
  const userCustomMember = untracked(() => {
795
796
  const { methods = {}, ...restInstance } = instance;
796
797
  return new Proxy(
797
798
  {
798
- ...this._widget._methods,
799
+ ...widget._methods,
799
800
  ...restInstance,
800
801
  ...methods,
801
802
  },
@@ -807,7 +808,7 @@ class UserWidget {
807
808
  if (prop !== 'methods' && prop in instance) {
808
809
  return instance[prop];
809
810
  }
810
- return this._widget._methods?.[prop];
811
+ return widget?._methods?.[prop];
811
812
  },
812
813
  },
813
814
  );