Make tsci push fall back to selectable project files when no entrypoint is configured#2915
Make tsci push fall back to selectable project files when no entrypoint is configured#2915rushabhcodes wants to merge 2 commits intotscircuit:mainfrom
Conversation
…int is configured
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Aligns tsci push behavior with tsci dev by adding a fallback project-file selection path when no entrypoint is configured, and adds regression coverage for the previously failing scenario.
Changes:
- Added selectable-file fallback logic to
push-snippetwhen entrypoint detection yields no result. - Added a new CLI test intended to ensure
tsci pushsucceeds without a conventional entrypoint.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/cli/push/push1-no-entrypoint.test.ts | Adds a regression test case for pushing without an entrypoint. |
| lib/shared/push-snippet.ts | Adds fallback file discovery (board files, then selectable project files) when no entrypoint is found. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test("should push a package by falling back to a selectable file when no entrypoint is found", async () => { | ||
| const { tmpDir, runCommand } = await getCliTestFixture({ | ||
| loggedIn: true, | ||
| }) | ||
|
|
||
| fs.writeFileSync( | ||
| path.resolve(tmpDir, "package.json"), | ||
| JSON.stringify({ name: "@tsci/test-user.test-package", version: "1.0.0" }), | ||
| ) | ||
| fs.writeFileSync( | ||
| path.resolve(tmpDir, "board.tsx"), | ||
| "export const Board = () => null\n", | ||
| ) |
| const files = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], { | ||
| cwd: projectDir, | ||
| ignore: DEFAULT_IGNORED_PATTERNS, | ||
| }) |
| return boardFiles | ||
| } | ||
|
|
||
| const files = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], { |
There was a problem hiding this comment.
you need to use the project config for this i think
seveibar
left a comment
There was a problem hiding this comment.
selecting a random file is kind of silly, what logic does runframe use to pick the default entrypoint?
|
i copied this logic from |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
tsci push previously failed with a "No entrypoint found" error when a project had no index.circuit.tsx and no mainEntrypoint, even though tsci dev already handled that case by falling back to the first
selectable project file.
This PR aligns push with dev by reusing the same fallback behavior:
It also adds a regression test covering a project with no conventional entrypoint, verifying that tsci push succeeds and does not print the entrypoint error.
Why this should score well against the guide:
/fixes #2797