elm-pages 3.0.7 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,7 +75,7 @@ console.elmlog = (str) => logs.push(str + "\n");
75
75
  const { Elm } = require("./Runner.elm.js");
76
76
 
77
77
  // Start the Elm app
78
- const flags = { initialSeed: 3448341197, fuzzRuns: 100, filter: null };
78
+ const flags = { initialSeed: 2473597562, fuzzRuns: 100, filter: null };
79
79
  const app = Elm.Runner.init({ flags: flags });
80
80
 
81
81
  // Record the timing at which we received the last "runTest" message
@@ -82,7 +82,7 @@ const verbosity = 0;
82
82
  // Create a long lived reporter worker
83
83
  const { Elm } = require("./Reporter.elm.js");
84
84
  const flags = {
85
- initialSeed: 3448341197,
85
+ initialSeed: 2473597562,
86
86
  fuzzRuns: 100,
87
87
  mode: "consoleNoColor",
88
88
  verbosity: verbosity,
@@ -75,7 +75,7 @@ console.elmlog = (str) => logs.push(str + "\n");
75
75
  const { Elm } = require("./Runner.elm.js");
76
76
 
77
77
  // Start the Elm app
78
- const flags = { initialSeed: 1590047921, fuzzRuns: 100, filter: null };
78
+ const flags = { initialSeed: 4202591380, fuzzRuns: 100, filter: null };
79
79
  const app = Elm.Runner.init({ flags: flags });
80
80
 
81
81
  // Record the timing at which we received the last "runTest" message
@@ -82,7 +82,7 @@ const verbosity = 0;
82
82
  // Create a long lived reporter worker
83
83
  const { Elm } = require("./Reporter.elm.js");
84
84
  const flags = {
85
- initialSeed: 1590047921,
85
+ initialSeed: 4202591380,
86
86
  fuzzRuns: 100,
87
87
  mode: "consoleNoColor",
88
88
  verbosity: verbosity,
@@ -73,7 +73,7 @@ export async function run(options) {
73
73
  // This is a temporary hack to avoid this warning. elm-pages manages compiling the Elm code without Vite's involvement, so it is external to Vite.
74
74
  // There is a pending issue to allow having external scripts in Vite, once this issue is fixed we can remove this hack:
75
75
  // https://github.com/vitejs/vite/issues/3533
76
- if (!messages[0]?.startsWith(`<script src="/elm.js">`)) {
76
+ if (messages && messages[0] && !messages[0].startsWith(`<script src="/elm.js">`)) {
77
77
  console.info(...messages);
78
78
  }
79
79
  };
@@ -1,3 +1,3 @@
1
1
  export const compatibilityKey = 20;
2
2
 
3
- export const packageVersion = "3.0.7";
3
+ export const packageVersion = "3.0.8";
@@ -37,7 +37,7 @@ const __dirname = path.dirname(__filename);
37
37
  */
38
38
  export async function start(options) {
39
39
  console.error = function (...messages) {
40
- if (!messages[0]?.startsWith("Failed to load url")) {
40
+ if (messages && messages[0] && !messages[0].startsWith("Failed to load url")) {
41
41
  console.info(...messages);
42
42
  }
43
43
  };
@@ -3,7 +3,7 @@ import * as path from "path";
3
3
  import { default as mm } from "micromatch";
4
4
  import * as routeHelpers from "./route-codegen-helpers.js";
5
5
  import { restoreColorSafe } from "./error-formatter.js";
6
- import { fileURLToPath } from "url";
6
+ import { fileURLToPath, pathToFileURL } from "url";
7
7
 
8
8
  /**
9
9
  * @param {string} basePath
@@ -66,7 +66,7 @@ export async function generateTemplateModuleConnector(basePath, phase) {
66
66
  async function runElmCodegenCli(templates, basePath, phase) {
67
67
  const __filename = fileURLToPath(import.meta.url);
68
68
  const __dirname = path.dirname(__filename);
69
- const filePath = path.join(__dirname, `../../codegen/elm-pages-codegen.cjs`);
69
+ const filePath = pathToFileURL(path.join(__dirname, `../../codegen/elm-pages-codegen.cjs`)).href;
70
70
 
71
71
  const promise = new Promise(async (resolve, reject) => {
72
72
  const elmPagesCodegen = (await import(filePath)).default.Elm.Generate;
@@ -10,7 +10,7 @@ export function merge_vite_configs(...configs) {
10
10
  ...config,
11
11
  resolve: {
12
12
  ...config.resolve,
13
- alias: normalize_alias(config.resolve?.alias || {}),
13
+ alias: normalize_alias((config.resolve && config.resolve.alias) || {}),
14
14
  },
15
15
  }))
16
16
  );
@@ -106,7 +106,7 @@ function find_anchor(node) {
106
106
  Object.defineProperty(SubmitEvent.prototype, "fields", {
107
107
  get: function fields() {
108
108
  let formData = new FormData(this.currentTarget);
109
- if (this.submitter?.name) {
109
+ if (this.submitter && this.submitter.name) {
110
110
  formData.append(this.submitter.name, this.submitter.value);
111
111
  }
112
112
  return [...formData.entries()];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elm-pages",
3
3
  "type": "module",
4
- "version": "3.0.7",
4
+ "version": "3.0.8",
5
5
  "homepage": "https://elm-pages.com",
6
6
  "moduleResolution": "node",
7
7
  "description": "Type-safe static sites, written in pure elm with your own custom elm-markup syntax.",
@@ -392,7 +392,7 @@ update config appMsg model =
392
392
  let
393
393
  navigatingToSamePage : Bool
394
394
  navigatingToSamePage =
395
- url.path == model.url.path
395
+ url.path == model.url.path && url.query == model.url.query && url.fragment /= Nothing
396
396
  in
397
397
  if navigatingToSamePage then
398
398
  -- this is a workaround for an issue with anchor fragment navigation
@@ -403,7 +403,7 @@ update config appMsg model =
403
403
 
404
404
  else
405
405
  ( model
406
- , BrowserPushUrl url.path
406
+ , BrowserPushUrl (Url.toString url)
407
407
  )
408
408
 
409
409
  Browser.External href ->
@@ -425,12 +425,21 @@ update config appMsg model =
425
425
 
426
426
  Nothing ->
427
427
  if model.url.path == url.path && model.url.query == url.query then
428
- ( { model
429
- | -- update the URL in case query params or fragment changed
430
- url = url
431
- }
432
- , NoEffect
433
- )
428
+ if url.fragment == Nothing then
429
+ ( { model
430
+ | -- update the URL in case query params or fragment changed
431
+ url = url
432
+ }
433
+ , ScrollToTop
434
+ )
435
+
436
+ else
437
+ ( { model
438
+ | -- update the URL in case query params or fragment changed
439
+ url = url
440
+ }
441
+ , NoEffect
442
+ )
434
443
 
435
444
  else
436
445
  ( model