@marko/run 0.5.13 → 0.5.15

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.
@@ -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('@marko/run/vite');
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,5 +1,5 @@
1
- import type { Fetch, Platform } from "../runtime";
2
1
  import { IncomingMessage, ServerResponse } from "http";
2
+ import type { Fetch, Platform } from "../runtime";
3
3
  export interface NodePlatformInfo {
4
4
  request: IncomingMessage;
5
5
  response: ServerResponse;
@@ -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) {
@@ -1,4 +1,4 @@
1
- import { ServerResponse } from 'http';
1
+ import { ServerResponse } from "http";
2
2
  declare global {
3
3
  interface Headers {
4
4
  getSetCookie: () => string[];
@@ -1,6 +1,6 @@
1
- import { defineConfig } from "vite";
2
1
  import marko from "@marko/run/vite";
2
+ import { defineConfig } from "vite";
3
3
 
4
4
  export default defineConfig({
5
- plugins: [marko()]
5
+ plugins: [marko()],
6
6
  });