Skip to content

Commit 401ff6b

Browse files
committed
chore: update to latest
1 parent acb1bc8 commit 401ff6b

File tree

18 files changed

+13280
-9283
lines changed

18 files changed

+13280
-9283
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-undef */
22
module.exports = {
3-
ignorePatterns: ["dtslint/", "lib/", "es6/", "build/", "react/demo/"],
3+
ignorePatterns: ["dtslint/", "lib/", "es6/", "build/", "react/demo/", "dist/"],
44
parser: "@typescript-eslint/parser",
55
parserOptions: {
66
ecmaVersion: 2018,

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ jobs:
2222
yarn run ci
2323
env:
2424
CI: "true"
25-
26-
- uses: codecov/[email protected]
27-
with:
28-
token: ${{secrets.CODECOV_TOKEN}}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/.yarn/*
2+
!/.yarn/releases
3+
!/.yarn/plugins
4+
!/.yarn/sdks
5+
16
lib/
27
node_modules/
38
.idea/

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

Lines changed: 9 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.1.1.cjs

Lines changed: 768 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
5+
spec: "@yarnpkg/plugin-interactive-tools"
6+
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
7+
spec: "@yarnpkg/plugin-typescript"
8+
9+
yarnPath: .yarn/releases/yarn-3.1.1.cjs

codecov.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

jest.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module.exports = {
1616
verbose: true,
1717
globals: {
1818
"ts-jest": {
19-
tsconfig: "<rootDir>/tsconfig.jest.json",
20-
compiler: "ttypescript"
19+
tsconfig: "<rootDir>/tsconfig.jest.json"
2120
}
2221
}
2322
}

package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,22 @@
1515
"autofix": "ultra -r autofix",
1616
"lint": "ultra -r lint",
1717
"tc": "ultra -r tc",
18-
"postinstall": "husky install",
18+
"postinstall": "husky install && ts-patch install -s",
1919
"version:alpha": "lerna version prerelease --conventional-commits --preid=alpha",
2020
"version:preminor": "lerna version preminor --conventional-commits",
2121
"version:minor": "lerna version minor --conventional-commits",
2222
"version:prepatch": "lerna version prepatch --conventional-commits",
2323
"version:patch": "lerna version patch --conventional-commits",
2424
"version:graduate": "lerna version --conventional-commits --conventional-graduate",
2525
"commit": "cz",
26-
"update": "ncu -x chalk,typescript"
26+
"ets:rimraf": "cd $INIT_CWD && rimraf",
27+
"ets:tsc": "cd $INIT_CWD && tsc",
28+
"ets:eslint": "cd $INIT_CWD && eslint",
29+
"ets:prettier": "cd $INIT_CWD && prettier",
30+
"ets:concurrently": "cd $INIT_CWD && concurrently",
31+
"ets:build-utils": "cd $INIT_CWD && build-utils",
32+
"ets:madge": "cd $INIT_CWD && madge",
33+
"ets:ts-node": "cd $INIT_CWD && ts-node"
2734
},
2835
"config": {
2936
"commitizen": {
@@ -45,9 +52,9 @@
4552
"@typescript-eslint/parser": "^5.9.0",
4653
"babel-plugin-annotate-pure-calls": "^0.4.0",
4754
"chalk": "^4.1.2",
55+
"concurrently": "^7.0.0",
4856
"cpx": "^1.5.0",
4957
"cz-conventional-changelog": "^3.3.0",
50-
"dtslint": "github:gcanti/dtslint",
5158
"eslint": "^8.6.0",
5259
"eslint-config-prettier": "^8.3.0",
5360
"eslint-import-resolver-typescript": "^2.5.0",
@@ -57,8 +64,6 @@
5764
"eslint-plugin-prettier": "^4.0.0",
5865
"eslint-plugin-simple-import-sort": "^7.0.0",
5966
"eslint-plugin-sort-destructure-keys": "^1.4.0",
60-
"fast-check": "^2.20.0",
61-
"fast-equals": "^2.0.4",
6267
"fast-safe-stringify": "^2.1.1",
6368
"glob": "^7.2.0",
6469
"husky": "7.0.4",
@@ -69,10 +74,9 @@
6974
"reflect-metadata": "^0.1.13",
7075
"ts-jest": "^27.1.2",
7176
"ts-node": "^10.4.0",
72-
"ttypescript": "^1.5.13",
73-
"typescript": "4.4.3",
74-
"ultra-runner": "^3.10.5",
75-
"yarn-deduplicate": "^3.1.0"
77+
"ts-patch": "^2.0.1",
78+
"typescript": "4.5.4",
79+
"ultra-runner": "^3.10.5"
7680
},
77-
"dependencies": {}
78-
}
81+
"packageManager": "[email protected]"
82+
}

packages/monocle/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
dist/
23
scripts/merge.ts
34
scripts/genp.ts
45
bench/

packages/monocle/package.json

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,28 @@
44
"license": "MIT",
55
"repository": "https://github.com/Effect-TS/monocle.git",
66
"homepage": "https://www.matechs.com",
7-
"private": false,
87
"scripts": {
9-
"clean": "rimraf build tsbuildinfo",
10-
"build:lib": "ttsc --build tsconfig.build.json && build-utils package",
11-
"build:es6": "ttsc --build tsconfig.es6.json && babel build/esm/ -d build/esm/ -s --plugins annotate-pure-calls && build-utils package-esm",
12-
"build:post-process": "build-utils rewrite-source-maps && build-utils rewrite-locals && yarn prettier:lib",
13-
"build": "yarn run build:lib && yarn run build:es6 && yarn run build:post-process",
14-
"lint": "eslint . --ext .ts,.tsx",
8+
"clean": "yarn ets:rimraf build tsbuildinfo dist",
9+
"build-cjs": "yarn ets:tsc -p tsconfig.build.cjs.json",
10+
"build-esm": "yarn ets:tsc -p tsconfig.build.esm.json",
11+
"build-post": "yarn ets:build-utils pack",
12+
"build": "yarn ets:concurrently \"yarn build-cjs\" \"yarn build-esm\" && yarn build-post",
13+
"lint": "yarn ets:eslint . --ext .ts,.tsx",
1514
"autofix": "yarn prettier && yarn lint --fix && yarn prettier",
16-
"prettier": "prettier --write \"./{src,test,demo}/**/*.ts\"",
17-
"prettier:lib": "prettier --write \"./build/**/*.ts\"",
18-
"tc": "tsc --noEmit",
19-
"demo": "ts-node --compiler ttypescript --project tsconfig.build.json",
20-
"circular": "madge --circular --ts-config ./tsconfig.build.json --extensions ts ./src"
15+
"prettier": "yarn ets:prettier --write \"./{src,test,demo}/**/*.ts\"",
16+
"tc": "yarn ets:tsc --noEmit",
17+
"circular": "yarn ets:madge --circular --ts-config ./tsconfig.json --extensions ts ./src"
2118
},
2219
"publishConfig": {
2320
"access": "public",
24-
"directory": "build"
21+
"directory": "dist"
2522
},
2623
"sideEffects": false,
2724
"peerDependencies": {
28-
"@effect-ts/core": "^0.44.11"
25+
"@effect-ts/core": "^0.50.0"
2926
},
3027
"config": {
28+
"side": [],
3129
"modules": [
3230
"At",
3331
"Internal",
@@ -39,4 +37,4 @@
3937
"Traversal"
4038
]
4139
}
42-
}
40+
}

