Closed
Conversation
3KINGZ
approved these changes
Mar 9, 2026
Comment on lines
28
to
+38
|
|
||
| // Avoid TS7056 by preventing a huge inferred literal type here. | ||
| const contractSource = fs.readFileSync(OUTPUT_FILE, "utf8"); | ||
| const endpointByMethodPattern = /export const EndpointByMethod\s*=\s*{/; | ||
| if (endpointByMethodPattern.test(contractSource)) { | ||
| const patchedSource = contractSource.replace( | ||
| endpointByMethodPattern, | ||
| "export const EndpointByMethod: Record<string, Record<string, Endpoint>> = {" | ||
| ); | ||
| fs.writeFileSync(OUTPUT_FILE, patchedSource, "utf8"); | ||
| } |
Contributor
There was a problem hiding this comment.
The CLI should not be the one patching items, it should be handled by you code structure or bundler.
Contributor
Author
There was a problem hiding this comment.
@BalogunofAfrica , can you help with exactly where you want this done please , i've not been able to figure out how to do this at a level that's not the CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ISSUE : for export const EndpointByMethod TS inferred a massive literal type which it's not able to serialize , it hit it's limit and started throwing
SOLUTION IN PR : annotate that line so typescript does not have to infer and then serialize all the literal types