tt-minigame-ide-cli 1.0.1 → 1.0.2-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 +8 -2
- package/lib/upload.js +3 -1
- package/lib/util/check.js +1 -1
- package/lib/util/request.js +4 -1
- package/package.json +1 -1
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 } = await checkBeforeUpload(entry);
|
31
|
+
const { success, msg, appId, appConfig, } = await checkBeforeUpload(entry);
|
32
32
|
if (!success) {
|
33
33
|
const errMsg = `[CLI PREVIEW ERROR]: ${msg}`;
|
34
34
|
console.log(chalk.red(errMsg));
|
@@ -45,7 +45,13 @@ async function preview(entry, options) {
|
|
45
45
|
throw new Error(errMsg);
|
46
46
|
return;
|
47
47
|
}
|
48
|
-
await uploadProject({
|
48
|
+
await uploadProject({
|
49
|
+
type: 'preview',
|
50
|
+
appId,
|
51
|
+
zipPath: filePath,
|
52
|
+
proxy: options.proxy,
|
53
|
+
appConfig,
|
54
|
+
});
|
49
55
|
|
50
56
|
outputResult('info', 'WAIT', 'Compiling...\n');
|
51
57
|
return await new Promise((resolve, reject) => {
|
package/lib/upload.js
CHANGED
@@ -44,7 +44,8 @@ async function upload(entry, options) {
|
|
44
44
|
const {
|
45
45
|
success: beforeSuccess,
|
46
46
|
msg: beforeMsg,
|
47
|
-
appId
|
47
|
+
appId,
|
48
|
+
appConfig,
|
48
49
|
} = await checkBeforeUpload(entry);
|
49
50
|
if (!beforeSuccess) {
|
50
51
|
const errMsg = `[CLI UPLOAD ERROR]: ${beforeMsg}`;
|
@@ -88,6 +89,7 @@ async function upload(entry, options) {
|
|
88
89
|
versionInfo: options.appVersion,
|
89
90
|
updateInfo: options.appChangelog,
|
90
91
|
proxy: options.proxy,
|
92
|
+
appConfig,
|
91
93
|
});
|
92
94
|
|
93
95
|
outputResult('info', 'WAIT', 'Compiling...\n');
|
package/lib/util/check.js
CHANGED
package/lib/util/request.js
CHANGED
@@ -168,7 +168,8 @@ exports.uploadProject = function ({
|
|
168
168
|
zipPath,
|
169
169
|
versionInfo,
|
170
170
|
updateInfo,
|
171
|
-
proxy
|
171
|
+
proxy,
|
172
|
+
appConfig
|
172
173
|
}) {
|
173
174
|
return new Promise(function (resolve, reject) {
|
174
175
|
let path;
|
@@ -185,6 +186,8 @@ exports.uploadProject = function ({
|
|
185
186
|
// form.append('render_type', 3);
|
186
187
|
form.append('source', fs.createReadStream(zipPath));
|
187
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());
|
188
191
|
const uploadOptions = {
|
189
192
|
method: 'put',
|
190
193
|
headers: {
|