RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/yan-labs/vite-tagger

Cursor rule

.cursor/rules/implementation-details.mdc

[object Object]

Cursor rules

Quality

30/100

Scores the file, not the repository.

Length

60 words

6 headings · 0 code blocks

Repository

1

— · pushed 368 days ago

Last changed

3 days ago

First indexed 3 days ago.
yan-labs/vite-tagger/.cursor/rules/implementation-details.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: false
5---
6# Vite Tagger 实现细节
7 
8## 核心实现
9 
10插件使用 [Babel](mdc:https:/babeljs.io) 解析JSX代码并使用 [estree-walker](mdc:https:/github.com/Rich-Harris/estree-walker) 遍历语法树,找到所有HTML元素并添加调试属性。
11 
12主要处理流程在 [src/index.ts](mdc:src/index.ts) 的 `viteTagger` 函数中:
13 
141. 解析配置选项
152. 解析源代码为AST
163. 遍历AST查找JSX元素
174. 为符合条件的元素添加调试属性
185. 返回修改后的代码
19 
20## 关键处理逻辑
21 
22### 元素内容提取
23 
24元素内容提取逻辑位于 `transform` 方法中:
25 
261. 提取元素的文本内容(递归处理嵌套元素)
272. 提取元素的关键属性(placeholder、className、id、title、alt等)
283. 构建content对象
294. 当content为空对象时,不添加`data-component-content`属性
30 
31### 3D元素过滤
32 
33插件内置了 Three.js 和 Drei 元素列表,可以通过配置选项 `filter3DElements` 来控制是否过滤这些3D元素。
34 
35## 测试
36 
37[src/index.test.ts](mdc:src/index.test.ts) 包含了多个测试用例,验证插件的核心功能:
38 
391. 测试文本内容提取
402. 测试简单按钮处理
413. 测试空内容元素不添加content属性
42 

Sections

  • Vite Tagger 实现细节
  • 核心实现
  • 关键处理逻辑
  • 元素内容提取
  • 3D元素过滤
  • 测试

Stack — with the evidence

typescript

(1.00)

vitest

(1.00)

node

(0.70)

vite

(0.70)

javascript

(0.60)

pnpm

(0.60)

github-actions

(0.60)

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
yan-labs
Language
—
License
—
Archived
no

All configs in this repo

Also in yan-labs/vite-tagger

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
yan-labs/vite-tagger.cursor/rules/plugin-usage.mdc · 1Cursor rulestypescriptvitest+5setup65/1003 days ago
yan-labs/vite-tagger.cursor/rules/project-overview.mdc · 1Cursor rulestypescriptvitest+5test32/1003 days ago
yan-labs/vite-tagger.cursor/rules/recent-changes.mdc · 1Cursor rulestypescriptvitest+5test35/1003 days ago
Diff against .cursor/rules/plugin-usage.mdc Diff against .cursor/rules/project-overview.mdc Diff against .cursor/rules/recent-changes.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack