fix: add fallback to find any .tsx/.ts/.circuit.json when no standard entrypoint found#2913
Open
64johnlee wants to merge 1 commit intotscircuit:mainfrom
Open
Conversation
… entrypoint found tsci push currently fails when no index.circuit.tsx or mainEntrypoint is configured, even though tsci dev finds alternative files. This mirrors the fallback behavior already present in resolve-dev-target.ts where it looks for any .tsx/.ts/.circuit.json file if getEntrypoint() returns null. The fallback is gated behind getEntrypoint() returning null, so if the user provided a specific filePath or configured mainEntrypoint, those still take precedence. Only when no entrypoint can be detected does the fallback kick in. Fixes tscircuit#2797
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.
Summary
tsci pushfails when noindex.circuit.tsx(or other standard entrypoint) exists AND nomainEntrypointis configured intscircuit.config.json. However,tsci devfinds alternative files — so push should do the same.Root Cause
push-snippet.tscallsgetEntrypoint()and immediately exits if it returnsnull. Meanwhile,resolve-dev-target.tshas a fallback that usesfindSelectableFiles()to locate any.tsx/.ts/.circuit.jsonfile whengetEntrypoint()fails.Fix
Added the same fallback logic to
pushSnippet():This keeps the priority: explicit
filePathargument >mainEntrypointconfig > standard entrypoint names > fallback to any circuit file.Testing
tsci devfallback behaviorRelated
tsci pushfails when noindex.circuit.tsxfile and nomainEntrypoint#2797resolve-dev-target.tswhich already has this fallback