[F] Preserve preset order in codegen
This commit is contained in:
@@ -41,7 +41,7 @@ unicode-segmentation = { workspace = true, features = [] }
|
||||
which = { workspace = true, features = [] }
|
||||
|
||||
[build-dependencies]
|
||||
indexmap = { workspace = true, features = ["std"] }
|
||||
indexmap = { workspace = true, features = ["std", "serde"] }
|
||||
regex = { workspace = true, features = ["perf", "std", "unicode"] }
|
||||
unicode-normalization = { workspace = true, features = ["std"] }
|
||||
fs_extra = "1.3.0"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::fmt::Write as _;
|
||||
use std::fs;
|
||||
use std::io::{BufWriter, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use fs_extra::dir::{CopyOptions};
|
||||
use fs_extra::dir::CopyOptions;
|
||||
use heck::ToUpperCamelCase;
|
||||
use indexmap::IndexMap;
|
||||
use regex::Regex;
|
||||
@@ -282,7 +281,7 @@ enum PresetEntry {
|
||||
Complex { colors: Vec<String>, weights: Option<Vec<u32>> },
|
||||
}
|
||||
|
||||
type PresetMap = HashMap<String, PresetEntry>;
|
||||
type PresetMap = IndexMap<String, PresetEntry>;
|
||||
|
||||
fn preset_codegen(json_path: &Path, out_path: &Path) -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 1. Read and parse the JSON file
|
||||
|
||||
Reference in New Issue
Block a user