@cloudbase/lowcode-builder 1.9.7 → 1.9.8

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.
@@ -13,8 +13,8 @@ const BASE_DEPS = {
13
13
  * 注意锁版本
14
14
  */
15
15
  const CLOUDBASE_DEPS = {
16
- '@cloudbase/weda-client': '1.1.8',
17
- '@cloudbase/weda-cloud-sdk': '1.0.86',
16
+ '@cloudbase/weda-client': '1.1.11',
17
+ '@cloudbase/weda-cloud-sdk': '1.0.87',
18
18
  };
19
19
  const COMPONENT_DEPS = {
20
20
  '@cloudbase/lowcode-render': '^1.1.4',
@@ -112,7 +112,7 @@ async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWe
112
112
  }
113
113
  exports.generateWedaRootCommonFile = generateWedaRootCommonFile;
114
114
  async function generateWxMp({ buildContext: _buildContext, weapps, calses, deployOptions, options, buildTypeList, ignoreInstall = false, cdnEndpoints = {}, mpConfig = {}, }) {
115
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
115
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
116
116
  const operationLabel = em('Wexin MiniProgram Generated');
117
117
  console.time(operationLabel);
118
118
  console.log(`Generating ${em('Wexin MiniProgram')} to ${_buildContext.projDir}`);
@@ -243,6 +243,7 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
243
243
  ? JSON.stringify(buildContext.privatelinkConfig, undefined, 2)
244
244
  : undefined,
245
245
  defaultLoginType: buildContext.__defaultLoginType__,
246
+ pureAnonymousLogin: !!((_k = (_j = calses[0]) === null || _j === void 0 ? void 0 : _j.extra) === null || _k === void 0 ? void 0 : _k.pureAnonymousLogin),
246
247
  },
247
248
  'datasources/datasource-profiles.js.tpl': {
248
249
  datasourceProfiles: (0, util_3.JsonToStringWithVariableName)([], { EOL: false }),
@@ -311,8 +312,8 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
311
312
  projectConfigJson.setting = {
312
313
  ...projectConfigJson.setting,
313
314
  ...projConfig.setting,
314
- packNpmRelationList: ((_j = projConfig.setting) === null || _j === void 0 ? void 0 : _j.packNpmRelationList) || ((_k = projectConfigJson.setting) === null || _k === void 0 ? void 0 : _k.packNpmRelationList)
315
- ? (0, mp_config_1.mergePackNpmRelationList)(projConfig.setting.packNpmRelationList, (_l = projectConfigJson.setting) === null || _l === void 0 ? void 0 : _l.packNpmRelationList)
315
+ packNpmRelationList: ((_l = projConfig.setting) === null || _l === void 0 ? void 0 : _l.packNpmRelationList) || ((_m = projectConfigJson.setting) === null || _m === void 0 ? void 0 : _m.packNpmRelationList)
316
+ ? (0, mp_config_1.mergePackNpmRelationList)(projConfig.setting.packNpmRelationList, (_o = projectConfigJson.setting) === null || _o === void 0 ? void 0 : _o.packNpmRelationList)
316
317
  : undefined,
317
318
  };
318
319
  const wedaRoot = path_1.default.posix.join('./', projectConfigJson.miniprogramRoot || '/', projectConfigJson.wedaRoot || '');
@@ -332,7 +333,7 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
332
333
  }
333
334
  const appJsonPath = path_1.default.join(miniprogramRoot, 'app.json');
334
335
  const appJson = await fs.readJson(appJsonPath);
335
- appJson.subpackages = (0, mp_config_1.mergeSubPackages)(((_o = (_m = appJson.subpackages) === null || _m === void 0 ? void 0 : _m.filter) === null || _o === void 0 ? void 0 : _o.call(_m, (item) => item.name !== 'wd-sys-module' && item.name !== 'wd-sys-materials')) || [], appConfig.subpackages);
336
+ appJson.subpackages = (0, mp_config_1.mergeSubPackages)(((_q = (_p = appJson.subpackages) === null || _p === void 0 ? void 0 : _p.filter) === null || _q === void 0 ? void 0 : _q.call(_p, (item) => item.name !== 'wd-sys-module' && item.name !== 'wd-sys-materials')) || [], appConfig.subpackages);
336
337
  await (0, generateFiles_1.writeFile)(appJsonPath, JSON.stringify(appJson, undefined, 2));
337
338
  }
338
339
  else {
@@ -631,7 +632,7 @@ async function generatePkg(ctx, { cals, weapp }, appRoot, pageConfigs, cssVarMap
631
632
  }
632
633
  }
