Skip to content

Fix moved flow relative import resolution#259

Open
abisheik687 wants to merge 1 commit intoflydelabs:mainfrom
abisheik687:fix-moved-flow-import-resolution
Open

Fix moved flow relative import resolution#259
abisheik687 wants to merge 1 commit intoflydelabs:mainfrom
abisheik687:fix-moved-flow-import-resolution

Conversation

@abisheik687
Copy link
Copy Markdown

@abisheik687 abisheik687 commented May 6, 2026

Summary

Fixes moved .flyde imports resolving their own relative dependencies from the wrong directory.

When a root flow imports a visual flow from another folder, that imported visual flow can also import local files next to itself. Before this change, those nested imports were still resolved relative to the root flow path, so moving files could break otherwise valid local imports.

Changes

  • Adds nested resolver support so imported visual nodes can resolve child imports from their own source file path.
  • Preserves the existing resolver behavior for inline visual nodes and nodes without source paths.
  • Applies the same nested resolver behavior to editor node resolution.
  • Adds a regression fixture where Root.flyde imports moved/Wrapper.flyde, and Wrapper.flyde imports sibling AddOne.flyde.js.
  • Corrects resolver spec fixture path helpers to point at loader/fixture from source-based test execution.

Verification

Ran locally:

pnpm --dir loader exec tsc -p .
NODE_OPTIONS=--no-experimental-strip-types pnpm --filter @flyde/loader test -- --grep "resolves local imports relative"
NODE_OPTIONS=--no-experimental-strip-types pnpm --filter @flyde/loader test -- --grep "resolves flows with transitive dependencies|resolves a .flyde with dependency on a local visual node file|resolves local imports relative"

Results:

  • Loader TypeScript build passed.
  • Focused regression test passed.
  • Adjacent resolver import tests passed.

I also ran the full loader suite locally. Most tests passed, but this Windows setup is missing generated @flyde/nodes bundled-config UI assets (CodeExpression.js, Switch.js) because the full workspace build scripts are Unix-oriented and require the node UI bundle generation path. The failures were unrelated to this resolver change; the targeted resolver checks above passed.

Demo

Demo video: https://github.com/abisheik687/flyde/releases/download/flyde-moved-imports-demo/demo-flyde-moved-imports.mp4

Fixes #112

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.

Broken imports after moving files

1 participant