Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/project/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type promptObject struct {
Title string // "Reverse string"
Repository string // "slack-samples/reverse-string"
Description string // "A function that reverses a given string"
Subdir string // "agents/hello-world" - subdirectory within the repository
}

const viewMoreSamples = "slack-cli#view-more-samples"
Expand Down Expand Up @@ -158,11 +159,15 @@ func runCreateCommand(clients *shared.ClientFactory, cmd *cobra.Command, args []
}
}

subdir := createSubdirFlag
if subdir == "" {
subdir = template.GetSubdir()
}
createArgs := create.CreateArgs{
AppName: appNameArg,
Template: template,
GitBranch: createGitBranchFlag,
Subdir: createSubdirFlag,
Subdir: subdir,
}
clients.EventTracker.SetAppTemplate(template.GetTemplatePath())

Expand Down
24 changes: 18 additions & 6 deletions cmd/project/create_samples.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,24 @@ var embedPromptSamplesTmpl string
// promptSampleSelection gathers upstream samples to select from
func promptSampleSelection(ctx context.Context, clients *shared.ClientFactory, sampleRepos []create.GithubRepo) (string, error) {
filteredRepos := []create.GithubRepo{}
selection, err := clients.IO.SelectPrompt(ctx, "Select a language:",
[]string{
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")),
},
languageOptions := []string{
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")),
}
if clients.Config.WithExperimentOn(experiment.Templates) {
languageOptions = []string{
"Bolt for JavaScript",
"Bolt for Python",
"Deno Slack SDK",
}
}
Comment on lines +38 to +49
Copy link
Member Author

Choose a reason for hiding this comment

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

πŸ”­ note: Toward confusion of #325 we focused on on a "framework" selection here - @srtaalej!

🐣 ramble: The samples command has the following flag option too but IMHO the prompt it supports feels unexpected. Perhaps it's changed to "framework" soon?

      --language string   runtime for the app framework
                            ex: "deno", "node", "python"

Copy link
Contributor

Choose a reason for hiding this comment

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

i like framework!

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, I've often felt "language" was a poor choice. We went with it back when Deno was the only choice. Now, it feels like we're choosing frameworks not languages.

question: In the spirit of focus around a survey-to-huh migration, can we consider keeping parity between the 2 prompts? Change it to framework in both places or consider doing the framework change AFTER we release the huh migration.

languagePrompt := "Select a language:"
if clients.Config.WithExperimentOn(experiment.Templates) {
languagePrompt = "Select a framework:"
}
Comment on lines +50 to +53
Copy link
Member

Choose a reason for hiding this comment

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

note: This is fine and I appreciate the improvement. But I'll plead for ya'll to try to keep the focus on a survey-to-huh migration without introducing other changes.

The more changes, the more to review, the longer it takes to release the experiment, and the harder it is to feel confident in the release.

I'd suggest keeping a list of improvements like switching language to framework and do it as follow-ups after releasing the survey-to-huh migration. Changing "Language" to "Framework" should also update/alias our --language flag and update any internal Golang references.

selection, err := clients.IO.SelectPrompt(ctx, languagePrompt,
languageOptions,
iostreams.SelectPromptConfig{
Flags: []*pflag.Flag{
clients.Config.Flags.Lookup("language"),
Expand Down
Loading
Loading