Skip to content

test(eval): accept a .js slice component - #293

Merged
angeloashmore merged 1 commit into
mainfrom
claude/prismic-cli-278-fix-eezmg6
Sep 9, 2026
Merged

test(eval): accept a .js slice component#293
angeloashmore merged 1 commit into
mainfrom
claude/prismic-cli-278-fix-eezmg6

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Sep 8, 2026

Copy link
Copy Markdown
Member

Refs: #278

Description

The eval that checks for slice component implementation only checked for .tsx or .jsx. The example project writes to .js instead.

This PR updates the eval to support all three valid extensions.

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

In a container or a disposable VM:

$ node --run build
$ EVAL_TRIALS=5 PRISMIC_ALLOW_EVALS=true node --run evals -- \
    evals/render-content.eval.ts

🤖 Generated with Claude Code

https://claude.ai/code/session_0194f9d6dLEYage35y3snFaD


Note

Low Risk
Test-only change to file discovery and assertion messaging; no production or runtime behavior affected.

Overview
Updates the writes a slice component eval so it discovers generated slice React files with .js as well as .tsx and .jsx, by changing the filename regex from one that only matched tsx/jsx to /\.(tsx|jsx?)$/.

When no matching file is found, the assertion now fails with a message listing the actual files in slices/Testimonial/ to make eval failures easier to debug.

Reviewed by Cursor Bugbot for commit 50ef6a1. Bugbot is set up for automated code reviews on this repo. Configure here.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

The slice component eval looked for a .tsx or .jsx file. The eval project
has no tsconfig.json, so it is a JavaScript project. Next.js compiles JSX
in .js files, and Slice Machine writes index.js for JavaScript projects.
The eval failed a trial that wrote a valid component.

The eval now also accepts .js. The failure message lists the files in the
slice folder, so the next failure shows what the agent wrote.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0194f9d6dLEYage35y3snFaD
@angeloashmore
angeloashmore marked this pull request as ready for review September 9, 2026 08:44
@angeloashmore
angeloashmore requested a review from lihbr September 9, 2026 09:04
@angeloashmore
angeloashmore merged commit 4f985ff into main Sep 9, 2026
24 of 28 checks passed
@angeloashmore
angeloashmore deleted the claude/prismic-cli-278-fix-eezmg6 branch September 9, 2026 14:54
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.

3 participants