mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 01:12:50 +03:00
Add script to automate updating compatibility key.
This commit is contained in:
parent
cc7344d815
commit
91192ca39a
@ -1 +0,0 @@
|
||||
1
|
1
generator/compatibility-key.js
Normal file
1
generator/compatibility-key.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = { compatibilityKey: 1 };
|
@ -9,6 +9,7 @@ const preRenderHtml = require("./pre-render-html.js");
|
||||
const { lookupOrPerform } = require("./request-cache.js");
|
||||
const kleur = require("kleur");
|
||||
const cookie = require("cookie-signature");
|
||||
const { compatibilityKey } = require("../compatibility-key.js");
|
||||
kleur.enabled = true;
|
||||
|
||||
process.on("unhandledRejection", (error) => {
|
||||
@ -17,7 +18,6 @@ process.on("unhandledRejection", (error) => {
|
||||
let foundErrors;
|
||||
let pendingDataSourceResponses;
|
||||
let pendingDataSourceCount;
|
||||
const compatibilityKey = 1;
|
||||
|
||||
module.exports =
|
||||
/**
|
||||
|
@ -23,6 +23,7 @@ import PageServerResponse exposing (PageServerResponse)
|
||||
import Pages.Flags
|
||||
import Pages.Http
|
||||
import Pages.Internal.NotFoundReason as NotFoundReason exposing (NotFoundReason)
|
||||
import Pages.Internal.Platform.CompatibilityKey
|
||||
import Pages.Internal.Platform.Effect as Effect exposing (Effect)
|
||||
import Pages.Internal.Platform.StaticResponses as StaticResponses exposing (StaticResponses)
|
||||
import Pages.Internal.Platform.ToJsPayload as ToJsPayload
|
||||
@ -49,7 +50,7 @@ type alias Flags =
|
||||
{-| -}
|
||||
currentCompatibilityKey : Int
|
||||
currentCompatibilityKey =
|
||||
1
|
||||
Pages.Internal.Platform.CompatibilityKey.currentCompatibilityKey
|
||||
|
||||
|
||||
{-| -}
|
||||
|
1276
src/Pages/Internal/Platform/Cli.elm.bak
Normal file
1276
src/Pages/Internal/Platform/Cli.elm.bak
Normal file
File diff suppressed because it is too large
Load Diff
6
src/Pages/Internal/Platform/CompatibilityKey.elm
Normal file
6
src/Pages/Internal/Platform/CompatibilityKey.elm
Normal file
@ -0,0 +1,6 @@
|
||||
module Pages.Internal.Platform.CompatibilityKey exposing (currentCompatibilityKey)
|
||||
|
||||
|
||||
currentCompatibilityKey : Int
|
||||
currentCompatibilityKey =
|
||||
1
|
33
update-compatibility-keys.js
Executable file
33
update-compatibility-keys.js
Executable file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/node
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const currentCompatibilityKey = 1;
|
||||
|
||||
fs.writeFileSync(
|
||||
"src/Pages/Internal/Platform/CompatibilityKey.elm",
|
||||
`module Pages.Internal.Platform.CompatibilityKey exposing (currentCompatibilityKey)
|
||||
|
||||
|
||||
currentCompatibilityKey : Int
|
||||
currentCompatibilityKey =
|
||||
${currentCompatibilityKey}
|
||||
`
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
"generator/compatibility-key.js",
|
||||
`module.exports = { compatibilityKey: ${currentCompatibilityKey} };
|
||||
`
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
"./README.md",
|
||||
fs
|
||||
.readFileSync("./README.md")
|
||||
.toString()
|
||||
.replace(
|
||||
/Current Compatibility Key: \d+\./,
|
||||
`Current Compatibility Key: ${currentCompatibilityKey}.`
|
||||
)
|
||||
);
|
Loading…
Reference in New Issue
Block a user