packages/monocle/src/Internal/index.ts

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,16 @@ export const isoAsPrism = <S, A>(sa: Iso<S, A>): Prism<S, A> =>
168168

169169
export const isoAsTraversal = <S, A>(sa: Iso<S, A>): Traversal<S, A> =>
170170
new Traversal({
171-
modifyF: (F) => (f) => (s) =>
172-
pipe(
173-
f(sa.get(s)),
174-
F.map((a) => sa.reverseGet(a))
175-
)
171+
modifyF:
172+
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
173+
<FK, FQ, FW, FX, FI, FS, FR, FE>(
174+
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
175+
) =>
176+
(s: S): P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S> =>
177+
pipe(
178+
f(sa.get(s)),
179+
F.map((a) => sa.reverseGet(a))
180+
)
176181
})
177182

178183
// -------------------------------------------------------------------------------------
@@ -187,11 +192,16 @@ export const lensAsOptional = <S, A>(sa: Lens<S, A>): Optional<S, A> =>
187192

188193
export const lensAsTraversal = <S, A>(sa: Lens<S, A>): Traversal<S, A> =>
189194
new Traversal({
190-
modifyF: (F) => (f) => (s) =>
191-
pipe(
192-
f(sa.get(s)),
193-
F.map((a) => sa.set(a)(s))
194-
)
195+
modifyF:
196+
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
197+
<FK, FQ, FW, FX, FI, FS, FR, FE>(
198+
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
199+
) =>
200+
(s: S): P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S> =>
201+
pipe(
202+
f(sa.get(s)),
203+
F.map((a) => sa.set(a)(s))
204+
)
195205
})
196206

