tt-minigame-ide-cli 1.0.2-beta.0 → 1.0.3-beta.0

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/preview.js CHANGED
@@ -28,7 +28,7 @@ async function preview(entry, options) {
28
28
  }
29
29
  }
30
30
 
31
- const { success, msg, appId, appConfig, } = await checkBeforeUpload(entry);
31
+ const { success, msg, appId } = await checkBeforeUpload(entry);
32
32
  if (!success) {
33
33
  const errMsg = `[CLI PREVIEW ERROR]: ${msg}`;
34
34
  console.log(chalk.red(errMsg));
@@ -38,7 +38,7 @@ async function preview(entry, options) {
38
38
 
39
39
  const tempDir = options.tempDir || path.join(__dirname, '../temp');
40
40
  await fs.emptyDir(tempDir);
41
- const { filePath } = await zipFile(entry, tempDir);
41
+ const { filePath, gameConfig } = await zipFile(entry, tempDir);
42
42
  if (!filePath) {
43
43
  const errMsg = `[CLI PREVIEW ERROR]`;
44
44
  console.log(chalk.red(errMsg));
@@ -50,7 +50,7 @@ async function preview(entry, options) {
50
50
  appId,
51
51
  zipPath: filePath,
52
52
  proxy: options.proxy,
53
- appConfig,
53
+ gameConfig
54
54
  });
55
55
 
56
56
  outputResult('info', 'WAIT', 'Compiling...\n');
package/lib/upload.js CHANGED
@@ -45,7 +45,6 @@ async function upload(entry, options) {
45
45
  success: beforeSuccess,
46
46
  msg: beforeMsg,
47
47
  appId,
48
- appConfig,
49
48
  } = await checkBeforeUpload(entry);
50
49
  if (!beforeSuccess) {
51
50
  const errMsg = `[CLI UPLOAD ERROR]: ${beforeMsg}`;
@@ -76,7 +75,7 @@ async function upload(entry, options) {
76
75
  throw new Error(errMsg);
77
76
  }
78
77
 
79
- const { filePath } = await zipFile(entry, tempDir);
78
+ const { filePath, gameConfig } = await zipFile(entry, tempDir);
80
79
  if (!filePath) {
81
80
  const errMsg = `[CLI UPLOAD ERROR]`;
82
81
  console.log(chalk.red(errMsg));
@@ -89,7 +88,7 @@ async function upload(entry, options) {
89
88
  versionInfo: options.appVersion,
90
89
  updateInfo: options.appChangelog,
91
90
  proxy: options.proxy,
92
- appConfig,
91
+ gameConfig,
93
92
  });
94
93
 
95
94
  outputResult('info', 'WAIT', 'Compiling...\n');
package/lib/util/check.js CHANGED
@@ -50,7 +50,7 @@ async function checkBeforeUpload(entry) {
50
50
  )} command`,
51
51
  };
52
52
  }
53
- return { success: true, appId, appConfig };
53
+ return { success: true, appId };
54
54
  }
55
55
  // 该方法暂无调用
56
56
  async function checkNeedUpdate() {
@@ -29,6 +29,7 @@ async function zipFile(sourcePath, targetPath) {
29
29
  const subPackagesArr = projectConfigJson.subPackages || projectConfigJson.subpackages;
30
30
  const zipFileRet = {
31
31
  filePath: null,
32
+ gameConfig: projectConfigJson,
32
33
  };
33
34
  if (subPackagesArr && subPackagesArr.length > 0) {
34
35
  const ifSubPackageUploadable = await verifySubPackageSize(projectConfigJson, sourcePath);
@@ -169,7 +169,7 @@ exports.uploadProject = function ({
169
169
  versionInfo,
170
170
  updateInfo,
171
171
  proxy,
172
- appConfig
172
+ gameConfig,
173
173
  }) {
174
174
  return new Promise(function (resolve, reject) {
175
175
  let path;
@@ -186,8 +186,7 @@ exports.uploadProject = function ({
186
186
  // form.append('render_type', 3);
187
187
  form.append('source', fs.createReadStream(zipPath));
188
188
  form.append('local_compile_version', '4.0.0-rc.12.ide');
189
- const hasSubPackages = (appConfig.subPackages || appConfig.subpackages || []).length > 0;
190
- form.append('subpackage', hasSubPackages.toString());
189
+ form.append('subpackage', String((gameConfig.subPackages || gameConfig.subpackages || []).length > 0));
191
190
  const uploadOptions = {
192
191
  method: 'put',
193
192
  headers: {
@@ -392,6 +391,6 @@ exports.checkUploadVersion = async function (appId, version) {
392
391
 
393
392
  const getProjectReleaseVersion = async function (appId) {
394
393
  const res = await axios.get(`/api/apps/v3/meta?appid=${appId}&aid=13&version=current&ttcode=OVCNW/U0UREwv0sHdY9Rm16vBgGrCQIBOWurUCmJ1H6d/2XHLKeOYTYfEJIEeC0AOCwBZAR2j34C4tFN7Nqfq9tHVEpM4OuJM2b8qz0INtUs1qLhKFOtnGa9/Ey0WW86GGocJk074eP72MMhzNmePzaTQzXwn/eqEq4GHwyF2Tg=&t=${new Date().getTime()}`)
395
- return res.data.data.version;
394
+ return res.data.data.version || '0.0.0';
396
395
  }
397
396
  exports.getProjectReleaseVersion = getProjectReleaseVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "1.0.2-beta.0",
3
+ "version": "1.0.3-beta.0",
4
4
  "description": "Command line interface for micro app development",
5
5
  "main": "lib/index.js",
6
6
  "bin": {