Skip to content

fix(analyzer): Fastify autoload prefixes, route params, SvelteKit @ folders, SQL entity names - #127

Merged
itsflaid merged 2 commits into
mainfrom
improve/analyzer-detection-accuracy
Oct 28, 2026
Merged

itsflaid merged 2 commits into
mainfrom
improve/analyzer-detection-accuracy

Conversation

@itsflaid

Copy link
Copy Markdown
Owner

Ringkasan

Hasil audit akurasi analyzer: devmap analyze dijalankan ke repo open-source nyata (taxonomy, nextjs-subscription-payments, Express/Nest/SvelteKit RealWorld, remix indie-stack, fastify/demo), lalu setiap deteksi yang meleset dibuktikan dan diperbaiki.

Temuan Sebelum Sesudah
Fastify @fastify/autoload (fastify/demo) route /, /:id, /login; fitur Task hilang /api/tasks, /api/tasks/:id, /api/auth/login; muncul Task Management
:id dianggap resource fitur ":id Management", "UpdatePassword Management" hilang
SvelteKit profile/@[user] terbuang jadi /profile (dua route bentrok) /profile/@[user], /profile/@[user]/favorites
Tabel snake_case "User_role Management" "UserRole Management"

Perubahan

  • routeDetector.ts: baca @fastify/autoload (dir, options.prefix, routeParams, dirNameRoutePrefix); toRoutePath hanya membuang folder @slot untuk Next App Router
  • nonResourceSegments.ts: helper bersama isDynamicSegment ([x], :x, *, {x}), dipakai capabilityDetector, fallbackExtractor, featureCandidates, frontendFeatureDetector
  • sqlExtractor.ts: nama entity lewat resourceEntityName
  • test/detection-accuracy.test.ts: 9 test baru; CHANGELOG diperbarui

Pengujian

  • pnpm test di packages/cli: 431 pass, 0 fail; tsc --noEmit bersih
  • Diverifikasi ulang ke repo nyata di atas

Belum dikerjakan (temuan lain, perlu keputusan)

  • Entry point feature Authentication bisa salah pilih (taxonomy: app/api/posts/route.ts, indie-stack: app/root.tsx) karena dipilih file terdekat ke root, bukan file yang mendefinisikan auth
  • Express RealWorld: "Comment Management" hanya berisi comment.model.ts karena sub-resource /articles/:slug/comments tidak jadi resource sendiri
  • taxonomy: "Doc" (dari segmen /docs) dan "Documentation" (vocabulary) tetap dua fitur terpisah
  • Entity SQL hanya dari file yang menyebut query (fastify/demo: tabel tasks tidak muncul karena seed script tidak menyentuhnya)

Generated by Claude Code

…e params as resources

Found by running the analyzer on real projects (fastify/demo, SvelteKit RealWorld,
Express RealWorld):

- Fastify: @fastify/autoload folder paths (plus registration prefix, routeParams,
  dirNameRoutePrefix) now prefix the routes, so /api/tasks/:id is detected and a
  Task Management feature appears
- ':id' / '{id}' URL segments are no longer resources (was ":id Management");
  shared isDynamicSegment helper replaces three divergent checks
- '@' folders are a literal URL character outside Next's App Router
  (SvelteKit /profile/@[user] no longer collapses into /profile)
- snake_case SQL tables are named like models (user_roles -> UserRole)

Adds test/detection-accuracy.test.ts (9 tests) and a CHANGELOG entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgTNRYi7S8ecZsSobSC3Qo
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
devmap-web Ready Ready Preview Oct 27, 2026 10:26pm UTC

@github-actions

Copy link
Copy Markdown

✅ Welcome ke DevMap!

Terima kasih sudah buat PR. Pastikan checklist ini terpenuhi sebelum review:

  • devmap doctor lolos (tanpa error)
  • Test pnpm test:cli lolos (semua pass)
  • New commands diupdate di docs/commands.md
  • Tidak ada console.log di command files
  • Registry terms sesuai standar (baca docs/guide/05-signal-registry.md)
  • Code style match dengan CONTRIBUTING.md

CI akan jalan otomatis pada setiap update. Kalau gagal, akan muncul link run di komentar ini.

Kalau DevMap membantu, tolong star ya: https://github.com/itsflaid/devmap

Terima kasih kontribusinya! 🙏

singularize("s") stripped the trailing "s" and returned "", so naming the page
feature for `app/s/[subdomain]/page.tsx` threw "Cannot read properties of
undefined (reading 'toUpperCase')" and aborted the analysis (reproduced on
vercel/platforms, on main too). Words of one or two letters are no longer
singularized, and the three `word[0].toUpperCase()` sites use charAt(0).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgTNRYi7S8ecZsSobSC3Qo
@itsflaid
itsflaid merged commit 768b7e8 into main Oct 28, 2026
2 checks passed
@itsflaid
itsflaid deleted the improve/analyzer-detection-accuracy branch October 28, 2026 01:27
@itsflaid itsflaid mentioned this pull request Oct 29, 2026

This branch was successfully deployed

1 active deployment
Preview — 294299ca Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants