Skip to content

Make tsci push fall back to selectable project files when no entrypoint is configured#2915

Open
rushabhcodes wants to merge 2 commits intotscircuit:mainfrom
rushabhcodes:fix/push-fallback-without-entrypoint
Open

Make tsci push fall back to selectable project files when no entrypoint is configured#2915
rushabhcodes wants to merge 2 commits intotscircuit:mainfrom
rushabhcodes:fix/push-fallback-without-entrypoint

Conversation

@rushabhcodes
Copy link
Copy Markdown
Contributor

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:

  • try the configured or detected entrypoint first
  • if none exists, fall back to board files
  • then fall back to selectable .tsx, .ts, or .circuit.json files

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:

  • it is a real bug fix, not a vague cleanup
  • it includes a reproduction test and the fix in the same PR
  • it is a meaningful CLI UX improvement

/fixes #2797

Copilot AI review requested due to automatic review settings May 2, 2026 17:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-snippet when entrypoint detection yields no result.
  • Added a new CLI test intended to ensure tsci push succeeds 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.

Comment on lines +44 to +56
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",
)
Comment on lines +45 to +48
const files = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], {
cwd: projectDir,
ignore: DEFAULT_IGNORED_PATTERNS,
})
return boardFiles
}

const files = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to use the project config for this i think

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

selecting a random file is kind of silly, what logic does runframe use to pick the default entrypoint?

@rushabhcodes
Copy link
Copy Markdown
Contributor Author

rushabhcodes commented May 2, 2026

i copied this logic from tsci dev cause @imrishabh18 said it works for it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

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.

tsci push fails when no index.circuit.tsx file and no mainEntrypoint

3 participants