-
Notifications
You must be signed in to change notification settings - Fork 8
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
Mastodon support #307
Mastodon support #307
Conversation
🦋 Changeset detectedLatest commit: 232ab37 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #307 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 10 +3
Lines 190 230 +40
Branches 0 7 +7
=========================================
+ Hits 190 230 +40 ☔ View full report in Codecov by Sentry. |
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.
Copilot reviewed 7 out of 22 changed files in this pull request and generated 1 comment.
Files not reviewed (15)
- demo/package.json: Language not supported
- package.json: Language not supported
- packages/mastodon/package.json: Language not supported
- packages/everything/.eleventy.js: Evaluated as low risk
- demo/src/index.md: Evaluated as low risk
- packages/everything/lib/pluginDefaults.js: Evaluated as low risk
- demo/eleventy.config.js: Evaluated as low risk
- packages/everything/test/test-validatePlugins.js: Evaluated as low risk
- demo/src/mastodon.md: Evaluated as low risk
- .changeset/lemon-bugs-cross.md: Evaluated as low risk
- packages/mastodon/test/replace.test.mjs: Evaluated as low risk
- packages/mastodon/test/_validStrings.mjs: Evaluated as low risk
- packages/mastodon/test/_validUrls.mjs: Evaluated as low risk
- packages/mastodon/lib/defaults.js: Evaluated as low risk
- packages/mastodon/lib/pattern.js: Evaluated as low risk
Comments suppressed due to low confidence (3)
packages/mastodon/index.js:11
- The error message should be more descriptive. Suggested change: '[eleventy-plugin-embed-mastodon] You need to configure a Mastodon server URL. Please set the 'server' option in the plugin configuration to the hostname of your Mastodon instance.'
throw new Error("[eleventy-plugin-embed-mastodon] You need to configure a Mastodon server URL");
packages/mastodon/lib/replace.js:47
- [nitpick] The error message could be more descriptive by specifying which parameter is missing.
console.error("Missing Mastodon instance or status ID.");
packages/mastodon/lib/replace.js:74
- [nitpick] The error message could be more descriptive by specifying which parameter is missing.
console.error("Missing hostname or URL.");
const federatedStatusQuery = `https://${hostname}/api/v1/statuses/${id}`; | ||
try { | ||
const {url} = await Fetch(federatedStatusQuery, { | ||
duration: cacheDuration, |
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.
There is no validation to ensure that cacheDuration is in the correct format, which could lead to runtime errors.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Refactor tests
Add TODOs to pattern file Delete dead comment Start scaffolding out replace functions Basically works
Just some commentary Fix broken test
Try/Catch, plus some error testing Configure Vitest coverage Config, throw better errors Fix mocking, I think
Testing, console.error mocking, more reliable return values Tests, more resilient to failure cases More test coverage
Coverage: failing oembed case Remove redundant return values
Closes #210
This PR adds support for embedding Mastodon posts. Some things to know:
eleventy-plugin-embed-everything
. Here's how to activate it. (If you installeleventy-plugin-embed-mastodon
on its own, however, it will be active by default.)