@cloudbase/lowcode-builder 1.8.65 → 1.8.67

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.8.65",
3
+ "version": "1.8.67",
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",
@@ -46,8 +46,8 @@
46
46
  "dependencies": {
47
47
  "@babel/core": "7.21.4",
48
48
  "@babel/preset-env": "7.21.4",
49
- "@cloudbase/cals": "^1.0.51",
50
- "@cloudbase/lowcode-generator": "^1.8.19",
49
+ "@cloudbase/cals": "^1.0.54",
50
+ "@cloudbase/lowcode-generator": "^1.8.20",
51
51
  "axios": "^0.21.0",
52
52
  "browserfs": "^1.4.3",
53
53
  "browserify-zlib": "^0.2.0",
@@ -543,7 +543,7 @@
543
543
  crossorigin
544
544
  src="<%=
545
545
  cdnEndpoints.cdngo
546
- %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.3897a073a34a755db5d0.bundle.js"
546
+ %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.60fc8d66d8b46f3c1b33.bundle.js"
547
547
  ></script>
548
548
  </body>
549
549
  </html>
@@ -41,7 +41,7 @@ const mainAppKey = '__weappsMainApp'
41
41
  key: '${l.key||''}',
42
42
  sourceKey: '${ l.sourceKey||"" }',
43
43
  handler: ${l.generateHandler(subLevelPath) || 'undefined'},
44
- args: ${stringifyObj(l.args||{}, {depth: null})},
44
+ args: ${JSON.stringify(l.args||{}, undefined, 2)},
45
45
  argsBinds: {${printBoundData(l.argsBinds)}}
46
46
  }`
47
47
  }).join(',')}
@@ -98,7 +98,7 @@ function createGlboalApi() {
98
98
  let dataset = createDataset('$global')
99
99
  dataset.query = generateDatasetQuery({<% Object.entries(appQuery).map(([id, item])=>{%>
100
100
  <%= id %>: { <% const { dataBinds, eventHandlers, handler, ...rest } = item %>
101
- ...(<%= stringifyObj(rest, {depth: null}) %>),
101
+ ...(<%= JSON.stringify(rest, undefined, 2) %>),
102
102
  handler: <%= handler %>,
103
103
  dataBinds: {<%= printBoundData(dataBinds) %>},
104
104
  eventHandlers: {<% printEventHandler(eventHandlers) %>}
@@ -62,52 +62,66 @@ export class Query {
62
62
  this.#action =
63
63
  this.#schema.type === 'sql' || this.#schema.type === 'sqlserver'
64
64
  ? async function (data) {
65
- const Data = await $w.cloud.callWedaApi({
66
- action: 'RunPluginQuery',
67
- data: {
68
- EnvId: $w.env.envId,
69
- MainAppId: $w.app.id,
70
- Name: data.sqlTemplateId,
71
- Parameter: JSON.stringify(
72
- Object.entries(data.params || {}).reduce((list, [key, value]) => {
73
- if (value !== undefined) {
74
- let type = 'OBJECT';
75
- const typeofValue = typeof value;
76
- switch (typeofValue) {
77
- case 'boolean': {
78
- type = 'BOOLEAN';
79
- break;
80
- }
81
- case 'number': {
82
- type = 'NUMBER';
83
- break;
84
- }
85
- case 'string': {
86
- type = 'STRING';
87
- break;
88
- }
89
- default: {
90
- if (Array.isArray(value)) {
91
- type = 'ARRAY';
92
- } else {
93
- type = 'OBJECT';
94
- }
65
+ const requestData = {
66
+ EnvId: $w.env.envId,
67
+ Name: data.sqlTemplateId,
68
+ Parameter: JSON.stringify(
69
+ Object.entries(data.params || {}).reduce((list, [key, value]) => {
70
+ if (value !== undefined) {
71
+ let type = 'OBJECT';
72
+ const typeofValue = typeof value;
73
+ switch (typeofValue) {
74
+ case 'boolean': {
75
+ type = 'BOOLEAN';
76
+ break;
77
+ }
78
+ case 'number': {
79
+ type = 'NUMBER';
80
+ break;
81
+ }
82
+ case 'string': {
83
+ type = 'STRING';
84
+ break;
85
+ }
86
+ default: {
87
+ if (Array.isArray(value)) {
88
+ type = 'ARRAY';
89
+ } else {
90
+ type = 'OBJECT';
95
91
  }
96
92
  }
97
-
98
- list.push({
99
- Key: key,
100
- Type: type,
101
- Value: type === 'STRING' ? value : JSON.stringify(value),
102
- });
103
93
  }
104
94
 
105
- return list;
106
- }, []) || [],
107
- ),
108
- },
95
+ list.push({
96
+ Key: key,
97
+ Type: type,
98
+ Value: type === 'STRING' ? value : JSON.stringify(value),
99
+ });
100
+ }
101
+
102
+ return list;
103
+ }, []) || [],
104
+ ),
105
+ };
106
+
107
+ const Data = await $w.cloud.callWedaApi({
108
+ action: 'RunQuery',
109
+ CallQuery: true,
110
+ QueryResource: this.#schema.type === 'sql' ? 'mysql-plugin' : 'mssql-plugin',
111
+ QueryPath: '/WeDa/Query/V1/RunPluginQuery',
112
+ EnvId: requestData.EnvId,
113
+ QueryName: requestData.Name,
114
+ data: requestData,
109
115
  });
110
116
 
117
+ // const Data = await $w.cloud.callWedaApi({
118
+ // action: 'RunPluginQuery',
119
+ // data: {
120
+ // MainAppId: $w.app.id,
121
+ // ...requestData
122
+ // },
123
+ // });
124
+
111
125
  const { ExecuteResultList = [], Total } = Data || {};
112
126
  return {
113
127
  records: ExecuteResultList.map((item) => JSON.parse(item)),
@@ -16,7 +16,7 @@ const handlers = {<% handlers.forEach(h => {%>
16
16
 
17
17
  const libCode = '<%= materialName %>'
18
18
 
19
- const widgetProps = <%= stringifyObj(widgetProps, {depth: null}) %>
19
+ const widgetProps = <%= JSON.stringify(widgetProps, undefined, 2) %>
20
20
 
21
21
  <% function printBoundData(boundData={}) {
22
22
  const list = []
@@ -35,7 +35,7 @@ const evtListeners = {<% Object.entries(eventHandlers).map(([handlerName, listen
35
35
  key: '<%= l.key %>',
36
36
  sourceKey: '<%= l.sourceKey %>',
37
37
  handler: <%= l.generateHandler('../') %>,
38
- args: <%= stringifyObj(l.args, {depth: null}) %>,
38
+ args: <%= JSON.stringify(l.args, undefined, 2) %>,
39
39
  argsBinds: { <%= printBoundData(l.argsBinds) %>}
40
40
  },<%})%>
41
41
  ],<%})%>
@@ -1 +1 @@
1
- export const widgetProps = <%= stringifyObj(widgetProps, {depth: null}) %>
1
+ export const widgetProps = <%= JSON.stringify(widgetProps, undefined, 2) %>
@@ -28,7 +28,7 @@ import { widgetProps } from './data'
28
28
  key: '${l.key||''}',
29
29
  sourceKey: '${ l.sourceKey||"" }',
30
30
  handler: ${l.generateHandler(subLevelPath) || 'undefined'},
31
- args: ${stringifyObj(l.args||{}, {depth: null})},
31
+ args: ${JSON.stringify(l.args||{}, undefined, 2)},
32
32
  argsBinds: {${printBoundData(l.argsBinds)}}
33
33
  }`
