feat(bundler): add consistent_name setting #13910
Draft
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.
Resolves #13893.
There are a bunch of small thing that I'm not sure about that I commented through out the changes.
I guess the total number of package types is 8.
I don't know if I should make
arch
asmut
and just writeif consistent_name { arch = ...; }
instead of inline if-else expression informat!
. At least because architecture is technically immutable. There are a few different approaches. You can also just shadow the var by writing a newlet arch
. I think this would be a better approach than the current one, just don't know if shadowing is allowed here.I opted into a bit more changes to make constructing the package file name also consistent.
The things that can be debated is what is the default consistent naming scheme? I think underscores are very dominant in file names, so it might be the safest bet. Though there is MSI that also have a language, which kinda breaks the consistency. As well as the "universal" architecture (which is a very bad, non-descriptive name for an architecture). Also don't know about architecture names in general, I just converted the enum variant names to lowercase strings.
Maybe the docs wording could be better.
Waiting for feedback. The general idea is already fully implemented.
I just don't know how to test this. I didn't find tests in a file when I was searching. I guess there are snapshot tests, but I can't run them.
rust-analyzer only works for half of the files.