@htyf-mp/cli 0.2.17 → 0.2.19
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/package.json +1 -1
- package/src/config.mjs +1 -1
- package/src/project-initializer.mjs +12 -1
package/package.json
CHANGED
package/src/config.mjs
CHANGED
|
@@ -42,7 +42,7 @@ export class ProjectConfig {
|
|
|
42
42
|
const timestamp = Date.now();
|
|
43
43
|
const randomUuid = uuidv4();
|
|
44
44
|
const uniqueString = `${timestamp}-${randomUuid}`;
|
|
45
|
-
return md5(uniqueString)
|
|
45
|
+
return `htyfapp${md5(uniqueString)}`;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
createProjectConfig(appName, displayName, appid, rotate) {
|
|
@@ -192,7 +192,18 @@ export class ProjectInitializer {
|
|
|
192
192
|
// 生成配置
|
|
193
193
|
spinner.text = '正在生成项目配置...';
|
|
194
194
|
const appid = this.config.generateAppId();
|
|
195
|
-
const projectConfig = this.config.createProjectConfig(appName, displayName, appid,
|
|
195
|
+
const projectConfig = this.config.createProjectConfig(appName, displayName, appid, 'portrait');
|
|
196
|
+
|
|
197
|
+
// 根据模板类型设置 htyf.type(app / game / web)
|
|
198
|
+
let appType = 'app';
|
|
199
|
+
if (templateType === CONSTANTS.TEMPLATE_TYPES.GAME_TEMPLATE) {
|
|
200
|
+
appType = 'game';
|
|
201
|
+
} else if (templateType === CONSTANTS.TEMPLATE_TYPES.WEB_TEMPLATE) {
|
|
202
|
+
appType = 'web';
|
|
203
|
+
} else if (templateType === CONSTANTS.TEMPLATE_TYPES.APP_TEMPLATE) {
|
|
204
|
+
appType = 'app';
|
|
205
|
+
}
|
|
206
|
+
projectConfig.type = appType;
|
|
196
207
|
// 写入配置文件
|
|
197
208
|
const configPath = path.join(appRootPath, 'app.json');
|
|
198
209
|
let existingConfig = {};
|