Dhaka, Bangladesh
Case Studies

Renaming a Component Library to Kebab-Case

Cover image for the case study "Renaming a Component Library to Kebab-Case"
Three layers - component library, page folders, React context - each converted from PascalCase to kebab-case across a five-commit timeline running Monday to Sunday.
Over one calendar week in February 2026, I renamed every PascalCase folder and file across WowShipping's shared UI component library, page folders, and React context modules to kebab-case. It took five commits, not the four an earlier brief listed. One sits between two of the others and renames individual file names rather than folders - easy to miss on a quick skim of the log. The last of the five also used the newly consistent naming to regroup loose page files back into their own components/ subfolder.
Five commits, one calendar week, three renamed layers, zero behavior changes - every diff outside a path or import line is empty.
TL;DR summary
What changedEvery PascalCase component, page, and context folder or file renamed to kebab-case, then regrouped
ScopeShared UI component library (13 folders), page folders and their internal files, React context (7 files)
Commits5, across three layers
TimespanOne calendar week - Monday, Feb 16 to Sunday, Feb 22, 2026
Behavior changeNone - every diff outside a rename or an import-path fixup is empty
Paired withRenaming a Domain Concept Mid-Flight →
Three example paths from before the rename, each folder or file name in PascalCase, annotated as the state of the codebase before February 16, 2026.
Before this week, the shared UI component library held thirteen folders, all in PascalCase - Badge, Chart, FileUploader, MultiSelect, Select, Sidebar, and the rest. The page folders followed the same pattern one level up - License, Overview, ShippingMethods, ShippingMethodsAddEdit - and so did most of the files inside them, with a couple of stragglers in camelCase instead of PascalCase. The React context folder had seven files, also PascalCase - NavContext.js, ShippingOptionsContext.js, ToastContext.js, and four more. The only files that already looked kebab-case were the single-word carrier service files, like auspost.js - there was no casing decision to make on a name with only one word.
A five-node timeline - three commits clustered on Monday, Feb 16, then one on Thursday, Feb 19, then one on Sunday, Feb 22 - each labeled with the layer it renamed.
Three commits landed within thirty minutes of each other on Monday, February 16, 2026, each renaming a different layer. The first renamed all thirteen component folders under the shared UI library to kebab-case and fixed the handful of imports that still pointed at the old paths. 28 files changed. Twelve minutes later, a second commit renamed the individual component files inside the page folders - AdvanceDisplayRules.js became advance-display-rules.js - and flattened a components/ subfolder out of five pages in the process. 48 files changed. This is the commit that's easy to miss on a quick scan: it renames files, not folders, and it landed between two folder-renaming commits on the same day. Eighteen minutes after that, a third commit renamed the page folders themselves, License to license and so on, updating the route imports to match. 56 files changed. Three days later, on Thursday, February 19, a fourth commit renamed all seven files in the React context folder to kebab-case and fixed the imports that consumed them. 35 files changed. Three days after that, on Sunday, February 22, a fifth commit put the components/ subfolder back into five pages - the same grouping the second commit had flattened out - and gave one more page a components/ subfolder for the first time. 25 files changed.
The same import statement resolved on three filesystems - macOS and Windows resolve it either way, Linux fails if the casing doesn't match exactly - flagged as inference, not a stated repo fact.
None of the five commit messages state why kebab-case was chosen, or why this particular week. One plausible, well-known reason: macOS and Windows default to case-insensitive filesystems, so an import like ./Badge resolves fine even against a folder actually named badge. Linux is case-sensitive by default, so the same mismatch fails outright in CI or on a Linux dev machine - a common source of "works on my machine" bugs when folder casing drifts. That's my own inference about the general value of casing consistency, not a confirmed fact about why this specific rename happened.
Four why-questions paired with compressed answers, the casing-choice question marked as an open, honest non-answer rather than a confident one.
Why standardize on kebab-case instead of PascalCase? No documented reason exists - none of the five commit messages or diffs explain the choice. Case-sensitive-filesystem behavior is a plausible generic reason, but that's inference, not something the repo states. Why split the rename across five commits instead of one? Splitting by layer - component folders, then page file names, then page folders, then context files - kept each commit's diff reviewable as one kind of change instead of one enormous mixed rename touching the whole tree at once. Why flatten the components/ subfolder out of several pages, then put it back three days later? The diffs show both changes happened, but neither commit message explains why - worth confirming from memory rather than assuming a deliberate two-step plan. Why rename folders after file names, instead of together? Renaming files first, inside folders that were still PascalCase, meant each commit's diff was one kind of change - file names, then folder names - rather than a single commit where every path segment changed at once and a reviewer couldn't tell which part caused which import fixup.
Part of the WowShipping frontend engineering case study series →
On this page
Quick answer
TL;DR
The before state
The five-commit pass
Why casing consistency matters
FAQ