Skip to content

feat(trace): add FullTracePackages db - #36

Merged
pi0 merged 4 commits into
mainfrom
feat/full-trace-packages
Apr 2, 2026
Merged

pi0 merged 4 commits into
mainfrom
feat/full-trace-packages

Conversation

@pi0

@pi0 pi0 commented Apr 2, 2026 •

Copy link
Copy Markdown
Member
  • add new FullTracePackages export to DB for packages that their files cannot by analyzed by nft
  • Add youch to NonBundleablePackages (has local assets)

Summary by CodeRabbit

  • Chores
    • Enhanced package tracing list to better support several native modules and utilities, improving bundling behavior.
  • Bug Fixes
    • Improved file discovery for traced packages and optional dependencies to reduce missing-file/bundle issues.

- Add `FullTracePackages` to db for packages needing full file tracing
- Add `youch` to `NonBundleablePackages` (has local assets)
- Extract `listPkgFiles()` helper to deduplicate dir listing logic
- Skip `fsp.glob` (Node 22+) when no glob pattern is specified
@coderabbitai

coderabbitai Bot commented Apr 2, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4fedddc5-feb0-4fab-bf56-6ed8b6172885

📥 Commits

Reviewing files that changed from the base of the PR and between f3de2b5 and 922b2ef.

📒 Files selected for processing (1)
  • src/trace.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/trace.ts

📝 Walkthrough

Walkthrough

Centralizes full-trace package configuration into src/db.ts, replaces a hardcoded include in scripts/trace.ts with the exported FullTracePackages, refactors file enumeration in src/trace.ts by adding listPkgFiles, and marks youch as non-bundleable.

Changes

Cohort / File(s) Summary
Package config
src/db.ts
Added exported FullTracePackages = ["usb","sodium-native","aws-crt","youch"] as const; added "youch" to NonBundleablePackages.
Script hookup
scripts/trace.ts
Replaced local fullTrace constant with fullTraceInclude: [...FullTracePackages] by importing FullTracePackages from src/db.ts.
Tracing logic
src/trace.ts
Reworked full-trace file collection: require/glob only when fullTraceEntry.glob exists; added listPkgFiles(dir) helper and replaced inline recursive readdir logic with this helper for optional deps and non-glob paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • pi0

Poem

🐰 I gathered packages neat and small,
Moved lists to db, no hardcoded call.
I hop through files with listPkgFiles bright,
Tracing made tidy, each path in sight. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(trace): add FullTracePackages db' directly and accurately summarizes the main change: introducing a new FullTracePackages export to the database for managing full-file tracing of packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/full-trace-packages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pi0 pi0 changed the title feat(trace): add FullTracePackages db and refactor listPkgFiles feat(trace): add FullTracePackages db Apr 2, 2026
@codecov

codecov Bot commented Apr 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.09091% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.51%. Comparing base (1bb2070) to head (922b2ef).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/trace.ts 57.14% 7 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   73.11%   73.51%   +0.39%     
==========================================
  Files           5        5              
  Lines         398      404       +6     
  Branches      123      124       +1     
==========================================
+ Hits          291      297       +6     
  Misses         74       74              
  Partials       33       33              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/trace.ts`:
- Around line 378-392: The listPkgFiles function drops symlinked files and can
false-positive filter paths; change the loop to compute fullPath =
join(entry.parentPath, entry.name), skip entries where any path segment equals
"node_modules" (e.g., split fullPath by path.sep and check segments), and treat
an entry as a file if entry.isFile() OR (entry.isSymbolicLink() && await
isFile(fullPath)); push the fullPath into files; use the existing
isFile(fullPath) utility and entry.isSymbolicLink() to include symlinked targets
while improving node_modules filtering.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4813ff1-16fb-4625-b062-b88b3ff5722c

📥 Commits

Reviewing files that changed from the base of the PR and between 1bb2070 and f3de2b5.

📒 Files selected for processing (3)
  • scripts/trace.ts
  • src/db.ts
  • src/trace.ts

Comment thread src/trace.ts Resolved
pi0 and others added 2 commits April 2, 2026 16:15
…tPkgFiles

- Include symlinked files via isSymbolicLink() + isFile() check
- Use segment-based node_modules check instead of substring match
@pi0
pi0 merged commit 463eafe into main Apr 2, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant