diff --git a/.changeset/serious-eels-rule.md b/.changeset/serious-eels-rule.md index af0ad388cb..57cb915e01 100644 --- a/.changeset/serious-eels-rule.md +++ b/.changeset/serious-eels-rule.md @@ -2,4 +2,4 @@ "@effect/platform-node": minor --- -upgrade undici to 7.x and move to peerDependencies +upgrade undici to 7.x and expose re-exports in Undici module diff --git a/packages/platform-node/package.json b/packages/platform-node/package.json index 70d4c662df..9082aca176 100644 --- a/packages/platform-node/package.json +++ b/packages/platform-node/package.json @@ -46,18 +46,17 @@ "dependencies": { "@effect/platform-node-shared": "workspace:^", "mime": "^3.0.0", + "undici": "^7.1.0", "ws": "^8.18.0" }, "peerDependencies": { "@effect/platform": "workspace:^", - "effect": "workspace:^", - "undici": "^7.1.0" + "effect": "workspace:^" }, "devDependencies": { "@effect/platform": "workspace:^", "@types/mime": "^3.0.4", "@types/ws": "^8.5.12", - "effect": "workspace:^", - "undici": "^7.1.0" + "effect": "workspace:^" } } diff --git a/packages/platform-node/src/NodeHttpClient.ts b/packages/platform-node/src/NodeHttpClient.ts index 9260de4b68..98943ce6a6 100644 --- a/packages/platform-node/src/NodeHttpClient.ts +++ b/packages/platform-node/src/NodeHttpClient.ts @@ -8,9 +8,9 @@ import type * as Layer from "effect/Layer" import type * as Scope from "effect/Scope" import type * as Http from "node:http" import type * as Https from "node:https" -import type * as Undici from "undici" import * as internal from "./internal/httpClient.js" import * as internalUndici from "./internal/httpClientUndici.js" +import type * as Undici from "./Undici.js" /** * @since 1.0.0 diff --git a/packages/platform-node/src/Undici.ts b/packages/platform-node/src/Undici.ts new file mode 100644 index 0000000000..761047527d --- /dev/null +++ b/packages/platform-node/src/Undici.ts @@ -0,0 +1,9 @@ +/** + * @since 1.0.0 + */ + +/** + * @since 1.0.0 + * @category undici + */ +export * from "undici" diff --git a/packages/platform-node/src/index.ts b/packages/platform-node/src/index.ts index 9aeae00efa..3b31b5f93c 100644 --- a/packages/platform-node/src/index.ts +++ b/packages/platform-node/src/index.ts @@ -82,3 +82,8 @@ export * as NodeWorker from "./NodeWorker.js" * @since 1.0.0 */ export * as NodeWorkerRunner from "./NodeWorkerRunner.js" + +/** + * @since 1.0.0 + */ +export * as Undici from "./Undici.js" diff --git a/packages/platform-node/src/internal/httpClientUndici.ts b/packages/platform-node/src/internal/httpClientUndici.ts index 244bc2a568..fb67f4380b 100644 --- a/packages/platform-node/src/internal/httpClientUndici.ts +++ b/packages/platform-node/src/internal/httpClientUndici.ts @@ -15,9 +15,9 @@ import * as Layer from "effect/Layer" import * as Option from "effect/Option" import type * as Scope from "effect/Scope" import type * as Stream from "effect/Stream" -import * as Undici from "undici" import type * as NodeClient from "../NodeHttpClient.js" import * as NodeStream from "../NodeStream.js" +import * as Undici from "../Undici.js" /** @internal */ export const Dispatcher = Context.GenericTag( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b413b0f7a..c650828767 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -467,6 +467,9 @@ importers: mime: specifier: ^3.0.0 version: 3.0.0 + undici: + specifier: ^7.1.0 + version: 7.1.0 ws: specifier: ^8.18.0 version: 8.18.0 @@ -483,9 +486,6 @@ importers: effect: specifier: workspace:^ version: link:../effect/dist - undici: - specifier: ^7.1.0 - version: 7.1.0 publishDirectory: dist packages/platform-node-shared: