elmPackages.elm-pages: update patch for 3.0.x

This commit is contained in:
PedroHLC ☭ 2023-10-05 10:24:23 -03:00
parent e071414dfc
commit 800399a2ce
No known key found for this signature in database
GPG key ID: DF4C6898CBDC6DF5

View file

@ -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));
}
/**