elm-pages 3.0.0-beta.34 → 3.0.0-beta.36

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.
Files changed (27) hide show
  1. package/README.md +1 -1
  2. package/codegen/elm-pages-codegen.cjs +155 -56
  3. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  4. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
  5. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
  6. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm.json +1 -1
  7. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +7692 -7239
  8. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  9. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
  10. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  11. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
  12. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
  13. package/generator/review/elm-stuff/tests-0.19.1/elm.json +1 -1
  14. package/generator/review/elm-stuff/tests-0.19.1/js/Runner.elm.js +14976 -14484
  15. package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  16. package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
  17. package/generator/src/build.js +1 -1
  18. package/generator/src/cli.js +27 -9
  19. package/generator/src/compatibility-key.js +2 -2
  20. package/package.json +17 -17
  21. package/src/BackendTask/File.elm +43 -13
  22. package/src/BackendTask/Internal/Request.elm +44 -3
  23. package/src/FatalError.elm +4 -3
  24. package/src/Pages/Internal/Platform/CompatibilityKey.elm +1 -1
  25. package/src/Pages/Internal/Platform/GeneratorApplication.elm +13 -3
  26. package/src/Pages/Internal/Platform/StaticResponses.elm +1 -7
  27. package/src/Stub.elm +56 -0
package/README.md CHANGED
@@ -81,7 +81,7 @@ https://github.com/dillonkearns/elm-pages/projects
81
81
  You will see an error if the NPM and Elm package do not have a matching Compatibility Key. Usually it's best to upgrade to the latest version of both the Elm and NPM
82
82
  packages when you upgrade. However, in case you want to install versions that are behind the latest, the Compatibility Key is included here for reference.
83
83
 
84
- Current Compatibility Key: 14.
84
+ Current Compatibility Key: 15.
85
85
 
86
86
  ## Contributors ✨
87
87
 
@@ -25043,6 +25043,41 @@ var $author$project$Elm$Extra$topLevelValue = F2(
25043
25043
  }
25044
25044
  };
25045
25045
  });
