@cloudbase/lowcode-builder 1.0.25 → 1.0.28

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,6 +12,7 @@ const common_1 = require("../types/common");
12
12
  const index_1 = require("../mp/index");
13
13
  const types_1 = require("../../types");
14
14
  const mixMode_1 = require("../mp/mixMode");
15
+ const index_2 = require("../h5/index");
15
16
  const common_2 = require("../../utils/common");
16
17
  const postProcess_1 = require("../../utils/postProcess");
17
18
  const net_1 = require("../util/net");
@@ -93,26 +94,26 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
93
94
  return outDir;
94
95
  }
95
96
  else {
96
- // const h5BuildDir = await buildH5App({
97
- // appKey,
98
- // buildDir: appBuildDir,
99
- // dependencies,
100
- // cals,
101
- // subAppCalsList,
102
- // extraData,
103
- // buildTypeList,
104
- // mode,
105
- // devTool,
106
- // runtime,
107
- // deployMode,
108
- // ignoreInstall,
109
- // domain,
110
- // });
111
- // cb?.(null, {
112
- // outDir: h5BuildDir,
113
- // timeElapsed: Date.now() - startTime,
114
- // });
115
- // return h5BuildDir;
97
+ const h5BuildDir = await (0, index_2.buildH5App)({
98
+ appKey,
99
+ buildDir: appBuildDir,
100
+ dependencies,
101
+ cals,
102
+ subAppCalsList,
103
+ extraData,
104
+ buildTypeList,
105
+ mode,
106
+ devTool,
107
+ runtime,
108
+ deployMode,
109
+ ignoreInstall,
110
+ domain,
111
+ });
112
+ cb === null || cb === void 0 ? void 0 : cb(null, {
113
+ outDir: h5BuildDir,
114
+ timeElapsed: Date.now() - startTime,
115
+ });
116
+ return h5BuildDir;
116
117
  }
117
118
  }
118
119
  catch (e) {
@@ -162,7 +162,7 @@ async function generateWxMp({ weapps, projDir, appId, domain, materials, plugins
162
162
  styles = styles.concat((lib.styles || []).map((stylePath) => stylePath && !stylePath.startsWith('/') ? `/${config_1.materialsDirName}/${lib.name}/${stylePath}` : stylePath) || []);
163
163
  return styles;
164
164
  }, [])
165
- .concat(importor.styles.map((mod) => path_1.default.join('lowcode', (0, weapps_core_1.getCodeModuleFilePath)('global', mod, { style: '.wxss' })))),
165
+ .concat(importor.styles.map((mod) => path_1.default.posix.join('lowcode', (0, weapps_core_1.getCodeModuleFilePath)('global', mod, { style: '.wxss' })))),
166
166
  },
167
167
  'package.json': {
168
168
  appId,
@@ -322,7 +322,7 @@ async function generatePkg(weapp, appRoot, ctx, pageConfigs) {
322
322
  },
323
323
  debug: ctx.debugMode,
324
324
  stringifyObj: util_1.inspect,
325
- subLevelPath: rootPath ? `${path_1.default.relative(rootPath, '')}/` : '',
325
+ subLevelPath: rootPath ? `${path_1.default.posix.relative(rootPath, '')}/` : '',
326
326
  importor,
327
327
  },
328
328
  [`index.json|${pageFileName}.json`]: {
@@ -336,7 +336,7 @@ async function generatePkg(weapp, appRoot, ctx, pageConfigs) {
336
336
  },
337
337
  [`index.wxss|${pageFileName}.wxss`]: {
338
338
  subWxss: rootPath && !((_b = ctx.mainAppData) === null || _b === void 0 ? void 0 : _b.mpPkgUrl)
339
- ? `@import "${path_1.default.relative(`/${rootPath}/pages/${page.id}`, '/lowcode')}/style.wxss";`
339
+ ? `@import "${path_1.default.posix.relative(`/${rootPath}/pages/${page.id}`, '/lowcode')}/style.wxss";`
340
340
  : '',
341
341
  content: (0, weapps_core_1.toCssText)((0, cals_1.processCommonStyle2CSSProperties)(page.commonStyle, {
342
342
  toRem: false,
@@ -391,7 +391,7 @@ async function generateFramework(appData, outDir, ctx) {
391
391
  'app/weapps-api.js': {
392
392
  appId: ctx.appId,
393
393
  domain: ctx.domain || '',
394
- subLevelPath: appData.rootPath ? `${path_1.default.relative(`${appData.rootPath}`, '')}/` : '',
394
+ subLevelPath: appData.rootPath ? `${path_1.default.posix.relative(`${appData.rootPath}`, '')}/` : '',
395
395
  subPackageName: appData.rootPath || '',
396
396
  importor,
397
397
  appConfig: (0, util_3.JsonToStringWithVariableName)({
@@ -30,7 +30,7 @@ async function writeCode2file(mod, lowcodeRootDir, opts = {}, themeCode, ctx) {
30
30
  }
31
31
  else {
32
32
  // Generate component lowcode
33
- code = `import process from '${mod.type === 'handler-fn' ? '../' : ''}../../../../common/process'\nimport app from '${mod.type === 'handler-fn' ? '../' : ''}../../../../common/weapp-sdk';\nconst $app = new Proxy({}, { get: function(obj, prop){ return app[prop] }});\n${code.replace(/\$comp/g, weapps_core_1.COMPONENT_API_PREFIX)}`;
33
+ code = `import process from '${mod.type === 'handler-fn' ? '../' : ''}../../../../common/process'\nimport { app } from '${mod.type === 'handler-fn' ? '../' : ''}../../../../app/weapps-api';\nconst $app = new Proxy({}, { get: function(obj, prop){ return app[prop] }});\n${code.replace(/\$comp/g, weapps_core_1.COMPONENT_API_PREFIX)}`;
34
34
  }
35
35
  }
36
36
  else {
@@ -287,6 +287,7 @@ function getWebpackWebBuildParams(appId, appBuildDir, publicPath = '/', mode = c
287
287
  mobx: 'window.mobx',
288
288
  '@cloudbase/js-sdk': 'window.cloudbase',
289
289
  '@cloudbase/weda-cloud-sdk/dist/h5': 'window.CloudSDK',
290
+ '@cloudbase/weda-cloud-sdk': 'window.CloudSDK',
290
291
  '@zxing/library': 'window.ZXing',
291
292
  '@cloudbase/lowcode-render': 'window["weda-render"]',
292
293
  },