Skip to content

Commit 7717c9f

Browse files
committed
Fix how app name is set from the AppLoader
1 parent 1b12e01 commit 7717c9f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/app/src/cli/models/app/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const LegacyAppSchema = zod
4848
.object({
4949
client_id: zod.number().optional(),
5050
name: zod.string().optional(),
51+
handle: zod.string().optional(),
5152
scopes: zod
5253
.string()
5354
.transform((scopes) => normalizeDelimitedString(scopes) ?? '')
@@ -80,6 +81,8 @@ function fixSingleWildcards(value: string[] | undefined) {
8081
*/
8182
export const AppSchema = zod.object({
8283
client_id: zod.string(),
84+
handle: zod.string().optional(),
85+
name: zod.string().optional(),
8386
build: zod
8487
.object({
8588
automatically_update_urls_on_dev: zod.boolean().optional(),
@@ -168,7 +171,7 @@ export function isLegacyAppSchema(item: AppConfiguration): item is LegacyAppConf
168171
*/
169172
export function isCurrentAppSchema(item: AppConfiguration): item is CurrentAppConfiguration {
170173
const {path, ...rest} = item
171-
return isType(AppSchema.nonstrict(), rest)
174+
return isType(AppSchema.passthrough(), rest)
172175
}
173176

174177
/**

packages/app/src/cli/models/app/loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class AppLoader<TConfig extends AppConfiguration, TModuleSpec extends ExtensionS
343343
const packageJSONPath = joinPath(directory, 'package.json')
344344

345345
// These don't need to be processed again if the app is being reloaded
346-
const name = this.previousApp?.name ?? (await loadAppName(directory))
346+
const name = this.previousApp?.name ?? configuration.handle ?? configuration.name ?? (await loadAppName(directory))
347347
const nodeDependencies = this.previousApp?.nodeDependencies ?? (await getDependencies(packageJSONPath))
348348
const packageManager = this.previousApp?.packageManager ?? (await getPackageManager(directory))
349349
const usesWorkspaces = this.previousApp?.usesWorkspaces ?? (await appUsesWorkspaces(directory))

0 commit comments

Comments
 (0)