197207
export const lensComposeLens =
@@ -280,7 +290,11 @@ export const prismAsOptional = <S, A>(sa: Prism<S, A>): Optional<S, A> =>
280290

281291
export const prismAsTraversal = <S, A>(sa: Prism<S, A>): Traversal<S, A> =>
282292
new Traversal({
283-
modifyF: (F) => {
293+
modifyF: <F extends P.URIS, C = P.Auto>(
294+
F: P.Applicative<F, C>
295+
): (<FK, FQ, FW, FX, FI, FS, FR, FE>(
296+
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
297+
) => (s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) => {
284298
const succeed = DSL.succeedF(F)
285299
return (f) => (s) =>
286300
O.fold_(
@@ -363,15 +377,19 @@ export const composePrism =
363377

364378
export const optionalAsTraversal = <S, A>(sa: Optional<S, A>): Traversal<S, A> =>
365379
new Traversal({
366-
modifyF: (F) => (f) => {
367-
const succeed = DSL.succeedF(F)
368-
return (s) =>
369-
O.fold_(
370-
sa.getOption(s),
371-
() => succeed(s),
372-
(a) => F.map<A, S>((a: A) => sa.set(a)(s))(f(a))
373-
)
374-
}
380+
modifyF:
381+
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
382+
<FK, FQ, FW, FX, FI, FS, FR, FE>(
383+
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
384+
): ((s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) => {
385+
const succeed = DSL.succeedF(F)
386+
return (s) =>
387+
O.fold_(
388+
sa.getOption(s),
389+
() => succeed(s),
390+
(a) => F.map<A, S>((a: A) => sa.set(a)(s))(f(a))
391+
)
392+
}
375393
})
376394

377395
export const optionalModifyOption =
@@ -419,9 +437,14 @@ export const find: <A>(predicate: Predicate<A>) => Optional<ReadonlyArray<A>, A>
419437
export function traversalComposeTraversal<A, B>(
420438
ab: Traversal<A, B>
421439
): <S>(sa: Traversal<S, A>) => Traversal<S, B> {
422-
return (sa) =>
440+
return <S>(sa: Traversal<S, A>) =>
423441
new Traversal({
424-
modifyF: (F) => (f) => sa.modifyF(F)(ab.modifyF(F)(f))
442+
modifyF:
443+
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
444+
<FK, FQ, FW, FX, FI, FS, FR, FE>(
445+
f: (a: B) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, B>
446+
): ((s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) =>
447+
sa.modifyF(F)(ab.modifyF(F)(f))
425448
})
426449
}
427450

packages/monocle/src/Traversal/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export { ModifyF, Traversal }
3333

3434
export const id = <S>(): Traversal<S, S> =>
3535
new Traversal({
36-
modifyF: (_) => (f) => f
36+
modifyF:
37+
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
38+
<FK, FQ, FW, FX, FI, FS, FR, FE>(
39+
f: (a: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>
40+
): ((s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) =>
41+
f
3742
})
3843

3944
/**

packages/monocle/tsconfig.build.json renamed to packages/monocle/tsconfig.build.cjs.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "build",
4+
"outDir": "build/cjs",
55
"target": "ES2018",
66
"module": "CommonJS",
77
"incremental": true,
@@ -16,6 +16,11 @@
1616
}
1717
]
1818
},
19-
"include": ["src/**/*"],
20-
"exclude": ["test", "node_modules"]
21-
}
19+
"include": [
20+
"src/**/*"
21+
],
22+
"exclude": [
23+
"test",
24+
"node_modules"
25+
]
26+
}

pre-commit.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
11
#!/bin/sh
2-
if yarn yarn-deduplicate -fl; then
3-
echo "No duplicates found. Pursuing..."
4-
else
5-
echo "ERROR: Lockfile contains duplicates!"
6-
echo "deduplicating..."
7-
yarn yarn-deduplicate
8-
yarn
9-
echo "deduplication finished"
10-
exit 1
11-
fi
2+
yarn dedupe -c

0 commit comments

Comments
 (0)