Skip to content

Support monorepo fragments, export * re-exports, and clearer unresolved-import errors#94

Open
jaredly wants to merge 11 commits intomainfrom
cross-module
Open

Support monorepo fragments, export * re-exports, and clearer unresolved-import errors#94
jaredly wants to merge 11 commits intomainfrom
cross-module

Conversation

@jaredly
Copy link
Collaborator

@jaredly jaredly commented Jan 23, 2026

Summary:

  • Use the resolve package to follow nodejs import resolution
  • Extend parser/resolve to support export * from "./..." re-exports when resolving fragments.
  • Improve error messaging for unresolved non-relative imports

Code mostly generated with gpt-5.2-codex

Test plan:

  • yarn test src/parser/__test__/utils.test.ts
  • yarn test src/parser/__test__/parse.test.ts

@jaredly jaredly self-assigned this Jan 23, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

🦋 Changeset detected

Latest commit: 6cfd6d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@khanacademy/graphql-flow Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jaredly jaredly marked this pull request as draft January 23, 2026 19:37
@jaredly jaredly requested review from a team, jeresig and kevinb-khan January 23, 2026 19:45
@jaredly jaredly marked this pull request as ready for review January 23, 2026 19:45
@kevinb-khan
Copy link
Contributor

Thanks for create this PR so quickly. I'd like to do some manual testing with this before I review the code. I'll try to do that sometime this week. I'm a little concerned about how we build the module map. During assessment testing periods we have multiple versions of @khan prefixed packages in the repo. I'll have to do some work to track down if there are any duplicate fragments in any of these packages.

@jaredly
Copy link
Collaborator Author

jaredly commented Feb 4, 2026

hmmmm so do you think we should be doing full package.json parsing to determine the resolution for an import? I wonder if there's a package for that.

@jaredly
Copy link
Collaborator Author

jaredly commented Feb 4, 2026

turns out there was! @kevinb-khan I now think that this solution will support the "assessments uses a pinned version while something else doesn't". however, I don't think we'll currently support 'depending on a fragment that is in a package not in the current repo, but is installed via pnpm' edit: actually maybe this would already work 🤔

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