Conversation
## Because - We pull in `camelcase` for one job: turning an SVG basename into a PascalCase component name, in two Jest transforms. - FXA-13929, part of the dependency reduction work. ## This pull request - Adds a local `toPascalCase` helper to `svg-transform.js` (fxa-react) and `fileTransform.js` (fxa-settings). - Drops `camelcase` from both `package.json` files and updates `yarn.lock`. - Leaves the two helpers as copies. Sharing one means a new cross-package export, which this does not justify. A follow-up can merge them if anyone wants that. ## Issue that this pull request solves Closes: https://mozilla-hub.atlassian.net/browse/FXA-13929
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces camelcase with package-local SVG basename conversion helpers to reduce dependencies.
Changes:
- Adds identical
toPascalCasehelpers to both Jest SVG transforms. - Removes direct
camelcasedependencies and updates the lockfile. - Direct regression coverage for the helpers is still needed.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/fxa-react/svg-transform.js |
Adds local PascalCase conversion. |
packages/fxa-react/package.json |
Removes camelcase. |
packages/fxa-settings/config/jest/fileTransform.js |
Adds local PascalCase conversion. |
packages/fxa-settings/package.json |
Removes camelcase. |
yarn.lock |
Updates workspace dependency records. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| // Turns an SVG basename into PascalCase. Twin of the helper in | ||
| // packages/fxa-settings/config/jest/fileTransform.js. | ||
| function toPascalCase(name) { |
|
|
||
| // Turns an SVG basename into PascalCase. Twin of the helper in | ||
| // packages/fxa-react/svg-transform.js. | ||
| function toPascalCase(name) { |
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.
Because
camelcasefor one job: turning an SVG basename into a PascalCase component name, in two Jest transforms.This pull request
toPascalCasehelper tosvg-transform.js(fxa-react) andfileTransform.js(fxa-settings).camelcasefrom bothpackage.jsonfiles and updatesyarn.lock.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-13929
Checklist
Put an
xin the boxes that applyHow to review (Optional)
toPascalCasehelper, which is identical in both transforms.package.jsonandyarn.lockremoval..svgbasenames, the helper returns the same string ascamelcase(name, { pascalCase: true }). That covers the three separators the repo uses (-,_,.), digits before letters (123Done-blue-logogives123DoneBlueLogo), and names already in camelCase (infoBlackgivesInfoBlack).Screenshots (Optional)
Other information (Optional)
camelcaseturnsABCDefintoAbcDef, the helper givesAbcdef. No filename in the repo looks like that, and the ticket asks for a helper scoped to the real input instead of a reimplementation of the library.Settings/ButtonIcon, 2 passed), andnx linton both packages (exit 0). I added no tests, so that checklist row stays unticked. Functional tests were skipped at the operator's request.