Skip to content

fix(path-checker): resolve workspace aliases and filter URLs (review fixes) - #68

Merged
theDakshJaitly merged 2 commits into
mex-memory:mainfrom
advancedresearcharray:fix/skip-scoped-packages-and-urls
Jun 6, 2026
Merged

fix(path-checker): resolve workspace aliases and filter URLs (review fixes)#68
theDakshJaitly merged 2 commits into
mex-memory:mainfrom
advancedresearcharray:fix/skip-scoped-packages-and-urls

Conversation

@advancedresearcharray

Copy link
Copy Markdown
Contributor

Summary

Addresses all review feedback on #17. Same feature (workspace alias resolution + URL filtering) with the requested fixes applied.

Supersedes/updates #17 — review fixes are on this branch because the original author fork does not have push access from maintainers yet.

Review feedback addressed

  • HIGH — pnpm workspace support: collectWorkspacePatterns() falls back to pnpm-workspace.yaml when root package.json has no workspaces field.
  • MEDIUM — URL regex: Broadened to ^(?:https?|ftp|file):\/\/|^\/\/ for ftp://, file:///, and protocol-relative URLs.
  • MEDIUM — createRequire anchor: Uses createRequire(resolve(projectRoot, "noop.js")).
  • LOW — Tests: Four new path-checker tests (URL skip, package.json workspaces, pnpm-workspace.yaml, require.resolve).

Test plan

  • All 87 tests pass
  • tsc --noEmit clean

Made with Cursor

adelin-b and others added 2 commits June 6, 2026 17:09
The path checker was flagging workspace package references (e.g.
`@acme/ui`, `@acme/shared/utils`) as MISSING_PATH errors because
it only checked the filesystem. In monorepos, these are valid
import aliases that resolve via the package manager.

Changes:
- Add workspace name collection from root package.json `workspaces`
  field — reads each workspace's package.json `name` to build a
  lookup set. Works with all package managers (npm, yarn, pnpm, bun).
- Try Node's `require.resolve` first for installed npm packages,
  fall back to workspace name check for package managers that don't
  symlink all workspaces into node_modules (e.g. bun).
- Filter URLs (http://, https://) which are never filesystem paths.

Example: a monorepo with `packages/ui/package.json` containing
`"name": "@acme/ui"` will now correctly resolve references like
`@acme/ui/button` in scaffold files instead of reporting them
as missing paths.
Parse pnpm-workspace.yaml when package.json has no workspaces field,
broaden URL filtering to ftp/file/protocol-relative URLs, use the
canonical createRequire anchor path, and add tests for the new behavior.
@advancedresearcharray
advancedresearcharray force-pushed the fix/skip-scoped-packages-and-urls branch from fdbb507 to 53448f1 Compare June 6, 2026 17:10
@advancedresearcharray

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main and force-pushed (fdbb50753448f1). Full test suite passes locally: 179/179 on Node 20.

@theDakshJaitly theDakshJaitly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. Cleanly addresses all four review points from #17: pnpm-workspace.yaml fallback, broadened URL filter, canonical createRequire(noop.js) anchor, and four new tests. Confirmed the yaml dependency is declared (not just transitively present) and CI is green (179 tests). Thanks for carrying adelin-b's original work forward with the fixes.

@theDakshJaitly
theDakshJaitly merged commit 13a6aba into mex-memory:main Jun 6, 2026
2 checks passed
@advancedresearcharray
advancedresearcharray deleted the fix/skip-scoped-packages-and-urls branch June 10, 2026 20:03
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.

3 participants