Skip to content

Commit

Permalink
upgrade to latest @effect/* packages
Browse files Browse the repository at this point in the history
  • Loading branch information
IMax153 committed Feb 25, 2023
1 parent 69f68af commit 6920e9a
Show file tree
Hide file tree
Showing 36 changed files with 1,753 additions and 1,445 deletions.
6 changes: 5 additions & 1 deletion .babel.cjs.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"plugins": [["@babel/transform-modules-commonjs"], ["annotate-pure-calls"]]
"plugins": [
["@effect/babel-plugin"],
["@babel/transform-modules-commonjs"],
["annotate-pure-calls"]
]
}
2 changes: 1 addition & 1 deletion .babel.mjs.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"plugins": [["annotate-pure-calls"]]
"plugins": [["@effect/babel-plugin"], ["annotate-pure-calls"]]
}
5 changes: 5 additions & 0 deletions .changeset/gold-dodos-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/test": minor
---

upgrade to latest @effect/\* packages
49 changes: 20 additions & 29 deletions docs/modules/Annotations.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ Added in v1.0.0

<h2 class="text-delta">Table of contents</h2>

- [environment](#environment)
- [context](#context)
- [Tag](#tag)
- [live](#live)
- [getters](#getters)
- [get](#get)
- [models](#models)
- [Annotations (interface)](#annotations-interface)
- [refinements](#refinements)
Expand All @@ -26,11 +24,12 @@ Added in v1.0.0
- [AnnotationsTypeId (type alias)](#annotationstypeid-type-alias)
- [utils](#utils)
- [annotate](#annotate)
- [get](#get)
- [supervisedFibers](#supervisedfibers)

---

# environment
# context

## Tag

Expand All @@ -46,27 +45,12 @@ Added in v1.0.0

## live

A `Layer` containing an instance of `Annotations`.
Constructs a new `Annotations` service.

**Signature**

```ts
export declare const live: Layer.Layer<never, never, Annotations>
```

Added in v1.0.0

# getters

## get

Accesses an `Annotations` instance in the environment and retrieves the
annotation of the specified type, or its default value if there is none.

**Signature**

```ts
export declare const get: <A>(key: TestAnnotation.TestAnnotation<A>) => Effect.Effect<Annotations, never, A>
export declare const live: () => Layer.Layer<never, never, Annotations>
```

Added in v1.0.0
Expand All @@ -87,25 +71,19 @@ monad effect.
```ts
export interface Annotations extends Annotations.Proto {
/**
* Accesses an `Annotations` instance in the environment and retrieves the
* Accesses an `Annotations` instance in the context and retrieves the
* annotation of the specified type, or its default value if there is none.
*
* @macro traced
*/
get<A>(key: TestAnnotation.TestAnnotation<A>): Effect.Effect<never, never, A>

/**
* Accesses an `Annotations` instance in the environment and appends the
* Accesses an `Annotations` instance in the context and appends the
* specified annotation to the annotation map.
*
* @macro traced
*/
annotate<A>(key: TestAnnotation.TestAnnotation<A>, value: A): Effect.Effect<never, never, void>

