@cloudbase/framework-plugin-low-code 0.6.10 → 0.6.11

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":"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,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE;QACP,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B,GAAG,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC,CA6RvC;AAkKD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EACd,GAAG,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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"}
@@ -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
- yield generateFramework(mainAppData, miniprogramRoot, buildContext);
101
- let appFileData = {
102
- 'common/style.js': {},
103
- 'common/utils.wxs': {
104
- domain: domain,
105
- },
106
- 'common/util.js': {
107
- isAdminPortal: common_1.buildAsAdminPortalByBuildType(buildTypeList),
108
- },
109
- 'common/widget.js': {},
110
- 'common/url.js': {},
111
- 'common/weapp-sdk.js': {},
112
- 'common/weapp-page.js': {
113
- dataPropNames: wxmlDataPrefix,
114
- debug: !buildContext.isProduction,
115
- },
116
- 'common/weapp-component.js': {},
117
- 'common/merge-renderer.js': {
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
- const datasourceFileData = {
172
- 'datasources/index.js': {},
173
- 'datasources/config.js.tpl': {
174
- envID: mainAppData.envId,
175
- appID: appId,
176
- resourceAppid: !!options.isCrossAccount ? options.resourceAppid : '',
177
- isProd: deployMode === types_1.DEPLOY_MODE.UPLOAD,
178
- },
179
- 'datasources/datasource-profiles.js.tpl': {
180
- datasourceProfiles: util_3.JsonToStringWithVariableName(dataSource_1.getDatasourceProfiles(weapps.reduce((datasources, app) => {
181
- datasources.push(...(app.datasources || []));
182
- return datasources;
183
- }, []))),
184
- },
185
- 'datasources/dataset-profiles.js.tpl': {
186
- datasetProfiles: util_3.JsonToStringWithVariableName(dataSource_1.getDatasetProfiles(mainAppData, weapps)),
187
- },
188
- };
189
- console.log('Generating ' + em('datasources') + ' files');
190
- yield generateFiles_1.default(datasourceFileData, templateDir, miniprogramRoot, buildContext);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/framework-plugin-low-code",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
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",