@htyf-mp/cli 0.2.0-alpha.13 → 0.2.0-alpha.14

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/build.mjs +9 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htyf-mp/cli",
3
- "version": "0.2.0-alpha.13",
3
+ "version": "0.2.0-alpha.14",
4
4
  "description": "红糖云服app小程序模板-cli",
5
5
  "type": "module",
6
6
  "bin": {
package/src/build.mjs CHANGED
@@ -100,7 +100,7 @@ export async function mpBuildShell(newAppInfo, isGodot) {
100
100
  const scriptName = getMiniAppScriptId(appid, version);
101
101
 
102
102
  const appJson = {
103
- type: 'app',
103
+ type: isGodot ? 'game' : 'app',
104
104
  engines: '2.0.0',
105
105
  name: newAppInfo.name,
106
106
  appid,
@@ -110,7 +110,7 @@ export async function mpBuildShell(newAppInfo, isGodot) {
110
110
  };
111
111
 
112
112
  let outputPath = path.join(mpOutputPath, 'dist');
113
- const distPackagePath = path.join(mpOutputPath, 'dist.dgz');
113
+ let distPackagePath = path.join(mpOutputPath, 'dist.dgz');
114
114
  const rootIndexPath = path.join(tempPath, '..', 'index.js');
115
115
 
116
116
  const mpOptions = {
@@ -154,6 +154,13 @@ export async function mpBuildShell(newAppInfo, isGodot) {
154
154
  await fse.ensureDir(outputPath);
155
155
  await fse.emptyDir(outputPath);
156
156
  await exportGodot(godotOptions);
157
+
158
+ // Godot 项目使用平台特定的文件名
159
+ const platformName = godotOptions.platform === 'ios' ? 'ios' : 'android';
160
+ distPackagePath = path.join(mpOutputPath, `dist.${platformName}.dgz`);
161
+ // 更新 appJson 中的 zipUrl
162
+ appJson.zipUrl = newAppInfo.zipUrl || `${newAppInfo.host}/dist.${platformName}.dgz`;
163
+ await fse.writeJson(appJsonPath, appJson, { spaces: 2 });
157
164
  }
158
165
 
159
166
  await fse.ensureDir(outputPath);