From c6eca4f81a669dbbfed7ddcb535bdb9fc81ea90a Mon Sep 17 00:00:00 2001 From: nikelborm Date: Sat, 25 Jul 2026 19:43:25 +0300 Subject: [PATCH] feat(ui): added support for Effect.ts playground links --- app/components/Package/Playgrounds.vue | 2 ++ server/utils/readme.ts | 7 +++++++ test/unit/server/utils/readme.spec.ts | 12 ++++++++++++ uno.theme.ts | 1 + 4 files changed, 22 insertions(+) diff --git a/app/components/Package/Playgrounds.vue b/app/components/Package/Playgrounds.vue index d6b6dd425b..3194e25065 100644 --- a/app/components/Package/Playgrounds.vue +++ b/app/components/Package/Playgrounds.vue @@ -9,6 +9,7 @@ const props = defineProps<{ const providerIcons: Record = { 'stackblitz': 'i-simple-icons:stackblitz', 'codesandbox': 'i-simple-icons:codesandbox', + 'effect-ts-playground': 'i-simple-icons:effect', 'codepen': 'i-simple-icons:codepen', 'replit': 'i-simple-icons:replit', 'gitpod': 'i-simple-icons:gitpod', @@ -28,6 +29,7 @@ const providerIcons: Record = { const providerColors: Record = { 'stackblitz': 'text-provider-stackblitz', 'codesandbox': 'text-provider-codesandbox', + 'effect-ts-playground': 'text-provider-effect', 'codepen': 'text-provider-codepen', 'replit': 'text-provider-replit', 'gitpod': 'text-provider-gitpod', diff --git a/server/utils/readme.ts b/server/utils/readme.ts index 717136f981..9cf2e92617 100644 --- a/server/utils/readme.ts +++ b/server/utils/readme.ts @@ -99,6 +99,13 @@ const PLAYGROUND_PROVIDERS: PlaygroundProvider[] = [ paths: ['/play'], icon: 'typescript', }, + { + id: 'effect-ts-playground', + name: 'Effect.ts Playground', + domains: ['effect.website'], + paths: ['/play'], + icon: 'effect', + }, { id: 'solid-playground', name: 'Solid Playground', diff --git a/test/unit/server/utils/readme.spec.ts b/test/unit/server/utils/readme.spec.ts index d24158d777..25d9833c25 100644 --- a/test/unit/server/utils/readme.spec.ts +++ b/test/unit/server/utils/readme.spec.ts @@ -91,6 +91,18 @@ describe('Playground Link Extraction', () => { expect(result.playgroundLinks[0]!.provider).toBe('codepen') }) + it('extracts Effect.ts playground links', async () => { + const markdown1 = `[Try it!](https://effect.website/play#3efe9f827b7d)` + const result1 = await renderReadmeHtml(markdown1, 'test-pkg') + + expect(result1.playgroundLinks[0]!.provider).toBe('effect-ts-playground') + + const markdown2 = `[Try it!](https://effect.website/play?code=Y29uc29sZS5sb2coKQ==)` + const result2 = await renderReadmeHtml(markdown2, 'test-pkg') + + expect(result2.playgroundLinks[0]!.provider).toBe('effect-ts-playground') + }) + it('extracts Replit links', async () => { const markdown = `[Repl](https://replit.com/@user/project)` const result = await renderReadmeHtml(markdown, 'test-pkg') diff --git a/uno.theme.ts b/uno.theme.ts index af97da1129..2afacb3c10 100644 --- a/uno.theme.ts +++ b/uno.theme.ts @@ -57,6 +57,7 @@ export const theme = { provider: { stackblitz: '#1389FD', codesandbox: '#FFCC00', + effect: '#000000', codepen: '#47CF73', replit: '#F26207', gitpod: '#FFAE33',