Skip to content

Fix pin_all_from incorrectly removing "js" substring from filenames#313

Merged
rafaelfranca merged 2 commits intomainfrom
rm-fix-282
Aug 1, 2025
Merged

Fix pin_all_from incorrectly removing "js" substring from filenames#313
rafaelfranca merged 2 commits intomainfrom
rm-fix-282

Conversation

@rafaelfranca
Copy link
Copy Markdown
Member

When using pin_all_from, filenames containing "js" as a substring (like "foo.jszip.js" or "bar.jsmin.js") were having the substring incorrectly removed, resulting in malformed module names like "foozip" and "barmin" instead of "foo.jszip" and "bar.jsmin".

Fixed the logic to only remove the file extension from the end of the filename, preserving any "js" substrings that appear
elsewhere in the name.

Fixes #282

When using pin_all_from, filenames containing "js" as a substring
(like "foo.jszip.js" or "bar.jsmin.js") were having the substring
incorrectly removed, resulting in malformed module names like
"foozip" and "barmin" instead of "foo.jszip" and "bar.jsmin".

Fixed the logic to only remove the file extension from the end
of the filename, preserving any "js" substrings that appear
elsewhere in the name.

Fixes #282
@rafaelfranca rafaelfranca merged commit 51c1a53 into main Aug 1, 2025
68 checks passed
@rafaelfranca rafaelfranca deleted the rm-fix-282 branch January 7, 2026 20:16
3. **Fix Implementation**: The actual code changes made
4. **Verification**: Results of running tests and any additional validation

Remember: Always write tests first, then implement the fix to make them pass. This ensures you truly understand and solve the problem.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@rafaelfranca — general thing to consider incorporating into AI workflow ... knowing when the specs shouldn't be left at the end (e.g., write a spec to see if fail, then fix + see it pass, then delete spec).

Example for an existing memory leak that was discovered:

  1. demonstrate leak via Vitest/Jest (commit)
  2. fix + push (commit -> see spec pass)
  3. cleanup (delete spec)

I think it makes sense to keep all the specs you wrote here; just a general suggestion.

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.

Fix path mangling when .js is a substring e.g. foo.jszip.js

2 participants