@cloudbase/framework-plugin-low-code 0.7.8 → 0.7.10-beta.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/builder/core/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAkBnD,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,EAC3B,cAAc,kCAA2B,EACzC,YAAY,6BAAsB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,SAAS,EAAE,EAC1B,UAAU,EAAE,WAAW,EACvB,OAAO,qBAAwB,EAC/B,aAAa,qBAAiB,EAC9B,SAAS;iBACM,OAAO;eACT,GAAG;aAIf,EACD,MAAM,EAAE,MAAM,iBA6Gf;AACD,wBAAsB,mBAAmB,CACvC,YAAY,oBAAa,EACzB,WAAW,EAAE,MAAM,EACnB,MAAM,KAAA,iBASP"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/builder/core/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAkBnD,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,EAC3B,cAAc,kCAA2B,EACzC,YAAY,6BAAsB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,SAAS,EAAE,EAC1B,UAAU,EAAE,WAAW,EACvB,OAAO,qBAAwB,EAC/B,aAAa,qBAAiB,EAC9B,SAAS;iBACM,OAAO;eACT,GAAG;aAIf,EACD,MAAM,EAAE,MAAM,iBA8Gf;AACD,wBAAsB,mBAAmB,CACvC,YAAY,oBAAa,EACzB,WAAW,EAAE,MAAM,EACnB,MAAM,KAAA,iBASP"}
@@ -53,6 +53,7 @@ function runGenerateCore(appBuildDir, appData, subAppDataList = [], dependencies
53
53
  }
54
54
  });
