[autocomplete-css] Sort completions.json
#552
Merged
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.
In this PR I've added two new features to the script that generates the
completions.json
.lengthSort()
: This runs right after the file has been fully generated. Sorting every property key by it's length, moving the shortest values to the top of the list.popularSort()
: This runs next, sorting all keys based on popularity, according to Chrome Platform CSS usage metrics.The
completions.json
file doesn't seem to have any other changes other than now being sorted.Additionally, you can see in my first commit here I simply moved all relevant files into an(EDIT: nevermind, GitHub recognizes the file was moved, so the diff isn't difficult to read. Ignore that)update
folder, so for the sake of reviewing I wouldn't suggest looking much at that first commit, but it contained zero other changes.Also, I've gone ahead and removed the no longer used
request
dependency, and replaced it withsuperagent
which we do now need. I've already done the same exact thing over on #474. This was just now relevant to what I was doing, as I needed a way to download the Chrome usage metrics.Resolves #541