@cloudbase/lowcode-builder 1.0.21 → 1.0.22

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,4 @@
1
- export { REPLACE_SIGN, MP_CONFIG_MODULE_NAME, KBONE_PAGE_KEYS, npmRegistry, remConfig, rpxConfig, } from '@cloudbase/lowcode-generator/lib/generator/config/index';
1
+ export { REPLACE_SIGN, MP_CONFIG_MODULE_NAME, KBONE_PAGE_KEYS, npmRegistry, remConfig, rpxConfig, OFFICIAL_LIB_KEY, } from '@cloudbase/lowcode-generator/lib/generator/config/index';
2
2
  export declare const sharedMaterialsDir: string;
3
3
  export declare const appTemplateDir: string;
4
4
  export declare const materialsDirName = "materials";
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.miniprogramDir = exports.miniprogramURL = exports.builderTemplateURL = exports.materialsDirName = exports.appTemplateDir = exports.sharedMaterialsDir = exports.rpxConfig = exports.remConfig = exports.npmRegistry = exports.KBONE_PAGE_KEYS = exports.MP_CONFIG_MODULE_NAME = exports.REPLACE_SIGN = void 0;
29
+ exports.miniprogramDir = exports.miniprogramURL = exports.builderTemplateURL = exports.materialsDirName = exports.appTemplateDir = exports.sharedMaterialsDir = exports.OFFICIAL_LIB_KEY = exports.rpxConfig = exports.remConfig = exports.npmRegistry = exports.KBONE_PAGE_KEYS = exports.MP_CONFIG_MODULE_NAME = exports.REPLACE_SIGN = void 0;
30
30
  const path = __importStar(require("path"));
31
31
  const os_1 = __importDefault(require("os"));
32
32
  var index_1 = require("@cloudbase/lowcode-generator/lib/generator/config/index");
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "KBONE_PAGE_KEYS", { enumerable: true, get: funct
36
36
  Object.defineProperty(exports, "npmRegistry", { enumerable: true, get: function () { return index_1.npmRegistry; } });
37
37
  Object.defineProperty(exports, "remConfig", { enumerable: true, get: function () { return index_1.remConfig; } });
38
38
  Object.defineProperty(exports, "rpxConfig", { enumerable: true, get: function () { return index_1.rpxConfig; } });
39
+ Object.defineProperty(exports, "OFFICIAL_LIB_KEY", { enumerable: true, get: function () { return index_1.OFFICIAL_LIB_KEY; } });
39
40
  exports.sharedMaterialsDir = path.join(os_1.default.homedir(), '.weapps-materials');
40
41
  exports.appTemplateDir = path.resolve(__dirname, '../../../template');
41
42
  exports.materialsDirName = 'materials'; // materials diretory of current project
@@ -18,6 +18,7 @@ const util_1 = require("../util");
18
18
  const types_1 = require("../../types");
19
19
  const mp_1 = require("../mp");
20
20
  const common_2 = require("../../utils/common");
21
+ const config_1 = require("../config");
21
22
  async function buildH5App({ appKey, buildDir, dependencies, i18nConfig, extraData, cals, buildTypeList = [common_1.BuildType.WEB], subAppCalsList, mode, devTool, runtime = types_1.RUNTIME.NONE, deployMode = types_1.DEPLOY_MODE.PREVIEW, ignoreInstall = false, domain = '', }) {
22
23
  var _a, _b;
23
24
  try {
@@ -64,7 +65,8 @@ async function buildH5App({ appKey, buildDir, dependencies, i18nConfig, extraDat
64
65
  console.time(runHandleMaterialTag);
65
66
  // 精简只使用用到的组件库,并获取补齐json格式
66
67
  const processedDependiencies = await (0, material_1.runHandleMaterial)(h5BuildDir, dependencies.filter((lib) => {
67
- return !!allAppUsedComps[lib.name];
68
+ // 注意需要包涵官方的(gsd),部分平台方法需要由其补充
69
+ return lib.name === config_1.OFFICIAL_LIB_KEY || !!allAppUsedComps[lib.name];
68
70
  }), materialsDir, runtime, ignoreInstall);
69
71
  console.timeEnd(runHandleMaterialTag);
70
72
  // // 获取 generate 需要的构建文件
@@ -11,6 +11,7 @@ const style_1 = require("@cloudbase/lowcode-generator/lib/generator/util/style")
11
11
  const generateFiles_1 = require("./generateFiles");
12
12
  const cals_1 = require("@cloudbase/cals");
13
13
  const compare_versions_1 = __importDefault(require("compare-versions"));
14
+ const config_1 = require("../config");
14
15
  const os_1 = __importDefault(require("os"));
15
16
  var common_1 = require("@cloudbase/lowcode-generator/lib/generator/util/common");
16
17
  Object.defineProperty(exports, "getMetaInfoBySourceKey", { enumerable: true, get: function () { return common_1.getMetaInfoBySourceKey; } });
@@ -200,7 +201,6 @@ function readComponentLibMata(libDir) {
200
201
  if (!isExistsMeta) {
201
202
  return null;
202
203
  }
203
- console.log('meta path', metaPath);
204
204
  let meta = fs_extra_1.default.readJSONSync(metaPath);
205
205
  let [major] = ((_a = meta === null || meta === void 0 ? void 0 : meta.schemaVersion) === null || _a === void 0 ? void 0 : _a.split('.')) || [];
206
206
  const originComponentMetaMap = meta.components;
@@ -218,7 +218,7 @@ function readComponentLibMata(libDir) {
218
218
  }
219
219
  exports.readComponentLibMata = readComponentLibMata;
220
220
  const _OFFICIAL_COMPONENT_LIB = {
221
- 'gsd-h5-react': ['*'],
221
+ [config_1.OFFICIAL_LIB_KEY]: ['*'],
222
222
  CLOUDBASE_BUSSINESS: ['1627377179261'],
223
223
  };
224
224
  function isOfficialComponentLib(name, version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
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",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@cloudbase/cals": "^0.4.2",
42
- "@cloudbase/lowcode-generator": "^1.0.7",
42
+ "@cloudbase/lowcode-generator": "^1.0.8",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
45
45
  "browserify-zlib": "^0.2.0",