diff options
author | PedroHLC ☭ <root@pedrohlc.com> | 2023-10-05 10:24:23 -0300 |
---|---|---|
committer | PedroHLC ☭ <root@pedrohlc.com> | 2023-10-05 10:24:23 -0300 |
commit | 800399a2ce0c5cadf91600f40746cf7387059735 (patch) | |
tree | e247f2e432f2d32dac988a8ea7ad05f681e81473 /pkgs/development/compilers/elm | |
parent | e071414dfccf9c3dd2ea6479b5a0dffaa3f8c46c (diff) |
elmPackages.elm-pages: update patch for 3.0.x
Diffstat (limited to 'pkgs/development/compilers/elm')
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch | 74 |
1 files changed, 27 insertions, 47 deletions
diff --git a/pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch b/pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch index ed9657f91151..547f89f86f69 100644 --- a/pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch +++ b/pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch @@ -1,18 +1,11 @@ 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 +++ 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(); - 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.writeFile("./.elm-pages/Pages.elm", uiFileContent), - fs.promises.copyFile( - path.join(__dirname, `./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`, + 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 + 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)); + } + + /** |