Skip to content

Conversation

m-Bilal
Copy link
Member

@m-Bilal m-Bilal commented Mar 27, 2025

This PR adds support for automatically preserving import statements in functions.ts and api.ts files

Why

This was required because if a user had a setup in which they were using functions from files other than api.ts and had @save annotation on those functions, re-running the codegen (introspect with overwrite set to true) would preserve the function, but would lose its import statement. This meant that the user would have to re-write their import statements again, which a really bad experience.

Note

import statements are always preserved and organized. They don't need a @save annotation.

Review

Since this is a relatively large PR, it'll be easier to review it per commit

@m-Bilal m-Bilal force-pushed the m-bilal/preserve-imports branch from dadcc48 to aa32694 Compare March 27, 2025 14:05
@m-Bilal m-Bilal force-pushed the m-bilal/preserve-imports branch from aa32694 to d1a60a8 Compare March 27, 2025 14:12
@m-Bilal m-Bilal merged commit 256a09b into main Mar 27, 2025
1 check passed
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.

2 participants