@cloudbase/lowcode-builder 1.10.3 → 1.10.5

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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateSystemPackageDependencies = exports.generateLibDependencies = exports.generatePackageDependencies = void 0;
4
4
  const cals_1 = require("@cloudbase/cals");
5
- const CLOUDBASE_VERSION = '2.8.34';
5
+ const CLOUDBASE_VERSION = '2.9.2';
6
6
  const BASE_DEPS = {
7
7
  'miniprogram-gesture': '^1.0.6',
8
8
  mobx: '^5',
@@ -13,7 +13,7 @@ const BASE_DEPS = {
13
13
  * 注意锁版本
14
14
  */
15
15
  const CLOUDBASE_DEPS = {
16
- '@cloudbase/weda-client': '1.1.21',
16
+ '@cloudbase/weda-client': '1.1.24',
17
17
  '@cloudbase/weda-cloud-sdk': '1.0.96',
18
18
  };
19
19
  const COMPONENT_DEPS = {
@@ -424,7 +424,7 @@ async function buildComposite({ dependencies, output, isBrowserMpBuilder, }) {
424
424
  };
425
425
  if (isBrowserMpBuilder) {
426
426
  // 尽早下载物料
427
- await (0, net_1.downloadBrowserMaterial)({ runtimeEndpointType: undefined });
427
+ await (0, net_1.downloadBrowserMaterial)({ runtimeEndpointType: undefined, node_modules: false });
428
428
  }
429
429
  await (0, index_1.generateWedaRootCommonFile)({
430
430
  buildContext,
@@ -470,6 +470,7 @@ async function buildComposite({ dependencies, output, isBrowserMpBuilder, }) {
470
470
  packageMiniprogramEntry,
471
471
  officialLibVersion: officialLib === null || officialLib === void 0 ? void 0 : officialLib.version,
472
472
  });
473
+ fs_extra_1.default.writeFile(path_1.default.join(output.path, 'index.js'), `import * as sdk from '@cloudbase/weda-client';\nexport * as clientSDK from '@cloudbase/weda-client';\n/* 注意取注,并填入环境ID */\n// sdk.init({\n// envID: '<填写你的云开发环境ID>'\n// })`);
473
474
  return output.path;
474
475
  // await generateCompLibs(dependencies, rpxCalcRoot);
475
476
  }
@@ -4,10 +4,11 @@ import { IBuildContext, IMpCommonBuildContext } from './BuildContext';
4
4
  import { BuildType } from '../types/common';
5
5
  import { IPlatformApp } from '@cloudbase/cals';
6
6
  import { IBuildWedaApp } from '../core';
7
- export declare function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId, filter, }: {
7
+ export declare function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId, envId, filter, }: {
8
8
  buildContext: IMpCommonBuildContext & Partial<Pick<IBuildContext, 'enableExpiredTag' | 'domain' | 'runtimeDynamicConfig'>>;
9
9
  buildTypeList: BuildType[];
10
10
  localWedaRoot: string;
11
+ envId?: string;
11
12
  appId?: string;
12
13
  loginConfigVersion?: string;
13
14
  cssVarMap?: Object;
@@ -66,7 +66,7 @@ function patchBuildContext(ctx, calses) {
66
66
  ctx.miniprogramPlugins = (mainAppData.miniprogramPlugins || []).filter((plugin) => used.component[plugin.name] || used.action[plugin.name]);
67
67
  return { used };
68
68
  }
69
- async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId, filter = () => true, }) {
69
+ async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId, envId, filter = () => true, }) {
70
70
  const expirationStartTimesnap = buildContext.enableExpiredTag ? Date.now() : 0;
71
71
  let customLoginConfig;
72
72
  let loginConfigPathname = loginConfigVersion
@@ -93,6 +93,7 @@ async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWe
93
93
  RUNTIME_CONFIG_URL: index_1.RUNTIME_CONFIG_URL,
94
94
  loginConfigPathname,
95
95
  customLoginConfig: customLoginConfig ? JSON.stringify(customLoginConfig, undefined, 2) : 'null',
96
+ ensureUserInfo: envId && ['lowcode-5gchkw9u14e4136a'].includes(envId),
96
97
  },
97
98
  'common/cloud-sdk.js': {},
98
99
  'common/weapp-page.js': {
@@ -205,6 +206,7 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
205
206
  buildTypeList,
206
207
  localWedaRoot,
207
208
  appId,
209
+ envId: mainAppData.envId,
208
210
  loginConfigVersion: (_f = (_e = calses[0]) === null || _e === void 0 ? void 0 : _e.extra) === null || _f === void 0 ? void 0 : _f.loginConfigVersion,
209
211
  cssVarMap,
210
212
  });
@@ -683,6 +685,7 @@ async function generateFramework(ctx, { cals, weapp: appData }, outDir, options)
683
685
  subPackageName: appData.rootPath || '',
684
686
  importor,
