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

update effect and typeclass deps #57

Merged
merged 3 commits into from
Oct 26, 2023
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/twelve-pumpkins-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fp-ts/optic": minor
---

update effect and typeclass deps
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [16.17.1]
node-version: [18.16.0]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -44,6 +44,7 @@ jobs:
- run: pnpm build
- run: pnpm test
- run: pnpm lint
- run: pnpm dtslint
- run: pnpm docgen
- name: Create Release Pull Request or Publish
id: changesets
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [16.17.1]
node-version: [18.16.0]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -46,4 +46,5 @@ jobs:
- run: pnpm build
- run: pnpm test
- run: pnpm lint
- run: pnpm dtslint
- run: pnpm docgen
2 changes: 1 addition & 1 deletion dtslint/pipeable-compose.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pipe } from "@effect/data/Function"
import { pipe } from "effect/Function"
import type { Iso, Lens, Optional, PolyIso, PolyLens, PolyOptional, PolyPrism, Prism } from "@fp-ts/optic"

interface S { s: string }
Expand Down
1 change: 1 addition & 0 deletions dtslint/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"skipLibCheck": true,
"noEmit": true,
"strict": true,
"noImplicitReturns": false,
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"build-all": "tsc -b tsconfig.json",
"build-watch": "tsc -b tsconfig.json --watch",
"dtslint": "dtslint --expectOnly dtslint",
"dtslint-clean": "dtslint --installAll",
"lint": "eslint . --ext .ts,.tsx",
"autofix": "pnpm lint --fix",
"tc": "tsc --noEmit",
Expand Down Expand Up @@ -67,14 +68,13 @@
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@definitelytyped/dtslint": "^0.0.163",
"@definitelytyped/dtslint": "0.0.178",
"@effect-ts/build-utils": "0.40.7",
"@effect-ts/core": "^0.60.5",
"@effect/docgen": "^0.2.0",
"@effect/typeclass": "^0.12.0",
"@effect/typeclass": "^0.13.1",
"@repo-tooling/eslint-plugin-dprint": "^0.0.4",
"@types/benchmark": "^2.1.2",
"@types/chai": "^4.3.4",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
Expand All @@ -86,7 +86,7 @@
"babel-plugin-annotate-pure-calls": "^0.4.0",
"concurrently": "^8.0.1",
"cpx": "^1.5.0",
"effect": "2.0.0-next.50",
"effect": "2.0.0-next.52",
"eslint": "^8.37.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-codegen": "0.17.0",
Expand All @@ -101,14 +101,13 @@
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"ts-node": "^10.9.1",
"tslint": "^6.1.3",
"typescript": "^5.1.6",
"ultra-runner": "^3.10.5",
"vite": "^4.3.1",
"vitest": "0.30.1"
},
"peerDependencies": {
"@effect/typeclass": "^0.12.0",
"effect": "2.0.0-next.50"
"@effect/typeclass": "^0.13.1",
"effect": "2.0.0-next.52"
}
}
108 changes: 43 additions & 65 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { Predicate, Refinement } from "effect/Predicate"
import * as ReadonlyArray from "effect/ReadonlyArray"
import * as ReadonlyRecord from "effect/ReadonlyRecord"
import * as S from "effect/Struct"
import type { Simplify } from "effect/Types"

const orElse: {
<E1, E2, B>(
Expand Down Expand Up @@ -318,13 +319,13 @@ const at = <S, Key extends keyof S & (string | symbol)>(key: Key): Lens<S, S[Key

const pick = <S, Keys extends readonly [keyof S, ...Array<keyof S>]>(
...keys: Keys
): Lens<S, { readonly [K in Keys[number]]: S[K] }> =>
lens(S.pick(...keys), (a) => (s) => ({ ...s, ...a }))
): Lens<S, Simplify<Pick<S, Keys[number]>>> =>
lens(S.pick(...keys), (a) => (s) => ({ ...s, ...a as any }))

const omit = <S, Keys extends readonly [keyof S, ...Array<keyof S>]>(
...keys: Keys
): Lens<S, { readonly [K in Exclude<keyof S, Keys[number]>]: S[K] }> =>
lens(S.omit(...keys), (a) => (s) => ({ ...s, ...a }))
): Lens<S, Simplify<Omit<S, Keys[number]>>> =>
lens(S.omit(...keys), (a) => (s) => ({ ...s, ...a as any }))

const filter: {
<S extends A, B extends A, A = S>(
Expand Down
1 change: 1 addition & 0 deletions test/data/Boolean.ts → test/data/Boolean.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as Optic from "@fp-ts/optic"
import * as BooleanOptic from "@fp-ts/optic/data/Boolean"
import { describe, expect, it } from "vitest"

describe("Boolean", () => {
it("toggle", () => {
Expand Down
Loading
Loading