@cloudbase/lowcode-builder 1.0.15 → 1.0.18

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.
@@ -20,7 +20,7 @@ async function writeCode2file(mod, lowcodeRootDir, opts = {}, themeCode, ctx) {
20
20
  const relativeRoot = (ctx === null || ctx === void 0 ? void 0 : ctx.isMixMode) && ctx.rootPath ? path_1.default.relative(ctx.rootPath, '') + '/' : '';
21
21
  let weappsApiPrefix = [
22
22
  `import { app, process } from '${relativeRoot}${baseDir}/app/weapps-api';`,
23
- 'const $app = app;',
23
+ 'const $app = new Proxy({}, { get: function(obj, prop){ return app[prop] }})',
24
24
  ]; // windows compatibility
25
25
  if (pageId !== 'global') {
26
26
  weappsApiPrefix.push(`import { $page } from '${baseDir}/pages/${pageId}/api'`);
@@ -29,7 +29,7 @@ async function writeCode2file(mod, lowcodeRootDir, opts = {}, themeCode, ctx) {
29
29
  }
30
30
  else {
31
31
  // Generate component lowcode
32
- code = `import process from '${mod.type === 'handler-fn' ? '../' : ''}../../../../common/process'\nimport app from '${mod.type === 'handler-fn' ? '../' : ''}../../../../common/weapp-sdk';\nconst $app = app;\n${code.replace(/\$comp/g, weapps_core_1.COMPONENT_API_PREFIX)}`;
32
+ 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
33
  }
34
34
  }
35
35
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.0.15",
3
+ "version": "1.0.18",
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",
@@ -38,8 +38,8 @@
38
38
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@cloudbase/cals": "^0.3.37",
42
- "@cloudbase/lowcode-generator": "^1.0.4",
41
+ "@cloudbase/cals": "^0.4.0",
42
+ "@cloudbase/lowcode-generator": "^1.0.5",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
45
45
  "browserify-zlib": "^0.2.0",
@@ -15,7 +15,7 @@ console.warn = (...args) => {
15
15
  }
16
16
  }
17
17
 
18
- const $app = app;
18
+ const $app = new Proxy({}, { get: function(obj, prop){ return app[prop] }});
19
19
  // 设置数据源请求的 loading 及 toast 处理
20
20
  setConfig({
21
21
  beforeDSRequest: (cfg) => {
@@ -385,6 +385,7 @@ function getEnumOptions(optionName) {
385
385
  return '';
386
386
  }
387
387
  async function getGeneralOptions(optionName) {
388
+ const { app } = getApp();
388
389
  return app.cloud.callWedaApi({
389
390
  action: 'DescribeGeneralOptionsDetailList',
390
391
  data: {
@@ -8,7 +8,7 @@ import state from '../../lowcode/<%= pageName %>/state'
8
8
  import computed from '../../lowcode/<%= pageName %>/computed'
9
9
  import { $page } from './api'
10
10
 
11
- const $app = app;
11
+ const $app = new Proxy({}, { get: function(obj, prop){ return app[prop] }});
12
12
  const context = observable({});
13
13
 
14
14
  const widgetProps = <%= stringifyObj(widgetProps, {depth: null}) %>