models-dev: 0-unstable-2025-07-29 -> 0-unstable-2025-07-30 (#429655)

This commit is contained in:
Gaétan Lepage
2025-07-31 00:48:59 +02:00
committed by GitHub
2 changed files with 28 additions and 3 deletions
+10 -3
View File
@@ -17,12 +17,12 @@ let
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "models-dev";
version = "0-unstable-2025-07-29";
version = "0-unstable-2025-07-30";
src = fetchFromGitHub {
owner = "sst";
repo = "models.dev";
rev = "69e91b1cee1dbd737dc60f5f99ce123a81763cda";
hash = "sha256-fr4cgQsW03ukgCxNBtlokAXmqjGh1fFJucWx1dJ7xV0=";
rev = "2bc25f1c57a61c0bcb29e4a7ed331be332991c15";
hash = "sha256-xCYu8AsTtH9ZVhFZ/sxukj92RSwZGmeQRE3COmiRqI4=";
};
node_modules = stdenvNoCC.mkDerivation {
@@ -41,6 +41,13 @@ stdenvNoCC.mkDerivation (finalAttrs: {
dontConfigure = true;
patches = [
# In bun 1.2.13 (release-25.05) HTML entrypoints get content hashes
# appended → index.html becomes index-pq8vj7za.html in ./dist. So, we
# rename the index file back to index.html
./post-build-rename-index-file.patch
];
buildPhase = ''
runHook preBuild
@@ -0,0 +1,18 @@
diff --git i/packages/web/script/build.ts w/packages/web/script/build.ts
index 9bdcdb3..e9ce1c9 100755
--- i/packages/web/script/build.ts
+++ w/packages/web/script/build.ts
@@ -14,6 +14,13 @@ for await (const file of new Bun.Glob("./public/*").scan()) {
await Bun.write(file.replace("./public/", "./dist/"), Bun.file(file));
}
+const distFiles = await fs.readdir("./dist");
+const htmlFile = distFiles.find(file => file.startsWith("index-") && file.endsWith(".html"));
+
+if (htmlFile) {
+ await fs.rename(`./dist/${htmlFile}`, "./dist/index.html");
+}
+
let html = await Bun.file("./dist/index.html").text();
html = html.replace("<!--static-->", Rendered);
await Bun.write("./dist/index.html", html);