685
687
  appConfig: (0, util_3.JsonToStringWithVariableName)({
688
+ name: cals.name || ctx.appId,
686
689
  label: (appData === null || appData === void 0 ? void 0 : appData.label) || '',
687
690
  version: (_a = options === null || options === void 0 ? void 0 : options.deployOptions) === null || _a === void 0 ? void 0 : _a.version,
688
691
  loginConfigVersion: (_b = cals.extra) === null || _b === void 0 ? void 0 : _b.loginConfigVersion,
@@ -46,6 +46,7 @@ async function generateMpConfig(ctx, weapps, calses, options) {
46
46
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
47
  const appConfig = {
48
48
  useExtendedLib: { weui: true },
49
+ networkTimeout: { request: 2 * 60 * 1000 },
49
50
  };
50
51
  const { miniprogramPlugins = [] } = ctx;
51
52
  const projConfig = (0, lodash_1.merge)({}, mp_1.defaultProjConfig, {
@@ -289,7 +289,8 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
289
289
  }
290
290
  case `${weapps_core_1.ActionType.Platform}:ai.LLM.chat`:
291
291
  case `${weapps_core_1.ActionType.Platform}:ai.bot.sendMessage`:
292
- case `${weapps_core_1.ActionType.Platform}:ai.bot.getRecommendQuestions`: {
292
+ case `${weapps_core_1.ActionType.Platform}:ai.bot.getRecommendQuestions`:
293
+ case `${weapps_core_1.ActionType.Platform}:_setStateVal`: {
293
294
  handler = `function({data, $w}) { return $app.${(_c = l.handler) === null || _c === void 0 ? void 0 : _c.name}(data, $w);}`;
294
295
  break;
295
296
  }
@@ -313,7 +314,7 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
313
314
  break;
314
315
  }
315
316
  case weapps_core_1.ActionType.GeneralFunc: {
316
- handler = `function({event, $w, params}) { return (\n${((_h = (_g = (_f = l.handler) === null || _f === void 0 ? void 0 : _f.code) === null || _g === void 0 ? void 0 : _g.replace) === null || _h === void 0 ? void 0 : _h.call(_g, /;\s*$/, '')) || '()=>{}'}\n)({event}) }`;
317
+ handler = `function({event, $w, params}) { const $comp = $w.$comp; return (\n${((_h = (_g = (_f = l.handler) === null || _f === void 0 ? void 0 : _f.code) === null || _g === void 0 ? void 0 : _g.replace) === null || _h === void 0 ? void 0 : _h.call(_g, /;\s*$/, '')) || '()=>{}'}\n)({event}) }`;
317
318
  break;
318
319
  }
319
320
  }
@@ -24,9 +24,10 @@ export declare function downloadZipInBrowser(url: string, dstDir: string, noCach
24
24
  * miniprogram_npm待微信提供端能力
25
25
  * @param output
26
26
  */
27
- export declare function downloadBrowserMaterial({ runtimeEndpointType, browser, }: {
27
+ export declare function downloadBrowserMaterial({ runtimeEndpointType, browser, node_modules, }: {
28
28
  runtimeEndpointType: IBuildWedaApp['endpointType'];
29
29
  browser?: boolean;
30
+ node_modules?: boolean;
30
31
  }): Promise<void>;
31
32
  export declare function installBrowserDependencies({ type, path: outPath, runtimeEndpointType, }: {
32
33
  type: 'wedaRoot' | '$weda_system';
@@ -121,7 +121,7 @@ async function saveFiles(files, dstDir) {
121
121
  * miniprogram_npm待微信提供端能力
122
122
  * @param output
123
123
  */
124
- async function downloadBrowserMaterial({ runtimeEndpointType, browser = true, }) {
124
+ async function downloadBrowserMaterial({ runtimeEndpointType, browser = true, node_modules = true, }) {
125
125
  const BUILD_TEMPLATES = require('../mp/template.json');
126
126
  await Promise.all([
127
127
  new Promise((resolve, reject) => {
@@ -136,10 +136,14 @@ async function downloadBrowserMaterial({ runtimeEndpointType, browser = true, })
136
136
  reject(e);
137
137
  }
138
138
  }),
139
- runtimeEndpointType === 'tcb-api'
140
- ? downloadZip(config_1.cloudbaseMiniprogramURL, config_1.cloudbaseMiniprogramDir, browser)
141
- : downloadZip(config_1.miniprogramURL, config_1.miniprogramDir, browser),
142
- downloadZip(config_1.systemSubpackageMiniprogramURL, config_1.systemSubpackageMiniprogramDir, browser),
139
+ ...(node_modules
140
+ ? [
141
+ runtimeEndpointType === 'tcb-api'
142
+ ? downloadZip(config_1.cloudbaseMiniprogramURL, config_1.cloudbaseMiniprogramDir, browser)
143
+ : downloadZip(config_1.miniprogramURL, config_1.miniprogramDir, browser),
144
+ downloadZip(config_1.systemSubpackageMiniprogramURL, config_1.systemSubpackageMiniprogramDir, browser),
145
+ ]
146
+ : []),
143
147
  ]);
144
148
  }
145
149
  exports.downloadBrowserMaterial = downloadBrowserMaterial;