From a89614851f71eb8b0abcea6d31335d04135513ab Mon Sep 17 00:00:00 2001 From: Alistair Pullen Date: Tue, 2 Sep 2025 14:56:42 +0000 Subject: [PATCH 1/2] fix: added support for JSON and JSON Lines file extensions in Info.plist Co-authored-by: Genie --- JSONViewer.xcodeproj/project.pbxproj | 8 ++++++-- JSONViewer/Info.plist | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/JSONViewer.xcodeproj/project.pbxproj b/JSONViewer.xcodeproj/project.pbxproj index 1b435f9..065465e 100644 --- a/JSONViewer.xcodeproj/project.pbxproj +++ b/JSONViewer.xcodeproj/project.pbxproj @@ -407,11 +407,13 @@ CFBundleTypeName = "JSON Document"; CFBundleTypeRole = Viewer; LSItemContentTypes = ( "public.json" ); + CFBundleTypeExtensions = ( "json" ); }, { CFBundleTypeName = "JSON Lines Document"; CFBundleTypeRole = Viewer; LSItemContentTypes = ( "org.jsonlines.jsonl" ); + CFBundleTypeExtensions = ( "jsonl", "ndjson" ); }, ); INFOPLIST_KEY_UTImportedTypeDeclarations = ( @@ -419,7 +421,7 @@ UTTypeIdentifier = "org.jsonlines.jsonl"; UTTypeDescription = "JSON Lines Document"; UTTypeConformsTo = ( "public.plain-text" ); - UTTypeTagSpecification = { "public.filename-extension" = ( "jsonl" ); "public.mime-type" = "application/x-ndjson"; }; + UTTypeTagSpecification = { "public.filename-extension" = ( "jsonl", "ndjson" ); "public.mime-type" = ( "application/x-ndjson", "application/ndjson" ); }; }, ); INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -455,11 +457,13 @@ CFBundleTypeName = "JSON Document"; CFBundleTypeRole = Viewer; LSItemContentTypes = ( "public.json" ); + CFBundleTypeExtensions = ( "json" ); }, { CFBundleTypeName = "JSON Lines Document"; CFBundleTypeRole = Viewer; LSItemContentTypes = ( "org.jsonlines.jsonl" ); + CFBundleTypeExtensions = ( "jsonl", "ndjson" ); }, ); INFOPLIST_KEY_UTImportedTypeDeclarations = ( @@ -467,7 +471,7 @@ UTTypeIdentifier = "org.jsonlines.jsonl"; UTTypeDescription = "JSON Lines Document"; UTTypeConformsTo = ( "public.plain-text" ); - UTTypeTagSpecification = { "public.filename-extension" = ( "jsonl" ); "public.mime-type" = "application/x-ndjson"; }; + UTTypeTagSpecification = { "public.filename-extension" = ( "jsonl", "ndjson" ); "public.mime-type" = ( "application/x-ndjson", "application/ndjson" ); }; }, ); INFOPLIST_KEY_NSHumanReadableCopyright = ""; diff --git a/JSONViewer/Info.plist b/JSONViewer/Info.plist index 28af1f4..edbc85a 100644 --- a/JSONViewer/Info.plist +++ b/JSONViewer/Info.plist @@ -29,6 +29,10 @@ public.json + CFBundleTypeExtensions + + json + CFBundleTypeName @@ -39,6 +43,11 @@ org.jsonlines.jsonl + CFBundleTypeExtensions + + jsonl + ndjson + @@ -59,9 +68,13 @@ public.filename-extension jsonl + ndjson public.mime-type - application/x-ndjson + + application/x-ndjson + application/ndjson + From 440f51d8bdbc6ba77bfd1a7011d1a73b62149ec0 Mon Sep 17 00:00:00 2001 From: Alistair Pullen Date: Tue, 2 Sep 2025 15:43:01 +0000 Subject: [PATCH 2/2] chore: disable plist generation and specify Info.plist file Co-authored-by: Genie --- JSONViewer.xcodeproj/project.pbxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/JSONViewer.xcodeproj/project.pbxproj b/JSONViewer.xcodeproj/project.pbxproj index 065465e..69957a6 100644 --- a/JSONViewer.xcodeproj/project.pbxproj +++ b/JSONViewer.xcodeproj/project.pbxproj @@ -399,7 +399,8 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"JSONViewer/Preview Content\""; ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; + GENERATE_INFOPLIST_FILE = NO; + INFOPLIST_FILE = JSONViewer/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Prism; INFOPLIST_KEY_CFBundleName = Prism; INFOPLIST_KEY_CFBundleDocumentTypes = ( @@ -449,7 +450,8 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"JSONViewer/Preview Content\""; ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; + GENERATE_INFOPLIST_FILE = NO; + INFOPLIST_FILE = JSONViewer/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Prism; INFOPLIST_KEY_CFBundleName = Prism; INFOPLIST_KEY_CFBundleDocumentTypes = (