From c60f2947986151bce1d63c734e9c63e3bb9023ed Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 12 Sep 2024 13:53:51 +1000 Subject: [PATCH 1/3] BREAKING(net/unstable): move `get-network-address` module to `unstable-get-network-address` --- _tools/check_docs.ts | 1 + http/file_server.ts | 2 +- net/deno.json | 2 +- net/mod.ts | 7 ++----- ..._network_address.ts => unstable_get_network_address.ts} | 4 ++-- ...ddress_test.ts => unstable_get_network_address_test.ts} | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) rename net/{get_network_address.ts => unstable_get_network_address.ts} (91%) rename net/{get_network_address_test.ts => unstable_get_network_address_test.ts} (97%) diff --git a/_tools/check_docs.ts b/_tools/check_docs.ts index 840132e06b04..80b5bd3831db 100644 --- a/_tools/check_docs.ts +++ b/_tools/check_docs.ts @@ -59,6 +59,7 @@ const ENTRY_POINTS = [ "../media_types/mod.ts", "../msgpack/mod.ts", "../net/mod.ts", + "../net/unstable_get_network_address.ts", "../path/mod.ts", "../path/posix/mod.ts", "../path/windows/mod.ts", diff --git a/http/file_server.ts b/http/file_server.ts index f686198fdd9e..64e459b51328 100644 --- a/http/file_server.ts +++ b/http/file_server.ts @@ -51,7 +51,7 @@ import { ByteSliceStream } from "@std/streams/byte-slice-stream"; import { parseArgs } from "@std/cli/parse-args"; import denoConfig from "./deno.json" with { type: "json" }; import { format as formatBytes } from "@std/fmt/bytes"; -import { getNetworkAddress } from "@std/net/get-network-address"; +import { getNetworkAddress } from "../net/unstable_get_network_address.ts"; import { HEADER } from "./unstable_header.ts"; import { METHOD } from "./unstable_method.ts"; diff --git a/net/deno.json b/net/deno.json index c4b2deccb7fc..f78a4efc5c10 100644 --- a/net/deno.json +++ b/net/deno.json @@ -4,6 +4,6 @@ "exports": { ".": "./mod.ts", "./get-available-port": "./get_available_port.ts", - "./get-network-address": "./get_network_address.ts" + "./unstable-get-network-address": "./unstable_get_network_address.ts" } } diff --git a/net/mod.ts b/net/mod.ts index 009017d44a42..f6136a146551 100644 --- a/net/mod.ts +++ b/net/mod.ts @@ -4,10 +4,8 @@ * Network utilities. * * ```ts no-assert no-eval - * import { getNetworkAddress, getAvailablePort } from "@std/net"; - * - * console.log(`My network IP address is ${getNetworkAddress()}`); - * + * import { getAvailablePort } from "@std/net"; + * * * const command = new Deno.Command(Deno.execPath(), { * args: ["test.ts", "--port", getAvailablePort().toString()], * }); @@ -19,4 +17,3 @@ */ export * from "./get_available_port.ts"; -export * from "./get_network_address.ts"; diff --git a/net/get_network_address.ts b/net/unstable_get_network_address.ts similarity index 91% rename from net/get_network_address.ts rename to net/unstable_get_network_address.ts index bbad8546946d..07c72532db8f 100644 --- a/net/get_network_address.ts +++ b/net/unstable_get_network_address.ts @@ -17,7 +17,7 @@ * * @example Get the IPv4 network address (default) * ```ts no-assert no-eval - * import { getNetworkAddress } from "@std/net/get-network-address"; + * import { getNetworkAddress } from "@std/net/unstable-get-network-address"; * * const hostname = getNetworkAddress()!; * @@ -26,7 +26,7 @@ * * @example Get the IPv6 network address * ```ts no-assert no-eval - * import { getNetworkAddress } from "@std/net/get-network-address"; + * import { getNetworkAddress } from "@std/net/unstable-get-network-address"; * * const hostname = getNetworkAddress("IPv6")!; * diff --git a/net/get_network_address_test.ts b/net/unstable_get_network_address_test.ts similarity index 97% rename from net/get_network_address_test.ts rename to net/unstable_get_network_address_test.ts index d22312722c3b..36c578a4d428 100644 --- a/net/get_network_address_test.ts +++ b/net/unstable_get_network_address_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { getNetworkAddress } from "./get_network_address.ts"; +import { getNetworkAddress } from "./unstable_get_network_address.ts"; import { stub } from "@std/testing/mock"; import { assertEquals } from "@std/assert"; From 747cabcfd5f7016814a631945b9674ca05fd228c Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 12 Sep 2024 13:54:25 +1000 Subject: [PATCH 2/3] fix --- net/mod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mod.ts b/net/mod.ts index f6136a146551..0d975ddc07e6 100644 --- a/net/mod.ts +++ b/net/mod.ts @@ -5,7 +5,7 @@ * * ```ts no-assert no-eval * import { getAvailablePort } from "@std/net"; - * * + * * const command = new Deno.Command(Deno.execPath(), { * args: ["test.ts", "--port", getAvailablePort().toString()], * }); From 7d1e3c6c31ed7e965476ef8f41c5e1dbe1cfa16d Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 12 Sep 2024 14:02:15 +1000 Subject: [PATCH 3/3] fix --- http/file_server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/file_server.ts b/http/file_server.ts index 64e459b51328..9e1cb9d8f8b0 100644 --- a/http/file_server.ts +++ b/http/file_server.ts @@ -51,7 +51,7 @@ import { ByteSliceStream } from "@std/streams/byte-slice-stream"; import { parseArgs } from "@std/cli/parse-args"; import denoConfig from "./deno.json" with { type: "json" }; import { format as formatBytes } from "@std/fmt/bytes"; -import { getNetworkAddress } from "../net/unstable_get_network_address.ts"; +import { getNetworkAddress } from "@std/net/unstable-get-network-address"; import { HEADER } from "./unstable_header.ts"; import { METHOD } from "./unstable_method.ts";