1tube 0.1.6 → 0.1.8

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/deno.json CHANGED
@@ -14,6 +14,13 @@
14
14
  "@std/assert": "jsr:@std/assert@^1",
15
15
  "hono": "npm:hono@4"
16
16
  },
17
+ "lint": {
18
+ "rules": {
19
+ "exclude": [
20
+ "no-import-prefix"
21
+ ]
22
+ }
23
+ },
17
24
  "nodeModulesDir": "auto",
18
25
  "allowScripts": {
19
26
  "allow": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "1tube",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "description": "Self-hosted Supabase Edge Functions gateway for Deno, plus an ESLint plugin for consumers",
6
6
  "license": "MIT",
package/src/discovery.ts CHANGED
@@ -9,7 +9,10 @@
9
9
  * registry's async-context binding.
10
10
  */
11
11
 
12
- import { join, toFileUrl } from "@std/path";
12
+ // node: specifiers so this module loads cleanly from node_modules in any
13
+ // host Deno project (no shared import-map entry required).
14
+ import { join } from "node:path";
15
+ import { pathToFileURL } from "node:url";
13
16
  import type { FunctionRegistry } from "./registry.ts";
14
17
  import { loadManifest } from "./manifest.ts";
15
18
 
@@ -110,7 +113,10 @@ export async function discoverAndLoad(
110
113
 
111
114
  const loadOne = async (name: string): Promise<void> => {
112
115
  const indexPath = join(resolvedDir, name, "index.ts");
113
- const moduleUrl = toFileUrl(indexPath);
116
+ // pathToFileURL is the node:url equivalent of std/path's toFileUrl;
117
+ // both produce a `file://` URL whose searchParams we mutate below for
118
+ // HMR cache-busting.
119
+ const moduleUrl = pathToFileURL(indexPath);
114
120
  if (options?.cacheBust) {
115
121
  moduleUrl.searchParams.set("v", options.cacheBust);
116
122
  }
@@ -8,7 +8,7 @@
8
8
  * requests).
9
9
  */
10
10
 
11
- import type { Context, Next } from "hono";
11
+ import type { Context, Next } from "npm:hono@4";
12
12
 
13
13
  const ALLOWED_HEADERS =
14
14
  "authorization, x-client-info, apikey, content-type, x-application-name, user-agent";
@@ -9,7 +9,7 @@
9
9
  * grow it unboundedly with synthetic high-cardinality function names.
10
10
  */
11
11
 
12
- import type { Context, Next } from "hono";
12
+ import type { Context, Next } from "npm:hono@4";
13
13
  import { logError, logInfo } from "../log-buffer.ts";
14
14
 
15
15
  export interface FunctionMetrics {
@@ -8,8 +8,8 @@
8
8
  * mint fresh buckets.
9
9
  */
10
10
 
11
- import type { Context, Next } from "hono";
12
- import { getConnInfo } from "hono/deno";
11
+ import type { Context, Next } from "npm:hono@4";
12
+ import { getConnInfo } from "npm:hono@4/deno";
13
13
  import type { FunctionRegistry } from "../registry.ts";
14
14
 
15
15
  interface Bucket {
package/src/health.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * strings leak into access logs, browser history, and proxy buffers).
9
9
  */
10
10
 
11
- import type { Context } from "hono";
11
+ import type { Context } from "npm:hono@4";
12
12
  import type { FunctionRegistry } from "./registry.ts";
13
13
  import type { FunctionSupervisor } from "./supervisor.ts";
14
14
  import { getCollectedMetrics, getPrometheusMetrics } from "./gateway/logging.ts";
package/src/manifest.ts CHANGED
@@ -22,7 +22,9 @@
22
22
  * out of rotation.
23
23
  */
24
24
 
25
- import { join } from "@std/path";
25
+ // node:path so this loads from node_modules in any host Deno project
26
+ // without depending on a shared import-map entry.
27
+ import { join } from "node:path";
26
28
 
27
29
  export interface ManifestPermissions {
28
30
  /** Hostnames the function may reach (e.g. "api.example.com"). [] = none. */
package/src/server.ts CHANGED
@@ -11,9 +11,14 @@
11
11
  * deno run --allow-all src/server.ts --dev --hmr # local development
12
12
  */
13
13
 
14
- import { Hono } from "hono";
15
- import { bodyLimit } from "hono/body-limit";
16
- import { relative, SEPARATOR } from "@std/path";
14
+ // All third-party imports below use `npm:` / `node:` / `jsr:` specifiers
15
+ // directly (not bare aliases from our deno.json) so this entry point loads
16
+ // cleanly when launched from a host project's node_modules — bare
17
+ // specifiers would otherwise require the host's deno.json to mirror our
18
+ // import map. Same convention applies to every src/ file.
19
+ import { Hono } from "npm:hono@4";
20
+ import { bodyLimit } from "npm:hono@4/body-limit";
21
+ import { relative, sep as SEPARATOR } from "node:path";
17
22
  import { currentRequestStorage, FunctionRegistry } from "./registry.ts";
18
23
  import { discoverAndLoad, type DiscoveryProgress } from "./discovery.ts";
19
24
  import { validateRequest } from "./gateway/auth.ts";
package/src/version.ts CHANGED
@@ -1,8 +1,11 @@
1
- import { join, fromFileUrl } from "jsr:@std/path@^1";
1
+ // node: specifiers (instead of "jsr:@std/path") so this loads from node_modules
2
+ // in any host Deno project without needing a shared import-map entry.
3
+ import { join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
2
5
 
3
6
  function readVersion(): string {
4
7
  try {
5
- const dir = fromFileUrl(new URL(".", import.meta.url));
8
+ const dir = fileURLToPath(new URL(".", import.meta.url));
6
9
  const raw = Deno.readTextFileSync(join(dir, "..", "package.json"));
7
10
  return JSON.parse(raw).version ?? "unknown";
8
11
  } catch {