brk: fix bundler use + bundler: remove minify html crate

This commit is contained in:
nym21
2025-06-15 12:39:50 +02:00
parent ae6aa4088b
commit 6a9ac9b025
10 changed files with 127 additions and 606 deletions
Generated
+98 -567
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -42,7 +42,7 @@ clap_derive = "4.5.40"
color-eyre = "0.6.5"
derive_deref = "1.1.1"
fjall = "2.11.0"
jiff = "0.2.14"
jiff = "0.2.15"
log = { version = "0.4.27" }
minreq = { version = "2.13.4", features = ["https", "serde_json"] }
rayon = "1.10.0"
+1 -1
View File
@@ -71,7 +71,7 @@ In contrast, existing alternatives tend to be either [very costly](https://studi
- [`brk_state`](https://crates.io/crates/brk_state): Various states used mainly by the computer
- [`brk_store`](https://crates.io/crates/brk_store): A thin wrapper around [`fjall`](https://crates.io/crates/fjall)
- [`brk_vec`](https://crates.io/crates/brk_vec): A push-only, truncable, compressable, saveable Vec
- [`brk_bundler`](https://crates.io/crates/brk_bundler): A crate that bundles the selected website for the server
- [`brk_bundler`](https://crates.io/crates/brk_bundler): A thin wrapper around [`rolldown`](https://rolldown.rs/)
## Hosting as a service
+1 -1
View File
@@ -2,7 +2,7 @@
#[cfg(feature = "bundler")]
#[doc(inline)]
pub use brk_bundle as bundle;
pub use brk_bundler as bundler;
#[doc(inline)]
pub use brk_cli as cli;
+1 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "brk_bundler"
description = "A crate that bundles the selected website for the server"
description = "A thin wrapper around rolldown"
version.workspace = true
edition.workspace = true
license.workspace = true
@@ -9,7 +9,6 @@ repository.workspace = true
[dependencies]
log = { workspace = true }
minify-html-onepass = "0.16.4"
notify = "8.0.0"
brk_rolldown = "0.0.1"
sugar_path = "1.2.0"
+1 -10
View File
@@ -2,7 +2,6 @@ use std::{fs, io, path::Path, sync::Arc};
use brk_rolldown::{Bundler, BundlerOptions, RawMinifyOptions, SourceMapType};
use log::error;
use minify_html_onepass::Cfg;
use notify::{EventKind, RecursiveMode, Watcher};
use sugar_path::SugarPath;
use tokio::sync::Mutex;
@@ -56,15 +55,7 @@ pub async fn bundle(websites_path: &Path, source_folder: &str, watch: bool) -> i
contents = contents.replace("/scripts/main.js", &format!("/scripts/{main_hashed}.js"));
}
if let Ok(contents) = minify_html_onepass::in_place_str(
contents.as_mut_str(),
&Cfg {
minify_js: false,
minify_css: false,
},
) {
let _ = fs::write(&absolute_dist_index_path, contents);
}
let _ = fs::write(&absolute_dist_index_path, contents);
};
let write_sw = move || {
+1 -1
View File
@@ -18,5 +18,5 @@ color-eyre = { workspace = true }
derive_deref = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_with = "3.12.0"
serde_with = "3.13.0"
tabled = { workspace = true }
+1 -1
View File
@@ -30,7 +30,7 @@ oxc = { version = "0.73.0", features = ["codegen", "minifier"] }
serde = { workspace = true }
tokio = { workspace = true }
tower-http = { version = "0.6.6", features = ["compression-full", "trace"] }
zip = "4.0.0"
zip = "4.1.0"
tracing = "0.1.41"
[package.metadata.cargo-machete]
+21 -21
View File
@@ -1424,7 +1424,7 @@ function createPartialOptions(colors) {
key: `${fixKey(key)}realized-price`,
name,
color,
})
}),
),
}
: createPriceWithRatio({
@@ -1507,7 +1507,7 @@ function createPartialOptions(colors) {
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
type: "Baseline",
key: `${fixKey(
key
key,
)}net-realized-profit-and-loss-relative-to-realized-cap`,
title: useGroupName ? name : "Net",
color: useGroupName ? color : undefined,
@@ -1578,7 +1578,7 @@ function createPartialOptions(colors) {
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
type: "Baseline",
key: `${fixKey(
key
key,
)}adjusted-spent-output-profit-ratio`,
title: useGroupName ? name : "asopr",
color: useGroupName ? color : undefined,
@@ -1601,7 +1601,7 @@ function createPartialOptions(colors) {
key: `${fixKey(key)}sell-side-risk-ratio`,
name: useGroupName ? name : "Risk",
color: color,
})
}),
),
},
],
@@ -1690,7 +1690,7 @@ function createPartialOptions(colors) {
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
type: "Baseline",
key: `${fixKey(
key
key,
)}net-unrealized-profit-and-loss-relative-to-market-cap`,
title: useGroupName ? name : "Net",
color: useGroupName ? color : undefined,
@@ -1868,7 +1868,7 @@ function createPartialOptions(colors) {
key: `${key}-sma`,
name: key,
color,
})
}),
),
},
...averages.map(({ key, name, color }) =>
@@ -1878,7 +1878,7 @@ function createPartialOptions(colors) {
title: `${name} Market Price Moving Average`,
legend: "average",
color,
})
}),
),
],
},
@@ -1969,7 +1969,7 @@ function createPartialOptions(colors) {
},
}),
],
})
}),
),
.../** @type {const} */ ([
{ name: "2 Year", key: "2y" },
@@ -2040,7 +2040,7 @@ function createPartialOptions(colors) {
},
}),
],
})
}),
),
],
},
@@ -2056,7 +2056,7 @@ function createPartialOptions(colors) {
name: `${year}`,
color,
defaultActive,
})
}),
),
},
...dcaClasses.map(
@@ -2083,7 +2083,7 @@ function createPartialOptions(colors) {
},
}),
],
})
}),
),
],
},
@@ -2144,10 +2144,10 @@ function createPartialOptions(colors) {
bottom: [
...createAverageSumCumulativeMinMaxPercentilesSeries("fee"),
...createAverageSumCumulativeMinMaxPercentilesSeries(
"fee-in-btc"
"fee-in-btc",
),
...createAverageSumCumulativeMinMaxPercentilesSeries(
"fee-in-usd"
"fee-in-usd",
),
],
},
@@ -2841,7 +2841,7 @@ function createPartialOptions(colors) {
},
{
name: "Status",
url: () => "https://status.kibo.money/",
url: () => "https://status.bitcoinresearchkit.org/",
},
{
name: "Crates",
@@ -2903,7 +2903,7 @@ export function initOptions({ colors, signals, env, utils, qrcode }) {
const detailsList = [];
const treeElement = signals.createSignal(
/** @type {HTMLDivElement | null} */ (null)
/** @type {HTMLDivElement | null} */ (null),
);
/** @type {string[] | undefined} */
@@ -3015,7 +3015,7 @@ export function initOptions({ colors, signals, env, utils, qrcode }) {
return null;
}
},
null
null,
);
partialTree.forEach((anyPartial, partialIndex) => {
@@ -3038,7 +3038,7 @@ export function initOptions({ colors, signals, env, utils, qrcode }) {
if ("tree" in anyPartial) {
const folderId = utils.stringToId(
`${(path || []).join(" ")} ${anyPartial.name} folder`
`${(path || []).join(" ")} ${anyPartial.name} folder`,
);
/** @type {Omit<OptionsGroup, keyof PartialOptionsGroup>} */
@@ -3053,13 +3053,13 @@ export function initOptions({ colors, signals, env, utils, qrcode }) {
const thisPath = groupAddons.id;
const passedDetails = signals.createSignal(
/** @type {HTMLDivElement | HTMLDetailsElement | null} */ (null)
/** @type {HTMLDivElement | HTMLDetailsElement | null} */ (null),
);
const childOptionsCount = recursiveProcessPartialTree(
anyPartial.tree,
passedDetails,
[...(path || []), thisPath]
[...(path || []), thisPath],
);
listForSum.push(childOptionsCount);
@@ -3191,7 +3191,7 @@ export function initOptions({ colors, signals, env, utils, qrcode }) {
});
return signals.createMemo(() =>
listForSum.reduce((acc, s) => acc + s(), 0)
listForSum.reduce((acc, s) => acc + s(), 0),
);
}
recursiveProcessPartialTree(partialOptions, treeElement);
@@ -3218,7 +3218,7 @@ export function initOptions({ colors, signals, env, utils, qrcode }) {
console.log(
[...m.entries()]
.filter(([_, value]) => value > 1)
.map(([key, _]) => key)
.map(([key, _]) => key),
);
throw Error("ID duplicate");
+1 -1
View File
@@ -2,7 +2,7 @@
// File auto-generated, any modifications will be overwritten
//
export const VERSION = "v0.0.57";
export const VERSION = "v0.0.58";
/** @typedef {0} DateIndex */
/** @typedef {1} DecadeIndex */