Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove more platform re-exports #2077

Merged
merged 3 commits into from
Feb 7, 2024
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: 1 addition & 4 deletions packages/effect/src/Runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,7 @@ export const updateContext: {
* @example
* import { Context, Runtime } from "effect"
*
* interface Name {
* readonly _: unique symbol
* }
* const Name = Context.Tag<Name, string>("Name")
* class Name extends Context.Tag("Name")<Name, string>() {}
*
* const runtime: Runtime.Runtime<Name> = Runtime.defaultRuntime.pipe(
* Runtime.provideService(Name, "John")
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-browser/examples/keyValueStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as KeyValueStore from "@effect/platform-browser/KeyValueStore"
import * as KeyValueStore from "@effect/platform/KeyValueStore"
import * as Effect from "effect/Effect"

const program = KeyValueStore.KeyValueStore.pipe(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
/**
* @since 1.0.0
*
* Also includes exports from [`@effect/platform/KeyValueStore`](https://effect-ts.github.io/effect/platform/KeyValueStore.ts.html).
*/
import type * as KeyValueStore from "@effect/platform/KeyValueStore"
import type * as Layer from "effect/Layer"
import * as internal from "./internal/keyValueStore.js"

/**
* @since 1.0.0
*/
export * from "@effect/platform/KeyValueStore"

/**
* Creates a KeyValueStore layer that uses the browser's localStorage api. Values are stored between sessions.
*
* @since 1.0.0
* @category models
*/
export const layerLocalStorage = internal.layerLocalStorage
export const layerLocalStorage: Layer.Layer<KeyValueStore.KeyValueStore, never, never> = internal.layerLocalStorage

/**
* Creates a KeyValueStore layer that uses the browser's sessionStorage api. Values are stored only for the current session.
*
* @since 1.0.0
* @category models
*/
export const layerSessionStorage = internal.layerSessionStorage
export const layerSessionStorage: Layer.Layer<KeyValueStore.KeyValueStore, never, never> = internal.layerSessionStorage
17 changes: 17 additions & 0 deletions packages/platform-browser/src/BrowserWorker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @since 1.0.0
*/
import type * as Worker from "@effect/platform/Worker"
import type * as Layer from "effect/Layer"
import * as internal from "./internal/worker.js"
/**
* @since 1.0.0
* @category layers
*/
export const layerManager: Layer.Layer<Worker.WorkerManager> = internal.layerManager

/**
* @since 1.0.0
* @category layers
*/
export const layerWorker: Layer.Layer<Worker.PlatformWorker> = internal.layerWorker
12 changes: 12 additions & 0 deletions packages/platform-browser/src/BrowserWorkerRunner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @since 1.0.0
*/
import type * as Runner from "@effect/platform/WorkerRunner"
import type * as Layer from "effect/Layer"
import * as internal from "./internal/workerRunner.js"

/**
* @since 1.0.0
* @category layers
*/
export const layer: Layer.Layer<Runner.PlatformRunner> = internal.layer
22 changes: 0 additions & 22 deletions packages/platform-browser/src/Effectify.ts

This file was deleted.

34 changes: 0 additions & 34 deletions packages/platform-browser/src/Error.ts

This file was deleted.

62 changes: 0 additions & 62 deletions packages/platform-browser/src/HttpClient.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/platform-browser/src/Path.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/platform-browser/src/Transferable.ts

This file was deleted.

64 changes: 0 additions & 64 deletions packages/platform-browser/src/Worker.ts

This file was deleted.

45 changes: 0 additions & 45 deletions packages/platform-browser/src/WorkerRunner.ts

This file was deleted.

45 changes: 5 additions & 40 deletions packages/platform-browser/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,24 @@
/**
* @since 1.0.0
*/
export * as Clipboard from "./Clipboard.js"

/**
* @since 1.0.0
*/
export * as Effectify from "./Effectify.js"

/**
* @since 1.0.0
*/
export * as Error from "./Error.js"

/**
* @since 1.0.0
*/
export * as HttpClient from "./HttpClient.js"

/**
* @since 1.0.0
*
* Also includes exports from [`@effect/platform/KeyValueStore`](https://effect-ts.github.io/effect/platform/KeyValueStore.ts.html).
*/
export * as KeyValueStore from "./KeyValueStore.js"
export * as BrowserKeyValueStore from "./BrowserKeyValueStore.js"

/**
* @since 1.0.0
*
* Also includes exports from [`@effect/platform/Path`](https://effect-ts.github.io/effect/platform/Path.ts.html).
*/
export * as Path from "./Path.js"
export * as BrowserRuntime from "./BrowserRuntime.js"

/**
* @since 1.0.0
*/
export * as Runtime from "./Runtime.js"
export * as BrowserWorker from "./BrowserWorker.js"

/**
* @since 1.0.0
*
* Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/effect/platform/Transferable.ts.html).
*/
export * as Transferable from "./Transferable.js"
export * as BrowserWorkerRunner from "./BrowserWorkerRunner.js"

/**
* @since 1.0.0
*
* Also includes exports from [`@effect/platform/Worker`](https://effect-ts.github.io/effect/platform/Worker.ts.html).
*/
export * as Worker from "./Worker.js"

/**
* @since 1.0.0
*
* Also includes exports from [`@effect/platform/WorkerRunner`](https://effect-ts.github.io/effect/platform/WorkerRunner.ts.html).
*/
export * as WorkerRunner from "./WorkerRunner.js"
export * as Clipboard from "./Clipboard.js"
Loading
Loading