/**
* Returns the set of all fibers in this test.
*
* @macro traced
*/
supervisedFibers(): Effect.Effect<never, never, SortedSet.SortedSet<Fiber.RuntimeFiber<unknown, unknown>>>
}
Expand Down Expand Up @@ -168,6 +146,19 @@ export declare const annotate: <A>(

Added in v1.0.0

## get

Accesses an `Annotations` instance in the environment and retrieves the
annotation of the specified type, or its default value if there is none.

**Signature**

```ts
export declare const get: <A>(key: TestAnnotation.TestAnnotation<A>) => Effect.Effect<Annotations, never, A>
```

Added in v1.0.0

## supervisedFibers

Returns the set of all fibers in this test.
Expand Down
75 changes: 62 additions & 13 deletions docs/modules/Live.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ Added in v1.0.0

<h2 class="text-delta">Table of contents</h2>

- [environment](#environment)
- [context](#context)
- [defaultLive](#defaultlive)
- [models](#models)
- [Live (interface)](#live-interface)
- [symbols](#symbols)
- [LiveTypeId](#livetypeid)
- [LiveTypeId (type alias)](#livetypeid-type-alias)
- [utils](#utils)
- [live](#live)
- [provideLive](#providelive)
- [withLive](#withlive)
- [withLiveScoped](#withlivescoped)

---

# environment
# context

## defaultLive

Expand All @@ -34,7 +39,7 @@ create your own environment type.
**Signature**

```ts
export declare const defaultLive: Layer.Layer<never, never, internal.Live>
export declare const defaultLive: Layer.Layer<never, never, Live>
```

Added in v1.0.0
Expand All @@ -52,27 +57,57 @@ these services.

```ts
export interface Live {
/**
* Provides the specified `effect` with the "live" default Effect services.
*
* @macro traced
*/
readonly [LiveTypeId]: LiveTypeId
provide<R, E, A>(effect: Effect.Effect<R, E, A>): Effect.Effect<R, E, A>
}
```

Added in v1.0.0

# symbols

## LiveTypeId

**Signature**

```ts
export declare const LiveTypeId: typeof LiveTypeId
```

Added in v1.0.0

## LiveTypeId (type alias)

**Signature**

```ts
export type LiveTypeId = typeof LiveTypeId
```
Added in v1.0.0
# utils
## live
Provides the specified `effect` with the "live" default Effect services.
Constructs a new `Live` service wrapped in a layer.
**Signature**
```ts
export declare const live: () => Layer.Layer<DefaultServices.DefaultServices, never, Live>
```

Added in v1.0.0

## provideLive

Provides a workflow with the "live" default Effect services.

**Signature**

```ts
export declare const live: <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<Live | R, E, A>
export declare const provideLive: <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<Live | R, E, A>
```

Added in v1.0.0
Expand All @@ -85,9 +120,23 @@ ensuring that the workflow itself is run with the test services.
**Signature**

```ts
export declare const withLive: <R, E, A, R2, E2, A2>(
f: (effect: Effect.Effect<R, E, A>) => Effect.Effect<R2, E2, A2>
) => (effect: Effect.Effect<R, E, A>) => Effect.Effect<Live | R | R2, E | E2, A2>
export declare const withLive: {
(live: Live): <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>
<R, E, A>(effect: Effect.Effect<R, E, A>, live: Live): Effect.Effect<R, E, A>
}
```

Added in v1.0.0

## withLiveScoped

Sets the implementation of the live service to the specified value and
restores it to its original value when the scope is closed.

**Signature**

```ts
export declare const withLiveScoped: (live: Live) => Effect.Effect<Scope.Scope, never, void>
```

Added in v1.0.0
60 changes: 30 additions & 30 deletions docs/modules/Runtime.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Added in v1.0.0
- [make](#make)
- [testRuntime](#testruntime)
- [execution](#execution)
- [unsafeFork](#unsafefork)
- [unsafeRun](#unsaferun)
- [unsafeRunPromise](#unsaferunpromise)
- [unsafeRunPromiseEither](#unsaferunpromiseeither)
- [unsafeRunPromiseExit](#unsaferunpromiseexit)
- [unsafeRunSync](#unsaferunsync)
- [unsafeRunSyncEither](#unsaferunsynceither)
- [unsafeRunSyncExit](#unsaferunsyncexit)
- [runCallback](#runcallback)
- [runFork](#runfork)
- [runPromise](#runpromise)
- [runPromiseEither](#runpromiseeither)
- [runPromiseExit](#runpromiseexit)
- [runSync](#runsync)
- [runSyncEither](#runsynceither)
- [runSyncExit](#runsyncexit)

---

Expand All @@ -38,7 +38,7 @@ export declare const make: <R>(
context: Context.Context<R>,
runtimeFlags: RuntimeFlags,
fiberRefs: FiberRefs.FiberRefs
) => Runtime.Runtime<R>
) => TestRuntime<R>
```

Added in v1.0.0
Expand All @@ -48,95 +48,95 @@ Added in v1.0.0
**Signature**

```ts
export declare const testRuntime: Runtime.Runtime<never>
export declare const testRuntime: TestRuntime<never>
```

Added in v1.0.0

# execution

## unsafeFork
## runCallback

**Signature**

```ts
export declare const unsafeFork: <E, A>(
export declare const runCallback: <E, A>(
effect: Effect.Effect<never, E, A>,
scheduler?: Scheduler | undefined
) => RuntimeFiber<E, A>
onExit?: ((exit: Exit<E, A>) => void) | undefined
) => Runtime.Cancel<E, A>
```

Added in v1.0.0

## unsafeRun
## runFork

**Signature**

```ts
export declare const unsafeRun: <E, A>(
export declare const runFork: <E, A>(
effect: Effect.Effect<never, E, A>,
onExit?: ((exit: Exit<E, A>) => void) | undefined
) => Runtime.Cancel<E, A>
scheduler?: Scheduler | undefined
) => RuntimeFiber<E, A>
```

Added in v1.0.0

## unsafeRunPromise
## runPromise

**Signature**

```ts
export declare const unsafeRunPromise: <E, A>(effect: Effect.Effect<never, E, A>) => Promise<A>
export declare const runPromise: <E, A>(effect: Effect.Effect<never, E, A>) => Promise<A>
```

Added in v1.0.0

## unsafeRunPromiseEither
## runPromiseEither

**Signature**

```ts
export declare const unsafeRunPromiseEither: <E, A>(effect: Effect.Effect<never, E, A>) => Promise<Either<E, A>>
export declare const runPromiseEither: <E, A>(effect: Effect.Effect<never, E, A>) => Promise<Either<E, A>>
```

Added in v1.0.0

## unsafeRunPromiseExit
## runPromiseExit

**Signature**

```ts
export declare const unsafeRunPromiseExit: <E, A>(effect: Effect.Effect<never, E, A>) => Promise<Exit<E, A>>
export declare const runPromiseExit: <E, A>(effect: Effect.Effect<never, E, A>) => Promise<Exit<E, A>>
```

Added in v1.0.0

## unsafeRunSync
## runSync

**Signature**

```ts
export declare const unsafeRunSync: <E, A>(effect: Effect.Effect<never, E, A>) => A
export declare const runSync: <E, A>(effect: Effect.Effect<never, E, A>) => A
```

Added in v1.0.0

## unsafeRunSyncEither
## runSyncEither

**Signature**

```ts
export declare const unsafeRunSyncEither: <E, A>(effect: Effect.Effect<never, E, A>) => Either<E, A>
export declare const runSyncEither: <E, A>(effect: Effect.Effect<never, E, A>) => Either<E, A>
```

Added in v1.0.0

## unsafeRunSyncExit
## runSyncExit

**Signature**

```ts
export declare const unsafeRunSyncExit: <E, A>(effect: Effect.Effect<never, E, A>) => Exit<E, A>
export declare const runSyncExit: <E, A>(effect: Effect.Effect<never, E, A>) => Exit<E, A>
```

Added in v1.0.0
Loading

0 comments on commit 6920e9a

Please sign in to comment.