- 
                Notifications
    You must be signed in to change notification settings 
- Fork 169
fix: don't lowercase name before titlizing to generate label #1081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this change at all. name is documented as such: "values must be all lowercase, and contain only alphanumeric characters with hyphens or underscores for word seperators".
Is there a reason for using camelCase instead of kebab-case for naming files/folders?
| Yes - the files themselves are also being referenced by the CMS (Craft) by slug, and those slugs need to be alphanumeric identifiers (no dashes.) I will update doc.js too, I don't see anything in the Doc class's _label method that would require access to the whole config object. Maybe a better question is - what does this hurt? I believe it just improves the the label generation, but doesn't change what files Fractal looks at, handles, etc. | 
| I updated doc.js to work with this change. I believe the  Again - we're using fractal with twig files we're sharing with another system where slugs can't contain dashes, and while everything works as is, this change makes the labels shown in Fractal show up "Like This" instead of "Likethis" by default. I looked for a way to override the  | 
| Thanks for this. I'll try to find time to take a look at this again sometime this week. It needs a bit of manual testing, since I don't believe these parts of the codebase are covered by any tests. | 
| Thanks, looks good! Sorry for the delay, forgot this :) I'll try to get this merged once GitHub Actions starts working properly again. | 
| @khamer I have no idea why GitHub doesn't allow me to run the workflows or merge main in to fix the out-of-dateness. Would you mind filing the PR again? Thanks. | 
| @mihkeleidast Sure, but if you'd like, check this one once more - I pulled all the subsequent upstream commits to my fork, so it might let you merge cleanly now. If not, I'll just make a new PR. | 
| Oh cool, the "Approve and Run" button appeared now! | 
| @khamer do you have any idea why the diff isn't clean? 🤔 | 
| Hrm, I'm not, but reset my main branch to upstream and cherrypicked just my two commits and now the diff looks clean, and files changed on github shows the right two instead of twelve. | 
| Thanks, looks good now! | 
This is a minor change that, when generating labels for components, uses the original case version of
nameinstead of the lowercased version. This means having component folder names likesomeComponent/correctly becomeSome Component, whereas without this change, it becomesSomecomponent.