@cloudbase/framework-plugin-low-code 0.6.8 → 0.6.12
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/lib/builder/mp/index.d.ts.map +1 -1
- package/lib/builder/mp/index.js +40 -47
- package/lib/builder/mp/wxml.d.ts.map +1 -1
- package/lib/builder/mp/wxml.js +7 -2
- package/lib/utils/postProcess.d.ts.map +1 -1
- package/lib/utils/postProcess.js +23 -6
- package/package.json +1 -1
- package/template/html/index.html.ejs +1 -1
- package/template/mp/datasources/config.js.tpl +1 -1
- package/template/mp/datasources/datasource-profiles.js.tpl +1 -1
- package/template/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builder/mp/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,aAAa,EACb,UAAU,EAEV,OAAO,EAIR,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAkB/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAEL,SAAS,EACT,YAAY,EACZ,UAAU,EACX,MAAM,iBAAiB,CAAC;AAUzB,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,YAAY,EACZ,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,aAAa,GACd,EAAE;IACD,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,GAAG,CAAC;IACf,SA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,CAqSvC;AAkKD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,aAAa,iBAgCnB;AAYD,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,MAAM,EACN,SAAS,GACV,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;;;EA0CA"}
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -97,30 +97,24 @@ function generateWxMp({ weapps, projDir, appId, domain, materials, plugins, isPr
|
|
|
97
97
|
const projectConfigJsonPath = path_1.default.join(projDir, mainAppData.rootPath || '', 'project.config.json');
|
|
98
98
|
let projectConfigJson = yield fs.readJSON(projectConfigJsonPath);
|
|
99
99
|
const miniprogramRoot = path_1.default.join(projDir, projectConfigJson.miniprogramRoot || '/');
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
'
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
'common/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
dataPropNames: wxmlDataPrefix,
|
|
119
|
-
debug: !buildContext.isProduction,
|
|
120
|
-
},
|
|
121
|
-
'common/process.js': {},
|
|
122
|
-
'common/data-patch.js': {},
|
|
123
|
-
};
|
|
100
|
+
let appFileData = {};
|
|
101
|
+
if (weapps.find((item) => !item.mpPkgUrl)) {
|
|
102
|
+
yield generateFramework(mainAppData, miniprogramRoot, buildContext);
|
|
103
|
+
let appJsPath = path_1.default.join(miniprogramRoot, 'app.js');
|
|
104
|
+
let appJsContent = yield fs.readFile(appJsPath);
|
|
105
|
+
yield generateFiles_1.writeFile(appJsPath, `import { app as wedaApp } from './app/weapps-api'\n${appJsContent}`);
|
|
106
|
+
appFileData = Object.assign(Object.assign({}, appFileData), { 'common/style.js': {}, 'common/utils.wxs': {
|
|
107
|
+
domain: domain,
|
|
108
|
+
}, 'common/util.js': {
|
|
109
|
+
isAdminPortal: common_1.buildAsAdminPortalByBuildType(buildTypeList),
|
|
110
|
+
}, 'common/widget.js': {}, 'common/url.js': {}, 'common/weapp-sdk.js': {}, 'common/weapp-page.js': {
|
|
111
|
+
dataPropNames: wxmlDataPrefix,
|
|
112
|
+
debug: !buildContext.isProduction,
|
|
113
|
+
}, 'common/weapp-component.js': {}, 'common/merge-renderer.js': {
|
|
114
|
+
dataPropNames: wxmlDataPrefix,
|
|
115
|
+
debug: !buildContext.isProduction,
|
|
116
|
+
}, 'common/process.js': {}, 'common/data-patch.js': {} });
|
|
117
|
+
}
|
|
124
118
|
if (mainAppData.mpPkgUrl) {
|
|
125
119
|
if (!projectConfigJson.setting) {
|
|
126
120
|
projectConfigJson.setting = {};
|
|
@@ -141,9 +135,6 @@ function generateWxMp({ weapps, projDir, appId, domain, materials, plugins, isPr
|
|
|
141
135
|
}
|
|
142
136
|
appJson.subpackages = subpackages;
|
|
143
137
|
yield generateFiles_1.writeFile(appJsonPath, JSON.stringify(appJson, undefined, 2));
|
|
144
|
-
let appJsPath = path_1.default.join(miniprogramRoot, 'app.js');
|
|
145
|
-
let appJsContent = yield fs.readFile(appJsPath);
|
|
146
|
-
yield generateFiles_1.writeFile(appJsPath, `import { app as wedaApp } from './app/weapps-api'\n${appJsContent}`);
|
|
147
138
|
}
|
|
148
139
|
else {
|
|
149
140
|
appFileData = Object.assign(Object.assign({}, appFileData), { 'common/wx_yypt_report_v2.js': {}, 'app.js': { yyptConfig: yyptConfig }, 'app.json': { content: appConfig }, 'app.wxss': {
|
|
@@ -168,26 +159,28 @@ function generateWxMp({ weapps, projDir, appId, domain, materials, plugins, isPr
|
|
|
168
159
|
`${projDir} to ${miniprogramRoot}`);
|
|
169
160
|
yield fs.move(path_1.default.join(projDir, config_1.materialsDirName), path_1.default.join(miniprogramRoot, config_1.materialsDirName));
|
|
170
161
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
162
|
+
if (weapps.find((item) => !item.mpPkgUrl)) {
|
|
163
|
+
const datasourceFileData = {
|
|
164
|
+
'datasources/index.js': {},
|
|
165
|
+
'datasources/config.js.tpl': {
|
|
166
|
+
envID: mainAppData.envId,
|
|
167
|
+
appID: appId,
|
|
168
|
+
resourceAppid: !!options.isCrossAccount ? options.resourceAppid : '',
|
|
169
|
+
isProd: deployMode === types_1.DEPLOY_MODE.UPLOAD,
|
|
170
|
+
},
|
|
171
|
+
'datasources/datasource-profiles.js.tpl': {
|
|
172
|
+
datasourceProfiles: util_3.JsonToStringWithVariableName(dataSource_1.getDatasourceProfiles(weapps.reduce((datasources, app) => {
|
|
173
|
+
datasources.push(...(app.datasources || []));
|
|
174
|
+
return datasources;
|
|
175
|
+
}, []))),
|
|
176
|
+
},
|
|
177
|
+
'datasources/dataset-profiles.js.tpl': {
|
|
178
|
+
datasetProfiles: util_3.JsonToStringWithVariableName(dataSource_1.getDatasetProfiles(mainAppData, weapps)),
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
console.log('Generating ' + em('datasources') + ' files');
|
|
182
|
+
yield generateFiles_1.default(datasourceFileData, templateDir, miniprogramRoot, buildContext);
|
|
183
|
+
}
|
|
191
184
|
yield Promise.all(weapps.map((app, index) => __awaiter(this, void 0, void 0, function* () {
|
|
192
185
|
if (index == 0) {
|
|
193
186
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wxml.d.ts","sourceRoot":"","sources":["../../../src/builder/mp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AAM,CAAC,CAAA;CAAO;;EAYlD"}
|
package/lib/builder/mp/wxml.js
CHANGED
|
@@ -109,7 +109,11 @@ function generateWxml(widgets, docTag, wxmlDataPrefix, ctx, usingComponents, nod
|
|
|
109
109
|
elements.push({
|
|
110
110
|
type: 'element',
|
|
111
111
|
name: tagName,
|
|
112
|
-
attributes: {
|
|
112
|
+
attributes: {
|
|
113
|
+
name: data0.name.type && data0.name.type !== 'static'
|
|
114
|
+
? `{{${id}.name}}`
|
|
115
|
+
: data0.name.value,
|
|
116
|
+
},
|
|
113
117
|
elements: [],
|
|
114
118
|
_order: xIndex || 0,
|
|
115
119
|
_parent: null,
|
|
@@ -186,7 +190,8 @@ function generateWxml(widgets, docTag, wxmlDataPrefix, ctx, usingComponents, nod
|
|
|
186
190
|
listeners.forEach((l) => {
|
|
187
191
|
const evtName = getMpEventName(l.trigger);
|
|
188
192
|
const modifiers = l;
|
|
189
|
-
node.attributes[getMpEventAttr(evtName, modifiers, tagName)] =
|
|
193
|
+
node.attributes[getMpEventAttr(evtName, modifiers, tagName)] =
|
|
194
|
+
getMpEventHanlderName(id, evtName, modifiers);
|
|
190
195
|
});
|
|
191
196
|
const compConfig = componentProto.compConfig;
|
|
192
197
|
if (compConfig && compConfig.pluginConfig) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postProcess.d.ts","sourceRoot":"","sources":["../../src/utils/postProcess.ts"],"names":[],"mappings":"AAKA,wBAAgB,wBAAwB,CAAC,eAAe,KAAA,EAAE,IAAI,KAAA,QAI7D;AAED,wBAAgB,0BAA0B,CAAC,WAAW,KAAA,EAAE,aAAa,KAAA,
|
|
1
|
+
{"version":3,"file":"postProcess.d.ts","sourceRoot":"","sources":["../../src/utils/postProcess.ts"],"names":[],"mappings":"AAKA,wBAAgB,wBAAwB,CAAC,eAAe,KAAA,EAAE,IAAI,KAAA,QAI7D;AAED,wBAAgB,0BAA0B,CAAC,WAAW,KAAA,EAAE,aAAa,KAAA,QAkBpE"}
|
package/lib/utils/postProcess.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
5
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
25
|
exports.postprocessDeployExtraJson = exports.postprocessProjectConfig = void 0;
|
|
7
|
-
const fs_extra_1 =
|
|
26
|
+
const fs_extra_1 = __importStar(require("fs-extra"));
|
|
8
27
|
const lodash_1 = require("lodash");
|
|
9
28
|
const path_1 = __importDefault(require("path"));
|
|
10
29
|
function postprocessProjectConfig(projectJsonPath, data) {
|
|
@@ -17,11 +36,9 @@ function postprocessDeployExtraJson(projectPath, deployOptions) {
|
|
|
17
36
|
if (targetMpAppId !== mpAppId) {
|
|
18
37
|
let projectJson = fs_extra_1.default.readJsonSync(path_1.default.resolve(projectPath, 'project.config.json'));
|
|
19
38
|
const miniprogramRoot = (projectJson === null || projectJson === void 0 ? void 0 : projectJson.miniprogramRoot) || './';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
directCommit: true,
|
|
24
|
-
}, null, 2));
|
|
39
|
+
const extPaht = path_1.default.resolve(projectPath, miniprogramRoot, 'ext.json');
|
|
40
|
+
const extJson = Object.assign(Object.assign({}, (fs_extra_1.default.existsSync(extPaht) ? fs_extra_1.readJsonSync(extPaht) : {})), { extEnable: true, extAppid: targetMpAppId, directCommit: true });
|
|
41
|
+
fs_extra_1.default.writeFileSync(extPaht, JSON.stringify(extJson, null, 2));
|
|
25
42
|
}
|
|
26
43
|
}
|
|
27
44
|
exports.postprocessDeployExtraJson = postprocessDeployExtraJson;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/framework-plugin-low-code",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
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",
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/0.1.2/_url/ajax/libs/mobx/5.15.7/mobx.umd.js"
|
|
444
444
|
crossorigin="anonymous"
|
|
445
445
|
></script>
|
|
446
|
-
<script src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@0.
|
|
446
|
+
<script src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.1/dist/h5.browser.js"></script>
|
|
447
447
|
<script src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/0.1.2/_url/npm/@zxing/library@0.18.6/umd/index.min.js"></script>
|
|
448
448
|
</body>
|
|
449
449
|
</html>
|
package/template/package.json
CHANGED