mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 15:12:01 +03:00
commit
d4a8342888
2
codegen/.gitignore
vendored
2
codegen/.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
Gen/
|
||||
elm-pages-codegen.js
|
||||
elm-pages-codegen.cjs
|
||||
|
||||
|
@ -3,11 +3,7 @@ import { defineConfig } from "cypress";
|
||||
export default defineConfig({
|
||||
defaultCommandTimeout: 20000,
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require("./cypress/plugins/index.js")(on, config);
|
||||
},
|
||||
setupNodeEvents(on, config) {},
|
||||
baseUrl: "http://localhost:1234",
|
||||
},
|
||||
});
|
||||
|
@ -1,22 +0,0 @@
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
}
|
2
elm.json
2
elm.json
@ -3,7 +3,7 @@
|
||||
"name": "dillonkearns/elm-pages-v3-beta",
|
||||
"summary": "A statically typed site generator.",
|
||||
"license": "BSD-3-Clause",
|
||||
"version": "10.0.0",
|
||||
"version": "11.0.0",
|
||||
"exposed-modules": [
|
||||
"Head",
|
||||
"Head.Seo",
|
||||
|
@ -1,2 +1,2 @@
|
||||
v17.2.0
|
||||
v19.2.0
|
||||
|
||||
|
@ -19,18 +19,18 @@ export default async function run({
|
||||
renderFunctionFilePath,
|
||||
"./functions/server-render/elm-pages-cli.js"
|
||||
);
|
||||
fs.copyFileSync(portsFilePath, "./functions/render/custom-backend-task.js");
|
||||
fs.copyFileSync(portsFilePath, "./functions/render/custom-backend-task.mjs");
|
||||
fs.copyFileSync(
|
||||
portsFilePath,
|
||||
"./functions/server-render/custom-backend-task.js"
|
||||
"./functions/server-render/custom-backend-task.mjs"
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
"./functions/render/index.js",
|
||||
"./functions/render/index.mjs",
|
||||
rendererCode(true, htmlTemplate)
|
||||
);
|
||||
fs.writeFileSync(
|
||||
"./functions/server-render/index.js",
|
||||
"./functions/server-render/index.mjs",
|
||||
rendererCode(false, htmlTemplate)
|
||||
);
|
||||
// TODO rename functions/render to functions/fallback-render
|
||||
@ -103,18 +103,21 @@ function isServerSide(route) {
|
||||
* @param {string} htmlTemplate
|
||||
*/
|
||||
function rendererCode(isOnDemand, htmlTemplate) {
|
||||
return `const path = require("path");
|
||||
const busboy = require("busboy");
|
||||
return `import * as path from "path";
|
||||
import * as busboy from "busboy";
|
||||
import { fileURLToPath } from "url";
|
||||
import * as renderer from "../../../../generator/src/render.js";
|
||||
import * as preRenderHtml from "../../../../generator/src/pre-render-html.js";
|
||||
const htmlTemplate = ${JSON.stringify(htmlTemplate)};
|
||||
|
||||
${
|
||||
isOnDemand
|
||||
? `const { builder } = require("@netlify/functions");
|
||||
? `import { builder } from "@netlify/functions";
|
||||
|
||||
exports.handler = builder(render);`
|
||||
export const handler = builder(render);`
|
||||
: `
|
||||
|
||||
exports.handler = render;`
|
||||
export const handler = render;`
|
||||
}
|
||||
|
||||
|
||||
@ -125,12 +128,8 @@ exports.handler = render;`
|
||||
async function render(event, context) {
|
||||
const requestTime = new Date();
|
||||
console.log(JSON.stringify(event));
|
||||
global.staticHttpCache = {};
|
||||
const compiledPortsFile = "./custom-backend-task.mjs";
|
||||
|
||||
const compiledElmPath = path.join(__dirname, "elm-pages-cli.js");
|
||||
const compiledPortsFile = path.join(__dirname, "custom-backend-task.js");
|
||||
const renderer = require("../../../../generator/src/render");
|
||||
const preRenderHtml = require("../../../../generator/src/pre-render-html");
|
||||
try {
|
||||
const basePath = "/";
|
||||
const mode = "build";
|
||||
@ -139,7 +138,7 @@ async function render(event, context) {
|
||||
const renderResult = await renderer.render(
|
||||
compiledPortsFile,
|
||||
basePath,
|
||||
require(compiledElmPath),
|
||||
(await import("./elm-pages-cli.js")).default,
|
||||
mode,
|
||||
event.path,
|
||||
await reqToJson(event, requestTime),
|
||||
|
@ -39,7 +39,7 @@ type alias RouteParams =
|
||||
|
||||
type alias ActionData =
|
||||
{ user : Maybe User
|
||||
, formResponse : Maybe { fields : List ( String, String ), errors : Dict String (List String) }
|
||||
, formResponse : Form.Response String
|
||||
}
|
||||
|
||||
|
||||
@ -191,16 +191,16 @@ action : RouteParams -> Parser (BackendTask FatalError (Server.Response.Response
|
||||
action routeParams =
|
||||
Request.formData (form |> Form.initCombined identity)
|
||||
|> Request.map
|
||||
(\userResult ->
|
||||
(\( response, userResult ) ->
|
||||
(case userResult of
|
||||
Ok user ->
|
||||
{ user = Just user
|
||||
, formResponse = Nothing
|
||||
, formResponse = response
|
||||
}
|
||||
|
||||
Err error ->
|
||||
{ user = Nothing
|
||||
, formResponse = Just error
|
||||
, formResponse = response
|
||||
}
|
||||
)
|
||||
|> Server.Response.render
|
||||
@ -270,7 +270,7 @@ view maybeUrl sharedModel app =
|
||||
, Attr.style "flex-direction" "column"
|
||||
, Attr.style "gap" "20px"
|
||||
]
|
||||
(app.action |> Maybe.andThen .formResponse)
|
||||
(.formResponse >> Just)
|
||||
app
|
||||
defaultUser
|
||||
]
|
||||
|
@ -72,7 +72,7 @@ data routeParams =
|
||||
Request.oneOf
|
||||
[ Request.formData (form |> Form.initCombined identity)
|
||||
|> MySession.withSession
|
||||
(\nameResult session ->
|
||||
(\( formResponse, nameResult ) session ->
|
||||
(nameResult
|
||||
|> unpack
|
||||
(\_ ->
|
||||
|
@ -104,7 +104,7 @@ data routeParams =
|
||||
Request.oneOf
|
||||
[ Request.formData (form |> Form.initCombined identity)
|
||||
|> Request.map
|
||||
(\formResult ->
|
||||
(\( formResponse, formResult ) ->
|
||||
BackendTask.succeed
|
||||
(Response.render
|
||||
{ results =
|
||||
@ -209,7 +209,7 @@ view maybeUrl sharedModel model static =
|
||||
|> Form.withGetMethod
|
||||
|> Form.renderHtml []
|
||||
-- TODO pass in server data
|
||||
Nothing
|
||||
(\_ -> Nothing)
|
||||
static
|
||||
()
|
||||
, static.data.results
|
||||
|
@ -60,6 +60,7 @@ route =
|
||||
action : RouteParams -> Request.Parser (BackendTask FatalError (Response ActionData ErrorPage))
|
||||
action _ =
|
||||
(Request.formData (form |> Form.initCombined identity)
|
||||
|> Request.map Tuple.second
|
||||
|> Request.map (Result.mapError (\error -> "Errors"))
|
||||
|> Request.andThen Request.fromResult
|
||||
)
|
||||
@ -270,7 +271,7 @@ view maybeUrl sharedModel model static =
|
||||
|> Form.toDynamicTransition "test1"
|
||||
|> Form.renderHtml []
|
||||
-- TODO pass in server data
|
||||
Nothing
|
||||
(\_ -> Nothing)
|
||||
static
|
||||
()
|
||||
]
|
||||
|
@ -563,7 +563,7 @@ action routeParams =
|
||||
}
|
||||
|> BackendTask.map Response.render
|
||||
|
||||
Err (Form.Response error) ->
|
||||
Err error ->
|
||||
BackendTask.succeed
|
||||
{ flashMessage = Err "Got errors"
|
||||
, user = defaultUser
|
||||
@ -592,7 +592,7 @@ type alias Data =
|
||||
type alias ActionData =
|
||||
{ user : User
|
||||
, flashMessage : Result String String
|
||||
, formResponse : Maybe { fields : List ( String, String ), errors : Dict String (List String) }
|
||||
, formResponse : Maybe (Form.Response String)
|
||||
}
|
||||
|
||||
|
||||
@ -722,9 +722,9 @@ view maybeUrl sharedModel model static =
|
||||
, form
|
||||
|> Form.toDynamicTransition "test"
|
||||
|> Form.renderStyledHtml []
|
||||
(static.action
|
||||
|> Maybe.andThen .formResponse
|
||||
)
|
||||
--static.action
|
||||
-- |> Maybe.andThen .formResponse
|
||||
(\_ -> Nothing)
|
||||
static
|
||||
()
|
||||
]
|
||||
|
@ -12,3 +12,4 @@
|
||||
|
||||
[functions]
|
||||
included_files = ["content/**"]
|
||||
node_bundler = "esbuild"
|
||||
|
@ -1,6 +1,6 @@
|
||||
// this middleware is only active when (config.base !== '/')
|
||||
|
||||
module.exports = function baseMiddleware(base) {
|
||||
export function baseMiddleware(base) {
|
||||
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
|
||||
return function viteBaseMiddleware(req, res, next) {
|
||||
// `req.url` only contains the path, since that is what gets passed in the HTTP request.
|
||||
@ -41,4 +41,4 @@ module.exports = function baseMiddleware(base) {
|
||||
|
||||
next();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
const fs = require("./dir-helpers.js");
|
||||
const fsPromises = require("fs").promises;
|
||||
|
||||
const { runElmReview } = require("./compile-elm.js");
|
||||
const { restoreColorSafe } = require("./error-formatter");
|
||||
const path = require("path");
|
||||
const spawnCallback = require("cross-spawn").spawn;
|
||||
const codegen = require("./codegen.js");
|
||||
const terser = require("terser");
|
||||
const os = require("os");
|
||||
const { Worker, SHARE_ENV } = require("worker_threads");
|
||||
const { ensureDirSync } = require("./file-helpers.js");
|
||||
const { generateClientFolder } = require("./codegen.js");
|
||||
const which = require("which");
|
||||
const { build } = require("vite");
|
||||
const preRenderHtml = require("./pre-render-html.js");
|
||||
const esbuild = require("esbuild");
|
||||
const { createHash } = require("crypto");
|
||||
const { merge_vite_configs } = require("./vite-utils.js");
|
||||
const { resolveConfig } = require("./config.js");
|
||||
const globby = require("globby");
|
||||
import * as fs from "./dir-helpers.js";
|
||||
import * as fsPromises from "fs/promises";
|
||||
import { runElmReview } from "./compile-elm.js";
|
||||
import { restoreColorSafe } from "./error-formatter.js";
|
||||
import * as path from "path";
|
||||
import { spawn as spawnCallback } from "cross-spawn";
|
||||
import * as codegen from "./codegen.js";
|
||||
import * as terser from "terser";
|
||||
import * as os from "os";
|
||||
import { Worker, SHARE_ENV } from "worker_threads";
|
||||
import { ensureDirSync } from "./file-helpers.js";
|
||||
import { generateClientFolder } from "./codegen.js";
|
||||
import { default as which } from "which";
|
||||
import { build } from "vite";
|
||||
import * as preRenderHtml from "./pre-render-html.js";
|
||||
import * as esbuild from "esbuild";
|
||||
import { createHash } from "crypto";
|
||||
import { merge_vite_configs } from "./vite-utils.js";
|
||||
import { resolveConfig } from "./config.js";
|
||||
import { globbySync } from "globby";
|
||||
import { fileURLToPath } from "url";
|
||||
import { copyFile } from "fs/promises";
|
||||
|
||||
let pool = [];
|
||||
let pagesReady;
|
||||
@ -65,7 +66,7 @@ async function ensureRequiredExecutables() {
|
||||
}
|
||||
}
|
||||
|
||||
async function run(options) {
|
||||
export async function run(options) {
|
||||
try {
|
||||
await ensureRequiredDirs();
|
||||
await ensureRequiredExecutables();
|
||||
@ -110,7 +111,11 @@ async function run(options) {
|
||||
withoutExtension
|
||||
);
|
||||
const assetManifestPath = path.join(process.cwd(), "dist/manifest.json");
|
||||
const manifest = require(assetManifestPath);
|
||||
const manifest = (
|
||||
await import(assetManifestPath, {
|
||||
assert: { type: "json" },
|
||||
})
|
||||
).default;
|
||||
const indexTemplate = await fsPromises.readFile(
|
||||
"dist/elm-stuff/elm-pages/index.html",
|
||||
"utf-8"
|
||||
@ -161,7 +166,7 @@ async function run(options) {
|
||||
})
|
||||
.catch((error) => {
|
||||
const portBackendTaskFileFound =
|
||||
globby.sync("./custom-backend-task.*").length > 0;
|
||||
globbySync("./custom-backend-task.*").length > 0;
|
||||
if (portBackendTaskFileFound) {
|
||||
// don't present error if there are no files matching custom-backend-task
|
||||
// if there are files matching custom-backend-task, warn the user in case something went wrong loading it
|
||||
@ -170,7 +175,7 @@ async function run(options) {
|
||||
});
|
||||
// TODO extract common code for compiling ports file?
|
||||
|
||||
XMLHttpRequest = {};
|
||||
global.XMLHttpRequest = {};
|
||||
const compileCli = compileCliApp(options);
|
||||
try {
|
||||
await compileCli;
|
||||
@ -207,6 +212,7 @@ async function run(options) {
|
||||
processedIndexTemplate
|
||||
);
|
||||
} catch (error) {
|
||||
console.trace(error);
|
||||
if (error) {
|
||||
console.error(restoreColorSafe(error));
|
||||
}
|
||||
@ -220,6 +226,8 @@ async function run(options) {
|
||||
*/
|
||||
function initWorker(basePath, whenDone) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
activeWorkers += 1;
|
||||
let newWorker = {
|
||||
worker: new Worker(path.join(__dirname, "./render-worker.js"), {
|
||||
@ -369,7 +377,7 @@ function elmOptimizeLevel2(outputPath, cwd) {
|
||||
|
||||
subprocess.on("close", async (code) => {
|
||||
if (code === 0) {
|
||||
await fs.copyFile(optimizedOutputPath, outputPath);
|
||||
await copyFile(optimizedOutputPath, outputPath);
|
||||
resolve();
|
||||
} else {
|
||||
if (!buildError) {
|
||||
@ -539,7 +547,7 @@ async function runTerser(filePath) {
|
||||
}
|
||||
}
|
||||
|
||||
async function compileCliApp(options) {
|
||||
export async function compileCliApp(options) {
|
||||
await spawnElmMake(
|
||||
// TODO should be --optimize, but there seems to be an issue with the html to JSON with --optimize
|
||||
options.debug ? "debug" : "optimize",
|
||||
@ -595,7 +603,7 @@ function _HtmlAsJson_toJson(html) {
|
||||
`;
|
||||
|
||||
await fsPromises.writeFile(
|
||||
ELM_FILE_PATH(),
|
||||
ELM_FILE_PATH().replace(/\.js$/, ".cjs"),
|
||||
elmFileContent
|
||||
.replace(
|
||||
/return \$elm\$json\$Json\$Encode\$string\(.REPLACE_ME_WITH_JSON_STRINGIFY.\)/g,
|
||||
@ -671,5 +679,3 @@ function defaultPreloadForFile(file) {
|
||||
* @param {string} contentJsonString
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
module.exports = { run, compileCliApp };
|
||||
|
@ -1,25 +1,27 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
|
||||
const build = require("./build.js");
|
||||
const dirHelpers = require("./dir-helpers.js");
|
||||
const dev = require("./dev-server.js");
|
||||
const init = require("./init.js");
|
||||
const codegen = require("./codegen.js");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { restoreColorSafe } = require("./error-formatter");
|
||||
const renderer = require("../../generator/src/render");
|
||||
const globby = require("globby");
|
||||
const esbuild = require("esbuild");
|
||||
const copyModifiedElmJson = require("./rewrite-elm-json.js");
|
||||
const { ensureDirSync, deleteIfExists } = require("./file-helpers.js");
|
||||
import * as build from "./build.js";
|
||||
import * as dev from "./dev-server.js";
|
||||
import * as init from "./init.js";
|
||||
import * as codegen from "./codegen.js";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import { restoreColorSafe } from "./error-formatter.js";
|
||||
import * as renderer from "./render.js";
|
||||
import { globbySync } from "globby";
|
||||
import * as esbuild from "esbuild";
|
||||
import { rewriteElmJson } from "./rewrite-elm-json.js";
|
||||
import { ensureDirSync, deleteIfExists } from "./file-helpers.js";
|
||||
|
||||
import * as commander from "commander";
|
||||
import { runElmCodegenInstall } from "./elm-codegen.js";
|
||||
|
||||
const commander = require("commander");
|
||||
const { runElmCodegenInstall } = require("./elm-codegen.js");
|
||||
const Argument = commander.Argument;
|
||||
const Option = commander.Option;
|
||||
|
||||
const packageVersion = require("../../package.json").version;
|
||||
import * as packageJson from "../../package.json" assert { type: "json" };
|
||||
const packageVersion = packageJson.version;
|
||||
|
||||
async function main() {
|
||||
const program = new commander.Command();
|
||||
@ -124,7 +126,7 @@ async function main() {
|
||||
path.join("./script/elm-stuff/elm-pages/.elm-pages/Main.elm"),
|
||||
generatorWrapperFile(moduleName)
|
||||
);
|
||||
await copyModifiedElmJson(
|
||||
await rewriteElmJson(
|
||||
"./script/elm.json",
|
||||
"./script/elm-stuff/elm-pages/elm.json"
|
||||
);
|
||||
@ -151,7 +153,7 @@ async function main() {
|
||||
})
|
||||
.catch((error) => {
|
||||
const portBackendTaskFileFound =
|
||||
globby.sync("./custom-backend-task.*").length > 0;
|
||||
globbySync("./custom-backend-task.*").length > 0;
|
||||
if (portBackendTaskFileFound) {
|
||||
// don't present error if there are no files matching custom-backend-task
|
||||
// if there are files matching custom-backend-task, warn the user in case something went wrong loading it
|
||||
@ -169,10 +171,14 @@ async function main() {
|
||||
// TODO have option for compiling with --debug or not (maybe allow running with elm-optimize-level-2 as well?)
|
||||
await build.compileCliApp({ debug: "debug" });
|
||||
process.chdir("../");
|
||||
fs.renameSync(
|
||||
"./script/elm-stuff/elm-pages/elm.js",
|
||||
"./script/elm-stuff/elm-pages/elm.cjs"
|
||||
);
|
||||
await renderer.runGenerator(
|
||||
unprocessedCliOptions,
|
||||
resolvedPortsPath,
|
||||
requireElm("./script/elm-stuff/elm-pages/elm.js"),
|
||||
await requireElm("./script/elm-stuff/elm-pages/elm.cjs"),
|
||||
moduleName
|
||||
);
|
||||
} catch (error) {
|
||||
@ -187,7 +193,7 @@ async function main() {
|
||||
.option("--port <number>", "serve site at localhost:<port>", "8000")
|
||||
.action(async (options) => {
|
||||
await codegen.generate("/");
|
||||
const DocServer = require("elm-doc-preview");
|
||||
const DocServer = (await import("elm-doc-preview")).default;
|
||||
const server = new DocServer({
|
||||
port: options.port,
|
||||
browser: true,
|
||||
@ -257,11 +263,11 @@ function normalizeUrl(rawPagePath) {
|
||||
/**
|
||||
* @param {string} compiledElmPath
|
||||
*/
|
||||
function requireElm(compiledElmPath) {
|
||||
async function requireElm(compiledElmPath) {
|
||||
const warnOriginal = console.warn;
|
||||
console.warn = function () {};
|
||||
|
||||
Elm = require(path.resolve(compiledElmPath));
|
||||
let Elm = (await import(path.resolve(compiledElmPath))).default;
|
||||
console.warn = warnOriginal;
|
||||
return Elm;
|
||||
}
|
||||
|
@ -1,21 +1,24 @@
|
||||
const fs = require("fs");
|
||||
const fsExtra = require("fs-extra");
|
||||
const copyModifiedElmJson = require("./rewrite-elm-json.js");
|
||||
const copyModifiedElmJsonClient = require("./rewrite-client-elm-json.js");
|
||||
const { elmPagesCliFile, elmPagesUiFile } = require("./elm-file-constants.js");
|
||||
const spawnCallback = require("cross-spawn").spawn;
|
||||
const which = require("which");
|
||||
const {
|
||||
generateTemplateModuleConnector,
|
||||
} = require("./generate-template-module-connector.js");
|
||||
const path = require("path");
|
||||
const { ensureDirSync, deleteIfExists } = require("./file-helpers.js");
|
||||
import * as fs from "fs";
|
||||
import * as fsExtra from "fs-extra/esm";
|
||||
import { rewriteElmJson } from "./rewrite-elm-json.js";
|
||||
import { rewriteClientElmJson } from "./rewrite-client-elm-json.js";
|
||||
import { elmPagesCliFile, elmPagesUiFile } from "./elm-file-constants.js";
|
||||
import { spawn as spawnCallback } from "cross-spawn";
|
||||
import { default as which } from "which";
|
||||
import { generateTemplateModuleConnector } from "./generate-template-module-connector.js";
|
||||
|
||||
import * as path from "path";
|
||||
import { ensureDirSync, deleteIfExists } from "./file-helpers.js";
|
||||
import { fileURLToPath } from "url";
|
||||
global.builtAt = new Date();
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
/**
|
||||
* @param {string} basePath
|
||||
*/
|
||||
async function generate(basePath) {
|
||||
export async function generate(basePath) {
|
||||
const cliCode = await generateTemplateModuleConnector(basePath, "cli");
|
||||
const browserCode = await generateTemplateModuleConnector(
|
||||
basePath,
|
||||
@ -63,7 +66,7 @@ async function generate(basePath) {
|
||||
browserCode.fetcherModules
|
||||
),
|
||||
// write modified elm.json to elm-stuff/elm-pages/
|
||||
copyModifiedElmJson("./elm.json", "./elm-stuff/elm-pages/elm.json"),
|
||||
rewriteElmJson("./elm.json", "./elm-stuff/elm-pages/elm.json"),
|
||||
// ...(await listFiles("./Pages/Internal")).map(copyToBoth),
|
||||
]);
|
||||
}
|
||||
@ -85,7 +88,7 @@ async function newCopyBoth(modulePath) {
|
||||
);
|
||||
}
|
||||
|
||||
async function generateClientFolder(basePath) {
|
||||
export async function generateClientFolder(basePath) {
|
||||
const browserCode = await generateTemplateModuleConnector(
|
||||
basePath,
|
||||
"browser"
|
||||
@ -97,7 +100,7 @@ async function generateClientFolder(basePath) {
|
||||
await newCopyBoth("SharedTemplate.elm");
|
||||
await newCopyBoth("SiteConfig.elm");
|
||||
|
||||
await copyModifiedElmJsonClient();
|
||||
await rewriteClientElmJson();
|
||||
await fsExtra.copy("./app", "./elm-stuff/elm-pages/client/app", {
|
||||
recursive: true,
|
||||
});
|
||||
@ -230,5 +233,3 @@ async function listFiles(dir) {
|
||||
function merge(arrays) {
|
||||
return [].concat.apply([], arrays);
|
||||
}
|
||||
|
||||
module.exports = { generate, generateClientFolder };
|
||||
|
@ -1 +1 @@
|
||||
module.exports = { compatibilityKey: 6 };
|
||||
export const compatibilityKey = 6;
|
||||
|
@ -1,17 +1,21 @@
|
||||
const spawnCallback = require("cross-spawn").spawn;
|
||||
const fs = require("fs");
|
||||
const fsHelpers = require("./dir-helpers.js");
|
||||
const fsPromises = require("fs").promises;
|
||||
const path = require("path");
|
||||
const kleur = require("kleur");
|
||||
const { inject } = require("elm-hot");
|
||||
import { spawn as spawnCallback } from "cross-spawn";
|
||||
import * as fs from "fs";
|
||||
import * as fsHelpers from "./dir-helpers.js";
|
||||
import * as fsPromises from "fs/promises";
|
||||
import * as path from "path";
|
||||
import * as kleur from "kleur/colors";
|
||||
import { inject } from "elm-hot";
|
||||
import { fileURLToPath } from "url";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
export async function compileElmForBrowser(options) {
|
||||
// TODO do I need to make sure this is run from the right cwd? Before it was run outside of this function in the global scope, need to make sure that doesn't change semantics.
|
||||
const pathToClientElm = path.join(
|
||||
process.cwd(),
|
||||
"elm-stuff/elm-pages/",
|
||||
"browser-elm.js"
|
||||
);
|
||||
|
||||
async function compileElmForBrowser(options) {
|
||||
await runElm(options, "./.elm-pages/Main.elm", pathToClientElm);
|
||||
return fs.promises.writeFile(
|
||||
"./.elm-pages/cache/elm.js",
|
||||
@ -26,7 +30,7 @@ async function compileElmForBrowser(options) {
|
||||
);
|
||||
}
|
||||
|
||||
async function compileCliApp(
|
||||
export async function compileCliApp(
|
||||
options,
|
||||
elmEntrypointPath,
|
||||
outputPath,
|
||||
@ -79,7 +83,7 @@ function _HtmlAsJson_toJson(html) {
|
||||
`;
|
||||
|
||||
await fsPromises.writeFile(
|
||||
readFrom,
|
||||
readFrom.replace(/\.js$/, ".cjs"),
|
||||
elmFileContent
|
||||
.replace(
|
||||
/return \$elm\$json\$Json\$Encode\$string\(.REPLACE_ME_WITH_JSON_STRINGIFY.\)/g,
|
||||
@ -211,7 +215,7 @@ async function runElm(options, elmEntrypointPath, outputPath, cwd) {
|
||||
/**
|
||||
* @param {string} [ cwd ]
|
||||
*/
|
||||
async function runElmReview(cwd) {
|
||||
export async function runElmReview(cwd) {
|
||||
const startTime = Date.now();
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = spawnCallback(
|
||||
@ -284,12 +288,6 @@ function elmOptimizeLevel2(outputPath, cwd) {
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
compileElmForBrowser,
|
||||
runElmReview,
|
||||
compileCliApp,
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} start
|
||||
* @param {number} subtract
|
||||
|
@ -1,6 +1,6 @@
|
||||
const path = require("path");
|
||||
import * as path from "path";
|
||||
|
||||
async function resolveConfig() {
|
||||
export async function resolveConfig() {
|
||||
const initialConfig = await await import(
|
||||
path.join(process.cwd(), "elm-pages.config.mjs")
|
||||
)
|
||||
@ -37,5 +37,3 @@ function defaultHeadTagsTemplate(context) {
|
||||
<meta name="generator" content="elm-pages v${context.cliVersion}" />
|
||||
`;
|
||||
}
|
||||
|
||||
module.exports = { resolveConfig };
|
||||
|
@ -1,40 +1,56 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const which = require("which");
|
||||
const chokidar = require("chokidar");
|
||||
const { URL } = require("url");
|
||||
const {
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
import { default as which } from "which";
|
||||
import * as chokidar from "chokidar";
|
||||
import { URL } from "url";
|
||||
import {
|
||||
compileElmForBrowser,
|
||||
runElmReview,
|
||||
compileCliApp,
|
||||
} = require("./compile-elm.js");
|
||||
const http = require("http");
|
||||
const https = require("https");
|
||||
const codegen = require("./codegen.js");
|
||||
const kleur = require("kleur");
|
||||
const serveStatic = require("serve-static");
|
||||
const connect = require("connect");
|
||||
const { restoreColorSafe } = require("./error-formatter");
|
||||
const { Worker, SHARE_ENV } = require("worker_threads");
|
||||
const os = require("os");
|
||||
const { ensureDirSync } = require("./file-helpers.js");
|
||||
const baseMiddleware = require("./basepath-middleware.js");
|
||||
const devcert = require("devcert");
|
||||
const busboy = require("busboy");
|
||||
const { createServer: createViteServer } = require("vite");
|
||||
const cliVersion = require("../../package.json").version;
|
||||
const esbuild = require("esbuild");
|
||||
const { merge_vite_configs } = require("./vite-utils.js");
|
||||
const { templateHtml } = require("./pre-render-html.js");
|
||||
const { resolveConfig } = require("./config.js");
|
||||
const globby = require("globby");
|
||||
} from "./compile-elm.js";
|
||||
import * as http from "http";
|
||||
import * as https from "https";
|
||||
import * as codegen from "./codegen.js";
|
||||
import * as kleur from "kleur/colors";
|
||||
import { default as serveStatic } from "serve-static";
|
||||
import { default as connect } from "connect";
|
||||
import { restoreColorSafe } from "./error-formatter.js";
|
||||
import { Worker, SHARE_ENV } from "worker_threads";
|
||||
import * as os from "os";
|
||||
import { ensureDirSync } from "./file-helpers.js";
|
||||
import { baseMiddleware } from "./basepath-middleware.js";
|
||||
import * as devcert from "devcert";
|
||||
import * as busboy from "busboy";
|
||||
import { createServer as createViteServer } from "vite";
|
||||
import * as esbuild from "esbuild";
|
||||
import { merge_vite_configs } from "./vite-utils.js";
|
||||
import { templateHtml } from "./pre-render-html.js";
|
||||
import { resolveConfig } from "./config.js";
|
||||
import { globbySync } from "globby";
|
||||
import * as packageJson from "../../package.json" assert { type: "json" };
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const cliVersion = packageJson.version;
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
/**
|
||||
* @param {{ port: string; base: string; https: boolean; debug: boolean; }} options
|
||||
*/
|
||||
async function start(options) {
|
||||
export async function start(options) {
|
||||
let threadReadyQueue = [];
|
||||
let pool = [];
|
||||
|
||||
function restartPool() {
|
||||
pool.forEach((thread) => thread.worker.terminate());
|
||||
const poolSize = Math.max(1, cpuCount / 2 - 1);
|
||||
pool = [];
|
||||
|
||||
for (let index = 0; index < poolSize; index++) {
|
||||
pool.push(initWorker(options.base));
|
||||
}
|
||||
}
|
||||
|
||||
ensureDirSync(path.join(process.cwd(), ".elm-pages", "http-response-cache"));
|
||||
const cpuCount = os.cpus().length;
|
||||
|
||||
@ -46,6 +62,7 @@ async function start(options) {
|
||||
const serveCachedFiles = serveStatic(".elm-pages/cache", { index: false });
|
||||
const generatedFilesDirectory = "elm-stuff/elm-pages/generated-files";
|
||||
fs.mkdirSync(generatedFilesDirectory, { recursive: true });
|
||||
|
||||
const serveStaticCode = serveStatic(
|
||||
path.join(__dirname, "../static-code"),
|
||||
{}
|
||||
@ -175,7 +192,7 @@ async function start(options) {
|
||||
})
|
||||
.catch((error) => {
|
||||
const portBackendTaskFileFound =
|
||||
globby.sync("./custom-backend-task.*").length > 0;
|
||||
globbySync("./custom-backend-task.*").length > 0;
|
||||
if (portBackendTaskFileFound) {
|
||||
// don't present error if there are no files matching custom-backend-task
|
||||
// if there are files matching custom-backend-task, warn the user in case something went wrong loading it
|
||||
@ -246,6 +263,7 @@ async function start(options) {
|
||||
}
|
||||
}
|
||||
elmMakeRunning = true;
|
||||
restartPool();
|
||||
if (codegenError) {
|
||||
const errorJson = JSON.stringify({
|
||||
type: "compile-errors",
|
||||
@ -784,4 +802,3 @@ function paramsToObject(entries) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
module.exports = { start };
|
||||
|
@ -1,5 +1,7 @@
|
||||
const util = require("util");
|
||||
const fsSync = require("fs");
|
||||
import * as util from "util";
|
||||
import * as fsSync from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
const fs = {
|
||||
writeFile: util.promisify(fsSync.writeFile),
|
||||
writeFileSync: fsSync.writeFileSync,
|
||||
@ -15,14 +17,14 @@ const fs = {
|
||||
/**
|
||||
* @param {import("fs").PathLike} dirName
|
||||
*/
|
||||
async function tryMkdir(dirName) {
|
||||
export async function tryMkdir(dirName) {
|
||||
const exists = await fs.exists(dirName);
|
||||
if (!exists) {
|
||||
await fs.mkdir(dirName, { recursive: true });
|
||||
}
|
||||
}
|
||||
|
||||
function fileExists(file) {
|
||||
export function fileExists(file) {
|
||||
return fsSync.promises
|
||||
.access(file, fsSync.constants.F_OK)
|
||||
.then(() => true)
|
||||
@ -33,18 +35,16 @@ function fileExists(file) {
|
||||
* @param {string} filePath
|
||||
* @param {string} data
|
||||
*/
|
||||
function writeFileSyncSafe(filePath, data) {
|
||||
export function writeFileSyncSafe(filePath, data) {
|
||||
fsSync.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||
fs.writeFileSync(filePath, data);
|
||||
}
|
||||
|
||||
const path = require("path");
|
||||
|
||||
/**
|
||||
* @param {string} srcDirectory
|
||||
* @param {string} destDir
|
||||
*/
|
||||
async function copyDirFlat(srcDirectory, destDir) {
|
||||
export async function copyDirFlat(srcDirectory, destDir) {
|
||||
const items = await fs.readdir(srcDirectory);
|
||||
items.forEach(function (childItemName) {
|
||||
copyDirNested(
|
||||
@ -58,7 +58,7 @@ async function copyDirFlat(srcDirectory, destDir) {
|
||||
* @param {string} src
|
||||
* @param {string} dest
|
||||
*/
|
||||
async function copyDirNested(src, dest) {
|
||||
export async function copyDirNested(src, dest) {
|
||||
var exists = fsSync.existsSync(src);
|
||||
var stats = exists && fsSync.statSync(src);
|
||||
var isDirectory = exists && stats.isDirectory();
|
||||
@ -76,19 +76,3 @@ async function copyDirNested(src, dest) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
writeFile: fs.writeFile,
|
||||
writeFileSync: fs.writeFileSync,
|
||||
readFile: fs.readFile,
|
||||
readFileSync: fsSync.readFileSync,
|
||||
copyFile: fs.copyFile,
|
||||
exists: fs.exists,
|
||||
writeFileSyncSafe,
|
||||
tryMkdir,
|
||||
copyDirFlat,
|
||||
copyDirNested,
|
||||
rmSync: fs.rm,
|
||||
rm: fs.rm,
|
||||
existsSync: fs.existsSync,
|
||||
fileExists: fileExists,
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
const spawnCallback = require("cross-spawn").spawn;
|
||||
import { spawn as spawnCallback } from "cross-spawn";
|
||||
|
||||
function runElmCodegenInstall() {
|
||||
export function runElmCodegenInstall() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const subprocess = spawnCallback(`elm-codegen`, ["install"], {
|
||||
// ignore stdout
|
||||
@ -33,5 +33,3 @@ function runElmCodegenInstall() {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { runElmCodegenInstall };
|
||||
|
@ -1,4 +1,4 @@
|
||||
function elmPagesUiFile() {
|
||||
export function elmPagesUiFile() {
|
||||
return `module Pages exposing (builtAt)
|
||||
|
||||
import Time
|
||||
@ -12,7 +12,6 @@ builtAt =
|
||||
`;
|
||||
}
|
||||
|
||||
function elmPagesCliFile() {
|
||||
export function elmPagesCliFile() {
|
||||
return elmPagesUiFile();
|
||||
}
|
||||
module.exports = { elmPagesUiFile, elmPagesCliFile };
|
||||
|
@ -1,4 +1,6 @@
|
||||
const kleur = require("kleur");
|
||||
"use strict";
|
||||
|
||||
import * as kleur from "kleur/colors";
|
||||
|
||||
/* Thanks to elm-live for this code!
|
||||
https://github.com/wking-io/elm-live/blob/e317b4914c471addea7243c47f28dcebe27a5d36/lib/src/build.js#L65
|
||||
@ -82,7 +84,7 @@ function toKleurColor(color) {
|
||||
/**
|
||||
* @param {RootObject} error
|
||||
* */
|
||||
const restoreColor = (error) => {
|
||||
export const restoreColor = (error) => {
|
||||
try {
|
||||
if (error.type === "compile-errors") {
|
||||
return error.errors
|
||||
@ -111,7 +113,7 @@ const restoreColor = (error) => {
|
||||
* @param {string} error
|
||||
* @returns {string}
|
||||
*/
|
||||
function restoreColorSafe(error) {
|
||||
export function restoreColorSafe(error) {
|
||||
try {
|
||||
if (typeof error === "string") {
|
||||
const asJson = JSON.parse(error);
|
||||
@ -149,8 +151,6 @@ const restoreProblem =
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { restoreColor, restoreColorSafe };
|
||||
|
||||
/** @typedef { CompilerError | ReportError | IElmReviewError } RootObject */
|
||||
|
||||
/** @typedef { { type: "compile-errors"; errors: Error_[]; } } CompilerError */
|
||||
|
@ -1,7 +1,6 @@
|
||||
const fs = require("fs");
|
||||
module.exports = { ensureDirSync, deleteIfExists };
|
||||
import * as fs from "fs";
|
||||
|
||||
function ensureDirSync(dirpath) {
|
||||
export function ensureDirSync(dirpath) {
|
||||
try {
|
||||
fs.mkdirSync(dirpath, { recursive: true });
|
||||
} catch (err) {
|
||||
@ -9,7 +8,7 @@ function ensureDirSync(dirpath) {
|
||||
}
|
||||
}
|
||||
|
||||
function deleteIfExists(/** @type string */ filePath) {
|
||||
export function deleteIfExists(/** @type string */ filePath) {
|
||||
if (fs.existsSync(filePath)) {
|
||||
fs.unlinkSync(filePath);
|
||||
}
|
||||
|
@ -1,17 +1,16 @@
|
||||
const globby = require("globby");
|
||||
const path = require("path");
|
||||
const mm = require("micromatch");
|
||||
const routeHelpers = require("./route-codegen-helpers");
|
||||
const { runElmCodegenInstall } = require("./elm-codegen");
|
||||
const { compileCliApp } = require("./compile-elm");
|
||||
const { restoreColorSafe } = require("./error-formatter");
|
||||
import { globbySync } from "globby";
|
||||
import * as path from "path";
|
||||
import { default as mm } from "micromatch";
|
||||
import * as routeHelpers from "./route-codegen-helpers.js";
|
||||
import { restoreColorSafe } from "./error-formatter.js";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
/**
|
||||
* @param {string} basePath
|
||||
* @param {'browser' | 'cli'} phase
|
||||
*/
|
||||
async function generateTemplateModuleConnector(basePath, phase) {
|
||||
const templates = globby.sync(["app/Route/**/*.elm"], {}).map((file) => {
|
||||
export async function generateTemplateModuleConnector(basePath, phase) {
|
||||
const templates = globbySync(["app/Route/**/*.elm"], {}).map((file) => {
|
||||
const captures = mm.capture("app/Route/**/*.elm", file);
|
||||
if (captures) {
|
||||
return path.join(captures[0], captures[1]).split(path.sep);
|
||||
@ -63,10 +62,12 @@ async function generateTemplateModuleConnector(basePath, phase) {
|
||||
}
|
||||
|
||||
async function runElmCodegenCli(templates, basePath, phase) {
|
||||
const filePath = path.join(__dirname, `../../codegen/elm-pages-codegen.js`);
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const filePath = path.join(__dirname, `../../codegen/elm-pages-codegen.cjs`);
|
||||
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
const elmPagesCodegen = require(filePath).Elm.Generate;
|
||||
const promise = new Promise(async (resolve, reject) => {
|
||||
const elmPagesCodegen = (await import(filePath)).default.Elm.Generate;
|
||||
|
||||
const app = elmPagesCodegen.init({
|
||||
flags: { templates: templates, basePath, phase },
|
||||
@ -91,7 +92,7 @@ async function runElmCodegenCli(templates, basePath, phase) {
|
||||
* @param {string[][]} templates
|
||||
* @returns
|
||||
*/
|
||||
function sortTemplates(templates) {
|
||||
export function sortTemplates(templates) {
|
||||
return templates.sort((first, second) => {
|
||||
const a = sortScore(first);
|
||||
const b = sortScore(second);
|
||||
@ -230,5 +231,3 @@ submit toMsg options =
|
||||
function camelToKebab(input) {
|
||||
return input.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
||||
}
|
||||
|
||||
module.exports = { generateTemplateModuleConnector, sortTemplates };
|
||||
|
@ -1,12 +1,15 @@
|
||||
const fs = require("fs");
|
||||
const copySync = require("fs-extra").copySync;
|
||||
const path = require("path");
|
||||
const kleur = require("kleur");
|
||||
import * as fs from "fs";
|
||||
import { copySync } from "fs-extra/esm";
|
||||
import * as path from "path";
|
||||
import * as kleur from "kleur/colors";
|
||||
import { fileURLToPath } from "url";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
*/
|
||||
async function run(name) {
|
||||
export async function run(name) {
|
||||
console.log("Creating " + name + " project...");
|
||||
|
||||
const appRoot = path.resolve(name.toString());
|
||||
@ -36,5 +39,3 @@ async function run(name) {
|
||||
kleur.green("Project is successfully created in `" + appRoot + "`.")
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = { run };
|
||||
|
@ -1,11 +1,14 @@
|
||||
const seo = require("./seo-renderer.js");
|
||||
const cliVersion = require("../../package.json").version;
|
||||
const path = require("path");
|
||||
import * as seo from "./seo-renderer.js";
|
||||
import * as packageJson from "../../package.json" assert { type: "json" };
|
||||
import * as path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const cliVersion = packageJson.version;
|
||||
|
||||
/** @typedef { { head: any[]; errors: any[]; html: string; route: string; title: string; } } Arg */
|
||||
/** @typedef { { tag : 'PageProgress'; args : Arg[] } } PageProgress */
|
||||
|
||||
function wrapHtml(basePath, fromElm, contentDatPayload) {
|
||||
export function wrapHtml(basePath, fromElm, contentDatPayload) {
|
||||
const seoData = seo.gather(fromElm.head);
|
||||
return {
|
||||
kind: "html-template",
|
||||
@ -21,7 +24,9 @@ function wrapHtml(basePath, fromElm, contentDatPayload) {
|
||||
* @param {boolean} devMode
|
||||
* @param {(context: {cliVersion: string;}) => string} userHeadTagsTemplate
|
||||
*/
|
||||
function templateHtml(devMode, userHeadTagsTemplate) {
|
||||
export function templateHtml(devMode, userHeadTagsTemplate) {
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
return /* html */ `<!DOCTYPE html>
|
||||
<!-- ROOT --><html lang="en">
|
||||
<head>
|
||||
@ -65,7 +70,7 @@ function indent(snippet) {
|
||||
/**
|
||||
* @param {string} processedTemplate
|
||||
*/
|
||||
function replaceTemplate(processedTemplate, info) {
|
||||
export function replaceTemplate(processedTemplate, info) {
|
||||
return processedTemplate
|
||||
.replace(
|
||||
/<!--\s*PLACEHOLDER_HEAD_AND_DATA\s*-->/,
|
||||
@ -76,9 +81,3 @@ function replaceTemplate(processedTemplate, info) {
|
||||
.replace(/<!--\s*PLACEHOLDER_HTML\s* -->/, info.html)
|
||||
.replace(/<!-- ROOT -->\S*<html lang="en">/m, info.rootElement);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
wrapHtml,
|
||||
templateHtml,
|
||||
replaceTemplate,
|
||||
};
|
||||
|
@ -1,11 +1,9 @@
|
||||
const renderer = require("../../generator/src/render");
|
||||
const path = require("path");
|
||||
const fs = require("./dir-helpers.js");
|
||||
const compiledElmPath = path.join(process.cwd(), "elm-stuff/elm-pages/elm.js");
|
||||
const { parentPort, threadId, workerData } = require("worker_threads");
|
||||
let Elm;
|
||||
|
||||
global.staticHttpCache = {};
|
||||
import * as renderer from "../../generator/src/render.js";
|
||||
import * as path from "path";
|
||||
import * as fs from "./dir-helpers.js";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { stat } from "fs/promises";
|
||||
import { parentPort, threadId, workerData } from "worker_threads";
|
||||
|
||||
async function run({ mode, pathname, serverRequest, portsFilePath }) {
|
||||
console.time(`${threadId} ${pathname}`);
|
||||
@ -13,7 +11,7 @@ async function run({ mode, pathname, serverRequest, portsFilePath }) {
|
||||
const renderResult = await renderer.render(
|
||||
portsFilePath,
|
||||
workerData.basePath,
|
||||
requireElm(mode),
|
||||
await requireElm(mode),
|
||||
mode,
|
||||
pathname,
|
||||
serverRequest,
|
||||
@ -42,20 +40,17 @@ async function run({ mode, pathname, serverRequest, portsFilePath }) {
|
||||
console.timeEnd(`${threadId} ${pathname}`);
|
||||
}
|
||||
|
||||
function requireElm(mode) {
|
||||
if (mode === "build") {
|
||||
if (!Elm) {
|
||||
async function requireElm(mode) {
|
||||
const compiledElmPath = path.join(
|
||||
process.cwd(),
|
||||
"elm-stuff/elm-pages/elm.cjs"
|
||||
);
|
||||
let elmImportPath = compiledElmPath;
|
||||
const warnOriginal = console.warn;
|
||||
console.warn = function () {};
|
||||
|
||||
Elm = require(compiledElmPath);
|
||||
const Elm = (await import(elmImportPath)).default;
|
||||
console.warn = warnOriginal;
|
||||
}
|
||||
return Elm;
|
||||
} else {
|
||||
delete require.cache[require.resolve(compiledElmPath)];
|
||||
return require(compiledElmPath);
|
||||
}
|
||||
}
|
||||
|
||||
async function outputString(
|
||||
@ -67,13 +62,13 @@ async function outputString(
|
||||
const args = fromElm;
|
||||
const normalizedRoute = args.route.replace(/index$/, "");
|
||||
await fs.tryMkdir(`./dist/${normalizedRoute}`);
|
||||
const template = await fs.readFileSync("./dist/template.html", "utf8");
|
||||
fs.writeFileSync(
|
||||
const template = readFileSync("./dist/template.html", "utf8");
|
||||
writeFileSync(
|
||||
`dist/${normalizedRoute}/index.html`,
|
||||
renderTemplate(template, fromElm)
|
||||
);
|
||||
args.contentDatPayload &&
|
||||
fs.writeFileSync(
|
||||
writeFileSync(
|
||||
`dist/${normalizedRoute}/content.dat`,
|
||||
Buffer.from(args.contentDatPayload.buffer)
|
||||
);
|
||||
|
@ -1,24 +1,22 @@
|
||||
// @ts-check
|
||||
|
||||
const path = require("path");
|
||||
const mm = require("micromatch");
|
||||
const matter = require("gray-matter");
|
||||
const globby = require("globby");
|
||||
const fsPromises = require("fs").promises;
|
||||
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;
|
||||
import * as path from "path";
|
||||
import { default as mm } from "micromatch";
|
||||
import { default as matter } from "gray-matter";
|
||||
import { globby } from "globby";
|
||||
import * as fsPromises from "fs/promises";
|
||||
import * as preRenderHtml from "./pre-render-html.js";
|
||||
import { lookupOrPerform } from "./request-cache.js";
|
||||
import * as kleur from "kleur/colors";
|
||||
import * as cookie from "cookie-signature";
|
||||
import { compatibilityKey } from "./compatibility-key.js";
|
||||
import * as fs from "fs";
|
||||
|
||||
process.on("unhandledRejection", (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
let foundErrors;
|
||||
|
||||
module.exports = { render, runGenerator };
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} basePath
|
||||
@ -29,7 +27,7 @@ module.exports = { render, runGenerator };
|
||||
* @param {boolean} hasFsAccess
|
||||
* @returns
|
||||
*/
|
||||
async function render(
|
||||
export async function render(
|
||||
portsFile,
|
||||
basePath,
|
||||
elmModule,
|
||||
@ -39,12 +37,12 @@ async function render(
|
||||
addBackendTaskWatcher,
|
||||
hasFsAccess
|
||||
) {
|
||||
const { fs, resetInMemoryFs } = require("./request-cache-fs.js")(hasFsAccess);
|
||||
resetInMemoryFs();
|
||||
// const { fs, resetInMemoryFs } = require("./request-cache-fs.js")(hasFsAccess);
|
||||
// resetInMemoryFs();
|
||||
foundErrors = false;
|
||||
// since init/update are never called in pre-renders, and BackendTask.Http is called using pure NodeJS HTTP fetching
|
||||
// we can provide a fake HTTP instead of xhr2 (which is otherwise needed for Elm HTTP requests from Node)
|
||||
XMLHttpRequest = {};
|
||||
global.XMLHttpRequest = {};
|
||||
const result = await runElmApp(
|
||||
portsFile,
|
||||
basePath,
|
||||
@ -53,7 +51,6 @@ async function render(
|
||||
path,
|
||||
request,
|
||||
addBackendTaskWatcher,
|
||||
fs,
|
||||
hasFsAccess
|
||||
);
|
||||
return result;
|
||||
@ -66,19 +63,19 @@ async function render(
|
||||
* @param {any} portsFile
|
||||
* @param {string} scriptModuleName
|
||||
*/
|
||||
async function runGenerator(
|
||||
export async function runGenerator(
|
||||
cliOptions,
|
||||
portsFile,
|
||||
elmModule,
|
||||
scriptModuleName
|
||||
) {
|
||||
global.isRunningGenerator = true;
|
||||
const { fs, resetInMemoryFs } = require("./request-cache-fs.js")(true);
|
||||
resetInMemoryFs();
|
||||
// const { fs, resetInMemoryFs } = require("./request-cache-fs.js")(true);
|
||||
// resetInMemoryFs();
|
||||
foundErrors = false;
|
||||
// since init/update are never called in pre-renders, and BackendTask.Http is called using pure NodeJS HTTP fetching
|
||||
// we can provide a fake HTTP instead of xhr2 (which is otherwise needed for Elm HTTP requests from Node)
|
||||
XMLHttpRequest = {};
|
||||
global.XMLHttpRequest = {};
|
||||
const result = await runGeneratorAppHelp(
|
||||
cliOptions,
|
||||
portsFile,
|
||||
@ -87,7 +84,6 @@ async function runGenerator(
|
||||
scriptModuleName,
|
||||
"production",
|
||||
"",
|
||||
fs,
|
||||
true
|
||||
);
|
||||
return result;
|
||||
@ -112,7 +108,6 @@ function runGeneratorAppHelp(
|
||||
scriptModuleName,
|
||||
mode,
|
||||
pagePath,
|
||||
fs,
|
||||
hasFsAccess
|
||||
) {
|
||||
const isDevServer = mode !== "build";
|
||||
@ -182,7 +177,6 @@ function runGeneratorAppHelp(
|
||||
app,
|
||||
mode,
|
||||
requestToPerform,
|
||||
fs,
|
||||
hasFsAccess,
|
||||
patternsToWatch
|
||||
);
|
||||
@ -193,7 +187,6 @@ function runGeneratorAppHelp(
|
||||
app,
|
||||
mode,
|
||||
requestToPerform,
|
||||
fs,
|
||||
hasFsAccess,
|
||||
requestToPerform
|
||||
);
|
||||
@ -236,7 +229,6 @@ function runElmApp(
|
||||
pagePath,
|
||||
request,
|
||||
addBackendTaskWatcher,
|
||||
fs,
|
||||
hasFsAccess
|
||||
) {
|
||||
const isDevServer = mode !== "build";
|
||||
@ -250,7 +242,6 @@ function runElmApp(
|
||||
.replace(/content\.dat\/?$/, "");
|
||||
|
||||
const modifiedRequest = { ...request, path: route };
|
||||
// console.log("StaticHttp cache keys", Object.keys(global.staticHttpCache));
|
||||
app = elmModule.Elm.Main.init({
|
||||
flags: {
|
||||
mode,
|
||||
@ -284,9 +275,6 @@ function runElmApp(
|
||||
console.log(fromElm.value);
|
||||
} else if (fromElm.tag === "ApiResponse") {
|
||||
const args = fromElm.args[0];
|
||||
if (mode === "build") {
|
||||
global.staticHttpCache = args.staticHttpCache;
|
||||
}
|
||||
|
||||
resolve({
|
||||
kind: "api-response",
|
||||
@ -296,10 +284,6 @@ function runElmApp(
|
||||
});
|
||||
} else if (fromElm.tag === "PageProgress") {
|
||||
const args = fromElm.args[0];
|
||||
if (mode === "build") {
|
||||
global.staticHttpCache = args.staticHttpCache;
|
||||
}
|
||||
|
||||
if (isBytes) {
|
||||
resolve({
|
||||
kind: "bytes",
|
||||
@ -331,7 +315,6 @@ function runElmApp(
|
||||
app,
|
||||
mode,
|
||||
requestToPerform,
|
||||
fs,
|
||||
hasFsAccess,
|
||||
patternsToWatch
|
||||
);
|
||||
@ -342,7 +325,6 @@ function runElmApp(
|
||||
app,
|
||||
mode,
|
||||
requestToPerform,
|
||||
fs,
|
||||
hasFsAccess,
|
||||
requestToPerform
|
||||
);
|
||||
@ -415,7 +397,6 @@ async function runHttpJob(
|
||||
app,
|
||||
mode,
|
||||
requestToPerform,
|
||||
fs,
|
||||
hasFsAccess,
|
||||
useCache
|
||||
) {
|
||||
@ -474,7 +455,6 @@ async function runInternalJob(
|
||||
app,
|
||||
mode,
|
||||
requestToPerform,
|
||||
fs,
|
||||
hasFsAccess,
|
||||
patternsToWatch
|
||||
) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
const path = require("path");
|
||||
const kleur = require("kleur");
|
||||
const fsPromises = require("fs/promises");
|
||||
import * as path from "path";
|
||||
import * as fsPromises from "fs/promises";
|
||||
import * as kleur from "kleur/colors";
|
||||
import { default as makeFetchHappenOriginal } from "make-fetch-happen";
|
||||
|
||||
const defaultHttpCachePath = "./.elm-pages/http-cache";
|
||||
|
||||
@ -13,8 +14,14 @@ const defaultHttpCachePath = "./.elm-pages/http-cache";
|
||||
* @param {boolean} hasFsAccess
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess, useCache) {
|
||||
const makeFetchHappen = require("make-fetch-happen").defaults({
|
||||
export function lookupOrPerform(
|
||||
portsFile,
|
||||
mode,
|
||||
rawRequest,
|
||||
hasFsAccess,
|
||||
useCache
|
||||
) {
|
||||
const makeFetchHappen = makeFetchHappenOriginal.defaults({
|
||||
cache: mode === "build" ? "no-cache" : "default",
|
||||
});
|
||||
return new Promise(async (resolve, reject) => {
|
||||
@ -29,7 +36,7 @@ function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess, useCache) {
|
||||
const portBackendTaskPath = path.resolve(portsFile);
|
||||
// On Windows, we need cannot use paths directly and instead must use a file:// URL.
|
||||
// portBackendTask = await require(url.pathToFileURL(portBackendTaskPath).href);
|
||||
portBackendTask = require(portBackendTaskPath);
|
||||
portBackendTask = await import(portBackendTaskPath);
|
||||
} catch (e) {
|
||||
portBackendTaskImportError = e;
|
||||
}
|
||||
@ -270,5 +277,3 @@ async function canAccess(filePath) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { lookupOrPerform };
|
||||
|
@ -1,6 +1,6 @@
|
||||
const fs = require("fs");
|
||||
import * as fs from "fs";
|
||||
|
||||
module.exports = async function () {
|
||||
export async function rewriteClientElmJson() {
|
||||
var elmJson = JSON.parse(
|
||||
(await fs.promises.readFile("./elm.json")).toString()
|
||||
);
|
||||
@ -9,11 +9,11 @@ module.exports = async function () {
|
||||
|
||||
await writeFileIfChanged(
|
||||
"./elm-stuff/elm-pages/client/elm.json",
|
||||
JSON.stringify(rewriteElmJson(elmJson))
|
||||
JSON.stringify(rewriteClientElmJsonHelp(elmJson))
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function rewriteElmJson(elmJson) {
|
||||
function rewriteClientElmJsonHelp(elmJson) {
|
||||
// The internal generated file will be at:
|
||||
// ./elm-stuff/elm-pages/
|
||||
// So, we need to take the existing elmJson and
|
||||
|
@ -1,6 +1,6 @@
|
||||
const fs = require("fs");
|
||||
import * as fs from "fs";
|
||||
|
||||
module.exports = async function (sourceElmJsonPath, targetElmJsonPath) {
|
||||
export async function rewriteElmJson(sourceElmJsonPath, targetElmJsonPath) {
|
||||
var elmJson = JSON.parse(
|
||||
(await fs.promises.readFile(sourceElmJsonPath)).toString()
|
||||
);
|
||||
@ -9,11 +9,11 @@ module.exports = async function (sourceElmJsonPath, targetElmJsonPath) {
|
||||
|
||||
await writeFileIfChanged(
|
||||
targetElmJsonPath,
|
||||
JSON.stringify(rewriteElmJson(elmJson))
|
||||
JSON.stringify(rewriteElmJsonHelp(elmJson))
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function rewriteElmJson(elmJson) {
|
||||
function rewriteElmJsonHelp(elmJson) {
|
||||
// The internal generated file will be at:
|
||||
// ./elm-stuff/elm-pages/
|
||||
// So, we need to take the existing elmJson and
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @param {string[]} name
|
||||
*/
|
||||
function routeParams(name) {
|
||||
export function routeParams(name) {
|
||||
return name
|
||||
.map((section) => {
|
||||
const routeParamMatch = section.match(/([A-Z][A-Za-z0-9]*)__?$/);
|
||||
@ -17,7 +17,7 @@ function routeParams(name) {
|
||||
* @param {string[]} name
|
||||
* @returns {Segment[]}
|
||||
*/
|
||||
function parseRouteParams(name) {
|
||||
export function parseRouteParams(name) {
|
||||
return name.flatMap((section) => {
|
||||
const routeParamMatch = section.match(/([A-Z][A-Za-z0-9]*)(_?_?)$/);
|
||||
const maybeParam = (routeParamMatch && routeParamMatch[1]) || "TODO";
|
||||
@ -68,7 +68,7 @@ function parseRouteParams(name) {
|
||||
* @param {string[]} name
|
||||
* @returns {( Segment | {kind: 'static'; name: string})[]}
|
||||
*/
|
||||
function parseRouteParamsWithStatic(name) {
|
||||
export function parseRouteParamsWithStatic(name) {
|
||||
return name.flatMap((section) => {
|
||||
const routeParamMatch = section.match(/([A-Z][A-Za-z0-9]*)(_?_?)$/);
|
||||
const maybeParam = (routeParamMatch && routeParamMatch[1]) || "TODO";
|
||||
@ -123,7 +123,7 @@ function parseRouteParamsWithStatic(name) {
|
||||
* @param {string[]} name
|
||||
* @returns {string}
|
||||
*/
|
||||
function routeVariantDefinition(name) {
|
||||
export function routeVariantDefinition(name) {
|
||||
const newLocal = parseRouteParams(name);
|
||||
if (newLocal.length == 0) {
|
||||
return routeVariant(name);
|
||||
@ -151,7 +151,7 @@ function routeVariantDefinition(name) {
|
||||
* @param {string[]} name
|
||||
* @returns {string}
|
||||
*/
|
||||
function toPathPattern(name) {
|
||||
export function toPathPattern(name) {
|
||||
return (
|
||||
"/" +
|
||||
parseRouteParamsWithStatic(name)
|
||||
@ -181,7 +181,7 @@ function toPathPattern(name) {
|
||||
* @param {string[]} name
|
||||
* @returns {string[]}
|
||||
*/
|
||||
function toPathPatterns(name) {
|
||||
export function toPathPatterns(name) {
|
||||
const segments = parseRouteParamsWithStatic(name);
|
||||
|
||||
const lastSegment = segments[segments.length - 1];
|
||||
@ -199,7 +199,7 @@ function toPathPatterns(name) {
|
||||
/**
|
||||
* @param {string[]} segments
|
||||
*/
|
||||
function joinPath(segments) {
|
||||
export function joinPath(segments) {
|
||||
const joined = segments.join("/");
|
||||
if (joined.startsWith("/")) {
|
||||
return joined;
|
||||
@ -211,7 +211,7 @@ function joinPath(segments) {
|
||||
/**
|
||||
* @return {string[]}
|
||||
*/
|
||||
function newHelper(segments) {
|
||||
export function newHelper(segments) {
|
||||
return segments.map((param) => {
|
||||
switch (param.kind) {
|
||||
case "static": {
|
||||
@ -238,7 +238,7 @@ function newHelper(segments) {
|
||||
* @param {string[]} name
|
||||
* @returns {string}
|
||||
*/
|
||||
function toElmPathPattern(name) {
|
||||
export function toElmPathPattern(name) {
|
||||
const parsedSegments = parseRouteParamsWithStatic(name);
|
||||
|
||||
const foundEndings = parsedSegments.flatMap((segment) => {
|
||||
@ -297,14 +297,14 @@ function toElmPathPattern(name) {
|
||||
* @param {string} input
|
||||
* @returns {string}
|
||||
*/
|
||||
function camelToKebab(input) {
|
||||
export function camelToKebab(input) {
|
||||
return input.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string[]} name
|
||||
*/
|
||||
function paramsRecord(name) {
|
||||
export function paramsRecord(name) {
|
||||
return `{ ${parseRouteParams(name).map((param) => {
|
||||
switch (param.kind) {
|
||||
case "dynamic": {
|
||||
@ -326,7 +326,7 @@ function paramsRecord(name) {
|
||||
/**
|
||||
* @param {string[]} name
|
||||
*/
|
||||
function routeVariant(name) {
|
||||
export function routeVariant(name) {
|
||||
return `${name.join("__")}`;
|
||||
}
|
||||
|
||||
@ -334,44 +334,29 @@ function routeVariant(name) {
|
||||
* @param {string[]} name
|
||||
* @param {string} paramsName
|
||||
*/
|
||||
function destructureRoute(name, paramsName) {
|
||||
export function destructureRoute(name, paramsName) {
|
||||
return emptyRouteParams(name)
|
||||
? `Route.${routeVariant(name)}`
|
||||
: `(Route.${routeVariant(name)} ${paramsName})`;
|
||||
}
|
||||
|
||||
function referenceRouteParams(name, paramsName) {
|
||||
export function referenceRouteParams(name, paramsName) {
|
||||
return emptyRouteParams(name) ? `{}` : paramsName;
|
||||
}
|
||||
/**
|
||||
* @param {string[]} name
|
||||
*/
|
||||
function emptyRouteParams(name) {
|
||||
export function emptyRouteParams(name) {
|
||||
return parseRouteParams(name).length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
*/
|
||||
function toFieldName(name) {
|
||||
export function toFieldName(name) {
|
||||
if (name === "SPLAT") {
|
||||
return "splat";
|
||||
} else {
|
||||
return name.charAt(0).toLowerCase() + name.slice(1);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
routeParams,
|
||||
routeVariantDefinition,
|
||||
routeVariant,
|
||||
toFieldName,
|
||||
paramsRecord,
|
||||
toPathPattern,
|
||||
toPathPatterns,
|
||||
parseRouteParams,
|
||||
parseRouteParamsWithStatic,
|
||||
toElmPathPattern,
|
||||
destructureRoute,
|
||||
referenceRouteParams,
|
||||
};
|
||||
|
@ -1,11 +1,9 @@
|
||||
module.exports = { gather };
|
||||
|
||||
/** @typedef { { type: 'root'; keyValuePair: [string, string] } } RootTagModifier */
|
||||
|
||||
/**
|
||||
* @param {( SeoTag | RootTagModifier )[]} tags
|
||||
*/
|
||||
function gather(tags) {
|
||||
export function gather(tags) {
|
||||
const withoutRootModifiers = tags.flatMap((value) => {
|
||||
if (value.type === "root") {
|
||||
return [];
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @param {...import('vite').UserConfig} configs
|
||||
* @returns {import('vite').UserConfig}
|
||||
*/
|
||||
function merge_vite_configs(...configs) {
|
||||
export function merge_vite_configs(...configs) {
|
||||
return deep_merge(
|
||||
...configs.map((config) => ({
|
||||
...config,
|
||||
@ -75,4 +75,3 @@ function merge_into(a, b) {
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = { merge_vite_configs };
|
||||
|
@ -1,5 +1,6 @@
|
||||
var assert = require("assert");
|
||||
const { sortTemplates } = require("../src/generate-template-module-connector");
|
||||
import * as assert from "assert";
|
||||
|
||||
import { sortTemplates } from "../src/generate-template-module-connector.js";
|
||||
describe("sort", function () {
|
||||
it("purely static comes before dynamic routes", function () {
|
||||
assert.deepStrictEqual(
|
||||
|
@ -1,8 +1,6 @@
|
||||
var assert = require("assert");
|
||||
const {
|
||||
toPathPattern,
|
||||
toPathPatterns,
|
||||
} = require("../src/route-codegen-helpers.js");
|
||||
import * as assert from "assert";
|
||||
|
||||
import { toPathPattern, toPathPatterns } from "../src/route-codegen-helpers.js";
|
||||
|
||||
describe("toPathPattern", function () {
|
||||
it("index is normalized", function () {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"types": ["node"],
|
||||
"module": "commonjs",
|
||||
"module": "esnext",
|
||||
"checkJs": true,
|
||||
"allowJs": true,
|
||||
"target": "es5",
|
||||
|
258
package-lock.json
generated
258
package-lock.json
generated
@ -1,17 +1,17 @@
|
||||
{
|
||||
"name": "elm-pages",
|
||||
"version": "3.0.0-beta.18",
|
||||
"version": "3.0.0-beta.19",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "elm-pages",
|
||||
"version": "3.0.0-beta.18",
|
||||
"version": "3.0.0-beta.19",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"busboy": "^1.0.0",
|
||||
"chokidar": "^3.5.3",
|
||||
"commander": "^9.5.0",
|
||||
"commander": "^10.0.0",
|
||||
"connect": "^3.7.0",
|
||||
"cookie-signature": "^1.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
@ -19,8 +19,8 @@
|
||||
"elm-doc-preview": "^5.0.5",
|
||||
"elm-hot": "^1.1.6",
|
||||
"esbuild": "^0.16.15",
|
||||
"fs-extra": "^10.1.0",
|
||||
"globby": "11.0.4",
|
||||
"fs-extra": "^11.1.0",
|
||||
"globby": "^13.1.3",
|
||||
"gray-matter": "^4.0.3",
|
||||
"jsesc": "^3.0.2",
|
||||
"kleur": "^4.1.5",
|
||||
@ -30,7 +30,7 @@
|
||||
"serve-static": "^1.15.0",
|
||||
"terser": "^5.16.1",
|
||||
"vite": "^4.0.4",
|
||||
"which": "^2.0.2"
|
||||
"which": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"elm-pages": "generator/src/cli.js"
|
||||
@ -42,7 +42,7 @@
|
||||
"@types/micromatch": "^4.0.2",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/serve-static": "^1.15.0",
|
||||
"cypress": "^12.3.0",
|
||||
"cypress": "^12.4.0",
|
||||
"elm-codegen": "^0.2.0",
|
||||
"elm-optimize-level-2": "^0.3.5",
|
||||
"elm-review": "^2.8.2",
|
||||
@ -1025,14 +1025,6 @@
|
||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
||||
},
|
||||
"node_modules/array-union": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
|
||||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/asn1": {
|
||||
"version": "0.2.6",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
|
||||
@ -1882,11 +1874,11 @@
|
||||
"integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w=="
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz",
|
||||
"integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/common-tags": {
|
||||
@ -1971,10 +1963,24 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn/node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/cypress": {
|
||||
"version": "12.3.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.3.0.tgz",
|
||||
"integrity": "sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==",
|
||||
"version": "12.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.4.0.tgz",
|
||||
"integrity": "sha512-//h93K/yGC/7pxv1KamlkADbKHLp5h3f9rZDE2McRjXZDagMETH0sXowOOanvhsH8cFt/JWspIcK+p9cuaoAqg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
@ -2487,6 +2493,21 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-review/node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-solve-deps-wasm": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/elm-solve-deps-wasm/-/elm-solve-deps-wasm-1.0.2.tgz",
|
||||
@ -2526,6 +2547,15 @@
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-test/node_modules/commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-test/node_modules/glob": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz",
|
||||
@ -2557,6 +2587,21 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-test/node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-tooling": {
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/elm-tooling/-/elm-tooling-1.11.0.tgz",
|
||||
@ -2633,6 +2678,15 @@
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/elm-verify-examples/node_modules/commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-verify-examples/node_modules/elm-test": {
|
||||
"version": "0.19.1-revision9",
|
||||
"resolved": "https://registry.npmjs.org/elm-test/-/elm-test-0.19.1-revision9.tgz",
|
||||
@ -2808,6 +2862,21 @@
|
||||
"node": ">= 4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/elm-verify-examples/node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/elmi-to-json": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/elmi-to-json/-/elmi-to-json-1.4.3.tgz",
|
||||
@ -3425,16 +3494,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz",
|
||||
"integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=14.14"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-minipass": {
|
||||
@ -3593,19 +3662,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/globby": {
|
||||
"version": "11.0.4",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz",
|
||||
"integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==",
|
||||
"version": "13.1.3",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz",
|
||||
"integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==",
|
||||
"dependencies": {
|
||||
"array-union": "^2.1.0",
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.1.1",
|
||||
"ignore": "^5.1.4",
|
||||
"merge2": "^1.3.0",
|
||||
"slash": "^3.0.0"
|
||||
"fast-glob": "^3.2.11",
|
||||
"ignore": "^5.2.0",
|
||||
"merge2": "^1.4.1",
|
||||
"slash": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@ -6491,11 +6559,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/slash": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
||||
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
|
||||
"integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/slice-ansi": {
|
||||
@ -7223,17 +7294,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz",
|
||||
"integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==",
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
"node-which": "bin/which.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which-module": {
|
||||
@ -8160,11 +8231,6 @@
|
||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
||||
},
|
||||
"array-union": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
|
||||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw=="
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.6",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
|
||||
@ -8807,9 +8873,9 @@
|
||||
"integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w=="
|
||||
},
|
||||
"commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ=="
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz",
|
||||
"integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA=="
|
||||
},
|
||||
"common-tags": {
|
||||
"version": "1.8.2",
|
||||
@ -8870,12 +8936,22 @@
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
"which": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cypress": {
|
||||
"version": "12.3.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.3.0.tgz",
|
||||
"integrity": "sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==",
|
||||
"version": "12.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.4.0.tgz",
|
||||
"integrity": "sha512-//h93K/yGC/7pxv1KamlkADbKHLp5h3f9rZDE2McRjXZDagMETH0sXowOOanvhsH8cFt/JWspIcK+p9cuaoAqg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cypress/request": "^2.88.10",
|
||||
@ -9280,6 +9356,15 @@
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -9316,6 +9401,12 @@
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"dev": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz",
|
||||
@ -9337,6 +9428,15 @@
|
||||
"requires": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -9404,6 +9504,12 @@
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"dev": true
|
||||
},
|
||||
"commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"dev": true
|
||||
},
|
||||
"elm-test": {
|
||||
"version": "0.19.1-revision9",
|
||||
"resolved": "https://registry.npmjs.org/elm-test/-/elm-test-0.19.1-revision9.tgz",
|
||||
@ -9535,6 +9641,15 @@
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
|
||||
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -10017,9 +10132,9 @@
|
||||
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz",
|
||||
"integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
@ -10144,16 +10259,15 @@
|
||||
}
|
||||
},
|
||||
"globby": {
|
||||
"version": "11.0.4",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz",
|
||||
"integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==",
|
||||
"version": "13.1.3",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz",
|
||||
"integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==",
|
||||
"requires": {
|
||||
"array-union": "^2.1.0",
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.1.1",
|
||||
"ignore": "^5.1.4",
|
||||
"merge2": "^1.3.0",
|
||||
"slash": "^3.0.0"
|
||||
"fast-glob": "^3.2.11",
|
||||
"ignore": "^5.2.0",
|
||||
"merge2": "^1.4.1",
|
||||
"slash": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"got": {
|
||||
@ -12284,9 +12398,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"slash": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
||||
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
|
||||
"integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew=="
|
||||
},
|
||||
"slice-ansi": {
|
||||
"version": "3.0.0",
|
||||
@ -12807,9 +12921,9 @@
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz",
|
||||
"integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==",
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
|
17
package.json
17
package.json
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "elm-pages",
|
||||
"version": "3.0.0-beta.18",
|
||||
"type": "module",
|
||||
"version": "3.0.0-beta.19",
|
||||
"homepage": "https://elm-pages.com",
|
||||
"moduleResolution": "node",
|
||||
"description": "Type-safe static sites, written in pure elm with your own custom elm-markup syntax.",
|
||||
@ -10,7 +11,7 @@
|
||||
"test": "./test.sh",
|
||||
"test:snapshot": "(cd examples/escaping && npm install && npm test) && (cd examples/base-path && npm install && npm test)",
|
||||
"cypress": "npm start & cypress run",
|
||||
"build:generator": "elm-codegen install && (cd codegen && lamdera make Generate.elm --output elm-pages-codegen.js)",
|
||||
"build:generator": "elm-codegen install && (cd codegen && lamdera make Generate.elm --output elm-pages-codegen.js && mv elm-pages-codegen.js elm-pages-codegen.cjs)",
|
||||
"review": "elm-review"
|
||||
},
|
||||
"repository": "https://github.com/dillonkearns/elm-pages",
|
||||
@ -26,7 +27,7 @@
|
||||
"dependencies": {
|
||||
"busboy": "^1.0.0",
|
||||
"chokidar": "^3.5.3",
|
||||
"commander": "^9.5.0",
|
||||
"commander": "^10.0.0",
|
||||
"connect": "^3.7.0",
|
||||
"cookie-signature": "^1.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
@ -34,8 +35,8 @@
|
||||
"elm-doc-preview": "^5.0.5",
|
||||
"elm-hot": "^1.1.6",
|
||||
"esbuild": "^0.16.15",
|
||||
"fs-extra": "^10.1.0",
|
||||
"globby": "11.0.4",
|
||||
"fs-extra": "^11.1.0",
|
||||
"globby": "^13.1.3",
|
||||
"gray-matter": "^4.0.3",
|
||||
"jsesc": "^3.0.2",
|
||||
"kleur": "^4.1.5",
|
||||
@ -45,7 +46,7 @@
|
||||
"serve-static": "^1.15.0",
|
||||
"terser": "^5.16.1",
|
||||
"vite": "^4.0.4",
|
||||
"which": "^2.0.2"
|
||||
"which": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cross-spawn": "^6.0.2",
|
||||
@ -54,7 +55,7 @@
|
||||
"@types/micromatch": "^4.0.2",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/serve-static": "^1.15.0",
|
||||
"cypress": "^12.3.0",
|
||||
"cypress": "^12.4.0",
|
||||
"elm-codegen": "^0.2.0",
|
||||
"elm-optimize-level-2": "^0.3.5",
|
||||
"elm-review": "^2.8.2",
|
||||
@ -70,7 +71,7 @@
|
||||
"generator/review/",
|
||||
"generator/dead-code-review/",
|
||||
"src/",
|
||||
"codegen/elm-pages-codegen.js",
|
||||
"codegen/elm-pages-codegen.cjs",
|
||||
"generator/template/",
|
||||
"generator/static-code/"
|
||||
],
|
||||
|
8
tsconfig.json
Normal file
8
tsconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"target": "ESNext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user