Skip to content

Conversation

@molisani
Copy link
Member

@molisani molisani commented Feb 26, 2025

Describe your changes
The core exposes a function proposeCompletions that is responsible for generating a set of completions for the given app + inputs. However, there needs to be some "glue" to adapt that function for each shell. At the moment, the only shell that's supported is bash (but that is going to change). Currently the "glue" is written into the new application template, which makes it virtually impossible to change and it is only implementing the bash "glue".

This PR adds a new handleCompletionsForShell function to @stricli/auto-complete that accepts the same args as proposeCompletions AND the kind of shell. It then handles the "glue" for that specific shell kind and resolves async. This will allow for changes to this logic to be handled "internally" to these packages, and doesn't require any application-owner changes to support a new shell (once it is supported by @stricli/auto-complete). To this end, there are new install-all and uninstall-all commands that will attempt to install/uninstall the autocomplete functionality for every supported shell all at once.

Testing performed
Unit tests exercise the new behavior of @stricli/auto-complete for bash that handles editing the .bashrc and generating the completions (making sure the inputs and outputs are correct). There are also changes to the @stricli/create-app baselines to account for the changes in autocomplete handling.

These changes were also confirmed manually by generating a new application with @stricli/create-app and verifying the behavior in a bash shell.

@molisani molisani self-assigned this Feb 26, 2025
@github-actions github-actions bot added auto-complete 🔮 Relates to the @stricli/auto-complete package create-app 📂 Relates to the @stricli/create-app package labels Feb 26, 2025
@molisani molisani force-pushed the feat/unified-autocomplete-handling branch 4 times, most recently from 4aa35fe to 963e55e Compare February 27, 2025 15:11
@molisani molisani marked this pull request as ready for review February 27, 2025 15:18
@molisani molisani requested a review from a team as a code owner February 27, 2025 15:18
@molisani molisani force-pushed the feat/unified-autocomplete-handling branch 2 times, most recently from 5d12878 to e01b8ce Compare March 25, 2025 13:58
@molisani molisani force-pushed the feat/unified-autocomplete-handling branch from e01b8ce to 57cabee Compare July 7, 2025 20:47
@robcresswell
Copy link

@molisani is this still planning on being merged? Its been stuck for a few months

@molisani
Copy link
Member Author

@molisani is this still planning on being merged? Its been stuck for a few months

Sorry for the delay, but yes I am still hoping to land this. I should have more time to work on getting this tested and released before the end of the year.

@robcresswell
Copy link

@molisani awesome! Thanks for your hard work

molisani and others added 2 commits December 3, 2025 15:58
Signed-off-by: Michael Molisani <[email protected]>
Signed-off-by: Michael Molisani <[email protected]>
@molisani molisani force-pushed the feat/unified-autocomplete-handling branch from 57cabee to c5135e1 Compare December 3, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-complete 🔮 Relates to the @stricli/auto-complete package create-app 📂 Relates to the @stricli/create-app package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants