Skip to content

fix: preserve original app name as manifest display name#521

Merged
srtaalej merged 6 commits intomainfrom
ale-fix-display-name-casing
May 8, 2026
Merged

fix: preserve original app name as manifest display name#521
srtaalej merged 6 commits intomainfrom
ale-fix-display-name-casing

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented May 4, 2026

Changelog

Fix: App manifest display names now preserve the original app name instead of using the kebab-case directory name during slack create.

Summary

  • Separates the directory name (kebab-case) from the manifest display name (original user input) during app creation
  • Manifest display names (display_information.name, bot_user.display_name, and Deno SDK Manifest({ name })) now preserve the user's original input instead of using the kebab-case directory name
  • package.json and pyproject.toml names remain kebab-case per npm/Python conventions

Behavior

$ slack create              # random name → path "vibrant-panther-540/", manifest "vibrant-panther-540"
$ slack create my-app       # path "my-app/", manifest "my-app"
$ slack create "My App"     # path "my-app/", manifest "My App"

Test plan

  • Test_App_UpdateDefaultProjectFiles validates manifest files get the display name while package.json/pyproject.toml keep kebab-case
  • Test_App_UpdateDefaultProjectFiles_WriteFileError covers the WriteFile error path
  • Test_RegexReplaceAppNameInManifest updated to reflect display name input
  • Manual: slack create "My App" → verify manifest display name is "My App", directory is my-app/, and package.json stays my-app

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").
@srtaalej srtaalej requested a review from a team as a code owner May 4, 2026 20:04
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.27%. Comparing base (178670f) to head (240dccb).

Files with missing lines Patch % Lines
internal/pkg/create/create.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #521      +/-   ##
==========================================
- Coverage   71.30%   71.27%   -0.04%     
==========================================
  Files         222      222              
  Lines       18677    18678       +1     
==========================================
- Hits        13318    13313       -5     
- Misses       4184     4185       +1     
- Partials     1175     1180       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@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?

Comment thread internal/app/app.go Outdated

// UpdateDefaultProjectFiles should update any project specific files if any
func UpdateDefaultProjectFiles(fs afero.Fs, dirPath string, appDirName string) error {
displayName := kebabToTitleCase(appDirName)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔍 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

Comment thread internal/app/app.go Outdated

// UpdateDefaultProjectFiles should update any project specific files if any
func UpdateDefaultProjectFiles(fs afero.Fs, dirPath string, appDirName string) error {
displayName := kebabToTitleCase(appDirName)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🐍 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.
@srtaalej srtaalej self-assigned this May 5, 2026
@srtaalej srtaalej added semver:minor Use on pull requests to describe the release version increment bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented enhancement M-T: A feature request for new functionality semver:patch Use on pull requests to describe the release version increment and removed semver:minor Use on pull requests to describe the release version increment labels May 5, 2026
@srtaalej srtaalej requested a review from zimeg May 7, 2026 17:50
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@srtaalej This is running alright but I'm not certain the expected behavior matches the PR description and title since IIRC we're now avoiding title case defaults?

Leaving a few thoughts before approving and I also think a changelog toward this is best? Perhaps a standalone "bug" label too unless new featuresets are included too?


// Update default project files' app name, bot name, etc
if err := app.UpdateDefaultProjectFiles(clients.Fs, projectDirPath, appDirName); err != nil {
if err := app.UpdateDefaultProjectFiles(clients.Fs, projectDirPath, appDirName, createArgs.AppName); err != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🌟 praise: Nice! Keeping these separate makes it much easier to think about for me!

Comment thread test/testdata/manifest-app-name.ts Outdated
Comment thread internal/app/app.go
Comment on lines +60 to +61
{"package.json", regexReplaceAppNameInPackageJSON, appDirName},
{"pyproject.toml", regexReplaceAppNameInPyprojectToml, appDirName},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🧠 praise: Nice separation for project titles!

@srtaalej srtaalej changed the title fix: use title case for manifest display names fix: preserve original app name as manifest display name May 7, 2026
srtaalej and others added 2 commits May 7, 2026 15:20
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
@srtaalej
Copy link
Copy Markdown
Contributor Author

srtaalej commented May 7, 2026

@zimeg updated the pr description and tests!

@srtaalej srtaalej requested a review from zimeg May 7, 2026 20:22
@srtaalej srtaalej added the changelog Use on updates to be included in the release notes label May 7, 2026
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@srtaalej Thanks for polish toward the create command 🦋

One question and hoping if this is toward next release let's include a changelog entry with the milestone 🚀 🔮

Comment thread internal/app/app_test.go
Comment on lines -117 to -126
"WriteFile error": {
appDirName: "vibrant-butterfly-1234",
existingFiles: map[string]string{
"manifest.json": string(testdata.ManifestJSON),
},
expectedFiles: map[string]string{
"manifest.json": string(testdata.ManifestJSONAppName),
},
expectedErrorType: nil,
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

📠 question: Was this case patched? It's not clear to me why the test is removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that test case is identical to the "manifest.json file exists" test case - i removed it because it was redundant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i will add a test case that actually produces the write file error separately

@srtaalej srtaalej added this to the Next Release milestone May 8, 2026
@srtaalej srtaalej merged commit 52ea60b into main May 8, 2026
8 checks passed
@srtaalej srtaalej deleted the ale-fix-display-name-casing branch May 8, 2026 15:22
srtaalej added a commit that referenced this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented changelog Use on updates to be included in the release notes enhancement M-T: A feature request for new functionality semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants