@cloudbase/lowcode-builder 1.3.15 → 1.4.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.3.15",
3
+ "version": "1.4.1",
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",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@cloudbase/cals": "^0.5.12",
42
- "@cloudbase/lowcode-generator": "^1.3.6",
42
+ "@cloudbase/lowcode-generator": "^1.4.0",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
45
45
  "browserify-zlib": "^0.2.0",
@@ -19,7 +19,7 @@
19
19
  <% cssStyles.forEach(function(styleUrl){%>
20
20
  <link type="text/css" rel="stylesheet" href="<%=styleUrl %>" />
21
21
  <% })%> <% if(cdnEndpoints.aegis){ %>
22
- <script crossorigin="anonymous" src="<%= cdnEndpoints.aegis %>/aegis/aegis-sdk/latest/aegis.min.js?v=1"></script>
22
+ <script crossorigin="anonymous" src="<%= cdnEndpoints.aegis %>/aegis-sdk/latest/aegis.min.js"></script>
23
23
  <script>
24
24
  <% if(!isAdminPortal){ %>
25
25
  const _aegis = new Aegis({
@@ -475,7 +475,7 @@
475
475
  crossorigin
476
476
  src="<%=
477
477
  cdnEndpoints.cdngo
478
- %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.2b07a569d23a6eba7136.bundle.js"
478
+ %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.efbaa5f34f9a013bf4b1.bundle.js"
479
479
  ></script>
480
480
  </body>
481
481
  </html>
@@ -4,6 +4,7 @@ import { createComputed, formatEnum, enumOptions } from '<%= subLevelPath %>../c
4
4
  import appGlobal from '<%= subLevelPath %>../app/app-global'
5
5
  import { createDataset } from '<%= subLevelPath %>../datasources/index'
6
6
  import lodashGet from 'lodash.get';
7
+ import config from '<%= subLevelPath %>../common/config';
7
8
 
8
9
 
9
10
  <%= importor.state? `import state from '../lowcode/state'` : "const state = {}" %>
@@ -25,11 +26,14 @@ export const $w = new Proxy(
25
26
 
26
27
  function createGlboalApi() {
27
28
  const mpApp = createMpApp({
28
- appConfig: <%= appConfig %>
29
+ appConfig: {
30
+ staticResourceDomain: config.domain,
31
+ ...(<%= appConfig %>)
32
+ }
29
33
  });
30
34
  const globalAPI = Object.assign(mpApp, {
31
35
  id: '<%= appId %>',
32
- domain: '<%= domain %>',
36
+ domain: config.domain,
33
37
  pages: {},
34
38
  session: {
35
39
  //configure: sdk.configure,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * require to be commonjs
3
+ */
4
+ module.exports = {
5
+ isPrivate: <%=isPrivateMode%>,
6
+ domain: '<%=domain%>',
7
+ endpointType: '<%=endpointType%>',
8
+ tcbApiOrigin: '<%= endpointType === `tcb-api` && isPrivateMode && domain ? `https://${domain}` : `` %>'
9
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ domain: '<%=domain%>',
3
+ };
@@ -33,11 +33,13 @@ export function generateDataContext(widget) {
33
33
  while (widget?._scope) {
34
34
  const current = widget;
35
35
  // 此处采用代理的方式,是为了可以获取到最新的 _scope.dataContext 防止 dataContext 引用被重新赋值
36
- Object.defineProperty(dataContext, current._scope.id, {
37
- get() {
38
- return current._scope.dataContext;
39
- },
40
- });
36
+ if(current?._scope?.id){
37
+ Object.defineProperty(dataContext, current._scope.id, {
38
+ get() {
39
+ return current?._scope?.dataContext;
40
+ },
41
+ });
42
+ }
41
43
  widget = widget.parent;
42
44
  }
43
45
  return dataContext;
@@ -1,6 +1,8 @@
1
+ var config = require('./config.wxs')
2
+
1
3
  function getStaticResourceAttribute(staticUrl) {
2
4
  if (staticUrl && staticUrl[0] == '/') {
3
- var domain = '<%=domain%>'
5
+ var domain = config.domain
4
6
  return 'https://' + domain + staticUrl;
5
7
  }
6
8
  return staticUrl
@@ -790,14 +790,28 @@ class UserWidget {
790
790
  }
791
791
 
792
792
  get custom() {
793
- const { methods = {}, ...restInstance } = this._widget._getInstanceRef?.()?.current || {};
794
-
795
- const userCustomMember = {
796
- ...this._widget._methods,
797
- ...restInstance,
798
- ...methods,
799
- };
800
-
793
+ const instance = this._widget._getInstanceRef?.()?.current || {};
794
+ const userCustomMember = untracked(() => {
795
+ const { methods = {}, ...restInstance } = instance;
796
+ return new Proxy(
797
+ {
798
+ ...this._widget._methods,
799
+ ...restInstance,
800
+ ...methods,
801
+ },
802
+ {
803
+ get(_, prop) {
804
+ if (prop in methods) {
805
+ return methods[prop];
806
+ }
807
+ if (prop !== 'methods' && prop in instance) {
808
+ return instance[prop];
809
+ }
810
+ return this._widget._methods?.[prop];
811
+ },
812
+ },
813
+ );
814
+ });
801
815
  return userCustomMember;
802
816
  }
803
817
  }
@@ -1,5 +1,6 @@
1
1
  import datasetProfiles from './dataset-profiles'
2
2
  const dataSourceProfiles = require('./datasource-profiles.js')
3
+ import config from '../common/config'
3
4
 
4
5
  /**
5
6
  * 数据源基本配置
@@ -25,14 +26,14 @@ export default {
25
26
  /**
26
27
  * 确定调用链路
27
28
  */
28
- endpointType: '<%= endpointType %>',
29
+ endpointType: config.endpointType,
29
30
  /**
30
31
  * 调用链路为 tcb-api 时有效
31
32
  * 私有化需要设置
32
33
  */
33
- tcbApiOrigin: '<%= tcbApiOrigin %>',
34
+ tcbApiOrigin: config.tcbApiOrigin,
34
35
  /**
35
36
  * 是否是处于私有化版本
36
37
  */
37
- isPrivate: <%= isPrivateMode %>
38
+ isPrivate: config.isPrivate
38
39
  }
@@ -5,7 +5,7 @@
5
5
  "dependencies": {<% if(importJSSDK) {%>
6
6
  "@cloudbase/js-sdk": "2.5.6-beta.1",<% } %>
7
7
  "@cloudbase/oauth": "0.1.1-alpha.5",
8
- "@cloudbase/weda-client": "0.2.47",
8
+ "@cloudbase/weda-client": "0.2.45",
9
9
  "@cloudbase/weda-cloud-sdk": "1.0.26",
10
10
  "mobx": "^5.15.4",
11
11
  "lodash.get": "^4.4.2",