Skip to content

feat/vue standard protocol antfu#2

Merged
suradet-ps merged 4 commits intomainfrom
feat/vue-standard-protocol-antfu
Dec 8, 2025
Merged

feat/vue standard protocol antfu#2
suradet-ps merged 4 commits intomainfrom
feat/vue-standard-protocol-antfu

Conversation

@suradet-ps
Copy link
Copy Markdown
Owner

@suradet-ps suradet-ps commented Dec 8, 2025

add new article

Summary by Sourcery

Add a new blog article detailing a Vue.js ESLint/Antfu standard setup and introduce a reusable YouTube embed content component for use within posts.

New Features:

  • Introduce a styled YouTube embed Astro component for responsive video embeds in content pages.
  • Publish a new featured blog post on setting up a production-ready Vue.js linting and CI workflow.

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rxdevnotes Ready Ready Preview Comment Dec 8, 2025 7:53am

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Dec 8, 2025

Reviewer's Guide

Adds a new blog article about setting up ESLint + Husky + lint-staged + GitHub Actions for Vue, and introduces a reusable YouTube embed Astro component wired into the MDX/MD content pipeline.

Sequence diagram for rendering MDX blog with YouTube embed

sequenceDiagram
  actor User
  participant Browser
  participant AstroServer
  participant MDXCompiler
  participant YouTube_astro as YouTubeComponent

  User->>Browser: Request vue_standard_protocol_antfu article
  Browser->>AstroServer: HTTP GET /blog/vue-standard-protocol-antfu
  AstroServer->>MDXCompiler: Render MDX file vue-standard-protocol-antfu_mdx
  MDXCompiler->>YouTube_astro: Instantiate with id and title props
  YouTube_astro-->>MDXCompiler: HTML iframe markup
  MDXCompiler-->>AstroServer: Rendered HTML for article
  AstroServer-->>Browser: Send full HTML response
  Browser->>Browser: Layout blog content and embedded iframe
  Browser-->>User: Display article with YouTube video
Loading

Class diagram for the new YouTube Astro content component

classDiagram
  class YouTube_astro {
    +string id
    +string title
    +render(props)
  }

  class MDX_Blog_Article {
    +render()
  }

  MDX_Blog_Article --> YouTube_astro : uses
Loading

File-Level Changes

Change Details Files
Register a new Astro content component for embedding YouTube videos in MDX/MD content.
  • Extend the Astro content collections configuration to include the new YouTube content component path so it can be used inside MDX files.
  • Ensure the component is available to be imported/used as a JSX-like tag in content (e.g., ).
astro.config.mjs
Add a new blog article describing a Vue production-ready linting and CI setup using Antfu's ESLint config.
  • Create a new MDX blog post with frontmatter metadata (title, description, dates, category, tags, featured flag, hero image).
  • Use various custom content components (YouTube, GitCommand, CodeExplainer, InfoBox, FeatureGrid, FeatureCard) within the article body for richer presentation.
  • Include example configuration snippets for ESLint, VS Code, Husky, lint-staged, and GitHub Actions.
src/content/blog/vue-standard-protocol-antfu.mdx
Implement a styled, responsive YouTube embed component for use in content pages.
  • Define a typed Astro component that receives a video id and optional title and renders a YouTube iframe embed URL.
  • Apply responsive 16:9 aspect ratio, border radius, card-like styling, and box shadow using CSS scoped to the component.
  • Enable lazy loading and appropriate iframe permissions for better performance and UX.
src/components/content/YouTube.astro

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Consider adding a referrerpolicy="strict-origin-when-cross-origin" (or similar) on the YouTube iframe to improve privacy and align with modern embed best practices.
  • The YouTube component defaults title to a generic value; for better accessibility, it may be worth making title required at call sites (or at least documenting/enforcing more descriptive titles for embedded videos.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a `referrerpolicy="strict-origin-when-cross-origin"` (or similar) on the YouTube iframe to improve privacy and align with modern embed best practices.
- The YouTube component defaults `title` to a generic value; for better accessibility, it may be worth making `title` required at call sites (or at least documenting/enforcing more descriptive titles for embedded videos.

## Individual Comments

### Comment 1
<location> `src/components/content/YouTube.astro:11-17` </location>
<code_context>
+---
+
+<div class="video-container">
+  <iframe
+    src={`https://www.youtube.com/embed/${id}`}
+    title={title}
+    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+    allowfullscreen
+    loading="lazy"
+  ></iframe>
+</div>
</code_context>

<issue_to_address>
**🚨 suggestion (security):** Tighten iframe attributes for privacy/security and slightly better UX.

Since this embed will be reused, consider hardening the defaults: add a `referrerpolicy` (e.g. `strict-origin-when-cross-origin`) to reduce referrer leakage, remove `autoplay` from `allow` unless you explicitly need programmatic autoplay, and optionally append `?rel=0` to the `src` to avoid unrelated recommendations at the end of playback.

```suggestion
  <iframe
    src={`https://www.youtube.com/embed/${id}?rel=0`}
    title={title}
    allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
    referrerpolicy="strict-origin-when-cross-origin"
    allowfullscreen
    loading="lazy"
  ></iframe>
```
</issue_to_address>

### Comment 2
<location> `src/content/blog/vue-standard-protocol-antfu.mdx:129-133` </location>
<code_context>
+    "prepare": "husky"
+  },
+  "lint-staged": {
+    "*.{js,ts,vue,md,json}": [
+      "eslint --fix"
+    ]
</code_context>

<issue_to_address>
**suggestion:** `lint-staged` pattern omits some likely-relevant file types such as config files.

The current glob only matches `js,ts,vue,md,json`, so files like `eslint.config.mjs`, other `*.mjs`/`*.cjs` configs, and `*.tsx`/`*.jsx` won’t be linted on commit. Consider broadening it (e.g. `*.{js,ts,jsx,tsx,vue,md,json,mjs,cjs}`) so all relevant source/config files are covered.

```suggestion
  "lint-staged": {
    "*.{js,ts,jsx,tsx,vue,md,json,mjs,cjs}": [
      "eslint --fix"
    ]
  }
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/components/content/YouTube.astro
Comment thread src/content/blog/vue-standard-protocol-antfu.mdx
@suradet-ps suradet-ps merged commit a69b815 into main Dec 8, 2025
5 checks passed
@suradet-ps suradet-ps deleted the feat/vue-standard-protocol-antfu branch December 8, 2025 07:55
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant