@revojs/cloudflare 0.2.60 → 0.2.62
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/dist/module/bun.d.ts +1 -0
- package/dist/module/bun.js +26 -0
- package/dist/module/index.d.ts +2 -1
- package/dist/module/index.js +2 -1
- package/dist/package.js +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Module from "module";
|
|
2
|
+
import { Server } from "net";
|
|
3
|
+
import { networkInterfaces } from "os";
|
|
4
|
+
//#region src/module/bun.ts
|
|
5
|
+
var loader = Module;
|
|
6
|
+
var resolveFilename = loader._resolveFilename;
|
|
7
|
+
var listen = Object.getOwnPropertyDescriptor(Server.prototype, "listen")?.value;
|
|
8
|
+
if (process.versions.bun !== void 0) {
|
|
9
|
+
loader._resolveFilename = (request, ...options) => {
|
|
10
|
+
if (request === "undici") return resolveFilename.call(loader, "undici/index.js", ...options);
|
|
11
|
+
return resolveFilename.call(loader, request, ...options);
|
|
12
|
+
};
|
|
13
|
+
let ipv6 = false;
|
|
14
|
+
for (const addresses of Object.values(networkInterfaces())) for (const address of addresses ?? []) if (address.family === "IPv6") ipv6 = true;
|
|
15
|
+
if (!ipv6) Server.prototype.listen = function(...options) {
|
|
16
|
+
const [first, second] = options;
|
|
17
|
+
if (typeof first === "number" && typeof second !== "string") options.splice(1, 0, "0.0.0.0");
|
|
18
|
+
if (typeof first === "object" && first !== null && !("path" in first) && (!("host" in first) || first.host === void 0)) options[0] = {
|
|
19
|
+
...first,
|
|
20
|
+
host: "0.0.0.0"
|
|
21
|
+
};
|
|
22
|
+
return listen.apply(this, options);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export {};
|
package/dist/module/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./bun.ts";
|
|
2
|
+
import type { PluginConfig } from "@cloudflare/vite-plugin";
|
|
2
3
|
export type CloudflareConfig = PluginConfig;
|
|
3
4
|
declare const _default: import("revojs/module").Module<"cloudflare", PluginConfig, readonly [import("revojs/module").Module<"server", Record<string, never>, []>]>;
|
|
4
5
|
export default _default;
|
package/dist/module/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import "./bun.js";
|
|
1
2
|
import package_default from "../package.js";
|
|
2
|
-
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
3
3
|
import server, { SERVER } from "@revojs/server/module";
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
5
5
|
import { join } from "path";
|
|
@@ -11,6 +11,7 @@ var module_default = defineModule({
|
|
|
11
11
|
modules: [server],
|
|
12
12
|
config: () => ({ viteEnvironment: { name: SERVER } }),
|
|
13
13
|
async setup(config) {
|
|
14
|
+
const { cloudflare } = await import("@cloudflare/vite-plugin");
|
|
14
15
|
const { fromModule } = useModule(import.meta.url);
|
|
15
16
|
const crons = /* @__PURE__ */ new Set();
|
|
16
17
|
for (const path of resolvePaths(["./schedules/**/*.{js,ts}", "!./schedules/**/*.d.ts"])) {
|
package/dist/package.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var name = "@revojs/cloudflare";
|
|
3
|
-
var version = "0.2.
|
|
3
|
+
var version = "0.2.62";
|
|
4
4
|
var repository = {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/tellua/revojs.git"
|
|
@@ -22,7 +22,7 @@ var exports = {
|
|
|
22
22
|
};
|
|
23
23
|
var scripts = {
|
|
24
24
|
"build": "vite build",
|
|
25
|
-
"typecheck": "
|
|
25
|
+
"typecheck": "bun check",
|
|
26
26
|
"watch": "vite build --watch"
|
|
27
27
|
};
|
|
28
28
|
var dependencies = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revojs/cloudflare",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.62",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "vite build",
|
|
28
|
-
"typecheck": "
|
|
28
|
+
"typecheck": "bun check",
|
|
29
29
|
"watch": "vite build --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|