Repository navigation
feat(cli): analisis JS/TS lebih kuat (workspace, Nuxt, entry points, database) - #112
Merged
Merged
Conversation
Audit of five real repos (create-t3-turbo, Nuxt "elk", Next "commerce", citty, express) showed the import graph missing most edges in monorepos and Nuxt apps, which skews critical files, entry points and change impact. Graph - Workspace packages imported by name resolve through package.json exports (conditions, * patterns), source/module/main, then file layout; build output (dist/, lib/) maps back to src/. - package.json "imports" (#internal/*) resolve within the nearest package; other # specifiers (Nuxt #shared) fall through to aliases. - Bundler query suffixes (./x.ts?raw) are stripped before resolution. - tsconfig/jsconfig in root-level folders (frontend/, client/) are found, not only under apps/ and packages/. - Nuxt: ~ @ ~~ @@ #shared #server aliases (Nuxt 3 root, Nuxt 4 app/, custom srcDir) and auto-import edges for components, composables, utils, shared, server/utils and Pinia stores. Entry points - Read package.json bin, published/root main and script targets; add framework file conventions (Nuxt, SvelteKit, Remix, Next Pages Router) that only count while nothing imports them. Config files and internal workspace package roots are never entries. Analyzer / detectors - CommonJS exports (module.exports, exports.x) are read as exports/symbols. - Database detector: models/ or schemas/ alone no longer means Mongoose; more ORMs/BaaS/drivers; secondary stores reported as database.additional; a cache is never the primary database. Effect on real projects: isolated source files 43% -> 14% (create-t3-turbo), 87% -> 8% (Nuxt). Adds 32 tests (356 total), refreshes CLAUDE.md and adds an Unreleased changelog entry. Go/Java/C#/PHP resolution is intentionally left for after JS/TS is mature. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019HJc4sv9pSLh7vhduSUxBE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Welcome ke DevMap!Terima kasih sudah buat PR. Pastikan checklist ini terpenuhi sebelum review:
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! 🙏 |
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kenapa
Audit ke 5 repo JS/TS nyata (create-t3-turbo, Nuxt "elk", Next "commerce", citty, express) menunjukkan graph import kehilangan banyak edge di monorepo dan Nuxt, sehingga critical files, entry points, dan change impact dihitung dari graph yang hampir kosong. PR ini fokus ke ekosistem JS/TS saja; bahasa lain sengaja ditunda sampai JS/TS matang.
Hasil di repo nyata (sebelum → sesudah)
Perubahan
Graph
@acme/ui,@acme/ui/button): resolusi viaexports(conditions + pola*),source/module/main, lalu layout file. Output build (dist/,lib/) dipetakan balik kesrc/.importsdi package.json (#internal/*) di-resolve di package terdekat;#lain (Nuxt#shared) jatuh ke alias../x.ts?raw) dibuang sebelum resolusi.frontend/ikut ditemukan (sebelumnya hanyaapps|packages|libs|services).~ @ ~~ @@ #shared #server(Nuxt 3, Nuxt 4app/,srcDircustom) + edge auto-import untuk komponen, composables, utils,shared/,server/utils/, Pinia stores.Entry points
bin,main(root/published saja, dan hanya jika tidak diimpor file lain), target scripts, plus konvensi framework (Nuxt, SvelteKit, Remix, Next Pages Router) yang hanya dihitung selama tidak ada yang mengimpornya. File config dan root package workspace internal tidak pernah jadi entry.Analyzer / detector
module.exports = {...},exports.x =) terbaca sebagai export dan symbol.models//schemas/saja tidak lagi dianggap Mongoose; TypeORM, Sequelize, MikroORM, Kysely, Knex, Firebase, Convex, PocketBase, MongoDB, Neon/Vercel Postgres, libSQL ditambah; store tambahan muncul didatabase.additional; Redis tidak pernah jadi database utama.Dokumen: CLAUDE.md diperbarui (jumlah tes, daftar tes, tabel bahasa termasuk
.java, bagian resolusi JS/TS, batasan), CHANGELOG bagian Unreleased.Verifikasi
pnpm test:cli: 356 lulus (32 baru dijs-ts-ecosystem.test.ts),tscbersih,pnpm build:clidantest:package-e2ehijau.packages/cli/src/index.ts(daribin).Sengaja belum
Edge untuk Go/Java/C#/PHP (PSR-4), framework baru (Remix/React Router, TanStack, Hono, Expo), alias yang hanya ada di config Vite/webpack.
Generated by Claude Code