elm-pages 3.0.19 → 3.0.20

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.
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  - [elm-pages Docs Site](https://elm-pages.com/docs)
13
13
  - [elm-pages site showcase](https://elm-pages.com/showcase/)
14
- - [elm-pages Elm API Docs](https://package.elm-lang.org/packages/dillonkearns/elm-pages/10.1.0/)
14
+ - [elm-pages Elm API Docs](https://package.elm-lang.org/packages/dillonkearns/elm-pages/10.2.0/)
15
15
  - [Quick start repo](https://github.com/dillonkearns/elm-pages-starter) [(live site hosted here)](https://elm-pages-starter.netlify.com)
16
16
  - [Introducing `elm-pages` blog post](https://elm-pages.com/blog/introducing-elm-pages)
17
17
  - [`examples` folder](https://github.com/dillonkearns/elm-pages/blob/master/examples/) (includes https://elm-pages.com site source) Use `git clone --recurse-submodules https://github.com/dillonkearns/elm-pages.git` so that there aren't missing files when you try to build the examples.
@@ -1,3 +1,3 @@
1
1
  export const compatibilityKey = 22;
2
2
 
3
- export const packageVersion = "3.0.19";
3
+ export const packageVersion = "3.0.20";
@@ -12,9 +12,9 @@
12
12
  "danfishgold/base64-bytes": "1.1.0",
13
13
  "danyx23/elm-mimetype": "4.0.1",
14
14
  "dillonkearns/elm-bcp47-language-tag": "2.0.0",
15
- "dillonkearns/elm-form": "3.0.0",
15
+ "dillonkearns/elm-form": "3.0.1",
16
16
  "dillonkearns/elm-markdown": "7.0.1",
17
- "dillonkearns/elm-pages": "10.1.0",
17
+ "dillonkearns/elm-pages": "10.2.0",
18
18
  "elm/browser": "1.0.2",
19
19
  "elm/bytes": "1.0.8",
20
20
  "elm/core": "1.0.5",
@@ -31,12 +31,12 @@
31
31
  "elm-community/result-extra": "2.4.0",
32
32
  "jluckyiv/elm-utc-date-strings": "1.0.0",
33
33
  "justinmimbs/date": "4.1.0",
34
- "mdgriffith/elm-codegen": "4.2.1",
35
- "miniBill/elm-codec": "2.1.0",
34
+ "mdgriffith/elm-codegen": "5.2.0",
35
+ "miniBill/elm-codec": "2.2.0",
36
36
  "noahzgordon/elm-color-extra": "1.0.2",
37
37
  "robinheghan/fnv1a": "1.0.0",
38
38
  "rtfeldman/elm-css": "18.0.0",
39
- "the-sett/elm-syntax-dsl": "6.0.2",
39
+ "the-sett/elm-syntax-dsl": "6.0.3",
40
40
  "turboMaCk/non-empty-list-alias": "1.4.0",
41
41
  "vito/elm-ansi": "10.0.1"
42
42
  },
@@ -53,9 +53,10 @@
53
53
  "robinheghan/murmur3": "1.0.0",
54
54
  "rtfeldman/elm-hex": "1.0.0",
55
55
  "rtfeldman/elm-iso8601-date-strings": "1.1.4",
56
- "stil4m/elm-syntax": "7.3.2",
56
+ "stil4m/elm-syntax": "7.3.8",
57
57
  "stil4m/structured-writer": "1.0.3",
58
- "the-sett/elm-pretty-printer": "3.1.0"
58
+ "the-sett/elm-pretty-printer": "3.1.0",
59
+ "wolfadex/elm-ansi": "3.0.0"
59
60
  }
60
61
  },
61
62
  "test-dependencies": {
@@ -5,7 +5,8 @@ type ElmPagesInit = {
5
5
 
6
6
  const config: ElmPagesInit = {
7
7
  load: async function (elmLoaded) {
8
- await elmLoaded;
8
+ const app = await elmLoaded;
9
+ console.log("App loaded", app);
9
10
  },
10
11
  flags: function () {
11
12
  return "You can decode this in Shared.elm using Json.Decode.string!";
@@ -7,15 +7,15 @@
7
7
  "build": "elm-pages build"
8
8
  },
9
9
  "devDependencies": {
10
- "elm-codegen": "^0.5.3",
10
+ "elm-codegen": "^0.6.1",
11
11
  "elm-optimize-level-2": "^0.3.5",
12
- "elm-pages": "^3.0.14",
12
+ "elm-pages": "3.0.19",
13
13
  "elm-review": "^2.12.0",
14
14
  "elm-tooling": "^1.15.1",
15
- "lamdera": "^0.19.1-1.2.1-1",
16
- "vite": "^5.3.3"
15
+ "lamdera": "^0.19.1-1.3.2",
16
+ "vite": "^6.0.6"
17
17
  },
18
18
  "dependencies": {
19
- "@netlify/functions": "^2.4.1"
19
+ "@netlify/functions": "^3.0.0"
20
20
  }
21
- }
21
+ }
@@ -8,12 +8,12 @@
8
8
  "dependencies": {
9
9
  "direct": {
10
10
  "dillonkearns/elm-cli-options-parser": "3.2.0",
11
- "dillonkearns/elm-pages": "10.1.0",
11
+ "dillonkearns/elm-pages": "10.2.0",
12
12
  "elm/bytes": "1.0.8",
13
13
  "elm/core": "1.0.5",
14
14
  "elm/html": "1.0.0",
15
15
  "elm/json": "1.1.3",
16
- "mdgriffith/elm-codegen": "4.2.1"
16
+ "mdgriffith/elm-codegen": "5.2.0"
17
17
  },
18
18
  "indirect": {
19
19
  "Chadtech/elm-bool-extra": "2.4.2",
@@ -22,7 +22,7 @@
22
22
  "danyx23/elm-mimetype": "4.0.1",
23
23
  "dillonkearns/elm-bcp47-language-tag": "2.0.0",
24
24
  "dillonkearns/elm-date-or-date-time": "2.0.0",
25
- "dillonkearns/elm-form": "3.0.0",
25
+ "dillonkearns/elm-form": "3.0.1",
26
26
  "elm/browser": "1.0.2",
27
27
  "elm/file": "1.0.5",
28
28
  "elm/http": "2.0.0",
@@ -38,7 +38,7 @@
38
38
  "fredcy/elm-parseint": "2.0.1",
39
39
  "jluckyiv/elm-utc-date-strings": "1.0.0",
40
40
  "justinmimbs/date": "4.1.0",
41
- "miniBill/elm-codec": "2.1.0",
41
+ "miniBill/elm-codec": "2.2.0",
42
42
  "miniBill/elm-unicode": "1.1.1",
43
43
  "noahzgordon/elm-color-extra": "1.0.2",
44
44
  "robinheghan/fnv1a": "1.0.0",
@@ -46,11 +46,11 @@
46
46
  "rtfeldman/elm-css": "18.0.0",
47
47
  "rtfeldman/elm-hex": "1.0.0",
48
48
  "rtfeldman/elm-iso8601-date-strings": "1.1.4",
49
- "stil4m/elm-syntax": "7.3.2",
49
+ "stil4m/elm-syntax": "7.3.8",
50
50
  "stil4m/structured-writer": "1.0.3",
51
51
  "the-sett/elm-pretty-printer": "3.1.0",
52
- "the-sett/elm-syntax-dsl": "6.0.2",
53
- "vito/elm-ansi": "10.0.1"
52
+ "the-sett/elm-syntax-dsl": "6.0.3",
53
+ "wolfadex/elm-ansi": "3.0.0"
54
54
  }
55
55
  },
56
56
  "test-dependencies": {
@@ -22,6 +22,7 @@ import Gen.List
22
22
  import Gen.Maybe
23
23
  import Gen.Pages.Form as PagesForm
24
24
  import Gen.Pages.Script
25
+ import Gen.Platform.Sub
25
26
  import Gen.Server.Request as Request
26
27
  import Gen.Server.Response as Response
27
28
  import Gen.View
@@ -253,7 +254,7 @@ createFile { moduleName, fields } =
253
254
  Elm.tuple (Elm.record []) Effect.none
254
255
  , subscriptions =
255
256
  \{ routeParams, path, shared, model } ->
256
- Elm.val "Sub.none"
257
+ Gen.Platform.Sub.none
257
258
  , model =
258
259
  Alias (Type.record [])
259
260
  , msg =
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elm-pages",
3
3
  "type": "module",
4
- "version": "3.0.19",
4
+ "version": "3.0.20",
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.",
@@ -34,7 +34,7 @@
34
34
  "cookie-signature": "^1.2.2",
35
35
  "cross-spawn": "7.0.6",
36
36
  "devcert": "^1.2.2",
37
- "elm-doc-preview": "^5.0.5",
37
+ "elm-doc-preview": "^6.0.0",
38
38
  "elm-hot": "^1.1.6",
39
39
  "esbuild": "^0.24.0",
40
40
  "fs-extra": "^11.2.0",
@@ -47,6 +47,7 @@
47
47
  "micromatch": "^4.0.8",
48
48
  "serve-static": "^1.16.2",
49
49
  "terser": "^5.36.0",
50
+ "vite": "^6.0.0",
50
51
  "which": "^5.0.0"
51
52
  },
52
53
  "devDependencies": {
@@ -65,7 +66,6 @@
65
66
  "elm-verify-examples": "^6.0.3",
66
67
  "lamdera": "^0.19.1-1.3.2",
67
68
  "typescript": "^5.7.2",
68
- "vite": "^6.0.0",
69
69
  "vitest": "^2.1.6"
70
70
  },
71
71
  "files": [
@@ -572,8 +572,14 @@ update config appMsg model =
572
572
  )
573
573
 
574
574
  else
575
- -- TODO should the user msg still be run if the form is invalid?
576
575
  ( model, NoEffect )
576
+ |> (case fields.msg of
577
+ Just justUserMsg ->
578
+ performUserMsg justUserMsg config
579
+
580
+ Nothing ->
581
+ identity
582
+ )
577
583
 
578
584
  Pages.Internal.Msg.FormMsg formMsg ->
579
585
  -- TODO when init is called for a new page, also need to clear out client-side `pageFormState`
@@ -17,7 +17,8 @@ module TerminalText exposing
17
17
  , yellow
18
18
  )
19
19
 
20
- import Ansi
20
+ import Ansi.Color
21
+ import Ansi.Parser
21
22
  import Json.Encode as Encode
22
23
 
23
24
 
@@ -32,27 +33,27 @@ text value =
32
33
 
33
34
  cyan : String -> Text
34
35
  cyan inner =
35
- Style { blankStyle | color = Just Ansi.Cyan } inner
36
+ Style { blankStyle | color = Just Ansi.Color.Cyan } inner
36
37
 
37
38
 
38
39
  green : String -> Text
39
40
  green inner =
40
- Style { blankStyle | color = Just Ansi.Green } inner
41
+ Style { blankStyle | color = Just Ansi.Color.Green } inner
41
42
 
42
43
 
43
44
  yellow : String -> Text
44
45
  yellow inner =
45
- Style { blankStyle | color = Just Ansi.Yellow } inner
46
+ Style { blankStyle | color = Just Ansi.Color.Yellow } inner
46
47
 
47
48
 
48
49
  red : String -> Text
49
50
  red inner =
50
- Style { blankStyle | color = Just Ansi.Red } inner
51
+ Style { blankStyle | color = Just Ansi.Color.Red } inner
51
52
 
52
53
 
53
54
  blue : String -> Text
54
55
  blue inner =
55
- Style { blankStyle | color = Just Ansi.Blue } inner
56
+ Style { blankStyle | color = Just Ansi.Color.Blue } inner
56
57
 
57
58
 
58
59
  resetColors : String
@@ -70,23 +71,23 @@ ansiPrefix =
70
71
  "\u{001B}"
71
72
 
72
73
 
73
- colorToString : Ansi.Color -> String
74
+ colorToString : Ansi.Color.Color -> String
74
75
  colorToString color =
75
76
  ansi <|
76
77
  case color of
77
- Ansi.Red ->
78
+ Ansi.Color.Red ->
78
79
  "[31m"
79
80
 
80
- Ansi.Blue ->
81
+ Ansi.Color.Blue ->
81
82
  "[34m"
82
83
 
83
- Ansi.Green ->
84
+ Ansi.Color.Green ->
84
85
  "[32m"
85
86
 
86
- Ansi.Yellow ->
87
+ Ansi.Color.Yellow ->
87
88
  "[33m"
88
89
 
89
- Ansi.Cyan ->
90
+ Ansi.Color.Cyan ->
90
91
  "[36m"
91
92
 
92
93
  _ ->
@@ -104,7 +105,7 @@ toString list =
104
105
  toString_ : Text -> String
105
106
  toString_ (Style ansiStyle innerText) =
106
107
  String.concat
107
- [ ansiStyle.color |> Maybe.withDefault Ansi.White |> colorToString
108
+ [ ansiStyle.color |> Maybe.withDefault Ansi.Color.White |> colorToString
108
109
  , innerText
109
110
  , resetColors
110
111
  ]
@@ -119,7 +120,7 @@ toPlainString list =
119
120
 
120
121
  fromAnsiString : String -> List Text
121
122
  fromAnsiString ansiString =
122
- Ansi.parseInto ( blankStyle, [] ) parseInto ansiString
123
+ Ansi.Parser.parseInto ( blankStyle, [] ) parseInto ansiString
123
124
  |> Tuple.second
124
125
  |> List.reverse
125
126
 
@@ -127,7 +128,7 @@ fromAnsiString ansiString =
127
128
  type alias AnsiStyle =
128
129
  { bold : Bool
129
130
  , underline : Bool
130
- , color : Maybe Ansi.Color
131
+ , color : Maybe Ansi.Color.Color
131
132
  }
132
133
 
133
134
 
@@ -139,16 +140,16 @@ blankStyle =
139
140
  }
140
141
 
141
142
 
142
- parseInto : Ansi.Action -> ( AnsiStyle, List Text ) -> ( AnsiStyle, List Text )
143
+ parseInto : Ansi.Parser.Command -> ( AnsiStyle, List Text ) -> ( AnsiStyle, List Text )
143
144
  parseInto action ( pendingStyle, soFar ) =
144
145
  case action of
145
- Ansi.Print string ->
146
+ Ansi.Parser.Text string ->
146
147
  ( blankStyle, Style pendingStyle string :: soFar )
147
148
 
148
- Ansi.Remainder _ ->
149
+ Ansi.Parser.Remainder _ ->
149
150
  ( pendingStyle, soFar )
150
151
 
151
- Ansi.SetForeground maybeColor ->
152
+ Ansi.Parser.SetForeground maybeColor ->
152
153
  case maybeColor of
153
154
  Just newColor ->
154
155
  ( { pendingStyle
@@ -160,22 +161,22 @@ parseInto action ( pendingStyle, soFar ) =
160
161
  Nothing ->
161
162
  ( blankStyle, soFar )
162
163
 
163
- Ansi.SetBold bool ->
164
+ Ansi.Parser.SetBold bool ->
164
165
  ( { pendingStyle | bold = bool }, soFar )
165
166
 
166
- Ansi.SetFaint _ ->
167
+ Ansi.Parser.SetFaint _ ->
167
168
  ( pendingStyle, soFar )
168
169
 
169
- Ansi.SetItalic _ ->
170
+ Ansi.Parser.SetItalic _ ->
170
171
  ( pendingStyle, soFar )
171
172
 
172
- Ansi.SetUnderline bool ->
173
+ Ansi.Parser.SetUnderline bool ->
173
174
  ( { pendingStyle | underline = bool }, soFar )
174
175
 
175
- Ansi.SetBackground _ ->
176
+ Ansi.Parser.SetBackground _ ->
176
177
  ( pendingStyle, soFar )
177
178
 
178
- Ansi.Linebreak ->
179
+ Ansi.Parser.Linebreak ->
179
180
  case soFar of
180
181
  next :: rest ->
181
182
  ( pendingStyle, Style blankStyle "\n" :: next :: rest )
@@ -194,56 +195,59 @@ encoder (Style ansiStyle string) =
194
195
  , ( "underline", Encode.bool ansiStyle.underline )
195
196
  , ( "color"
196
197
  , Encode.string <|
197
- case ansiStyle.color |> Maybe.withDefault Ansi.White of
198
- Ansi.Red ->
198
+ case ansiStyle.color |> Maybe.withDefault Ansi.Color.White of
199
+ Ansi.Color.Red ->
199
200
  "red"
200
201
 
201
- Ansi.Blue ->
202
+ Ansi.Color.Blue ->
202
203
  "blue"
203
204
 
204
- Ansi.Green ->
205
+ Ansi.Color.Green ->
205
206
  "green"
206
207
 
207
- Ansi.Yellow ->
208
+ Ansi.Color.Yellow ->
208
209
  "yellow"
209
210
 
210
- Ansi.Cyan ->
211
+ Ansi.Color.Cyan ->
211
212
  "cyan"
212
213
 
213
- Ansi.Black ->
214
+ Ansi.Color.Black ->
214
215
  "black"
215
216
 
216
- Ansi.Magenta ->
217
+ Ansi.Color.Magenta ->
217
218
  "magenta"
218
219
 
219
- Ansi.White ->
220
+ Ansi.Color.White ->
220
221
  "white"
221
222
 
222
- Ansi.BrightBlack ->
223
+ Ansi.Color.BrightBlack ->
223
224
  "BLACK"
224
225
 
225
- Ansi.BrightRed ->
226
+ Ansi.Color.BrightRed ->
226
227
  "RED"
227
228
 
228
- Ansi.BrightGreen ->
229
+ Ansi.Color.BrightGreen ->
229
230
  "GREEN"
230
231
 
231
- Ansi.BrightYellow ->
232
+ Ansi.Color.BrightYellow ->
232
233
  "YELLOW"
233
234
 
234
- Ansi.BrightBlue ->
235
+ Ansi.Color.BrightBlue ->
235
236
  "BLUE"
236
237
 
237
- Ansi.BrightMagenta ->
238
+ Ansi.Color.BrightMagenta ->
238
239
  "MAGENTA"
239
240
 
240
- Ansi.BrightCyan ->
241
+ Ansi.Color.BrightCyan ->
241
242
  "CYAN"
242
243
 
243
- Ansi.BrightWhite ->
244
+ Ansi.Color.BrightWhite ->
244
245
  "WHITE"
245
246
 
246
- Ansi.Custom _ _ _ ->
247
+ Ansi.Color.Custom256 _ ->
248
+ ""
249
+
250
+ Ansi.Color.CustomTrueColor _ ->
247
251
  ""
248
252
  )
249
253
  , ( "string", Encode.string string )