elm-pages 3.0.0-beta.12 → 3.0.0-beta.14
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 +1 -1
- package/codegen/elm-pages-codegen.js +1496 -1126
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmi +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmo +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmo +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm.json +1 -1
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +151 -39
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
- package/generator/dead-code-review/elm.json +3 -2
- package/generator/dead-code-review/src/Pages/Review/DeadCodeEliminateData.elm +58 -10
- package/generator/dead-code-review/tests/Pages/Review/DeadCodeEliminateDataTest.elm +45 -29
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm.json +1 -1
- package/generator/review/elm-stuff/tests-0.19.1/js/Runner.elm.js +45 -4
- package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
- package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
- package/generator/review/elm.json +3 -3
- package/generator/src/RouteBuilder.elm +66 -52
- package/generator/src/SharedTemplate.elm +3 -2
- package/generator/src/SiteConfig.elm +3 -2
- package/generator/src/build.js +6 -6
- package/generator/src/cli.js +12 -7
- package/generator/src/compatibility-key.js +1 -1
- package/generator/src/dev-server.js +7 -7
- package/generator/src/render-test.js +109 -0
- package/generator/src/render.js +77 -51
- package/generator/src/request-cache.js +149 -158
- package/generator/template/app/Api.elm +2 -2
- package/generator/template/app/Route/Index.elm +3 -3
- package/generator/template/app/Shared.elm +3 -3
- package/generator/template/app/Site.elm +3 -3
- package/package.json +11 -11
- package/src/ApiRoute.elm +63 -57
- package/src/BackendTask/Env.elm +87 -0
- package/src/{DataSource → BackendTask}/File.elm +89 -43
- package/src/{DataSource → BackendTask}/Glob.elm +134 -125
- package/src/BackendTask/Http.elm +637 -0
- package/src/{DataSource → BackendTask}/Internal/Glob.elm +1 -1
- package/src/BackendTask/Internal/Request.elm +28 -0
- package/src/BackendTask/Port.elm +202 -0
- package/src/{DataSource.elm → BackendTask.elm} +223 -207
- package/src/Exception.elm +37 -0
- package/src/Form.elm +20 -20
- package/src/Head.elm +7 -7
- package/src/Internal/ApiRoute.elm +7 -5
- package/src/PageServerResponse.elm +6 -1
- package/src/Pages/Generate.elm +35 -63
- package/src/Pages/Internal/Platform/Cli.elm +422 -731
- package/src/Pages/Internal/Platform/Cli.elm.bak +22 -22
- package/src/Pages/Internal/Platform/CompatibilityKey.elm +1 -1
- package/src/Pages/Internal/Platform/Effect.elm +0 -1
- package/src/Pages/Internal/Platform/GeneratorApplication.elm +53 -113
- package/src/Pages/Internal/Platform/StaticResponses.elm +72 -256
- package/src/Pages/Internal/Platform/ToJsPayload.elm +4 -4
- package/src/Pages/Internal/Platform.elm +25 -31
- package/src/Pages/Internal/Script.elm +17 -0
- package/src/Pages/Internal/StaticHttpBody.elm +35 -1
- package/src/Pages/Manifest.elm +5 -4
- package/src/Pages/ProgramConfig.elm +8 -7
- package/src/Pages/Script.elm +34 -25
- package/src/Pages/SiteConfig.elm +3 -2
- package/src/Pages/StaticHttp/Request.elm +2 -2
- package/src/Pages/StaticHttpRequest.elm +37 -90
- package/src/RequestsAndPending.elm +8 -19
- package/src/Server/Request.elm +14 -14
- package/src/Server/Session.elm +34 -34
- package/src/Server/SetCookie.elm +1 -1
- package/src/DataSource/Env.elm +0 -62
- package/src/DataSource/Http.elm +0 -446
- package/src/DataSource/Internal/Request.elm +0 -20
- package/src/DataSource/Port.elm +0 -90
|
@@ -1,175 +1,169 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
-
const fetch = require("node-fetch");
|
|
3
|
-
const objectHash = require("object-hash");
|
|
4
2
|
const kleur = require("kleur");
|
|
5
3
|
|
|
6
|
-
/**
|
|
7
|
-
* To cache HTTP requests on disk with quick lookup and insertion, we store the hashed request.
|
|
8
|
-
* This uses SHA1 hashes. They are uni-directional hashes, which works for this use case. Most importantly,
|
|
9
|
-
* they're unique enough and can be expressed in a case-insensitive way so it works on Windows filesystems.
|
|
10
|
-
* And they are 40 hex characters, so the length won't be too long no matter what the request payload.
|
|
11
|
-
* @param {Object} request
|
|
12
|
-
*/
|
|
13
|
-
function requestToString(request) {
|
|
14
|
-
return objectHash(request);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @param {Object} request
|
|
18
|
-
*/
|
|
19
|
-
function fullPath(portsHash, request, hasFsAccess) {
|
|
20
|
-
const requestWithPortHash =
|
|
21
|
-
request.url === "elm-pages-internal://port"
|
|
22
|
-
? { portsHash, ...request }
|
|
23
|
-
: request;
|
|
24
|
-
if (hasFsAccess) {
|
|
25
|
-
return path.join(
|
|
26
|
-
process.cwd(),
|
|
27
|
-
// TODO use parameter or something other than global for this `global.isRunningGenerator` condition
|
|
28
|
-
".elm-pages",
|
|
29
|
-
"http-response-cache",
|
|
30
|
-
requestToString(requestWithPortHash)
|
|
31
|
-
);
|
|
32
|
-
} else {
|
|
33
|
-
return path.join("/", requestToString(requestWithPortHash));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
4
|
+
/** @typedef {{kind: 'cache-response-path', value: string} | {kind: 'response-json', value: JSON}} Response */
|
|
36
5
|
|
|
37
6
|
/**
|
|
38
7
|
* @param {string} mode
|
|
39
8
|
* @param {{url: string;headers: {[x: string]: string;};method: string;body: Body;}} rawRequest
|
|
40
|
-
* @returns {Promise<string>}
|
|
41
9
|
* @param {string} portsFile
|
|
42
10
|
* @param {boolean} hasFsAccess
|
|
11
|
+
* @returns {Promise<Response>}
|
|
43
12
|
*/
|
|
44
13
|
function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess, useCache) {
|
|
45
|
-
const
|
|
14
|
+
const fetch = require("make-fetch-happen").defaults({
|
|
15
|
+
cachePath: "./.elm-pages/http-cache",
|
|
16
|
+
cache: mode === "build" ? "no-cache" : "default",
|
|
17
|
+
});
|
|
46
18
|
return new Promise(async (resolve, reject) => {
|
|
47
19
|
const request = toRequest(rawRequest);
|
|
48
|
-
const portsHash = (portsFile && portsFile.match(/-([^-]+)\.js$/)[1]) || "";
|
|
49
|
-
const responsePath = fullPath(portsHash, request, hasFsAccess);
|
|
50
20
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let portDataSource = {};
|
|
57
|
-
let portDataSourceImportError = null;
|
|
58
|
-
try {
|
|
59
|
-
if (portsFile === undefined) {
|
|
60
|
-
throw "missing";
|
|
61
|
-
}
|
|
62
|
-
const portDataSourcePath = path.resolve(portsFile);
|
|
63
|
-
// On Windows, we need cannot use paths directly and instead must use a file:// URL.
|
|
64
|
-
// portDataSource = await require(url.pathToFileURL(portDataSourcePath).href);
|
|
65
|
-
portDataSource = require(portDataSourcePath);
|
|
66
|
-
} catch (e) {
|
|
67
|
-
portDataSourceImportError = e;
|
|
21
|
+
let portBackendTask = {};
|
|
22
|
+
let portBackendTaskImportError = null;
|
|
23
|
+
try {
|
|
24
|
+
if (portsFile === undefined) {
|
|
25
|
+
throw "missing";
|
|
68
26
|
}
|
|
27
|
+
const portBackendTaskPath = path.resolve(portsFile);
|
|
28
|
+
// On Windows, we need cannot use paths directly and instead must use a file:// URL.
|
|
29
|
+
// portBackendTask = await require(url.pathToFileURL(portBackendTaskPath).href);
|
|
30
|
+
portBackendTask = require(portBackendTaskPath);
|
|
31
|
+
} catch (e) {
|
|
32
|
+
portBackendTaskImportError = e;
|
|
33
|
+
}
|
|
69
34
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
35
|
+
if (request.url === "elm-pages-internal://port") {
|
|
36
|
+
try {
|
|
37
|
+
const { input, portName } = rawRequest.body.args[0];
|
|
73
38
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
} else if (
|
|
83
|
-
|
|
39
|
+
if (!portBackendTask[portName]) {
|
|
40
|
+
if (portBackendTaskImportError === null) {
|
|
41
|
+
resolve({
|
|
42
|
+
kind: "response-json",
|
|
43
|
+
value: jsonResponse({
|
|
44
|
+
"elm-pages-internal-error": "PortNotDefined",
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
} else if (portBackendTaskImportError === "missing") {
|
|
48
|
+
resolve({
|
|
49
|
+
kind: "response-json",
|
|
50
|
+
value: jsonResponse({
|
|
51
|
+
"elm-pages-internal-error": "MissingPortsFile",
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
resolve({
|
|
56
|
+
kind: "response-json",
|
|
57
|
+
value: jsonResponse({
|
|
58
|
+
"elm-pages-internal-error": "ErrorInPortsFile",
|
|
59
|
+
error:
|
|
60
|
+
(portBackendTaskImportError &&
|
|
61
|
+
portBackendTaskImportError.stack) ||
|
|
62
|
+
"",
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
84
65
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
reject({
|
|
93
|
-
title: "DataSource.Port Error",
|
|
94
|
-
message: error.toString(),
|
|
66
|
+
} else if (typeof portBackendTask[portName] !== "function") {
|
|
67
|
+
resolve({
|
|
68
|
+
kind: "response-json",
|
|
69
|
+
value: jsonResponse({
|
|
70
|
+
"elm-pages-internal-error": "ExportIsNotFunction",
|
|
71
|
+
error: typeof portBackendTask[portName],
|
|
72
|
+
}),
|
|
95
73
|
});
|
|
74
|
+
} else {
|
|
75
|
+
try {
|
|
76
|
+
resolve({
|
|
77
|
+
kind: "response-json",
|
|
78
|
+
value: jsonResponse(await portBackendTask[portName](input)),
|
|
79
|
+
});
|
|
80
|
+
} catch (portCallError) {
|
|
81
|
+
resolve({
|
|
82
|
+
kind: "response-json",
|
|
83
|
+
value: jsonResponse({
|
|
84
|
+
"elm-pages-internal-error": "PortCallError",
|
|
85
|
+
error: portCallError,
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
96
89
|
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
body = await response.json();
|
|
117
|
-
bodyKind = "json";
|
|
118
|
-
} else if (
|
|
119
|
-
expectString === "ExpectBytes" ||
|
|
120
|
-
expectString === "ExpectBytesResponse"
|
|
121
|
-
) {
|
|
122
|
-
bodyKind = "bytes";
|
|
123
|
-
const arrayBuffer = await response.arrayBuffer();
|
|
124
|
-
body = Buffer.from(arrayBuffer).toString("base64");
|
|
125
|
-
} else if (expectString === "ExpectWhatever") {
|
|
126
|
-
bodyKind = "whatever";
|
|
127
|
-
body = null;
|
|
128
|
-
} else if (
|
|
129
|
-
expectString === "ExpectResponse" ||
|
|
130
|
-
expectString === "ExpectString"
|
|
131
|
-
) {
|
|
132
|
-
bodyKind = "string";
|
|
133
|
-
body = await response.text();
|
|
134
|
-
} else {
|
|
135
|
-
throw `Unexpected expectString ${expectString}`;
|
|
136
|
-
}
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.trace(error);
|
|
92
|
+
reject({
|
|
93
|
+
title: "BackendTask.Port Error",
|
|
94
|
+
message: error.toString(),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
try {
|
|
99
|
+
console.time(`fetch ${request.url}`);
|
|
100
|
+
const response = await fetch(request.url, {
|
|
101
|
+
method: request.method,
|
|
102
|
+
body: request.body,
|
|
103
|
+
headers: {
|
|
104
|
+
"User-Agent": "request",
|
|
105
|
+
...request.headers,
|
|
106
|
+
},
|
|
107
|
+
...rawRequest.cacheOptions,
|
|
108
|
+
});
|
|
137
109
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
JSON.stringify({
|
|
141
|
-
headers: Object.fromEntries(response.headers.entries()),
|
|
142
|
-
statusCode: response.status,
|
|
143
|
-
body: body,
|
|
144
|
-
bodyKind,
|
|
145
|
-
url: response.url,
|
|
146
|
-
statusText: response.statusText,
|
|
147
|
-
})
|
|
148
|
-
);
|
|
110
|
+
console.timeEnd(`fetch ${request.url}`);
|
|
111
|
+
const expectString = request.headers["elm-pages-internal"];
|
|
149
112
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
`,
|
|
161
|
-
});
|
|
113
|
+
let body;
|
|
114
|
+
let bodyKind;
|
|
115
|
+
if (expectString === "ExpectJson") {
|
|
116
|
+
try {
|
|
117
|
+
body = await response.buffer();
|
|
118
|
+
body = JSON.parse(body.toString("utf-8"));
|
|
119
|
+
bodyKind = "json";
|
|
120
|
+
} catch (error) {
|
|
121
|
+
body = body.toString("utf8");
|
|
122
|
+
bodyKind = "string";
|
|
162
123
|
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
})
|
|
124
|
+
} else if (
|
|
125
|
+
expectString === "ExpectBytes" ||
|
|
126
|
+
expectString === "ExpectBytesResponse"
|
|
127
|
+
) {
|
|
128
|
+
body = await response.buffer();
|
|
129
|
+
try {
|
|
130
|
+
body = body.toString("base64");
|
|
131
|
+
bodyKind = "bytes";
|
|
132
|
+
} catch (e) {
|
|
133
|
+
body = body.toString("utf8");
|
|
134
|
+
bodyKind = "string";
|
|
135
|
+
}
|
|
136
|
+
} else if (expectString === "ExpectWhatever") {
|
|
137
|
+
bodyKind = "whatever";
|
|
138
|
+
body = null;
|
|
139
|
+
} else if (
|
|
140
|
+
expectString === "ExpectResponse" ||
|
|
141
|
+
expectString === "ExpectString"
|
|
142
|
+
) {
|
|
143
|
+
bodyKind = "string";
|
|
144
|
+
body = await response.text();
|
|
145
|
+
} else {
|
|
146
|
+
throw `Unexpected expectString ${expectString}`;
|
|
172
147
|
}
|
|
148
|
+
|
|
149
|
+
resolve({
|
|
150
|
+
kind: "response-json",
|
|
151
|
+
value: {
|
|
152
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
153
|
+
statusCode: response.status,
|
|
154
|
+
body,
|
|
155
|
+
bodyKind,
|
|
156
|
+
url: response.url,
|
|
157
|
+
statusText: response.statusText,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
} catch (error) {
|
|
161
|
+
console.trace("@@@ request-cache2 HTTP error", error);
|
|
162
|
+
reject({
|
|
163
|
+
title: "BackendTask.Http Error",
|
|
164
|
+
message: `${kleur.yellow().underline(request.url)} ${error.toString()}
|
|
165
|
+
`,
|
|
166
|
+
});
|
|
173
167
|
}
|
|
174
168
|
}
|
|
175
169
|
});
|
|
@@ -189,15 +183,6 @@ function toRequest(elmRequest) {
|
|
|
189
183
|
body: toBody(elmRequest.body),
|
|
190
184
|
};
|
|
191
185
|
}
|
|
192
|
-
/**
|
|
193
|
-
* @param {string} file
|
|
194
|
-
*/
|
|
195
|
-
function checkFileExists(fs, file) {
|
|
196
|
-
return fs.promises
|
|
197
|
-
.access(file, fs.constants.F_OK)
|
|
198
|
-
.then(() => true)
|
|
199
|
-
.catch(() => false);
|
|
200
|
-
}
|
|
201
186
|
/**
|
|
202
187
|
* @param {Body} body
|
|
203
188
|
*/
|
|
@@ -209,6 +194,9 @@ function toBody(body) {
|
|
|
209
194
|
case "StringBody": {
|
|
210
195
|
return body.args[1];
|
|
211
196
|
}
|
|
197
|
+
case "BytesBody": {
|
|
198
|
+
return Buffer.from(body.args[1], "base64");
|
|
199
|
+
}
|
|
212
200
|
case "JsonBody": {
|
|
213
201
|
return JSON.stringify(body.args[0]);
|
|
214
202
|
}
|
|
@@ -227,13 +215,16 @@ function toContentType(body) {
|
|
|
227
215
|
case "StringBody": {
|
|
228
216
|
return { "Content-Type": body.args[0] };
|
|
229
217
|
}
|
|
218
|
+
case "BytesBody": {
|
|
219
|
+
return { "Content-Type": body.args[0] };
|
|
220
|
+
}
|
|
230
221
|
case "JsonBody": {
|
|
231
222
|
return { "Content-Type": "application/json" };
|
|
232
223
|
}
|
|
233
224
|
}
|
|
234
225
|
}
|
|
235
226
|
|
|
236
|
-
/** @typedef { { tag: 'EmptyBody'} | { tag: 'StringBody'; args: [string, string] } | {tag: 'JsonBody'; args: [ Object ] } } Body */
|
|
227
|
+
/** @typedef { { tag: 'EmptyBody'} |{ tag: 'BytesBody'; args: [string, string] } | { tag: 'StringBody'; args: [string, string] } | {tag: 'JsonBody'; args: [ Object ] } } Body */
|
|
237
228
|
function requireUncached(mode, filePath) {
|
|
238
229
|
if (mode === "dev-server") {
|
|
239
230
|
// for the build command, we can skip clearing the cache because it won't change while the build is running
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module Api exposing (routes)
|
|
2
2
|
|
|
3
3
|
import ApiRoute exposing (ApiRoute)
|
|
4
|
-
import
|
|
4
|
+
import BackendTask exposing (BackendTask)
|
|
5
5
|
import Html exposing (Html)
|
|
6
6
|
import Pages.Manifest as Manifest
|
|
7
7
|
import Route exposing (Route)
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
routes :
|
|
11
|
-
|
|
11
|
+
BackendTask (List Route)
|
|
12
12
|
-> (Maybe { indent : Int, newLines : Bool } -> Html Never -> String)
|
|
13
13
|
-> List (ApiRoute ApiRoute.Response)
|
|
14
14
|
routes getStaticRoutes htmlToString =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Route.Index exposing (Data, Model, Msg, route)
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import BackendTask exposing (BackendTask)
|
|
4
4
|
import Head
|
|
5
5
|
import Head.Seo as Seo
|
|
6
6
|
import Html
|
|
@@ -38,9 +38,9 @@ route =
|
|
|
38
38
|
|> RouteBuilder.buildNoState { view = view }
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
data :
|
|
41
|
+
data : BackendTask Data
|
|
42
42
|
data =
|
|
43
|
-
|
|
43
|
+
BackendTask.succeed Data
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
head :
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Shared exposing (Data, Model, Msg(..), SharedMsg(..), template)
|
|
2
2
|
|
|
3
3
|
import Browser.Navigation
|
|
4
|
-
import
|
|
4
|
+
import BackendTask
|
|
5
5
|
import Html exposing (Html)
|
|
6
6
|
import Html.Events
|
|
7
7
|
import Pages.Flags
|
|
@@ -76,9 +76,9 @@ subscriptions _ _ =
|
|
|
76
76
|
Sub.none
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
data :
|
|
79
|
+
data : BackendTask.BackendTask Data
|
|
80
80
|
data =
|
|
81
|
-
|
|
81
|
+
BackendTask.succeed ()
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
view :
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Site exposing (config)
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import BackendTask exposing (BackendTask)
|
|
4
4
|
import Head
|
|
5
5
|
import SiteConfig exposing (SiteConfig)
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ config =
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
head :
|
|
15
|
+
head : BackendTask (List Head.Tag)
|
|
16
16
|
head =
|
|
17
17
|
[ Head.metaName "viewport" (Head.raw "width=device-width,initial-scale=1")
|
|
18
18
|
, Head.metaName "mobile-web-app-capable" (Head.raw "yes")
|
|
@@ -21,4 +21,4 @@ head =
|
|
|
21
21
|
, Head.metaName "apple-mobile-web-app-status-bar-style" (Head.raw "black-translucent")
|
|
22
22
|
, Head.sitemapLink "/sitemap.xml"
|
|
23
23
|
]
|
|
24
|
-
|>
|
|
24
|
+
|> BackendTask.succeed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elm-pages",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.14",
|
|
4
4
|
"homepage": "https://elm-pages.com",
|
|
5
5
|
"moduleResolution": "node",
|
|
6
6
|
"description": "Type-safe static sites, written in pure elm with your own custom elm-markup syntax.",
|
|
@@ -26,43 +26,43 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"busboy": "^1.0.0",
|
|
28
28
|
"chokidar": "^3.5.3",
|
|
29
|
-
"commander": "9.
|
|
29
|
+
"commander": "^9.5.0",
|
|
30
30
|
"connect": "^3.7.0",
|
|
31
31
|
"cookie-signature": "^1.1.0",
|
|
32
32
|
"cross-spawn": "7.0.3",
|
|
33
33
|
"devcert": "^1.2.2",
|
|
34
34
|
"elm-doc-preview": "^5.0.5",
|
|
35
35
|
"elm-hot": "^1.1.6",
|
|
36
|
-
"esbuild": "^0.15
|
|
36
|
+
"esbuild": "^0.16.15",
|
|
37
37
|
"fs-extra": "^10.1.0",
|
|
38
38
|
"globby": "11.0.4",
|
|
39
39
|
"gray-matter": "^4.0.3",
|
|
40
40
|
"jsesc": "^3.0.2",
|
|
41
41
|
"kleur": "^4.1.5",
|
|
42
|
+
"make-fetch-happen": "^11.0.2",
|
|
42
43
|
"memfs": "^3.4.7",
|
|
43
44
|
"micromatch": "^4.0.5",
|
|
44
|
-
"node-fetch": "^2.6.7",
|
|
45
|
-
"object-hash": "^2.2.0",
|
|
46
45
|
"serve-static": "^1.15.0",
|
|
47
|
-
"terser": "^5.
|
|
48
|
-
"vite": "^
|
|
46
|
+
"terser": "^5.16.1",
|
|
47
|
+
"vite": "^4.0.4",
|
|
49
48
|
"which": "^2.0.2"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@types/cross-spawn": "^6.0.2",
|
|
53
52
|
"@types/fs-extra": "^9.0.13",
|
|
53
|
+
"@types/make-fetch-happen": "^10.0.1",
|
|
54
54
|
"@types/micromatch": "^4.0.2",
|
|
55
55
|
"@types/node": "^18.11.9",
|
|
56
56
|
"@types/serve-static": "^1.15.0",
|
|
57
|
-
"cypress": "^
|
|
57
|
+
"cypress": "^12.3.0",
|
|
58
58
|
"elm-codegen": "^0.2.0",
|
|
59
59
|
"elm-optimize-level-2": "^0.3.5",
|
|
60
60
|
"elm-review": "^2.8.2",
|
|
61
|
-
"elm-test": "^0.19.1-
|
|
62
|
-
"elm-tooling": "^1.
|
|
61
|
+
"elm-test": "^0.19.1-revision11",
|
|
62
|
+
"elm-tooling": "^1.11.0",
|
|
63
63
|
"elm-verify-examples": "^5.2.0",
|
|
64
64
|
"elmi-to-json": "^1.2.0",
|
|
65
|
-
"mocha": "^10.
|
|
65
|
+
"mocha": "^10.2.0",
|
|
66
66
|
"typescript": "^4.9.3"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|