Proposal: Expose global flags for when running in remix-sitemap cli #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now there is no way to know if any given route is being imported because it's being used to generated a sitemap, or because it's actually being used for a server. Because of this it means if a server relies on workers, or opens a connection for logging, it will also do so when attempting to just generate a sitemap then shut down.
This causes the
npx remix-sitemap
command to hand infinitely, because of connectioned opened or workers started for functionality not used in generating a sitemap.In this pr I've implemented a basic functioning flag system to allow apps using remix-sitemap to probe if it's been started purely for the purpose of sitemap generation:
I do not think the current function names or flag names should stay as is, but it's a MVP for something that would be helpful feature to be added