Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eff-145-deno-services.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/platform-deno": patch
---

Add the aggregate Deno platform services layer.
49 changes: 49 additions & 0 deletions packages/platform-deno/src/DenoServices.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Aggregate Deno platform services layer.
*
* This module defines the `DenoServices` union and a single `layer` that
* provides Deno-backed child process spawning, crypto, filesystem, path, stdio,
* and terminal services. Use the layer when a Deno program wants the standard
* platform services from one place.
*
* @since 4.0.0
*/
import type { Crypto } from "effect/Crypto"
import type { FileSystem } from "effect/FileSystem"
import * as Layer from "effect/Layer"
import type { Path } from "effect/Path"
import type { Stdio } from "effect/Stdio"
import type { Terminal } from "effect/Terminal"
import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
import * as DenoChildProcessSpawner from "./DenoChildProcessSpawner.ts"
import * as DenoCrypto from "./DenoCrypto.ts"
import * as DenoFileSystem from "./DenoFileSystem.ts"
import * as DenoPath from "./DenoPath.ts"
import * as DenoStdio from "./DenoStdio.ts"
import * as DenoTerminal from "./DenoTerminal.ts"

/**
* The union of core services provided by the Deno platform layer, including
* child process spawning, crypto, filesystem, path, stdio, and terminal services.
*
* @category models
* @since 4.0.0
*/
export type DenoServices = ChildProcessSpawner | Crypto | FileSystem | Path | Terminal | Stdio
Comment thread
tim-smart marked this conversation as resolved.

/**
* Provides the default Deno implementations for child process spawning,
* crypto, filesystem, path, stdio, and terminal services.
*
* @category layers
* @since 4.0.0
*/
export const layer: Layer.Layer<DenoServices> = DenoChildProcessSpawner.layer.pipe(
Layer.provideMerge(Layer.mergeAll(
DenoFileSystem.layer,
DenoCrypto.layer,
DenoPath.layer,
DenoStdio.layer,
DenoTerminal.layer
))
)
5 changes: 5 additions & 0 deletions packages/platform-deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export * as DenoRedis from "./DenoRedis.ts"
*/
export * as DenoRuntime from "./DenoRuntime.ts"

/**
* @since 4.0.0
*/
export * as DenoServices from "./DenoServices.ts"

/**
* @since 4.0.0
*/
Expand Down
Loading