From d96f5029f1233495be850d2615cbd1475641363d Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 29 Sep 2023 15:20:19 +1300 Subject: [PATCH] update to effect package (#184) --- .changeset/weak-boxes-fetch.md | 5 +++++ examples/bench.ts | 4 ++-- package.json | 4 ++-- pnpm-lock.yaml | 14 +++++++------- src/Types.ts | 4 ++-- src/index.ts | 10 +++++----- src/internal/matcher.ts | 12 ++++++------ test/index.test.ts | 8 ++++---- 8 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 .changeset/weak-boxes-fetch.md diff --git a/.changeset/weak-boxes-fetch.md b/.changeset/weak-boxes-fetch.md new file mode 100644 index 0000000..ccb1692 --- /dev/null +++ b/.changeset/weak-boxes-fetch.md @@ -0,0 +1,5 @@ +--- +"@effect/match": minor +--- + +update to effect package diff --git a/examples/bench.ts b/examples/bench.ts index cde41ab..7ed8605 100644 --- a/examples/bench.ts +++ b/examples/bench.ts @@ -1,7 +1,7 @@ -import * as Data from "@effect/data/Data" -import { pipe } from "@effect/data/Function" import * as Match from "@effect/match" import benny from "benny" +import * as Data from "effect/Data" +import { pipe } from "effect/Function" import { match } from "ts-pattern" type ABC = Data.TaggedEnum<{ diff --git a/package.json b/package.json index ee1860f..a8b89d8 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ } }, "peerDependencies": { - "@effect/data": "^0.18.3" + "effect": "2.0.0-next.37" }, "devDependencies": { "@babel/cli": "^7.22.10", @@ -65,7 +65,6 @@ "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.2", "@effect/build-utils": "^0.1.4", - "@effect/data": "^0.18.3", "@effect/docgen": "^0.1.4", "@effect/eslint-plugin": "^0.1.2", "@effect/language-service": "^0.0.21", @@ -77,6 +76,7 @@ "babel-plugin-annotate-pure-calls": "^0.4.0", "benny": "^3.7.1", "concurrently": "^8.2.1", + "effect": "2.0.0-next.37", "eslint": "^8.48.0", "eslint-import-resolver-typescript": "^3.6.0", "eslint-plugin-codegen": "0.17.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c15c514..ad8f7e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,9 +23,6 @@ devDependencies: '@effect/build-utils': specifier: ^0.1.4 version: 0.1.4 - '@effect/data': - specifier: ^0.18.3 - version: 0.18.3 '@effect/docgen': specifier: ^0.1.4 version: 0.1.4(@types/node@20.5.7)(typescript@5.2.2) @@ -59,6 +56,9 @@ devDependencies: concurrently: specifier: ^8.2.1 version: 8.2.1 + effect: + specifier: 2.0.0-next.37 + version: 2.0.0-next.37 eslint: specifier: ^8.48.0 version: 8.48.0 @@ -654,10 +654,6 @@ packages: hasBin: true dev: true - /@effect/data@0.18.3: - resolution: {integrity: sha512-xNG4CwxE758EK0v81EIPnKv9QeU/x9st1Doab/Fjf7sb9V3n55C85aBiKChpKgGD8pKCPHcjGydLsRHVUvzpwg==} - dev: true - /@effect/docgen@0.1.4(@types/node@20.5.7)(typescript@5.2.2): resolution: {integrity: sha512-weC9RKjucxi87ryxRmSzC+DIPa0tqsdwwwbOjFRoTgajzDPjywlHTSciaG+uzBnfTVPAY52gFZpDFCc1+VgAKw==} engines: {node: '>=16.17.1'} @@ -2388,6 +2384,10 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true + /effect@2.0.0-next.37: + resolution: {integrity: sha512-poONzql/x5pn9ZtsmabqiPPZPuiGJoMUoZccGMaCZWYY1DSD8klYNviQEker1BDU0szr+J7bmyFFjgdYT3BVfQ==} + dev: true + /electron-to-chromium@1.4.507: resolution: {integrity: sha512-brvPFnO1lu3UYBpBht2qWw9qqhdG4htTjT90/9oOJmxQ77VvTxL9+ghErFqQzgj7n8268ONAmlebqjBR/S+qgA==} dev: true diff --git a/src/Types.ts b/src/Types.ts index f8f6df4..a277cae 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -2,9 +2,9 @@ * @since 1.0.0 */ /* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */ -import type { Predicate, Refinement } from "@effect/data/Predicate" -import type { UnionToIntersection } from "@effect/data/Types" import type { SafeRefinement } from "@effect/match/SafeRefinement" +import type { Predicate, Refinement } from "effect/Predicate" +import type { UnionToIntersection } from "effect/Types" /** * @since 1.0.0 diff --git a/src/index.ts b/src/index.ts index 620fccf..cea3bcb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,14 @@ /** * @since 1.0.0 */ -import type * as E from "@effect/data/Either" -import type * as O from "@effect/data/Option" -import type { Pipeable } from "@effect/data/Pipeable" -import * as Predicate from "@effect/data/Predicate" -import type { Unify } from "@effect/data/Unify" import * as internal from "@effect/match/internal/matcher" import type { SafeRefinement } from "@effect/match/SafeRefinement" import type * as Types from "@effect/match/Types" +import type * as E from "effect/Either" +import type * as O from "effect/Option" +import type { Pipeable } from "effect/Pipeable" +import * as Predicate from "effect/Predicate" +import type { Unify } from "effect/Unify" /** * @category type ids diff --git a/src/internal/matcher.ts b/src/internal/matcher.ts index 8537e8a..d8c688d 100644 --- a/src/internal/matcher.ts +++ b/src/internal/matcher.ts @@ -1,12 +1,12 @@ -import * as Either from "@effect/data/Either" -import { identity } from "@effect/data/Function" -import * as Option from "@effect/data/Option" -import { pipeArguments } from "@effect/data/Pipeable" -import type * as Predicate from "@effect/data/Predicate" -import type { Unify } from "@effect/data/Unify" import type * as Match from "@effect/match" import type { SafeRefinement } from "@effect/match/SafeRefinement" import type * as Types from "@effect/match/Types" +import * as Either from "effect/Either" +import { identity } from "effect/Function" +import * as Option from "effect/Option" +import { pipeArguments } from "effect/Pipeable" +import type * as Predicate from "effect/Predicate" +import type { Unify } from "effect/Unify" /** @internal */ export const TypeId: Match.MatcherTypeId = Symbol.for( diff --git a/test/index.test.ts b/test/index.test.ts index a938907..8de2c2b 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,9 +1,9 @@ -import * as E from "@effect/data/Either" -import { pipe } from "@effect/data/Function" -import * as O from "@effect/data/Option" -import * as Predicate from "@effect/data/Predicate" import * as M from "@effect/match" import { typeEquals } from "@effect/match/test/utils/typeEquals" +import * as E from "effect/Either" +import { pipe } from "effect/Function" +import * as O from "effect/Option" +import * as Predicate from "effect/Predicate" describe("Matcher", () => { it("exhaustive", () => {