34
34
  }).join(',')}
@@ -49,7 +49,7 @@ const dataBinds = {
49
49
 
50
50
  const query = {<% Object.entries(query).map(([id, item])=>{%>
51
51
  <%= id %>: { <% const {dataBinds={}, eventHandlers, handler, ...rest } = item %>
52
- ...(<%= stringifyObj(rest, {depth: null}) %>),
52
+ ...(<%= JSON.stringify(rest, undefined, 2) %>),
53
53
  handler: <%= handler %>,
54
54
  dataBinds: {<%= printBoundData(dataBinds) %>},
55
55
  eventHandlers: {<% printEventHandler(eventHandlers) %>}
@@ -57,7 +57,7 @@ const query = {<% Object.entries(query).map(([id, item])=>{%>
57
57
  }
58
58
 
59
59
  const eventFlows = [<% eventFlows.map(flow => {%> { <% const { eventHandlers, ...rest } = flow %>
60
- ...(<%= stringifyObj(rest, {depth: null}) %>),
60
+ ...(<%= JSON.stringify(rest, undefined, 2) %>),
61
61
  eventHandlers: {<% printEventHandler(eventHandlers) %>}
62
62
  },<%}) %>
63
63
  ]
@@ -75,6 +75,6 @@ createPage({
75
75
  handlers,
76
76
  query,
77
77
  eventFlows,
78
- pageAttributes: <%= pageAttributes? stringifyObj(pageAttributes, {depth: null}):'{}' %>,
78
+ pageAttributes: <%= pageAttributes? JSON.stringify(pageAttributes):'{}' %>,
79
79
  resetShare: <%= resetShare %>
80
80
  })
@@ -159,7 +159,7 @@ module.exports = function (options) {
159
159
  },
160
160
  devtool: devtool,
161
161
  resolve: {
162
- extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.scss', '.css'],
162
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.mjs', '.scss', '.css'],
163
163
  modules: [...resolveModules],
164
164
  symlinks: false,
165
165
  cacheWithContext: false,
@@ -184,6 +184,11 @@ module.exports = function (options) {
184
184
  /node_modules\/(?!(@cloudbase\/weda-ui)|(@tcwd\/vuera)|(@tcwd\/weapps-core)|(@react-spring)|(@react-hookz))|gsd-kbone-react/,
185
185
  use: ['happypack/loader?id=babel'],
186
186
  },
187
+ {
188
+ test: /node_modules\/@loadable\/component\/.*\.mjs$/,
189
+ include: /node_modules/,
190
+ type: 'javascript/auto',
191
+ },
187
192
  {
188
193
  test: /\.(scss|sass)$/,
189
194
  use: [