@cloudbase/framework-plugin-low-code 0.7.33 → 0.7.34
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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +29 -22
- package/lib/weapps-core/utils/file.d.ts +1 -1
- package/package.json +1 -1
- package/lib/config/private.d.ts +0 -3
- package/lib/config/private.d.ts.map +0 -1
- package/lib/config/private.js +0 -14
package/lib/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ declare class LowCodePlugin extends Plugin {
|
|
|
80
80
|
protected _appPath: string;
|
|
81
81
|
protected _authPlugin: any;
|
|
82
82
|
protected _miniprogramePlugin: any;
|
|
83
|
+
protected _miniprogramePluginProjectParam: any;
|
|
83
84
|
protected _webPlugin: any;
|
|
84
85
|
protected _functionPlugin: any;
|
|
85
86
|
protected _productBasePath?: string;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAOA,OAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAOrE,OAAO,EACL,SAAS,EAET,cAAc,EAIf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AASvD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAE7D,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AAKpD,eAAO,MAAM,SAAS,WAAW,CAAC;AAClC,eAAO,MAAM,2BAA2B,IAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAOA,OAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;A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M,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;gBACiB,IAAI,EAAE,MAAM,EAAS,GAAG,EAAE,gBAAgB,EAAS,MAAM,EAAE,6BAA6B;IA4H3G,QAAQ;IAMR,qBAAqB,CAAC,aAAa,EAAE,cAAc;IAwEnD,eAAe;IAQf,KAAK,CAAC,KAAK,KAAA;IASX,QAAQ,CAAC,KAAK,KAAA;IAWR,IAAI;IAKJ,GAAG;IAKH,MAAM;IAKN,OAAO;IAKP,KAAK;IA8QL,OAAO;IAkGP,MAAM;IAyHN,qBAAqB,CAAC,OAAO,EAAE,MAAM;IA8BrC,mBAAmB,CAAC,KAAK,KAAA,EAAE,KAAK,UAAQ;IAgBxC,eAAe,CAAC,KAAK,KAAA,EAAE,KAAK,UAAQ;IAqB1C,eAAe,CAAC,OAAO,KAAA;IAIjB,gBAAgB;IA8GhB,2BAA2B;IA6D3B,UAAU;IAoBV,OAAO,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA;IAejB,uBAAuB;IAoBvB,yBAAyB;IA0F/B,oBAAoB;CAKrB;AA4BD,eAAO,MAAM,MAAM,sBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -71,6 +71,12 @@ const QRCODE_PATH = './qrcode.jpg';
|
|
|
71
71
|
const LOG_FILE = 'build.log';
|
|
72
72
|
const DEFAULT_CLOUDFUNCTION_ROOT_NAME = 'cloudfunctions';
|
|
73
73
|
const DEFAULT_CLOUDFUNCTION_ROOT_PATH = path_1.default.join(DEFAULT_CLOUDFUNCTION_ROOT_NAME, '/');
|
|
74
|
+
const MP_COMPILE_SETTING = {
|
|
75
|
+
es6: true,
|
|
76
|
+
es7: true,
|
|
77
|
+
minify: true,
|
|
78
|
+
codeProtect: false,
|
|
79
|
+
};
|
|
74
80
|
const DEFAULT_INPUTS = {
|
|
75
81
|
_inputFile: 'input.json',
|
|
76
82
|
debug: false,
|
|
@@ -224,29 +230,20 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
224
230
|
}
|
|
225
231
|
let projectJson = fs_extra_1.default.readJsonSync(path_1.default.resolve(this.api.projectPath, exports.DIST_PATH, 'project.config.json'));
|
|
226
232
|
let { cloudfunctionRoot, miniprogramRoot = './' } = projectJson;
|
|
227
|
-
|
|
228
|
-
es6: true,
|
|
229
|
-
es7: true,
|
|
230
|
-
minify: true,
|
|
231
|
-
codeProtect: false,
|
|
232
|
-
};
|
|
233
|
-
this._miniprogramePlugin = new framework_plugin_mp_1.plugin('miniprograme', this.api, {
|
|
233
|
+
this._miniprogramePluginProjectParam = {
|
|
234
234
|
appid: deployOptions.mpAppId,
|
|
235
235
|
privateKeyPath: `./private.${deployOptions.mpAppId}.key`,
|
|
236
|
-
localPath: exports.DIST_PATH,
|
|
237
236
|
ignores: ['node_modules/**/*', LOG_FILE].concat(cloudfunctionRoot ? [path_1.default.join(cloudfunctionRoot, '**/*')] : []),
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
};
|
|
238
|
+
this._miniprogramePlugin = new framework_plugin_mp_1.plugin('miniprograme', this.api, Object.assign(Object.assign({}, this._miniprogramePluginProjectParam), { localPath: exports.DIST_PATH, deployMode: deployOptions.mpAppId === deployOptions.targetMpAppId ? deployOptions.mode : types_1.DEPLOY_MODE.UPLOAD, uploadOptions: {
|
|
240
239
|
version: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.version) || '1.0.0',
|
|
241
240
|
desc: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.description) || '',
|
|
242
|
-
setting,
|
|
243
|
-
},
|
|
244
|
-
previewOptions: {
|
|
241
|
+
setting: MP_COMPILE_SETTING,
|
|
242
|
+
}, previewOptions: {
|
|
245
243
|
qrcodeOutputPath: path_1.default.resolve(this.api.projectPath, QRCODE_PATH),
|
|
246
244
|
pagePath: (_b = (_a = fs_extra_1.default.readJsonSync(path_1.default.resolve(this.api.projectPath, exports.DIST_PATH, miniprogramRoot, 'app.json'))) === null || _a === void 0 ? void 0 : _a.pages) === null || _b === void 0 ? void 0 : _b[0],
|
|
247
|
-
setting,
|
|
248
|
-
}
|
|
249
|
-
});
|
|
245
|
+
setting: MP_COMPILE_SETTING,
|
|
246
|
+
} }));
|
|
250
247
|
}
|
|
251
248
|
else if ((0, common_2.buildAsWebByBuildType)(buildTypeList)) {
|
|
252
249
|
this._webPlugin = new framework_plugin_website_1.plugin('web', this.api, {
|
|
@@ -599,6 +596,21 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
599
596
|
this._time("DEPLOY");
|
|
600
597
|
if (this._miniprogramePlugin) {
|
|
601
598
|
yield this._miniprogramePlugin.deploy();
|
|
599
|
+
try {
|
|
600
|
+
const saveZipPath = path_1.default.join(this._productBasePath, 'compiledResult.zip');
|
|
601
|
+
yield mpci.getCompiledResult({
|
|
602
|
+
project: new mpci.Project(Object.assign(Object.assign({}, this._miniprogramePluginProjectParam), { projectPath: this._appPath, type: 'miniProgram' })),
|
|
603
|
+
version: '0.0.0',
|
|
604
|
+
desc: '',
|
|
605
|
+
setting: MP_COMPILE_SETTING,
|
|
606
|
+
onProgressUpdate: () => { },
|
|
607
|
+
}, path_1.default.join(this._productBasePath, 'compiledResult.zip'));
|
|
608
|
+
const { size } = yield fs_extra_1.default.stat(saveZipPath);
|
|
609
|
+
this.api.logger.info('获取小程序包大小', size);
|
|
610
|
+
}
|
|
611
|
+
catch (e) {
|
|
612
|
+
this.api.logger.error('获取小程序包失败', e);
|
|
613
|
+
}
|
|
602
614
|
}
|
|
603
615
|
else if (this._webPlugin) {
|
|
604
616
|
yield this._webPlugin.deploy();
|
|
@@ -685,12 +697,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
685
697
|
mpAnalyzeAndCleanCode(distDir) {
|
|
686
698
|
return __awaiter(this, void 0, void 0, function* () {
|
|
687
699
|
let { deployOptions } = this._resolvedInputs;
|
|
688
|
-
const project = new mpci.Project({
|
|
689
|
-
appid: deployOptions.mpAppId,
|
|
690
|
-
projectPath: distDir,
|
|
691
|
-
type: 'miniProgram',
|
|
692
|
-
privateKeyPath: `./private.${deployOptions.mpAppId}.key`,
|
|
693
|
-
});
|
|
700
|
+
const project = new mpci.Project(Object.assign(Object.assign({}, this._miniprogramePluginProjectParam), { projectPath: distDir, type: 'miniProgram' }));
|
|
694
701
|
const analyseRes = yield mpci.analyseCode(project);
|
|
695
702
|
if (analyseRes) {
|
|
696
703
|
const codeExtensions = new Set(['.wxml', '.wxss', '.wxs', '.js', '.json', '.json', '.ts']);
|
|
@@ -6,7 +6,7 @@ export declare function originJsonToFileList(appData: IWeAppData): (import("../t
|
|
|
6
6
|
code: string;
|
|
7
7
|
pageId: string;
|
|
8
8
|
})[];
|
|
9
|
-
export declare function getExtByType(type: CodeType): ".less" | ".
|
|
9
|
+
export declare function getExtByType(type: CodeType): ".less" | ".js" | ".json";
|
|
10
10
|
export declare function HACK_FIX_LOWCODE_IN(code?: string): string;
|
|
11
11
|
export declare function HACK_FIX_LOWCODE_OUT(code?: string): string;
|
|
12
12
|
//# sourceMappingURL=file.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/framework-plugin-low-code",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.34",
|
|
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",
|
package/lib/config/private.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const PRIVATE_JS_NAME = "weda-private.js";
|
|
2
|
-
export declare const PRIVATE_JS_CODE = "\n /**\n * An empty js file. It will be overridden in private place.\n *\n * For example:\n * ```javascript\n * window._isPrivate = true\n * ```\n */\n ";
|
|
3
|
-
//# sourceMappingURL=private.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"private.d.ts","sourceRoot":"","sources":["../../src/config/private.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAKjD,eAAO,MAAM,eAAe,oKAS1B,CAAC"}
|
package/lib/config/private.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PRIVATE_JS_CODE = exports.PRIVATE_JS_NAME = void 0;
|
|
4
|
-
exports.PRIVATE_JS_NAME = 'weda-private.js';
|
|
5
|
-
exports.PRIVATE_JS_CODE = `
|
|
6
|
-
/**
|
|
7
|
-
* An empty js file. It will be overridden in private place.
|
|
8
|
-
*
|
|
9
|
-
* For example:
|
|
10
|
-
* \`\`\`javascript
|
|
11
|
-
* window._isPrivate = true
|
|
12
|
-
* \`\`\`
|
|
13
|
-
*/
|
|
14
|
-
`;
|