feat: separate Chinese display name and English packaging name

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-28 08:54:43 +08:00
parent aef449e0e4
commit edf2bdada6
11 changed files with 104 additions and 28 deletions

View File

@@ -61,6 +61,7 @@ export async function uploadSiteZip(jobId: string, zipBuffer: Buffer): Promise<v
export async function triggerBuildWorkflow(input: {
jobId: string;
appName: string;
appNameEn: string;
appIdentifier: string;
}): Promise<number> {
const { owner, repo } = getGitHubConfig();
@@ -74,6 +75,7 @@ export async function triggerBuildWorkflow(input: {
inputs: {
job_id: input.jobId,
app_name: input.appName,
app_name_en: input.appNameEn,
app_identifier: input.appIdentifier,
},
});

View File

@@ -154,6 +154,27 @@ function sanitizeSegment(segment: string): string {
return value.slice(0, 48);
}
export function validateEnglishAppName(input: string): string {
const value = input.trim();
if (!value) {
throw new ZipValidationError("应用英文名不能为空");
}
if (!/^[a-zA-Z][a-zA-Z0-9 _.-]*$/.test(value)) {
throw new ZipValidationError(
"应用英文名需以字母开头,仅支持英文字母、数字、空格、下划线和连字符",
);
}
return value;
}
export function validateChineseAppName(input: string): string {
const value = input.trim();
if (!value) {
throw new ZipValidationError("应用中文名不能为空");
}
return value;
}
export function slugifyIdentifier(input: string): string {
return input
.toLowerCase()