From 9018924760d878bccaaafb4afc4a810c45387183 Mon Sep 17 00:00:00 2001 From: Kavitha Date: Tue, 13 Aug 2024 10:00:21 -0400 Subject: [PATCH 1/3] add JSON as default supported language --- packages/demo/src/sample-code.ts | 27 ++++++++++++++++++++++ packages/generate-prism-languages/index.ts | 1 + 2 files changed, 28 insertions(+) diff --git a/packages/demo/src/sample-code.ts b/packages/demo/src/sample-code.ts index 6395ff3..34d6ff8 100644 --- a/packages/demo/src/sample-code.ts +++ b/packages/demo/src/sample-code.ts @@ -206,4 +206,31 @@ impl GroceryItem { } `, }, + ["JSON"]: { + language: "json", + code: ` + { + "id": 1, + "name": "John Doe", + "email": "johndoe@example.com", + "address": { + "street": "123 Main St", + "city": "San Diego", + "state": "CA", + "zip": "12345" + }, + "phoneNumbers": [ + { + "type": "home", + "number": "555-123-4567" + }, + { + "type": "work", + "number": "555-901-2345" + } + ], + "interests": ["reading", "hiking", "coding"] + } + `, + }, } diff --git a/packages/generate-prism-languages/index.ts b/packages/generate-prism-languages/index.ts index bea5226..31395f7 100644 --- a/packages/generate-prism-languages/index.ts +++ b/packages/generate-prism-languages/index.ts @@ -22,6 +22,7 @@ export const languagesToBundle = [ "cpp", "markdown", "python", + "json" ] /** From c22f8b04b4a0284d4bf191e10c8d1337323a33c5 Mon Sep 17 00:00:00 2001 From: Kavitha Date: Tue, 13 Aug 2024 10:08:16 -0400 Subject: [PATCH 2/3] add changeset --- .changeset/sweet-kiwis-shop.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/sweet-kiwis-shop.md diff --git a/.changeset/sweet-kiwis-shop.md b/.changeset/sweet-kiwis-shop.md new file mode 100644 index 0000000..8aadf71 --- /dev/null +++ b/.changeset/sweet-kiwis-shop.md @@ -0,0 +1,5 @@ +--- +"prism-react-renderer": minor +--- + +'Add JSON as default supported language' From c5f2b5d685925760cd3e3854fc05ae69e9db9c8d Mon Sep 17 00:00:00 2001 From: Kavitha Date: Tue, 13 Aug 2024 10:09:39 -0400 Subject: [PATCH 3/3] fix lint --- packages/generate-prism-languages/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/generate-prism-languages/index.ts b/packages/generate-prism-languages/index.ts index 31395f7..ca3b883 100644 --- a/packages/generate-prism-languages/index.ts +++ b/packages/generate-prism-languages/index.ts @@ -22,7 +22,7 @@ export const languagesToBundle = [ "cpp", "markdown", "python", - "json" + "json", ] /**