fix(import): accept documented exercise CSV aliases#210
Open
Xmemo wants to merge 1 commit into
Open
Conversation
|
@Xmemo is attempting to deploy a commit to the Workoutcool Team Team on Vercel. A member of the Team first needs to authorize it. |
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
Fixes #167 by making the exercise CSV importer accept the values already documented in the CSV generation prompt.
What changed
normalizeExerciseAttributeValue(attributeName, value)for importer-safe attribute value normalization.PRIMARY_MUSCLE/SECONDARY_MUSCLE:CORE -> ABDOMINALSEQUIPMENT:BODYWEIGHT -> BODY_ONLYEQUIPMENT:RESISTANCE_BAND -> BANDSTYPE:FLEXIBILITY -> STRETCHINGN/A,NA,NONE,NULL, empty string ->NA).Why
The CSV prompt previously told users or LLMs to generate values like
CORE, butExerciseAttributeValueEnumusesABDOMINALS. That mismatch makes self-hosted custom exercise imports fail or silently lose useful muscle attributes.Testing
Passed:
pnpm exec tsx scripts/import-exercise-attribute-values.test.tspnpm exec eslint scripts/import-exercise-attribute-values.ts scripts/import-exercise-attribute-values.test.ts scripts/import-exercises-with-attributes.tsgit diff --check HEAD~1 HEADChecked but not clean on current base:
pnpm exec tsc --noEmit --pretty falsefails on existing public image module imports such as@public/logo.png,@public/images/trophy.png, and equipment images.pnpm lintfails on existing unrelated import/order and unused React warnings/errors across the app. The files touched by this PR pass the targeted ESLint command above.Not run:
DATABASE_URL; this PR verifies the normalization layer directly and keeps database behavior unchanged.