25046
+ var $elm$core$String$isEmpty = function (string) {
25047
+ return string === '';
25048
+ };
25049
+ var $author$project$Internal$Compiler$documentation = F2(
25050
+ function (rawDoc, decl) {
25051
+ var doc = $elm$core$String$trim(rawDoc);
25052
+ if ($elm$core$String$isEmpty(doc)) {
25053
+ return decl;
25054
+ } else {
25055
+ switch (decl.$) {
25056
+ case 'Comment':
25057
+ return decl;
25058
+ case 'Block':
25059
+ var source = decl.a;
25060
+ return decl;
25061
+ default:
25062
+ var details = decl.a;
25063
+ return $author$project$Internal$Compiler$Declaration(
25064
+ _Utils_update(
25065
+ details,
25066
+ {
25067
+ docs: function () {
25068
+ var _v1 = details.docs;
25069
+ if (_v1.$ === 'Nothing') {
25070
+ return $elm$core$Maybe$Just(doc);
25071
+ } else {
25072
+ var existing = _v1.a;
25073
+ return $elm$core$Maybe$Just(doc + ('\n\n' + existing));
25074
+ }
25075
+ }()
25076
+ }));
25077
+ }
25078
+ }
25079
+ });
25080
+ var $author$project$Elm$withDocumentation = $author$project$Internal$Compiler$documentation;
25046
25081
  var $author$project$Generate$file = F2(
25047
25082
  function (templates, basePath) {
25048
25083
  var routes = A2($elm$core$List$filterMap, $author$project$Pages$Internal$RoutePattern$fromModuleName, templates);
@@ -25124,8 +25159,11 @@ var $author$project$Generate$file = F2(
25124
25159
  $elm$core$Maybe$Just(
25125
25160
  A2($author$project$Elm$Annotation$named, _List_Nil, 'Route'))),
25126
25161
  function (route) {
25127
- return $author$project$Gen$Path$toAbsolute(
25128
- toPath.call(route));
25162
+ return A2(
25163
+ $author$project$Elm$withType,
25164
+ $author$project$Elm$Annotation$string,
25165
+ $author$project$Gen$Path$toAbsolute(
25166
+ toPath.call(route)));
25129
25167
  });
25130
25168
  var redirectTo = A2(
25131
25169
  $author$project$Elm$declaration,
@@ -25155,7 +25193,25 @@ var $author$project$Generate$file = F2(
25155
25193
  var toLink = A4(
25156
25194
  $author$project$Elm$Declare$fn2,
25157
25195
  'toLink',
25158
- _Utils_Tuple2('toAnchorTag', $elm$core$Maybe$Nothing),
25196
+ _Utils_Tuple2(
25197
+ 'toAnchorTag',
25198
+ $elm$core$Maybe$Just(
25199
+ A2(
25200
+ $author$project$Elm$Annotation$function,
25201
+ _List_fromArray(
25202
+ [
25203
+ $author$project$Elm$Annotation$list(
25204
+ A3(
25205
+ $author$project$Elm$Annotation$namedWith,
25206
+ _List_fromArray(
25207
+ ['Html']),
25208
+ 'Attribute',
25209
+ _List_fromArray(
25210
+ [
25211
+ $author$project$Elm$Annotation$var('msg')
25212
+ ])))
25213
+ ]),
25214
+ $author$project$Elm$Annotation$var('a')))),
25159
25215
  _Utils_Tuple2(
25160
25216
  'route',
25161
25217
  $elm$core$Maybe$Just(
@@ -25163,45 +25219,85 @@ var $author$project$Generate$file = F2(
25163
25219
  F2(
25164
25220
  function (toAnchorTag, route) {
25165
25221
  return A2(
25166
- $author$project$Elm$apply,
25167
- toAnchorTag,
25168
- _List_fromArray(
25169
- [
25170
- $author$project$Elm$list(
25171
- _List_fromArray(
25172
- [
25173
- $author$project$Gen$Html$Attributes$call_.href(
25174
- toString.call(route)),
25175
- A2($author$project$Gen$Html$Attributes$attribute, 'elm-pages:prefetch', '')
25176
- ]))
25177
- ]));
25222
+ $author$project$Elm$withType,
25223
+ $author$project$Elm$Annotation$var('a'),
25224
+ A2(
25225
+ $author$project$Elm$apply,
25226
+ toAnchorTag,
25227
+ _List_fromArray(
25228
+ [
25229
+ $author$project$Elm$list(
25230
+ _List_fromArray(
25231
+ [
25232
+ $author$project$Gen$Html$Attributes$call_.href(
25233
+ toString.call(route)),
25234
+ A2($author$project$Gen$Html$Attributes$attribute, 'elm-pages:prefetch', '')
25235
+ ]))
25236
+ ])));
25178
25237
  }));
25179
25238
  var link = A2(
25180
25239
  $author$project$Elm$declaration,
25181
25240
  'link',
25182
- A4(
25183
- $author$project$Elm$fn3,
25184
- _Utils_Tuple2('attributes', $elm$core$Maybe$Nothing),
25185
- _Utils_Tuple2('children', $elm$core$Maybe$Nothing),
25186
- _Utils_Tuple2(
25187
- 'route',
25188
- $elm$core$Maybe$Just(
25189
- A2($author$project$Elm$Annotation$named, _List_Nil, 'Route'))),
25190
- F3(
25191
- function (attributes, children, route) {
25192
- return A2(
25193
- toLink.call,
25194
- A2(
25195
- $author$project$Elm$fn,
25196
- _Utils_Tuple2('anchorAttrs', $elm$core$Maybe$Nothing),
25197
- function (anchorAttrs) {
25198
- return A2(
25199
- $author$project$Gen$Html$call_.a,
25200
- A2($author$project$Elm$Op$append, anchorAttrs, attributes),
25201
- children);
25202
- }),
25203
- route);
25204
- })));
25241
+ A2(
25242
+ $author$project$Elm$withType,
25243
+ A2(
25244
+ $author$project$Elm$Annotation$function,
25245
+ _List_fromArray(
25246
+ [
25247
+ $author$project$Elm$Annotation$list(
25248
+ A3(
25249
+ $author$project$Elm$Annotation$namedWith,
25250
+ _List_fromArray(
25251
+ ['Html']),
25252
+ 'Attribute',
25253
+ _List_fromArray(
25254
+ [
25255
+ $author$project$Elm$Annotation$var('msg')
25256
+ ]))),
25257
+ $author$project$Elm$Annotation$list(
25258
+ A3(
25259
+ $author$project$Elm$Annotation$namedWith,
25260
+ _List_fromArray(
25261
+ ['Html']),
25262
+ 'Html',
25263
+ _List_fromArray(
25264
+ [
25265
+ $author$project$Elm$Annotation$var('msg')
25266
+ ]))),
25267
+ A2($author$project$Elm$Annotation$named, _List_Nil, 'Route')
25268
+ ]),
25269
+ A3(
25270
+ $author$project$Elm$Annotation$namedWith,
25271
+ _List_fromArray(
25272
+ ['Html']),
25273
+ 'Html',
25274
+ _List_fromArray(
25275
+ [
25276
+ $author$project$Elm$Annotation$var('msg')
25277
+ ]))),
25278
+ A4(
25279
+ $author$project$Elm$fn3,
25280
+ _Utils_Tuple2('attributes', $elm$core$Maybe$Nothing),
25281
+ _Utils_Tuple2('children', $elm$core$Maybe$Nothing),
25282
+ _Utils_Tuple2(
25283
+ 'route',
25284
+ $elm$core$Maybe$Just(
25285
+ A2($author$project$Elm$Annotation$named, _List_Nil, 'Route'))),
25286
+ F3(
25287
+ function (attributes, children, route) {
25288
+ return A2(
25289
+ toLink.call,
25290
+ A2(
25291
+ $author$project$Elm$fn,
25292
+ _Utils_Tuple2('anchorAttrs', $elm$core$Maybe$Nothing),
25293
+ function (anchorAttrs) {
25294
+ return A2(
25295
+ $author$project$Gen$Html$call_.a,
25296
+ A2($author$project$Elm$Op$append, anchorAttrs, attributes),
25297
+ children);
25298
+ }),
25299
+ route);
25300
+ }))));
25205
25301
  var withoutBaseUrl = A2(
25206
25302
  $author$project$Elm$declaration,
25207
25303
  'withoutBaseUrl',
@@ -25230,24 +25326,27 @@ var $author$project$Generate$file = F2(
25230
25326
  A2(
25231
25327
  $elm$core$List$map,
25232
25328
  $author$project$Generate$expose,
25233
- _List_fromArray(
25234
- [
25235
- A2(
25236
- $author$project$Elm$customType,
25237
- 'Route',
25238
- A2($elm$core$List$map, $author$project$Pages$Internal$RoutePattern$toVariant, routes)),
25239
- segmentsToRouteFn.declaration,
25240
- urlToRoute,
25241
- baseUrl.declaration,
25242
- routeToPathFn.declaration,
25243
- baseUrlAsPath.declaration,
25244
- toPath.declaration,
25245
- toString.declaration,
25246
- redirectTo,
25247
- toLink.declaration,
25248
- link,
25249
- withoutBaseUrl
25250
- ])),
25329
+ A2(
25330
+ $elm$core$List$map,
25331
+ $author$project$Elm$withDocumentation('.'),
25332
+ _List_fromArray(
25333
+ [
25334
+ A2(
25335
+ $author$project$Elm$customType,
25336
+ 'Route',
25337
+ A2($elm$core$List$map, $author$project$Pages$Internal$RoutePattern$toVariant, routes)),
25338
+ segmentsToRouteFn.declaration,
25339
+ urlToRoute,
25340
+ baseUrl.declaration,
25341
+ routeToPathFn.declaration,
25342
+ baseUrlAsPath.declaration,
25343
+ toPath.declaration,
25344
+ toString.declaration,
25345
+ redirectTo,
25346
+ toLink.declaration,
25347
+ link,
25348
+ withoutBaseUrl
25349
+ ]))),
25251
25350
  _List_fromArray(
25252
25351
  [$author$project$Generate$splitPath.declaration, $author$project$Generate$maybeToList.declaration])
25253
25352
  ])));
@@ -1 +1 @@
1
- {"type":"application","source-directories":["../../src","../../tests","../../../../src","src"],"elm-version":"0.19.1","dependencies":{"direct":{"elm/core":"1.0.5","elm/json":"1.1.3","elm-community/result-extra":"2.4.0","elm-explorations/test":"2.1.1","jfmengels/elm-review":"2.12.2","mpizenberg/elm-test-runner":"6.0.0","stil4m/elm-syntax":"7.2.9"},"indirect":{"elm/bytes":"1.0.8","elm/html":"1.0.0","elm/parser":"1.1.0","elm/project-metadata-utils":"1.0.2","elm/random":"1.0.0","elm/time":"1.0.0","elm/virtual-dom":"1.0.3","elm-community/list-extra":"8.7.0","miniBill/elm-unicode":"1.0.3","rtfeldman/elm-hex":"1.0.0","stil4m/structured-writer":"1.0.3"}},"test-dependencies":{"direct":{},"indirect":{}}}
1
+ {"type":"application","source-directories":["../../src","../../tests","../../../../src","src"],"elm-version":"0.19.1","dependencies":{"direct":{"elm/core":"1.0.5","elm/json":"1.1.3","elm-community/result-extra":"2.4.0","elm-explorations/test":"2.1.1","jfmengels/elm-review":"2.13.0","mpizenberg/elm-test-runner":"6.0.0","stil4m/elm-syntax":"7.2.9"},"indirect":{"elm/bytes":"1.0.8","elm/html":"1.0.0","elm/parser":"1.1.0","elm/project-metadata-utils":"1.0.2","elm/random":"1.0.0","elm/time":"1.0.0","elm/virtual-dom":"1.0.3","elm-community/list-extra":"8.7.0","miniBill/elm-unicode":"1.0.3","rtfeldman/elm-hex":"1.0.0","stil4m/structured-writer":"1.0.3"}},"test-dependencies":{"direct":{},"indirect":{}}}