Repository navigation
Fix vanilla JS template ignoring video-specific data in code generation - #89
Closed
groupthinking with Claude wants to merge 2 commits into
Closed
groupthinking with Claude wants to merge 2 commits into
groupthinking with Claude wants to merge 2 commits into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…fic data - Add optional AICodeGenerator integration to ProjectCodeGenerator - Update _generate_vanilla_main_js to include tutorial steps and features in generated code - Improve _sanitize_name to prefer video-derived names over generic fallback - Add USE_AI_CODE_GENERATION env variable to enable AI-powered generation - Add comprehensive tests to verify different videos produce different outputs - Fix: Tutorial steps now embedded as comments in main.js - Fix: Features affect generated JavaScript (API integration, responsive design) - Fix: Project names now derived from video titles instead of generic "uvai-generated-project" Tests confirm: - Vanilla JS projects from different videos have unique code - React projects from different videos have unique content - Main.js includes tutorial-specific comments and feature-specific code Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Owner
This branch was successfully deployed
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.
Problem
All generated projects were byte-for-byte identical because
_generate_vanilla_main_js()ignoredtutorial_stepsandfeaturesparameters, returning hardcoded boilerplate regardless of video content. Project names defaulted to genericuvai-generated-project-XXXXpattern.Changes
Template Generation
_generate_vanilla_main_js()now embeds tutorial steps as comments and generates feature-specific code:AI Integration
AICodeGeneratordelegation viaUSE_AI_CODE_GENERATION=trueenvironment variableProjectCodeGeneratorcan now route to AI-powered generation when availableProject Naming
_sanitize_name()now prefers video-derived names over generic fallbackbuild-javascript-todo-app,create-javascript-calculatorinstead ofuvai-generated-project-1234Test Coverage
Added
test_code_generator_unique_output.pyverifying:main.jswith video-specific commentsApp.jswith video-specific contentfetchData(), responsive design adds resize handlers)Original prompt