Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli/setup-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ const updateProjectConfig = async (projectName) => {
const contents = fs.readFileSync(configPath, {
encoding: 'utf-8',
});
// Schemes first, lowercase only. /ObytesApp/gi also matches `obytesapp`
// and would copy PascalCase from the project name (breaks EAS Update).
const scheme = projectName.toLowerCase().replace(/[^a-z0-9+.-]/g, '');
const replaced = contents
.replace(/ObytesApp/gi, projectName)
.replace(/obytesapp/g, scheme)
.replace(/ObytesApp/g, projectName)
.replace(/com.obytes/gi, `com.${projectName.toLowerCase()}`)
.replace(/obytes/gi, 'expo-owner');

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import packageJSON from './package.json';
const envSchema = z.object({
EXPO_PUBLIC_APP_ENV: z.enum(['development', 'preview', 'production']),
EXPO_PUBLIC_NAME: z.string(),
EXPO_PUBLIC_SCHEME: z.string(),
EXPO_PUBLIC_SCHEME: z.string().regex(/^[a-z][a-z0-9+.-]*$/),
EXPO_PUBLIC_BUNDLE_ID: z.string(),
EXPO_PUBLIC_PACKAGE: z.string(),
EXPO_PUBLIC_VERSION: z.string(),
Expand Down Expand Up @@ -35,10 +35,13 @@ const PACKAGES = {
production: 'com.obytes',
} as const;

// URL schemes must be lowercase. EAS Update rejects PascalCase
// (e.g. obytesApp) with: scheme must match ^[a-z][a-z0-9+.-]*$.
// Display NAME can stay mixed-case.
const SCHEMES = {
development: 'obytesApp',
preview: 'obytesApp.preview',
production: 'obytesApp',
development: 'obytesapp',
preview: 'obytesapp.preview',
production: 'obytesapp',
} as const;

const NAME = 'ObytesApp';
Expand Down