@cloudbase/lowcode-builder 1.8.110 → 1.9.0

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.
@@ -12,23 +12,24 @@ const BASE_DEPS = {
12
12
  * 注意锁版本
13
13
  */
14
14
  const CLOUDBASE_DEPS = {
15
- '@cloudbase/oauth': '0.1.1-alpha.11',
16
- '@cloudbase/weda-client': '1.1.4',
17
- '@cloudbase/weda-cloud-sdk': '1.0.64',
15
+ '@cloudbase/oauth': '0.1.1-alpha.14',
16
+ '@cloudbase/weda-client': '1.1.5',
17
+ '@cloudbase/weda-cloud-sdk': '1.0.68',
18
18
  };
19
19
  function generatePackageDependencies({ importJSSDK, mode, officialLibVersion, uin, }) {
20
20
  const deps = {};
21
21
  if (importJSSDK) {
22
- deps['@cloudbase/js-sdk'] = '2.5.45-beta.0';
22
+ deps['@cloudbase/js-sdk'] = '2.5.46-beta.0';
23
23
  }
24
24
  const mod = uin ? Number(uin) % 10 : undefined;
25
25
  if (mode === 'lib') {
26
26
  // eslint-disable-next-line no-restricted-syntax
27
27
  for (const key in CLOUDBASE_DEPS) {
28
+ const version = CLOUDBASE_DEPS[key];
28
29
  /**
29
30
  * lib 模式下采用松散的引用
30
31
  */
31
- deps[key] = /^\d/.test(CLOUDBASE_DEPS[key]) ? CLOUDBASE_DEPS[key] : `^${CLOUDBASE_DEPS[key]}`;
32
+ deps[key] = /^\d/.test(version) ? `^${version}` : version;
32
33
  }
33
34
  if (officialLibVersion) {
34
35
  deps[cals_1.OFFICIAL_LIB_MP_NPM_PACKAGENAME] = officialLibVersion;
@@ -36,10 +37,7 @@ function generatePackageDependencies({ importJSSDK, mode, officialLibVersion, ui
36
37
  }
37
38
  else {
38
39
  for (const key in CLOUDBASE_DEPS) {
39
- deps[key] =
40
- mode !== undefined && !isNaN(mod) && mod <= 1 && key === '@cloudbase/weda-cloud-sdk'
41
- ? '1.0.65'
42
- : CLOUDBASE_DEPS[key];
40
+ deps[key] = CLOUDBASE_DEPS[key];
43
41
  }
44
42
  }
45
43
  return {
@@ -476,14 +476,15 @@ async function patchMpComponentNPM({ packageDir, name, version, packageMiniprogr
476
476
  }
477
477
  packageJSON = {
478
478
  ...packageJSON,
479
- name: `@tcwd/weda-component-${name || 'lib'}`,
479
+ name: `@cloudbase-module/${name || 'components'}`,
480
480
  version: version || packageJSON.version || '0.0.1',
481
481
  miniprogram: `./${packageMiniprogramEntry}`,
482
+ keywords: ['微搭', '小程序', '区块组件', 'cloudbase', 'cloudbase-module', 'cloudbase-component'],
482
483
  scripts: {
483
484
  ...packageJSON.scripts,
484
485
  postinstall: 'node scripts/fixCloudSdk.js',
485
486
  },
486
- peerDependencies: {
487
+ dependencies: {
487
488
  ...packageJSON.peerDependencies,
488
489
  ...BASE_DEPS,
489
490
  },
@@ -301,7 +301,7 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
301
301
  // path: 'index',
302
302
  // });
303
303
  // }
304
- codes.map((mod) => {
304
+ await Promise.all(codes.map((mod) => {
305
305
  let themeCode;
306
306
  if (mod.type === cals_1.ECodeType.STYLE && compLibCommonResource) {
307
307
  themeCode = `
@@ -317,7 +317,7 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
317
317
  return;
318
318
  }
319
319
  return (0, lowcode_1.writeCode2file)(compositeCtx, mod, path.join(componentDir, LOWCODE_DIR_NAME), { comp: compositedComp }, themeCode, mode === 'lib' ? true : false);
320
- });
320
+ }));
321
321
  // await writeLowCodeFiles(weapp, appRoot)
322
322
  // await generateFramework(weapp, appRoot)
323
323
  }
@@ -557,13 +557,13 @@ function generateScopedStyleText(widgets, weightPrefix = '#wd-page-root') {
557
557
  // 移除换行及其前后的空白符
558
558
  .replace(/\s*\n\s*/g, '')
559
559
  // 添加 `#wd-page-root` 前缀以增加样式权重
560
- .replace(/(:scope.*?{)/g, `\n${weightPrefix} $1`)
560
+ .replace(/(:scope.*?[,{])/g, `\n${weightPrefix} $1`)
561
561
  // 替换 `:scope`
562
562
  .replace(/:scope/g, `.wd-comp-id-${id}`)
563
563
  // `: ` => `:`
564
- .replace(/\s*:\s*/g, ':')
564
+ // `, ` => `,`
565
565
  // ` {` => `{`
566
- .replace(/\s*{\s*/g, '{')
566
+ .replace(/\s*([:,{])\s*/g, '$1')
567
567
  // `;}` => `}`
568
568
  .replace(/;\s*}/g, '}');
569
569
  cssTextList.push(cssText.trim());