Skip to content

Conversation

@devdattatalele
Copy link
Contributor

When generating metadata for new scripts with relative imports, the Bun bundler now checks for locally provided script content before attempting to fetch from the server. This fixes the issue where new scripts in new directories would fail because the imported scripts don't exist on the server yet.

Fixes #7352

When generating metadata for new scripts with relative imports, the Bun
bundler now checks for locally provided script content before attempting
to fetch from the server. This fixes the issue where new scripts in new
directories would fail because the imported scripts don't exist on the
server yet.

Fixes windmill-labs#7352
@rubenfiszel
Copy link
Contributor

This is very cool but are you sure the CLI currently provide those files currently when generating-metadata ? Could you write a cli test for it (if you look we have some already). It would be a waste for the CLI to send all the local scripts so an optimization would to use local logic on CLI to try to guess which scripts are worth sending by doing local traversal of imports.

  - Add collectLocalScripts() to find imported scripts recursively
  - Add import extractors for TypeScript/JS and Python
  - Optimize to only send scripts in import chain (not all scripts)
  - Add comprehensive test suite with 4 test cases

  Addresses maintainer feedback on PR windmill-labs#7465:
  - Verified CLI wasn't sending local scripts before
  - Implemented optimization via import traversal
  - Added CLI tests using containerized backend

  Fixes windmill-labs#7352
@devdattatalele
Copy link
Contributor Author

@rubenfiszel! Updated the PR! CLI now sends imported scripts via raw_scripts array and added CLI tests
also optimized which sends imported scripts via recursive import traversal (not all local scripts)

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.

bug: unable to push a new script in a new directory while local development

2 participants