Skip to content

refactor(runner): add the flow import resolver - #1512

Merged
Atchyut Preetham Pulavarthi (theonly1me) merged 1 commit into
feat/nova-1604-cli-run-environment-filefrom
refactor/nova-1574-resolve-the-flow-import-graph
Aug 21, 2026
Merged

refactor(runner): add the flow import resolver#1512
Atchyut Preetham Pulavarthi (theonly1me) merged 1 commit into
feat/nova-1604-cli-run-environment-filefrom
refactor/nova-1574-resolve-the-flow-import-graph

Conversation

@theonly1me

Copy link
Copy Markdown
Member

Overview of Changes

qawolf runner run ships every shippable file under the working directory, so on a workspace where a flow reaches ten files it collects thousands and the request is refused on size before it ever runs. A socket run does not do this: it walks the flow's import graph. This ports that resolver so the CLI can do the same, as pure functions with no disk access; the walk that uses them is a separate change.

  • Port parseTsconfigPaths and resolvePathAlias, honouring only the first target of the first matching pattern as the socket path does
  • Port getImports, collecting top-level static imports and dynamic import() calls anywhere in the file, deduplicated
  • Keep that walk's gaps, so export ... from and require() stay invisible and the CLI ships the same file set a socket run does
  • Match on an alias prefix alone rather than a resolvable target, since a pattern naming no target still counts as an import to collect
  • Port resolveImportPath, resolving an alias against the project root and a relative import against the importing file's directory
  • Try .ts, .js, /index.ts then /index.js, never the bare path, and try the other supported extension when one is explicit
  • Answer not-a-repository-import for a bare specifier and unresolved-repository-import for a relative or aliased import that matches nothing
  • Resolve with node:path/posix, since collected paths always use forward slashes and backslashes would match nothing on Windows
  • Take the TypeScript compiler as a parameter, so core/ stays free of I/O and nothing loads the compiler at runtime yet
  • Cover every behaviour above, including the two gaps and the unreachable .tsx extension

Testing

bun run typecheck
bun run lint --max-warnings 0
bun run format:check
bun run knip
bun run test

bun test gives 1788 pass 0 fail, 31 of them new. The other five give exit 0.

  • bun run build leaves dist/cli.js at 7.1 MB with no createSourceFile in it, confirming the type-only compiler import erases and nothing new is bundled.
  • Added lines, excluding bun.lock and snapshots: 453, over the 400 warning threshold in scripts/check-pr-size.sh and under the 600 error threshold.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2a864375-ee13-48a2-81e7-7d26ce907955

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@theonly1me
Atchyut Preetham Pulavarthi (theonly1me) merged commit ad44380 into main Aug 21, 2026
7 checks passed
@theonly1me
Atchyut Preetham Pulavarthi (theonly1me) deleted the refactor/nova-1574-resolve-the-flow-import-graph branch August 21, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants