Skip to content

Commit 5f58ed7

Browse files
cs-rajclaude
andcommitted
fix(utilities): add globalfields.json to readGlobalFieldSchemas ignore list
Prevents silent data corruption when a CLI v1 export archive containing global_fields/globalfields.json is passed to readGlobalFieldSchemas — the bulk array file is now skipped instead of being parsed as a single schema element. readContentTypeSchemas is unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ee6fd07 commit 5f58ed7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/contentstack-utilities/src/content-type-utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import { resolve as pResolve } from 'node:path';
77
* @param ignoredFiles - Files to ignore (defaults to schema.json, .DS_Store, __master.json, __priority.json)
88
* @returns Array of content type schemas (empty if the path is missing or has no eligible files)
99
*/
10+
const DEFAULT_GF_IGNORED_FILES = ['schema.json', '.DS_Store', '__master.json', '__priority.json', 'field_rules_uid.json', 'globalfields.json'];
11+
1012
export function readGlobalFieldSchemas(
1113
dirPath: string,
12-
ignoredFiles?: string[],
14+
ignoredFiles: string[] = DEFAULT_GF_IGNORED_FILES,
1315
): Record<string, unknown>[] {
1416
return readContentTypeSchemas(dirPath, ignoredFiles);
1517
}

0 commit comments

Comments
 (0)