run on ios

This commit is contained in:
2026-10-07 13:00:58 +02:00
parent aa647ee869
commit 7fb87fbb96
3 changed files with 46 additions and 4 deletions
+20 -2
View File
@@ -37,6 +37,22 @@ const project = await p.group(
]
})
,
bundleid: async ({ results }) => {
if (results.mobile !== "expo") return ""
// Valid as both an iOS bundle identifier and an Android package name.
const fallback = `com.${String(results.name).toLowerCase().replace(/[^a-z0-9]/g, "").replace(/^[0-9]+/, "") || "app"}.mobile`
return await p.text({
message: "What bundle identifier should the mobile app use?",
placeholder: fallback,
defaultValue: fallback,
validate: (value) => {
if (value && !/^[a-zA-Z][a-zA-Z0-9]*(\.[a-zA-Z][a-zA-Z0-9]*)+$/.test(value)) {
return "Use reverse-DNS segments of letters and digits, e.g. com.example.app"
}
return undefined
},
})
},
goprefix: () =>
p.text({
message: "What would you like to use as a go package prefix?",
@@ -65,11 +81,13 @@ const render = createRenderer(z.object({
name: z.string(),
goprefix: z.string(),
frontend: z.string(),
mobile: z.string()
mobile: z.string(),
bundleid: z.string()
})
}))
const destDir = path.join("./", project.name);
render(destDir, { project }, { reverseMap: true })
// `results` in the bundleid prompt makes group() infer it as unknown.
render(destDir, { project: { ...project, bundleid: project.bundleid as string } }, { reverseMap: true })
const s = p.spinner();
if (project.installDeps) {