@shuji-bonji/rxjs-mcp 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.0] - 2026-05-17
9
+
10
+ ### Added
11
+ - **`lint_rxjs` ツール**: eslint-plugin-rxjs-x の recommended/strict ルールを正規表現ベースで再実装。コードスニペットを渡すだけで即座にフィードバック(ESLint 不要)
12
+ - **20 recommended ルール**: no-async-subscribe, no-create, no-nested-subscribe, no-sharereplay, prefer-root-operators, no-topromise, no-unsafe-takeuntil, throw-error 等
13
+ - **8 strict ルール**: no-exposed-subjects, no-floating-observables, no-misused-observables, no-subclass, finnish 等
14
+ - **フレームワーク固有ルール**: Angular (takeUntilDestroyed 推奨), React (useEffect 内 subscribe), Vue (onUnmounted cleanup)
15
+ - `config` パラメータ: `recommended`(デフォルト)/ `strict`
16
+ - `framework` パラメータ: `angular` / `react` / `vue` / `none`
17
+ - `rules` パラメータ: 個別ルール指定可能
18
+
19
+ ### Changed
20
+ - `DOC_BASE_URL` エイリアスを削除 (v0.3.0 で deprecated 告知済み)
21
+
8
22
  ## [0.3.0] - 2026-05-16
9
23
 
10
24
  ### BREAKING
package/README.md CHANGED
@@ -212,6 +212,31 @@ Available patterns:
212
212
  - `cache-refresh` - Cache with refresh strategy
213
213
  - And more...
214
214
 
215
+ ### lint_rxjs
216
+
217
+ Lint RxJS code snippets for common issues and best practices. Based on [eslint-plugin-rxjs-x](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x) rules.
218
+
219
+ ```typescript
220
+ // Parameters:
221
+ {
222
+ code: string; // RxJS code to lint
223
+ config?: 'recommended' | 'strict'; // Rule set (default: recommended)
224
+ framework?: 'angular' | 'react' | 'vue' | 'none'; // Framework context
225
+ rules?: string[]; // Specific rules to check (overrides config)
226
+ }
227
+ ```
228
+
229
+ **Config levels:**
230
+
231
+ - `recommended` — 20 rules covering the most common issues
232
+ - `strict` — All rules including style checks (finnish, no-exposed-subjects, etc.)
233
+
234
+ **Framework-specific checks:**
235
+
236
+ - **Angular** — Detects missing `takeUntilDestroyed()` or `takeUntil(destroy$)` in components
237
+ - **React** — Detects `subscribe()` without `useEffect` cleanup
238
+ - **Vue** — Detects `subscribe()` without `onUnmounted` cleanup
239
+
215
240
  ## Usage Examples
216
241
 
217
242
  ### With Claude
@@ -329,9 +354,42 @@ Future Meta-MCP integration will allow seamless coordination between these tools
329
354
  │ • analyze_operators│
330
355
  │ • detect_memory_leak│
331
356
  │ • suggest_pattern│
357
+ │ • lint_rxjs │
332
358
  └─────────────────┘
333
359
  ```
334
360
 
361
+ ## Documentation Reference System
362
+
363
+ Since v0.3.0, `analyze_operators` outputs three-tier documentation links for each operator and creation function:
364
+
365
+ | Tier | Source | Purpose | AI-readable? |
366
+ |------|--------|---------|:---:|
367
+ | **Official** | [rxjs.dev](https://rxjs.dev) | Authoritative API reference for humans | ❌ (SPA) |
368
+ | **Source** | [GitHub (tag 7.8.2)](https://github.com/ReactiveX/rxjs/tree/7.8.2/src/internal) | JSDoc + implementation — the richest context for AI | ✅ |
369
+ | **Guide** | [RxJS-with-TypeScript](https://github.com/shuji-bonji/RxJS-with-TypeScript) | Bilingual JP/EN explanations with practical examples | ✅ |
370
+
371
+ ### Why include the community guide alongside official docs?
372
+
373
+ 1. **rxjs.dev is a client-rendered SPA.** AI assistants cannot fetch its content — HTTP requests return an empty shell with JavaScript loaders. The official site is therefore a "link to hand to humans," not a source AI can read.
374
+
375
+ 2. **GitHub source provides raw truth.** The RxJS source code (pinned at tag `7.8.2`) contains JSDoc, type signatures, and implementation details. This is the primary reference for AI assistants.
376
+
377
+ 3. **The bilingual guide adds learning context.** It organizes operators by use-case (not just alphabetically), provides runnable examples, and offers Japanese translations. For Japanese-speaking users or learners, this fills a gap that neither rxjs.dev nor raw source addresses.
378
+
379
+ ### Priority order
380
+
381
+ When the MCP server outputs references, it follows this priority:
382
+
383
+ 1. `officialUrl` — always shown (authority, human-readable)
384
+ 2. `sourceUrl` — shown when available (AI should read this)
385
+ 3. `guideUrl` — shown when the page exists (supplementary)
386
+
387
+ If a guide page does not yet exist for an operator, the field is simply omitted (no broken link). Coverage is tracked by the [URL validation CI](.github/workflows/url-validation.yml).
388
+
389
+ ### Can I disable the guide references?
390
+
391
+ Currently there is no runtime option to exclude `guideUrl` from output. If you prefer official-only references, you can fork this server or open a feature request. A future version may support a `--references=official,source` flag.
392
+
335
393
  ## Contributing
336
394
 
337
395
  Contributions are welcome! Please feel free to submit a PR.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * RxJS Lint Rules Database
3
+ *
4
+ * Regex-based reimplementation of eslint-plugin-rxjs-x rules.
5
+ * These rules work on code snippets without requiring ESLint runtime or TypeScript parser.
6
+ *
7
+ * Reference: https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x
8
+ */
9
+ export type LintSeverity = 'error' | 'warning' | 'info';
10
+ export type LintConfig = 'recommended' | 'strict';
11
+ export type FrameworkContext = 'angular' | 'react' | 'vue' | 'none';
12
+ export interface LintDiagnostic {
13
+ rule: string;
14
+ severity: LintSeverity;
15
+ message: string;
16
+ line?: number;
17
+ suggestion?: string;
18
+ docUrl: string;
19
+ }
20
+ export interface LintRule {
21
+ name: string;
22
+ description: string;
23
+ severity: LintSeverity;
24
+ config: LintConfig;
25
+ /** Whether this rule requires type information (cannot be fully checked with regex) */
26
+ requiresTypeInfo: boolean;
27
+ docUrl: string;
28
+ check: (code: string, framework: FrameworkContext) => LintDiagnostic[];
29
+ }
30
+ export declare const allLintRules: LintRule[];
31
+ /** Get rules for a given config level */
32
+ export declare function getRulesForConfig(config: LintConfig): LintRule[];
33
+ //# sourceMappingURL=lint-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint-rules.d.ts","sourceRoot":"","sources":["../../src/data/lint-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,uFAAuF;IACvF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,KAAK,cAAc,EAAE,CAAC;CACxE;AAigCD,eAAO,MAAM,YAAY,EAAE,QAAQ,EAiClC,CAAC;AAEF,yCAAyC;AACzC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,EAAE,CAMhE"}