55
55
  yield Promise.all(allAppDataList.map((data) => __awaiter(this, void 0, void 0, function* () {
56
+ var _a;
56
57
  const { pageInstanceList, rootPath = '' } = data;
57
58
  const appName = rootPath ? 'Sub app ' + rootPath : 'Main app';
58
59
  console.log(chalk_1.default.blue.bold('Generating files for ' + appName));
@@ -68,6 +69,7 @@ function runGenerateCore(appBuildDir, appData, subAppDataList = [], dependencies
68
69
  appConfig: (0, util_1.JsonToStringWithVariableName)({
69
70
  id: appKey,
70
71
  envId: appData.envId,
72
+ clientId: (_a = appData.extra) === null || _a === void 0 ? void 0 : _a.clientId,
71
73
  staticResourceDomain: domain || '',
72
74
  envVersion: deployMode === types_1.DEPLOY_MODE.UPLOAD ? 'production' : 'preview',
73
75
  pages: pageInstanceList
package/lib/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
- export * as generator from './generator/core/index';
3
2
  import { PathLike } from 'fs-extra';
4
3
  import { Plugin, PluginServiceApi } from '@cloudbase/framework-core';
5
4
  import { BuildType, GenerateMpType } from './builder/types/common';
6
5
  import { IMaterialItem, IPlugin } from './weapps-core';
7
6
  import { DEPLOY_MODE, RUNTIME } from './types';
7
+ export * as generator from './generator/core/index';
8
8
  export declare const DIST_PATH = "./dist";
9
9
  export declare const PERSISTENT_DEPENDIENCES_MAP: {};
10
10
  declare const DEFAULT_INPUTS: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","source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qBAAqB,CAAC,OAAO,EAAE,MAAM;IA8CrC,mBAAmB,CAAC,KAAK,KAAA,EAAE,KAAK,UAAQ;IAgBxC,eAAe,CAAC,KAAK,KAAA,EAAE,KAAK,UAAQ;IAqB1C,eAAe,CAAC,OAAO,KAAA;IAIjB,gBAAgB;IA4HhB,2BAA2B;IAuE3B,UAAU;IAwBV,OAAO,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA;IAejB,uBAAuB;IA2BvB,yBAAyB;IAgG/B,oBAAoB;CAOrB;AA4BD,eAAO,MAAM,MAAM,sBAAgB,CAAC"}
package/lib/index.js CHANGED
@@ -43,7 +43,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
43
43
  };
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
45
  exports.plugin = exports.PERSISTENT_DEPENDIENCES_MAP = exports.DIST_PATH = exports.generator = void 0;
46
- exports.generator = __importStar(require("./generator/core/index"));
47
46
  const fs_extra_1 = __importDefault(require("fs-extra"));
48
47
  const path_1 = __importDefault(require("path"));
49
48
  const framework_core_1 = require("@cloudbase/framework-core");
@@ -64,6 +63,7 @@ const qrcode_1 = __importDefault(require("qrcode"));
64
63
  const url_1 = __importDefault(require("url"));
65
64
  const types_1 = require("./types");
66
65
  const config_1 = require("./generator/config");
66
+ exports.generator = __importStar(require("./generator/core/index"));
67
67
  exports.DIST_PATH = './dist';
68
68
  exports.PERSISTENT_DEPENDIENCES_MAP = {};
69
69
  const DEBUG_PATH = './debug';
@@ -108,7 +108,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
108
108
  this._resolvedInputs = resolveInputs(inputs, resolveInputs(params, DEFAULT_INPUTS));
109
109
  this._appPath = '';
110
110
  this._productBasePath = `lca/${this._resolvedInputs.appId}/${process.env.CLOUDBASE_CIID ? `/${process.env.CLOUDBASE_CIID}` : ''}`;
111
- let envId = this.api.envId;
111
+ let { envId } = this.api;
112
112
  if (!this._resolvedInputs.mainAppSerializeData) {
113
113
  throw new Error('缺少必须参数: mainAppSerializeData');
114
114
  }
@@ -123,26 +123,28 @@ class LowCodePlugin extends framework_core_1.Plugin {
123
123
  if (this._checkIsVersion(this._resolvedInputs.calsVersion)) {
124
124
  const cals = this._resolvedInputs.mainAppSerializeData;
125
125
  if (!this._resolvedInputs.mainAppSerializeData.mpPkgUrl) {
126
- this._resolvedInputs.mainAppSerializeData = (0, cals_1.deserializePlatformApp)(cals, { dependencies: this._resolvedInputs.dependencies });
126
+ this._resolvedInputs.mainAppSerializeData = (0, cals_1.deserializePlatformApp)(cals, {
127
+ dependencies: this._resolvedInputs.dependencies,
128
+ });
127
129
  if ((_a = cals.extra) === null || _a === void 0 ? void 0 : _a.miniprogramPlugins) {
128
130
  this._resolvedInputs.mainAppSerializeData.miniprogramPlugins = cals.extra.miniprogramPlugins.map((plugin) => {
129
131
  var _a;
130
- return Object.assign(Object.assign({}, plugin), { componentConfigs: ((_a = plugin.componentConfigs) === null || _a === void 0 ? void 0 : _a.map((component) => {
132
+ return (Object.assign(Object.assign({}, plugin), { componentConfigs: ((_a = plugin.componentConfigs) === null || _a === void 0 ? void 0 : _a.map((component) => {
131
133
  const { data, events, meta = {} } = component, restComponent = __rest(component, ["data", "events", "meta"]);
132
134
  const processedCompoennt = Object.assign(Object.assign({}, restComponent), { meta: {
133
135
  desc: (meta === null || meta === void 0 ? void 0 : meta.desc) || (meta === null || meta === void 0 ? void 0 : meta.description),
134
136
  } });
135
137
  if (data) {
136
- processedCompoennt['dataForm'] = data.properties;
138
+ processedCompoennt.dataForm = data.properties;
137
139
  }
138
140
  if (events) {
139
- processedCompoennt['emitEvents'] = events === null || events === void 0 ? void 0 : events.map((event) => ({
141
+ processedCompoennt.emitEvents = events === null || events === void 0 ? void 0 : events.map((event) => ({
140
142
  eventName: event.name,
141
143
  name: event.title,
142
144
  }));
143
145
  }
144
146
  return processedCompoennt;
145
- })) || [] });
147
+ })) || [] }));
146
148
  });
147
149
  }
148
150
  if (this._resolvedInputs.buildTypeList.includes("app") ||
@@ -325,7 +327,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
325
327
  });
326
328
  }
327
329
  try {
328
- const envId = this.api.envId;
330
+ const { envId } = this.api;
329
331
  let [website, hostingDatas] = yield this._getHostingInfoTask(envId, true);
330
332
  this._website = website;
331
333
  }
@@ -380,10 +382,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
380
382
  pauseConsoleOutput();
381
383
  }
382
384
  this._time("build process");
383
- this._appPath = yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
384
- var _g, _h;
385
+ this._appPath = yield new Promise((resolve, reject) => {
386
+ var _a, _b;
385
387
  try {
386
- yield (0, core_1.default)({
388
+ (0, core_1.default)({
387
389
  mainAppSerializeData,
388
390
  subAppSerializeDataList,
389
391
  dependencies,
@@ -393,7 +395,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
393
395
  runtime: this._resolvedInputs.runtime,
394
396
  ignoreInstall: this._resolvedInputs.ignoreInstall,
395
397
  mode: webpackMode,
396
- deployMode: (_g = this._resolvedInputs.deployOptions) === null || _g === void 0 ? void 0 : _g.mode,
398
+ deployMode: (_a = this._resolvedInputs.deployOptions) === null || _a === void 0 ? void 0 : _a.mode,
397
399
  watch: false,
398
400
  generateMpType,
399
401
  generateMpPath,
@@ -401,11 +403,11 @@ class LowCodePlugin extends framework_core_1.Plugin {
401
403
  plugins,
402
404
  extraData,
403
405
  isCrossAccount: this._resolvedInputs.mpAppId !==
404
- ((_h = this._resolvedInputs.deployOptions) === null || _h === void 0 ? void 0 : _h.targetMpAppId),
406
+ ((_b = this._resolvedInputs.deployOptions) === null || _b === void 0 ? void 0 : _b.targetMpAppId),
405
407
  resourceAppid: this._resolvedInputs.mpAppId,
406
408
  domain,
407
409
  }, (err, result) => __awaiter(this, void 0, void 0, function* () {
408
- var _j;
410
+ var _c;
409
411
  if (!err) {
410
412
  try {
411
413
  const { appConfig = {} } = mainAppSerializeData;
@@ -447,7 +449,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
447
449
  if ((0, common_2.buildAsWebByBuildType)(buildTypeList) &&
448
450
  !(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList) &&
449
451
  this._checkBroswerHisroty()) {
450
- yield Promise.all((((_j = this._resolvedInputs.mainAppSerializeData) === null || _j === void 0 ? void 0 : _j.pageInstanceList) || []).map((page) => fs_extra_1.default.copy(path_1.default.join(distPath, 'index.html'), path_1.default.join(distPath, page.id, 'index.html'))));
452
+ yield Promise.all((((_c = this._resolvedInputs.mainAppSerializeData) === null || _c === void 0 ? void 0 : _c.pageInstanceList) || []).map((page) => fs_extra_1.default.copy(path_1.default.join(distPath, 'index.html'), path_1.default.join(distPath, page.id, 'index.html'))));
451
453
  }
452
454
  }
453
455
  resolve(distPath);
@@ -486,7 +488,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
486
488
  catch (e) {
487
489
  reject(e);
488
490
  }
489
- }));
491
+ });
490
492
  if (!debug) {
491
493
  resumeConsoleOutput();
492
494
  }
@@ -550,11 +552,12 @@ class LowCodePlugin extends framework_core_1.Plugin {
550
552
  this._webPlugin) {
551
553
  try {
552
554
  const HostingProvider = (_a = this.api.resourceProviders) === null || _a === void 0 ? void 0 : _a.hosting;
553
- const envId = this.api.envId;
555
+ const { envId } = this.api;
554
556
  let [website, hostingDatas] = yield this._getHostingInfoTask(envId, false);
555
557
  if (HostingProvider) {
556
558
  if (!hostingDatas) {
557
- hostingDatas = (yield HostingProvider.getHostingInfo({ envId: envId })).data;
559
+ hostingDatas = (yield HostingProvider.getHostingInfo({ envId }))
560
+ .data;
558
561
  }
559
562
  let domains = hostingDatas.map((item) => item.cdnDomain);
560
563
  this._domain = domains;
@@ -587,13 +590,11 @@ class LowCodePlugin extends framework_core_1.Plugin {
587
590
  cloudPath: `/weda-config/${config_1.PRIVATE_JS_NAME}`,
588
591
  },
589
592
  ];
590
- yield Promise.all(deployContent.map((options) => {
591
- return this.api.cloudbaseManager.hosting.uploadFiles({
592
- localPath: options.src,
593
- cloudPath: options.cloudPath,
594
- ignore: this._webPlugin.resolvedInputs.ignore,
595
- });
596
- }));
593
+ yield Promise.all(deployContent.map((options) => this.api.cloudbaseManager.hosting.uploadFiles({
594
+ localPath: options.src,
595
+ cloudPath: options.cloudPath,
596
+ ignore: this._webPlugin.resolvedInputs.ignore,
597
+ })));
597
598
  }
598
599
  if (!Object.keys(res.Resources || {}).length &&
599
600
  !Object.keys(res.Config || {}).length) {
@@ -772,7 +773,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
772
773
  return __awaiter(this, void 0, void 0, function* () {
773
774
  const HostingProvider = (_a = this.api.resourceProviders) === null || _a === void 0 ? void 0 : _a.hosting;
774
775
  let [website, hostingDatas] = yield HostingProvider.getHostingInfo({
775
- envId: envId,
776
+ envId,
776
777
  }).then(({ data: hostingDatas }) => {
777
778
  let website = hostingDatas[0];
778
779
  return [website, hostingDatas];
@@ -802,7 +803,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
802
803
  let { credential, storage } = this._resolvedInputs;
803
804
  let cos = (credential === null || credential === void 0 ? void 0 : credential.token)
804
805
  ? new cos_nodejs_sdk_v5_1.default({
805
- getAuthorization: function (options, callback) {
806
+ getAuthorization(options, callback) {
806
807
  callback({
807
808
  TmpSecretId: (credential === null || credential === void 0 ? void 0 : credential.secretId) || '',
808
809
  TmpSecretKey: (credential === null || credential === void 0 ? void 0 : credential.secretKey) || '',
@@ -822,7 +823,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
822
823
  Region: (storage === null || storage === void 0 ? void 0 : storage.region) || '',
823
824
  Key: `${this._productBasePath}/dist.zip`,
824
825
  Body: fs_extra_1.default.createReadStream(zipPath),
825
- }, function (err, data) {
826
+ }, (err, data) => {
826
827
  if (err) {
827
828
  reject(err);
828
829
  }
@@ -839,7 +840,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
839
840
  Region: (storage === null || storage === void 0 ? void 0 : storage.region) || '',
840
841
  Key: `${this._productBasePath}/qrcode.jpg`,
841
842
  Body: fs_extra_1.default.createReadStream(path_1.default.resolve(this.api.projectPath, QRCODE_PATH)),
842
- }, function (err, data) {
843
+ }, (err, data) => {
843
844
  if (err) {
844
845
  reject(err);
845
846
  }
@@ -856,7 +857,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
856
857
  Region: (storage === null || storage === void 0 ? void 0 : storage.region) || '',
857
858
  Key: `${this._productBasePath}/${LOG_FILE}`,
858
859
  Body: fs_extra_1.default.createReadStream(this._logFilePath),
859
- }, function (err, data) {
860
+ }, (err, data) => {
860
861
  if (err) {
861
862
  reject(err);
862
863
  }
@@ -876,7 +877,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
876
877
  Region: (storage === null || storage === void 0 ? void 0 : storage.region) || '',
877
878
  Key: `${this._productBasePath}/debug.zip`,
878
879
  Body: fs_extra_1.default.createReadStream(zipPath),
879
- }, function (err, data) {
880
+ }, (err, data) => {
880
881
  if (err) {
881
882
  reject(err);
882
883
  }
@@ -899,7 +900,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
899
900
  let { credential } = this._resolvedInputs;
900
901
  let cos = (credential === null || credential === void 0 ? void 0 : credential.token)
901
902
  ? new cos_nodejs_sdk_v5_1.default({
902
- getAuthorization: function (options, callback) {
903
+ getAuthorization(options, callback) {
903
904
  callback({
904
905
  TmpSecretId: (credential === null || credential === void 0 ? void 0 : credential.secretId) || '',
905
906
  TmpSecretKey: (credential === null || credential === void 0 ? void 0 : credential.secretKey) || '',
@@ -929,7 +930,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
929
930
  Region: region,
930
931
  Key: cosKey,
931
932
  Body: fs_extra_1.default.createReadStream(zipPath),
932
- }, function (err, data) {
933
+ }, (err, data) => {
933
934
  if (err) {
934
935
  reject(err);
935
936
  }
@@ -962,8 +963,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
962
963
  _zipDir(src, dist) {
963
964
  return __awaiter(this, void 0, void 0, function* () {
964
965
  return new Promise((resolve, reject) => {
965
- var output = fs_extra_1.default.createWriteStream(dist);
966
- var archive = (0, archiver_1.default)('zip', {
966
+ let output = fs_extra_1.default.createWriteStream(dist);
967
+ let archive = (0, archiver_1.default)('zip', {
967
968
  zlib: { level: 9 },
968
969
  });
969
970
  output.on('close', resolve);
@@ -979,38 +980,6 @@ class LowCodePlugin extends framework_core_1.Plugin {
979
980
  return __awaiter(this, void 0, void 0, function* () {
980
981
  const { appId, buildTypeList, mainAppSerializeData, deployOptions, } = this._resolvedInputs;
981
982
  if ((0, common_2.buildAsAdminPortalByBuildType)(buildTypeList)) {
982
- try {
983
- const isPreview = (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === types_1.DEPLOY_MODE.PREVIEW;
984
- const id = isPreview ? `${appId}-preview` : appId;
985
- let name = (mainAppSerializeData === null || mainAppSerializeData === void 0 ? void 0 : mainAppSerializeData.label) || appId;
986
- name = isPreview ? `${name}-预览` : name;
987
- const params = {
988
- ID: id,
989
- Name: name,
990
- EnvId: this.api.envId,
991
- DeployUrl: `https://${path_1.default.join(this._website.cdnDomain, this._getWebRootPath())}?t=${Date.now()}`,
992
- Pages: ((mainAppSerializeData === null || mainAppSerializeData === void 0 ? void 0 : mainAppSerializeData.pageInstanceList) || [])
993
- .filter((page) => !page.hideAdminPortalMenu)
994
- .map((page) => {
995
- var _a, _b;
996
- return ({
997
- ID: page.id,
998
- Title: ((_b = (_a = page.data) === null || _a === void 0 ? void 0 : _a.title) === null || _b === void 0 ? void 0 : _b.value) || page.id,
999
- Path: `/${page.id}`,
1000
- });
1001
- }),
1002
- };
1003
- yield this.api.cloudbaseManager
1004
- .commonService('lowcode', '2021-01-08')
1005
- .call({
1006
- Action: 'CreateRouter',
1007
- Param: params,
1008
- });
1009
- this.api.logger.info('门户路由成功');
1010
- }
1011
- catch (e) {
1012
- this.api.logger.error('门户路由注册失败: ', e);
1013
- }
1014
983
  try {
1015
984
  if (((_b = (_a = this._resolvedInputs) === null || _a === void 0 ? void 0 : _a.deployOptions) === null || _b === void 0 ? void 0 : _b.mode) === types_1.DEPLOY_MODE.UPLOAD) {
1016
985
  yield this.api.cloudbaseManager
@@ -1136,13 +1105,9 @@ let previousStdoutWrite = process.stdout.write.bind(process.stdout);
1136
1105
  let previousStderrWrite = process.stderr.write.bind(process.stderr);
1137
1106
  function pauseConsoleOutput() {
1138
1107
  previousStdoutWrite = process.stdout.write;
1139
- process.stdout.write = () => {
1140
- return true;
1141
- };
1108
+ process.stdout.write = () => true;
1142
1109
  previousStderrWrite = process.stderr.write.bind(process.stderr);
1143
- process.stderr.write = () => {
1144
- return true;
1145
- };
1110
+ process.stderr.write = () => true;
1146
1111
  }
1147
1112
  function resumeConsoleOutput(original = false) {
1148
1113
  if (original) {
@@ -214,14 +214,7 @@ function translateStyleByHandler(style = {}, handler) {
214
214
  setStyleValue(result, key, value);
215
215
  }
216
216
  else if (value !== undefined && value !== null) {
217
- try {
218
-
219
217
  setStyleValue(result, key, handler(value));
220
- }catch(e){
221
- console.log(style,key,value)
222
- console.log(e)
223
- throw e
224
- }
225
218
  }
226
219
  return result;
227
220
  }, {});
@@ -264,7 +257,6 @@ function toREM(cssLen) {
264
257
  return calPxToREM(cssLen);
265
258
  }
266
259
  else {
267
- console.log(cssLen)
268
260
  throw new Error('cssLen type error');
269
261
  }
270
262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/framework-plugin-low-code",
3
- "version": "0.7.8",
3
+ "version": "0.7.10-beta.3",
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",