fix: use title case for manifest display names#521
Conversation
The display_information.name and bot_user.display_name fields in manifest files were set to the kebab-case directory name (e.g. "my-app") instead of a human-readable title case name (e.g. "My App").
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #521 +/- ##
=======================================
Coverage 71.26% 71.26%
=======================================
Files 222 222
Lines 18682 18683 +1
=======================================
+ Hits 13314 13315 +1
Misses 4188 4188
Partials 1180 1180 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
@srtaalej Thanks for getting this started 👾 ✨
I'm hesitant on this approach and am wondering if we instead separate how arguments and flags are parsed at this point?
Some issues I ran into are in comments but I'd like to share how I think about the "create" command:
$ slack create # Generates a random app name as current
$ slack create my-app # Keeps path "my-app" and manifest "my-app"
$ slack create "my App" # Uses path "my-app" and manifest "my App"🧰 Additional cases might complicate this but it's a good time to untangle this perhaps? I'm curious also if adding the --outdir flag makes parts of this more clear, while still supporting the happiest path simple cases?
|
|
||
| // UpdateDefaultProjectFiles should update any project specific files if any | ||
| func UpdateDefaultProjectFiles(fs afero.Fs, dirPath string, appDirName string) error { | ||
| displayName := kebabToTitleCase(appDirName) |
There was a problem hiding this comment.
🔍 issue: We might want to avoid changing the app name format altogether if this is provided in flags? Forgive me if I'm not understanding requirements right, but this app manifest for example might break with replacements:
Translator - Translate Languages
🔗 https://slack.com/marketplace/A8KHN4EDV-translator-translate-languages
|
|
||
| // UpdateDefaultProjectFiles should update any project specific files if any | ||
| func UpdateDefaultProjectFiles(fs afero.Fs, dirPath string, appDirName string) error { | ||
| displayName := kebabToTitleCase(appDirName) |
There was a problem hiding this comment.
🐍 ramble: Apps I keep might not fare well for additional example: "TIM", "TOM", or "snaek" have strange cases.
…ebab Addresses review feedback — instead of converting the kebab-case directory name to title case (which mangles names like "TIM" or "Translator - Translate Languages"), pass the original user-provided app name through to manifest display fields. This preserves the user's exact casing and formatting.
Summary
display_information.name,bot_user.display_name, and Deno SDKManifest({ name })) now use title case (e.g. "My App") instead of the kebab-case directory name (e.g. "my-app")package.jsonandpyproject.tomlnames remain kebab-case per npm/Python conventionskebabToTitleCasehelper usinggolang.org/x/text/cases(already in go.mod)Test plan
kebabToTitleCaseconversionTest_App_UpdateDefaultProjectFilesvalidates manifest files get title case while package.json/pyproject.toml keep kebab-caseTest_RegexReplaceAppNameInManifestupdated to reflect title-cased inputslack createa new app → verify manifest display name is title-cased, directory and package.json stay kebab-cased