@marko/run 0.5.12 → 0.5.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 +85 -76
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapter/default-entry.mjs +12 -13
- package/dist/adapter/index.cjs +470 -454
- package/dist/adapter/index.d.ts +2 -2
- package/dist/adapter/index.js +473 -457
- package/dist/adapter/load-dev-worker.mjs +5 -5
- package/dist/adapter/middleware.cjs +5 -3
- package/dist/adapter/middleware.d.ts +1 -1
- package/dist/adapter/middleware.js +5 -3
- package/dist/adapter/polyfill.d.ts +1 -1
- package/dist/cli/default.config.mjs +2 -2
- package/dist/cli/index.mjs +1491 -1466
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/internal.d.ts +1 -1
- package/dist/runtime/namespace.d.ts +1 -1
- package/dist/vite/codegen/index.d.ts +1 -1
- package/dist/vite/constants.d.ts +1 -1
- package/dist/vite/index.cjs +1445 -1420
- package/dist/vite/index.d.ts +2 -2
- package/dist/vite/index.js +1440 -1415
- package/dist/vite/plugin.d.ts +1 -1
- package/dist/vite/routes/vdir.d.ts +1 -1
- package/dist/vite/types.d.ts +3 -3
- package/dist/vite/utils/config.d.ts +1 -1
- package/dist/vite/utils/log.d.ts +1 -1
- package/dist/vite/utils/route.d.ts +1 -1
- package/dist/vite/utils/server.d.ts +1 -1
- package/package.json +64 -63
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getDevGlobal } from "@marko/run/adapter";
|
|
1
2
|
import net from "net";
|
|
2
3
|
import { createServer } from "vite";
|
|
3
|
-
import { getDevGlobal } from "@marko/run/adapter";
|
|
4
4
|
|
|
5
5
|
process
|
|
6
6
|
.on("message", (message) => {
|
|
@@ -15,7 +15,7 @@ process
|
|
|
15
15
|
|
|
16
16
|
async function start(entry, config) {
|
|
17
17
|
if (config.plugins) {
|
|
18
|
-
const plugin = await import(
|
|
18
|
+
const plugin = await import("@marko/run/vite");
|
|
19
19
|
config.plugins = plugin.default();
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ async function start(entry, config) {
|
|
|
29
29
|
|
|
30
30
|
const port = await getAvailablePort();
|
|
31
31
|
await loader.listen(port);
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
loader.ssrLoadModule(entry).catch((err) => {
|
|
34
34
|
loader.ssrFixStacktrace(err);
|
|
35
35
|
|
|
@@ -42,7 +42,7 @@ async function start(entry, config) {
|
|
|
42
42
|
JSON.stringify({
|
|
43
43
|
type: "error",
|
|
44
44
|
err: { message, stack },
|
|
45
|
-
})
|
|
45
|
+
}),
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -70,4 +70,4 @@ async function getAvailablePort() {
|
|
|
70
70
|
server.close(() => resolve(port));
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
-
}
|
|
73
|
+
}
|
|
@@ -40,11 +40,14 @@ module.exports = __toCommonJS(middleware_exports);
|
|
|
40
40
|
var import_url = require("url");
|
|
41
41
|
var __importMetaURL = (0, import_url.pathToFileURL)(__filename);
|
|
42
42
|
|
|
43
|
+
// src/adapter/middleware.ts
|
|
44
|
+
var import_node_stream = require("node:stream");
|
|
45
|
+
|
|
43
46
|
// src/adapter/polyfill.ts
|
|
44
|
-
var webStream = __toESM(require("stream/web"), 1);
|
|
45
47
|
var import_crypto = require("crypto");
|
|
46
|
-
var undici = __toESM(require("undici"), 1);
|
|
47
48
|
var import_http = require("http");
|
|
49
|
+
var webStream = __toESM(require("stream/web"), 1);
|
|
50
|
+
var undici = __toESM(require("undici"), 1);
|
|
48
51
|
globalThis.crypto ?? (globalThis.crypto = import_crypto.webcrypto);
|
|
49
52
|
globalThis.fetch ?? (globalThis.fetch = undici.fetch);
|
|
50
53
|
globalThis.Response ?? (globalThis.Response = undici.Response);
|
|
@@ -109,7 +112,6 @@ function getSetCookie_fallback(headers) {
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
// src/adapter/middleware.ts
|
|
112
|
-
var import_node_stream = require("node:stream");
|
|
113
115
|
function getForwardedHeader(req, name) {
|
|
114
116
|
const value = req.headers["x-forwarded-" + name];
|
|
115
117
|
if (value) {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
// src/adapter/middleware.ts
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
|
|
1
4
|
// src/adapter/polyfill.ts
|
|
2
|
-
import * as webStream from "stream/web";
|
|
3
5
|
import { webcrypto } from "crypto";
|
|
4
|
-
import * as undici from "undici";
|
|
5
6
|
import { ServerResponse } from "http";
|
|
7
|
+
import * as webStream from "stream/web";
|
|
8
|
+
import * as undici from "undici";
|
|
6
9
|
globalThis.crypto ?? (globalThis.crypto = webcrypto);
|
|
7
10
|
globalThis.fetch ?? (globalThis.fetch = undici.fetch);
|
|
8
11
|
globalThis.Response ?? (globalThis.Response = undici.Response);
|
|
@@ -67,7 +70,6 @@ function getSetCookie_fallback(headers) {
|
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
// src/adapter/middleware.ts
|
|
70
|
-
import { Readable } from "node:stream";
|
|
71
73
|
function getForwardedHeader(req, name) {
|
|
72
74
|
const value = req.headers["x-forwarded-" + name];
|
|
73
75
|
if (value) {
|