633
634
  async function generateFramework(ctx, { cals, weapp: appData }, outDir, options) {
634
- var _a, _b, _c;
635
+ var _a, _b, _c, _d, _e;
635
636
  let fileData = {};
636
637
  if (appData.mpPkgUrl) {
637
638
  /**
@@ -684,6 +685,7 @@ async function generateFramework(ctx, { cals, weapp: appData }, outDir, options)
684
685
  label: (appData === null || appData === void 0 ? void 0 : appData.label) || '',
685
686
  version: (_a = options === null || options === void 0 ? void 0 : options.deployOptions) === null || _a === void 0 ? void 0 : _a.version,
686
687
  loginConfigVersion: (_b = cals.extra) === null || _b === void 0 ? void 0 : _b.loginConfigVersion,
688
+ pureAnonymousLogin: !!((_d = (_c = cals.extra) === null || _c === void 0 ? void 0 : _c.access) === null || _d === void 0 ? void 0 : _d.pureAnonymousLogin),
687
689
  basename: ctx.wedaRoot,
688
690
  pages: appData.pageInstanceList
689
691
  .sort((item) => (item.isHome ? -1 : 1))
@@ -699,7 +701,7 @@ async function generateFramework(ctx, { cals, weapp: appData }, outDir, options)
699
701
  });
700
702
  }),
701
703
  }),
702
- appQuery: (0, util_2.createTemplateQuery)(ctx, (_c = appData.dataset) === null || _c === void 0 ? void 0 : _c.query),
704
+ appQuery: (0, util_2.createTemplateQuery)(ctx, (_e = appData.dataset) === null || _e === void 0 ? void 0 : _e.query),
703
705
  /**
704
706
  * @deprecated
705
707
  */
@@ -262,7 +262,7 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
262
262
  datasetProfile: (0, util_1.JsonToStringWithVariableName)((0, lowcode_generator_1.generateDynamicDataset)(compositedComp.dataset || {}), {
263
263
  EOL: true,
264
264
  }),
265
- query: (0, util_2.createTemplateQuery)(compositeCtx, (_a = compositedComp.dataset) === null || _a === void 0 ? void 0 : _a.query) || {},
265
+ query: (0, util_2.createTemplateQuery)(compositeCtx, (_a = compositedComp.dataset) === null || _a === void 0 ? void 0 : _a.query, true) || {},
266
266
  eventFlows: (0, util_2.createTemplateEventFlows)(compositeCtx, compositedComp.eventFlows) || [],
267
267
  nativeMode: mode === 'lib' ? 1 : 0,
268
268
  },
@@ -24,7 +24,7 @@ export declare function generateDataContainerListeners(): {
24
24
  }[];
25
25
  export declare function createTemplateQuery(ctx: IMpCommonBuildContext, query?: {
26
26
  [key: string]: IQueryData;
27
- }): {};
27
+ }, isComposite?: boolean): {};
28
28
  export declare function createTemplateEventFlows(ctx: IMpCommonBuildContext, eventFlows?: any[]): any[];
29
29
  export declare function generateArgsDynamicValueFromData(args?: {
30
30
  [prop: string]: IDynamicValue;
@@ -211,15 +211,17 @@ function generateDataContainerListeners() {
211
211
  ];
212
212
  }
213
213
  exports.generateDataContainerListeners = generateDataContainerListeners;
214
- function createTemplateQuery(ctx, query = {}) {
214
+ function createTemplateQuery(ctx, query = {}, isComposite = false) {
215
215
  return Object.entries(query).reduce((map, [key, item]) => {
216
- var _a, _b;
216
+ var _a, _b, _c, _d;
217
217
  const { listeners = [], handler, data, args, ...rest } = item;
218
218
  const { staticProps, boundProps } = generatedDynamicData(generateArgsDynamicValueFromData(args, data) || {}, undefined, false);
219
219
  map[key] = {
220
220
  ...rest,
221
221
  handler: item.type === cals_1.EQueryType.GeneralFunc
222
- ? `(__data__,__params__) => (\n${(_b = (_a = handler['code']) === null || _a === void 0 ? void 0 : _a.replace) === null || _b === void 0 ? void 0 : _b.call(_a, /;\s*$/, '')}\n)({params:__params__,data:__data__})`
222
+ ? isComposite
223
+ ? `(__data__,__params__,$comp,$w) => (\n${(_b = (_a = handler['code']) === null || _a === void 0 ? void 0 : _a.replace) === null || _b === void 0 ? void 0 : _b.call(_a, /;\s*$/, '')}\n)({params:__params__,data:__data__,$comp,$w})`
224
+ : `(__data__,__params__) => (\n${(_d = (_c = handler['code']) === null || _c === void 0 ? void 0 : _c.replace) === null || _d === void 0 ? void 0 : _d.call(_c, /;\s*$/, '')}\n)({params:__params__,data:__data__})`
223
225
  : `(...args) => $app.${handler === null || handler === void 0 ? void 0 : handler.name}(...args)`,
224
226
  data: staticProps,
225
227
  dataBinds: boundProps,