Skip to content

Conversation

@itowlson
Copy link
Collaborator

The UI is the usual dialoguer one:

$ spin new http-rust tplchoicetest
CUTLERY ME!:
  spork
> another spork

Activated by setting allowed_values = [...] on the parameter.

We don't need this for any templates in this repo, but spinframework/spin-js-sdk#356 muses about offering a choice of router rather than separate templates. (Although that idea has gnarlier woes than this!) Low priority unless JS SDK decides they want to go down that route.

@karthik2804
Copy link
Contributor

@itowlson would this make it necessary to bump the version on the manifest? What would the behavior be where the templates are newer and use the allowed_values field but the user has Spin <3.2?

@itowlson
Copy link
Collaborator Author

@karthik2804 This is why we have tags (spin/template/v...) that direct each version of Spin to compatible templates. We could rev the manifest version but that just shifts the problem to "my Spin 3.1 doesn't understand the new manifest version" I think?

@karthik2804
Copy link
Contributor

@itowlson that makes sense thanks! I forgot one would love to see this land. Various tools in the JS ecosystem already provide a setup experience like this and it would be great to have it in Spin as well!

@itowlson itowlson merged commit 0de8809 into spinframework:main Mar 20, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants