Skip to content

Commit fe708e8

Browse files
authoredJan 10, 2025··
fix: ensures singleworkspace falls back to the name 'default' as expected in all contexts (#8228)
1 parent 86c6ab1 commit fe708e8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎packages/sanity/src/core/config/__tests__/resolveConfig.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ describe('resolveConfig', () => {
3939

4040
const [workspace] = await firstValueFrom(
4141
resolveConfig({
42-
name: 'default',
42+
//the default name should be 'default', in both the workspace and the unstable_sources
43+
//name: 'default',
4344
dataset,
4445
projectId,
4546
auth: createMockAuthStore({client, currentUser: null}),

‎packages/sanity/src/core/config/prepareConfig.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function prepareConfig(
103103
const rootPath = getRootPath(options?.basePath)
104104
const workspaceOptions: WorkspaceOptions[] | [SingleWorkspace] = Array.isArray(config)
105105
? config
106-
: [config]
106+
: [{...config, name: config.name ?? 'default'}]
107107

108108
try {
109109
validateWorkspaces({workspaces: workspaceOptions})

0 commit comments

Comments
 (0)
Please sign in to comment.