Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Jun 25, 2025

Changelog

The Bolt for JavaScript and Bolt for Python samples referenced in documentation are now included in prompts of the samples command and can be filtered with the --language flag.

Summary

This PR adds Bolt for JavaScript and Bolt for Python sample apps to the samples command.

Preview

samples.mov

Reviewers

Create more apps with these commands:

$ slack create                      # Select "View more samples" and pick a language then sample!
$ slack samples                     # Browse the samples without a prior prompt
$ slack samples --language bolt-js  # Filter the selection to Bolt for JavaScript

Notes

  • The --language flag was named to match the current similar prompt of the create command, but I'm open to updating this if another option is better!
  • The --language flag wasn't added to the create command to avoid filtering the curated apps. IMO it might be confusing to have with that command too 🤖

Requirements

@zimeg zimeg added this to the Next Release milestone Jun 25, 2025
@zimeg zimeg self-assigned this Jun 25, 2025
@zimeg zimeg requested a review from a team as a code owner June 25, 2025 03:47
@zimeg zimeg added enhancement M-T: A feature request for new functionality changelog Use on updates to be included in the release notes semver:minor Use on pull requests to describe the release version increment labels Jun 25, 2025
@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

Attention: Patch coverage is 48.07692% with 27 lines in your changes missing coverage. Please review.

Project coverage is 63.53%. Comparing base (da8a61f) to head (f169934).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/project/create_samples.go 53.48% 17 Missing and 3 partials ⚠️
internal/iostreams/survey.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
- Coverage   63.59%   63.53%   -0.07%     
==========================================
  Files         212      212              
  Lines       22348    22395      +47     
==========================================
+ Hits        14213    14229      +16     
- Misses       7054     7080      +26     
- Partials     1081     1086       +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
Member Author

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

📝 A few notes on changed selections adjacent to prompts for the most kind reviewers!

selection, err := clients.IO.SelectPrompt(ctx, msg, surveyPromptOptions,
iostreams.SelectPromptConfig{
Flag: clients.Config.Flags.Lookup("name"),
Required: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

🔍 The required option defaulting to false will cause this prompt to skip from the changes below!

Comment on lines +498 to +500
if opt == nil {
continue
}
Copy link
Member Author

Choose a reason for hiding this comment

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

👁️‍🗨️ Here we avoid checking nonexistent flags for a changed value which is useful since the create command doesn't provide a "language" flag.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting how the survey is kinda getting in the way. Thanks for improving it!

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Implementation looks crisp and it works well! This is a very nice improvement!

🧪 Local testing works like a charm!

📝 My suggestion is to use --language <deno|node|python> to align the values with our runtime values but use a more familiar flag name. We may want to swap "Runtime" with "Language" in the Doctor command and verbose logs as well, eventually.

Comment on lines +44 to +47
fmt.Sprintf("Bolt for JavaScript %s", style.Secondary("Node.js")),
fmt.Sprintf("Bolt for Python %s", style.Secondary("Python")),
fmt.Sprintf("Deno Slack SDK %s", style.Secondary("Deno")),
},
Copy link
Member

Choose a reason for hiding this comment

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

praise: Great consideration for detail by choosing to match the styling of the create command! 🎨


cmd.Flags().StringVarP(&samplesTemplateURLFlag, "template", "t", "", "template URL for your app")
cmd.Flags().StringVarP(&samplesGitBranchFlag, "branch", "b", "", "name of git branch to checkout")
cmd.Flags().StringVar(&samplesLanguageFlag, "language", "", "framework from the app runtime\n ex: \"bolt-js\", \"bolt-python\", \"deno\"")
Copy link
Member

@mwbrooks mwbrooks Jun 26, 2025

Choose a reason for hiding this comment

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

thought: I like the --language flag. It's more familiar than --runtime, which we went with prior to supporting Bolt.

However, I can't shake that 2 choices are frameworks and 1 choice in a runtime. None are actually languages. 😬

I like the goal of keeping things consistent and recognizing that the create command uses language. The create command is also flawed, because it's listing Frameworks (Bolt JS, Bolt Python, and Deno SDK) and Runtimes (Node.js, Python, and Deno).

To make matter worse, the hooks return a runtime value ("deno", "node", & "python"). This at least returns the actual runtimes, haha. And the doctor command displays these values under the title "Runtime".

Zooming out, perhaps --runtime <deno|node|python> is the technically correct and aligns the best with our current use of Runtime. While --language <deno|bolt-js|bolt-python> is more familiar to developers.

🧠 My opinion is to go with --language <deno|node|python>. This is a mix of both, but the reason is 3 fold:

  1. If you ask a dev what language they prefer, many will say "Node" if they actually mean JavaScript or TypeScript running outside of the browser.
  2. The values align with our Runtime values returned by the hooks, displayed by Doctor, and displayed as secondary by the create and samples prompts.
  3. Since the values match, we can always support --runtime as an flag alias using a semver:minor - in the future, if we decide runtime was the better choice. Escape Hatch.

Comment on lines +498 to +500
if opt == nil {
continue
}
Copy link
Member

Choose a reason for hiding this comment

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

Interesting how the survey is kinda getting in the way. Thanks for improving it!

@zimeg
Copy link
Member Author

zimeg commented Jun 26, 2025

@mwbrooks These are great suggestions! 🙏

My opinion is to go with --language <deno|node|python>

I was hoping to match create outputs to start but I agree that node or deno or python match the filtering that follows "language" as expected and made this change in f169934.

The "runtime" option is so interesting to me though and wasn't something I considered! In later reworks I'll keep this in mind but for now I also find it to have more of an internal meaning.

Interesting how the survey is kinda getting in the way.

This was a frustrated finding in an otherwise unrelated change but I hope we can revisit the cause of this soon 👁️‍🗨️

I will merge this PR now with the above changes. Thanks so much for the kind review and thoughts shared 🧠 ✨

@zimeg zimeg merged commit f59f7b7 into main Jun 26, 2025
6 checks passed
@zimeg zimeg deleted the zimeg-feat-samples-language branch June 26, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog Use on updates to be included in the release notes enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants