repowise-dev / repowise-dev/repowise
[Bug] A workspace sub-package with its own package.json resolves to nothing
@Aman-goel-04 is already working on this.
Since Sep 18, 2026.
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 711
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 439
Description
Summary
Some packages ship sub-packages nested inside their own tree, each with its own package.json and entry point, without being separate workspace members. solid ships packages/solid/web, packages/solid/store and others this way.
When something imports solid-js/web, the resolver matches the outer package and then tries to resolve web as a path under the outer package's own layout. It never considers that web is itself a package.
packages/core/src/repowise/core/ingestion/resolvers/ts_workspace.py:573-584
direct = _probe_path(f"{dir_posix}/{sub}", ctx.path_set)
if direct is not None:
return direct
for src_root in ("src", "lib", "dist"):
cand = _probe_path(f"{dir_posix}/{src_root}/{sub}", ctx.path_set)
if cand is not None:
return cand
return spare_export_target()
_probe_path (:470-489) additionally tries <base>/index.*. None of these reads <dir>/<sub>/package.json.
Mechanism
The probes nearly work, which is why this is easy to miss. _probe_path would find packages/solid/web/index.ts if it existed. It does not. Verified on disk:
test-repos/solid/packages/solid/web/package.json
test-repos/solid/packages/solid/web/src/index.ts
The entry point is web/src/index.ts, named by web's own manifest. The outer package's src root is packages/solid/src, so the src fallback probes packages/solid/src/web, which is a different place entirely.
Repro
Index test-repos/solid and resolve an import of solid-js/web. It resolves to nothing and becomes an external node; every call through it is absent from the call graph.
Impact
Any package publishing nested sub-packages this way. solid is the confirmed instance in the corpus.
Under-reporting only.
Done looks like
When the four existing probes fail, check for <dir>/<sub>/package.json and resolve the subpath as its own package, reading its main/module/exports and probing relative to <dir>/<sub>.
Branch 2 of the same function (:552-571) already does bare-package resolution and is the logic to mirror, rooted one level deeper.
This can only replace an unresolved external node with a real file. It cannot retarget an import that already resolves, because it runs only after every existing probe has failed.
Tests: the ts_workspace resolver tests — a fixture with a nested package.json under a workspace member, asserting the subpath specifier resolves to the nested entry file rather than None.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.