-
-
Notifications
You must be signed in to change notification settings - Fork 502
feat(ui): added support for Effect.ts playground links #3082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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') | ||
| }) | ||
|
Comment on lines
+94
to
+104
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Assert the link exists before indexing the array. Both assertions use As per coding guidelines, array values accessed by index must be checked. 🤖 Prompt for AI AgentsSource: Coding guidelines
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same feedback applies to the test, which was used as a base for this addition. Polishing the tests regarding this issue needs refactoring that is outside the scope of this PR.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Would you like me to open a follow-up issue for it? |
||
|
|
||
| it('extracts Replit links', async () => { | ||
| const markdown = `[Repl](https://replit.com/@user/project)` | ||
| const result = await renderReadmeHtml(markdown, 'test-pkg') | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Avoid prefix matching for the
/playroute.The matcher uses
pathname.startsWith(path), so this entry also classifies URLs such as/playgroundand/playeras Effect.ts playgrounds. Match the exact route or a segment descendant (/playand/play/...) and add a near-match regression test.🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same feedback applies to the TypeScript case, which was used as a base for this addition. Fixing the prefix issue needs refactoring that is outside the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikelborm, agreed — this is pre-existing shared matcher behaviour, including the TypeScript provider, rather than a regression unique to the Effect.ts addition. I’ll leave it out of this PR. Would you like me to open a follow-up issue to tighten path matching across all providers?