Merge pull request #259186 from PedroHLC/elm-update-packages

elmPackages: update
This commit is contained in:
Marek Fajkus 2023-10-05 18:28:36 +02:00 committed by GitHub
commit 91ff180d1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2421 additions and 944 deletions

View file

@ -247,6 +247,7 @@ in lib.makeScope pkgs.newScope (self: with self; {
# see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem # see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem
preFixup = '' preFixup = ''
patch $out/lib/node_modules/elm-pages/generator/src/codegen.js ${./packages/elm-pages-fix-read-only.patch} patch $out/lib/node_modules/elm-pages/generator/src/codegen.js ${./packages/elm-pages-fix-read-only.patch}
patch $out/lib/node_modules/elm-pages/generator/src/init.js ${./packages/elm-pages-fix-init-read-only.patch}
''; '';
postFixup = '' postFixup = ''

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

@ -1,18 +1,11 @@
diff --git a/generator/src/codegen.js b/generator/src/codegen.js diff --git a/generator/src/codegen.js b/generator/src/codegen.js
index a0ef8806e..fe00ac904 100644 index baf5368..e5edf4d 100644
--- a/generator/src/codegen.js --- a/generator/src/codegen.js
+++ b/generator/src/codegen.js +++ b/generator/src/codegen.js
@@ -20,33 +20,33 @@ async function generate(basePath) { @@ -37,9 +37,9 @@ export async function generate(basePath) {
copyToBoth("SiteConfig.elm"),
const uiFileContent = elmPagesUiFile(); fs.promises.writeFile("./.elm-pages/Pages.elm", uiFileContent),
await Promise.all([
- fs.promises.copyFile(
- path.join(__dirname, `./Page.elm`),
- `./.elm-pages/Page.elm`
+ fs.promises.writeFile(
+ `./.elm-pages/Page.elm`,
+ fs.readFileSync(path.join(__dirname, `./Page.elm`))
),
- fs.promises.copyFile( - fs.promises.copyFile(
- path.join(__dirname, `./elm-application.json`), - path.join(__dirname, `./elm-application.json`),
- `./elm-stuff/elm-pages/elm-application.json` - `./elm-stuff/elm-pages/elm-application.json`
@ -20,40 +13,27 @@ index a0ef8806e..fe00ac904 100644
+ `./elm-stuff/elm-pages/elm-application.json`, + `./elm-stuff/elm-pages/elm-application.json`,
+ fs.readFileSync(path.join(__dirname, `./elm-application.json`)) + fs.readFileSync(path.join(__dirname, `./elm-application.json`))
), ),
- fs.promises.copyFile(
- path.join(__dirname, `./Page.elm`),
- `./elm-stuff/elm-pages/.elm-pages/Page.elm`
+ fs.promises.writeFile(
+ `./elm-stuff/elm-pages/.elm-pages/Page.elm`,
+ fs.readFileSync(path.join(__dirname, `./Page.elm`))
),
- fs.promises.copyFile(
- path.join(__dirname, `./SharedTemplate.elm`),
- `./.elm-pages/SharedTemplate.elm`
+ fs.promises.writeFile(
+ `./.elm-pages/SharedTemplate.elm`,
+ fs.readFileSync(path.join(__dirname, `./SharedTemplate.elm`))
),
- fs.promises.copyFile(
- path.join(__dirname, `./SharedTemplate.elm`),
- `./elm-stuff/elm-pages/.elm-pages/SharedTemplate.elm`
+ fs.promises.writeFile(
+ `./elm-stuff/elm-pages/.elm-pages/SharedTemplate.elm`,
+ fs.readFileSync(path.join(__dirname, `./SharedTemplate.elm`))
),
- fs.promises.copyFile(
- path.join(__dirname, `./SiteConfig.elm`),
- `./.elm-pages/SiteConfig.elm`
+ fs.promises.writeFile(
+ `./.elm-pages/SiteConfig.elm`,
+ fs.readFileSync(path.join(__dirname, `./SiteConfig.elm`))
),
- fs.promises.copyFile(
- path.join(__dirname, `./SiteConfig.elm`),
- `./elm-stuff/elm-pages/.elm-pages/SiteConfig.elm`
+ fs.promises.writeFile(
+ `./elm-stuff/elm-pages/.elm-pages/SiteConfig.elm`,
+ fs.readFileSync(path.join(__dirname, `./SiteConfig.elm`))
),
fs.promises.writeFile("./.elm-pages/Pages.elm", uiFileContent),
// write `Pages.elm` with cli interface // 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));
}
/**

View file

@ -5,26 +5,6 @@
version = "1.0.0"; version = "1.0.0";
}; };
"elm/json" = {
sha256 = "1a107nmm905dih4w4mjjkkpdcjbgaf5qjvr7fl30kkpkckfjjnrw";
version = "1.1.2";
};
"elm/html" = {
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
version = "1.0.0";
};
"elm/svg" = {
sha256 = "1cwcj73p61q45wqwgqvrvz3aypjyy3fw732xyxdyj6s256hwkn0k";
version = "1.0.1";
};
"elm/project-metadata-utils" = {
sha256 = "1d4rd4grrnbdvj9gf00h7dr6hbkjzawgkzpizfrkp1z1pyr3mvq9";
version = "1.0.0";
};
"elm/browser" = { "elm/browser" = {
sha256 = "1zlmx672glg7fdgkvh5jm47y85pv7pdfr5mkhg6x7ar6k000vyka"; sha256 = "1zlmx672glg7fdgkvh5jm47y85pv7pdfr5mkhg6x7ar6k000vyka";
version = "1.0.1"; version = "1.0.1";
@ -35,11 +15,31 @@
version = "1.0.2"; version = "1.0.2";
}; };
"elm/html" = {
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
version = "1.0.0";
};
"elm/http" = { "elm/http" = {
sha256 = "008bs76mnp48b4dw8qwjj4fyvzbxvlrl4xpa2qh1gg2kfwyw56v1"; sha256 = "008bs76mnp48b4dw8qwjj4fyvzbxvlrl4xpa2qh1gg2kfwyw56v1";
version = "2.0.0"; version = "2.0.0";
}; };
"elm/json" = {
sha256 = "1a107nmm905dih4w4mjjkkpdcjbgaf5qjvr7fl30kkpkckfjjnrw";
version = "1.1.2";
};
"elm/project-metadata-utils" = {
sha256 = "1d4rd4grrnbdvj9gf00h7dr6hbkjzawgkzpizfrkp1z1pyr3mvq9";
version = "1.0.0";
};
"elm/svg" = {
sha256 = "1cwcj73p61q45wqwgqvrvz3aypjyy3fw732xyxdyj6s256hwkn0k";
version = "1.0.1";
};
"elm/bytes" = { "elm/bytes" = {
sha256 = "040d7irrawcbnq9jxhzx8p9qacdlw5bncy6lgndd6inm53rvvwbp"; sha256 = "040d7irrawcbnq9jxhzx8p9qacdlw5bncy6lgndd6inm53rvvwbp";
version = "1.0.7"; version = "1.0.7";
@ -55,13 +55,13 @@
version = "1.1.0"; version = "1.1.0";
}; };
"elm/url" = { "elm/time" = {
sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4"; sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1";
version = "1.0.0"; version = "1.0.0";
}; };
"elm/time" = { "elm/url" = {
sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1"; sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4";
version = "1.0.0"; version = "1.0.0";
}; };

View file

@ -1,12 +1,11 @@
{ mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary { mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary
, bytestring, containers, directory, edit-distance, fetchgit , bytestring, containers, directory, edit-distance, fetchgit
, file-embed, filelock, filepath, ghc-prim, haskeline, HTTP , file-embed, filelock, filepath, ghc-prim, haskeline, HTTP
, http-client, http-client-tls, http-types, language-glsl, mtl , http-client, http-client-tls, http-types, language-glsl, lib, mtl
, network, parsec, process, raw-strings-qq, scientific, SHA , network, parsec, process, raw-strings-qq, scientific, SHA
, snap-core, snap-server, lib, template-haskell, time , snap-core, snap-server, template-haskell, time
, unordered-containers, utf8-string, vector, zip-archive , unordered-containers, utf8-string, vector, zip-archive
}: }:
mkDerivation { mkDerivation {
pname = "elm"; pname = "elm";
version = "0.19.1"; version = "0.19.1";
@ -29,4 +28,5 @@ mkDerivation {
homepage = "https://elm-lang.org"; homepage = "https://elm-lang.org";
description = "The `elm` command line interface"; description = "The `elm` command line interface";
license = lib.licenses.bsd3; license = lib.licenses.bsd3;
mainProgram = "elm";
} }

File diff suppressed because it is too large Load diff