push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
{
nodePkgs,
pkgs,
lib,
makeWrapper,
}:
let
ESBUILD_BINARY_PATH = lib.getExe (
pkgs.esbuild.override {
buildGoModule =
args:
pkgs.buildGoModule (
args
// rec {
version = "0.25.5";
src = pkgs.fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-jemGZkWmN1x2+ZzJ5cLp3MoXO0oDKjtZTmZS9Be/TDw=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
}
);
}
);
in
nodePkgs."elm-pages".overrideAttrs (old: {
inherit ESBUILD_BINARY_PATH;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
makeWrapper
old.nodejs.pkgs.node-gyp-build
];
# can't use `patches = [ <patch_file> ]` with a nodePkgs derivation;
# need to patch in one of the build phases instead.
# see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem
preFixup = ''
patch $out/lib/node_modules/elm-pages/generator/src/codegen.js ${./fix-read-only.patch}
patch $out/lib/node_modules/elm-pages/generator/src/init.js ${./fix-init-read-only.patch}
'';
postFixup = ''
wrapProgram $out/bin/elm-pages --prefix PATH : ${
with pkgs.elmPackages;
lib.makeBinPath [
elm
elm-review
elm-optimize-level-2
]
}
'';
meta =
with lib;
nodePkgs."elm-pages".meta
// {
description = "Statically typed site generator for Elm";
homepage = "https://github.com/dillonkearns/elm-pages";
license = licenses.bsd3;
maintainers = [
maintainers.turbomack
maintainers.jali-clarke
];
};
})

View File

@@ -0,0 +1,39 @@
diff --git a/generator/src/init.js b/generator/src/init.js
index 06386ff..7127dae 100644
--- a/generator/src/init.js
+++ b/generator/src/init.js
@@ -6,6 +6,20 @@ import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
+let walknDo = function(somePath, doStuff) {
+ doStuff(somePath, true);
+ const dir = fs.readdirSync(somePath)
+ dir.forEach((i) => {
+ let p = path.join(somePath, i);
+ const s = fs.statSync(p)
+ if (s.isDirectory()) {
+ walknDo(p, doStuff)
+ } else {
+ doStuff(p);
+ }
+ });
+}
+
/**
* @param {string} name
*/
@@ -18,6 +32,13 @@ export async function run(name) {
if (!fs.existsSync(name)) {
try {
await fsExtra.copy(template, appRoot);
+ walknDo(appRoot, (file, isDir) => {
+ if (isDir) {
+ fs.chmodSync(file, 0o755);
+ } else {
+ fs.chmodSync(file, 0o644);
+ }
+ });
fs.renameSync(
path.resolve(appRoot, "gitignore"),
path.resolve(appRoot, ".gitignore")

View File

@@ -0,0 +1,39 @@
diff --git a/generator/src/codegen.js b/generator/src/codegen.js
index baf5368..e5edf4d 100644
--- a/generator/src/codegen.js
+++ b/generator/src/codegen.js
@@ -37,9 +37,9 @@ export async function generate(basePath) {
copyToBoth("SiteConfig.elm"),
fs.promises.writeFile("./.elm-pages/Pages.elm", uiFileContent),
- fs.promises.copyFile(
- path.join(__dirname, `./elm-application.json`),
- `./elm-stuff/elm-pages/elm-application.json`
+ fs.promises.writeFile(
+ `./elm-stuff/elm-pages/elm-application.json`,
+ fs.readFileSync(path.join(__dirname, `./elm-application.json`))
),
// write `Pages.elm` with cli interface
fs.promises.writeFile(
@@ -82,9 +82,9 @@ function writeFetcherModules(basePath, fetcherData) {
}
async function newCopyBoth(modulePath) {
- await fs.promises.copyFile(
- path.join(__dirname, modulePath),
- path.join(`./elm-stuff/elm-pages/client/.elm-pages/`, modulePath)
+ await fs.promises.writeFile(
+ path.join(`./elm-stuff/elm-pages/client/.elm-pages/`, modulePath),
+ fs.readFileSync(path.join(__dirname, modulePath))
);
}
@@ -197,7 +197,7 @@ async function copyFileEnsureDir(from, to) {
await fs.promises.mkdir(path.dirname(to), {
recursive: true,
});
- await fs.promises.copyFile(from, to);
+ await fs.promises.writeFile(to, fs.readFileSync(from));
}
/**