Skip to content

Commit

Permalink
chore: update to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mikearnaldi committed Jan 7, 2022
1 parent acb1bc8 commit 401ff6b
Show file tree
Hide file tree
Showing 18 changed files with 13,280 additions and 9,283 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef */
module.exports = {
ignorePatterns: ["dtslint/", "lib/", "es6/", "build/", "react/demo/"],
ignorePatterns: ["dtslint/", "lib/", "es6/", "build/", "react/demo/", "dist/"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ jobs:
yarn run ci
env:
CI: "true"

- uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/.yarn/*
!/.yarn/releases
!/.yarn/plugins
!/.yarn/sdks

lib/
node_modules/
.idea/
Expand Down
363 changes: 363 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.1.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.1.1.cjs
5 changes: 0 additions & 5 deletions codecov.yml

This file was deleted.

3 changes: 1 addition & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ module.exports = {
verbose: true,
globals: {
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.jest.json",
compiler: "ttypescript"
tsconfig: "<rootDir>/tsconfig.jest.json"
}
}
}
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@
"autofix": "ultra -r autofix",
"lint": "ultra -r lint",
"tc": "ultra -r tc",
"postinstall": "husky install",
"postinstall": "husky install && ts-patch install -s",
"version:alpha": "lerna version prerelease --conventional-commits --preid=alpha",
"version:preminor": "lerna version preminor --conventional-commits",
"version:minor": "lerna version minor --conventional-commits",
"version:prepatch": "lerna version prepatch --conventional-commits",
"version:patch": "lerna version patch --conventional-commits",
"version:graduate": "lerna version --conventional-commits --conventional-graduate",
"commit": "cz",
"update": "ncu -x chalk,typescript"
"ets:rimraf": "cd $INIT_CWD && rimraf",
"ets:tsc": "cd $INIT_CWD && tsc",
"ets:eslint": "cd $INIT_CWD && eslint",
"ets:prettier": "cd $INIT_CWD && prettier",
"ets:concurrently": "cd $INIT_CWD && concurrently",
"ets:build-utils": "cd $INIT_CWD && build-utils",
"ets:madge": "cd $INIT_CWD && madge",
"ets:ts-node": "cd $INIT_CWD && ts-node"
},
"config": {
"commitizen": {
Expand All @@ -45,9 +52,9 @@
"@typescript-eslint/parser": "^5.9.0",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"chalk": "^4.1.2",
"concurrently": "^7.0.0",
"cpx": "^1.5.0",
"cz-conventional-changelog": "^3.3.0",
"dtslint": "github:gcanti/dtslint",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.5.0",
Expand All @@ -57,8 +64,6 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"fast-check": "^2.20.0",
"fast-equals": "^2.0.4",
"fast-safe-stringify": "^2.1.1",
"glob": "^7.2.0",
"husky": "7.0.4",
Expand All @@ -69,10 +74,9 @@
"reflect-metadata": "^0.1.13",
"ts-jest": "^27.1.2",
"ts-node": "^10.4.0",
"ttypescript": "^1.5.13",
"typescript": "4.4.3",
"ultra-runner": "^3.10.5",
"yarn-deduplicate": "^3.1.0"
"ts-patch": "^2.0.1",
"typescript": "4.5.4",
"ultra-runner": "^3.10.5"
},
"dependencies": {}
}
"packageManager": "yarn@3.1.1"
}
1 change: 1 addition & 0 deletions packages/monocle/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
dist/
scripts/merge.ts
scripts/genp.ts
bench/
28 changes: 13 additions & 15 deletions packages/monocle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@
"license": "MIT",
"repository": "https://github.com/Effect-TS/monocle.git",
"homepage": "https://www.matechs.com",
"private": false,
"scripts": {
"clean": "rimraf build tsbuildinfo",
"build:lib": "ttsc --build tsconfig.build.json && build-utils package",
"build:es6": "ttsc --build tsconfig.es6.json && babel build/esm/ -d build/esm/ -s --plugins annotate-pure-calls && build-utils package-esm",
"build:post-process": "build-utils rewrite-source-maps && build-utils rewrite-locals && yarn prettier:lib",
"build": "yarn run build:lib && yarn run build:es6 && yarn run build:post-process",
"lint": "eslint . --ext .ts,.tsx",
"clean": "yarn ets:rimraf build tsbuildinfo dist",
"build-cjs": "yarn ets:tsc -p tsconfig.build.cjs.json",
"build-esm": "yarn ets:tsc -p tsconfig.build.esm.json",
"build-post": "yarn ets:build-utils pack",
"build": "yarn ets:concurrently \"yarn build-cjs\" \"yarn build-esm\" && yarn build-post",
"lint": "yarn ets:eslint . --ext .ts,.tsx",
"autofix": "yarn prettier && yarn lint --fix && yarn prettier",
"prettier": "prettier --write \"./{src,test,demo}/**/*.ts\"",
"prettier:lib": "prettier --write \"./build/**/*.ts\"",
"tc": "tsc --noEmit",
"demo": "ts-node --compiler ttypescript --project tsconfig.build.json",
"circular": "madge --circular --ts-config ./tsconfig.build.json --extensions ts ./src"
"prettier": "yarn ets:prettier --write \"./{src,test,demo}/**/*.ts\"",
"tc": "yarn ets:tsc --noEmit",
"circular": "yarn ets:madge --circular --ts-config ./tsconfig.json --extensions ts ./src"
},
"publishConfig": {
"access": "public",
"directory": "build"
"directory": "dist"
},
"sideEffects": false,
"peerDependencies": {
"@effect-ts/core": "^0.44.11"
"@effect-ts/core": "^0.50.0"
},
"config": {
"side": [],
"modules": [
"At",
"Internal",
Expand All @@ -39,4 +37,4 @@
"Traversal"
]
}
}
}
67 changes: 45 additions & 22 deletions packages/monocle/src/Internal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,16 @@ export const isoAsPrism = <S, A>(sa: Iso<S, A>): Prism<S, A> =>

export const isoAsTraversal = <S, A>(sa: Iso<S, A>): Traversal<S, A> =>
new Traversal({
modifyF: (F) => (f) => (s) =>
pipe(
f(sa.get(s)),
F.map((a) => sa.reverseGet(a))
)
modifyF:
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
<FK, FQ, FW, FX, FI, FS, FR, FE>(
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
) =>
(s: S): P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S> =>
pipe(
f(sa.get(s)),
F.map((a) => sa.reverseGet(a))
)
})

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

export const lensAsTraversal = <S, A>(sa: Lens<S, A>): Traversal<S, A> =>
new Traversal({
modifyF: (F) => (f) => (s) =>
pipe(
f(sa.get(s)),
F.map((a) => sa.set(a)(s))
)
modifyF:
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
<FK, FQ, FW, FX, FI, FS, FR, FE>(
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
) =>
(s: S): P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S> =>
pipe(
f(sa.get(s)),
F.map((a) => sa.set(a)(s))
)
})

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

export const prismAsTraversal = <S, A>(sa: Prism<S, A>): Traversal<S, A> =>
new Traversal({
modifyF: (F) => {
modifyF: <F extends P.URIS, C = P.Auto>(
F: P.Applicative<F, C>
): (<FK, FQ, FW, FX, FI, FS, FR, FE>(
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
) => (s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) => {
const succeed = DSL.succeedF(F)
return (f) => (s) =>
O.fold_(
Expand Down Expand Up @@ -363,15 +377,19 @@ export const composePrism =

export const optionalAsTraversal = <S, A>(sa: Optional<S, A>): Traversal<S, A> =>
new Traversal({
modifyF: (F) => (f) => {
const succeed = DSL.succeedF(F)
return (s) =>
O.fold_(
sa.getOption(s),
() => succeed(s),
(a) => F.map<A, S>((a: A) => sa.set(a)(s))(f(a))
)
}
modifyF:
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
<FK, FQ, FW, FX, FI, FS, FR, FE>(
f: (a: A) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, A>
): ((s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) => {
const succeed = DSL.succeedF(F)
return (s) =>
O.fold_(
sa.getOption(s),
() => succeed(s),
(a) => F.map<A, S>((a: A) => sa.set(a)(s))(f(a))
)
}
})

export const optionalModifyOption =
Expand Down Expand Up @@ -419,9 +437,14 @@ export const find: <A>(predicate: Predicate<A>) => Optional<ReadonlyArray<A>, A>
export function traversalComposeTraversal<A, B>(
ab: Traversal<A, B>
): <S>(sa: Traversal<S, A>) => Traversal<S, B> {
return (sa) =>
return <S>(sa: Traversal<S, A>) =>
new Traversal({
modifyF: (F) => (f) => sa.modifyF(F)(ab.modifyF(F)(f))
modifyF:
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
<FK, FQ, FW, FX, FI, FS, FR, FE>(
f: (a: B) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, B>
): ((s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) =>
sa.modifyF(F)(ab.modifyF(F)(f))
})
}

Expand Down
7 changes: 6 additions & 1 deletion packages/monocle/src/Traversal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export { ModifyF, Traversal }

export const id = <S>(): Traversal<S, S> =>
new Traversal({
modifyF: (_) => (f) => f
modifyF:
<F extends P.URIS, C = P.Auto>(F: P.Applicative<F, C>) =>
<FK, FQ, FW, FX, FI, FS, FR, FE>(
f: (a: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>
): ((s: S) => P.Kind<F, C, FK, FQ, FW, FX, FI, FS, FR, FE, S>) =>
f
})

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "build",
"outDir": "build/cjs",
"target": "ES2018",
"module": "CommonJS",
"incremental": true,
Expand All @@ -16,6 +16,11 @@
}
]
},
"include": ["src/**/*"],
"exclude": ["test", "node_modules"]
}
"include": [
"src/**/*"
],
"exclude": [
"test",
"node_modules"
]
}
File renamed without changes.
11 changes: 1 addition & 10 deletions pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
#!/bin/sh
if yarn yarn-deduplicate -fl; then
echo "No duplicates found. Pursuing..."
else
echo "ERROR: Lockfile contains duplicates!"
echo "deduplicating..."
yarn yarn-deduplicate
yarn
echo "deduplication finished"
exit 1
fi
yarn dedupe -c
Loading

0 comments on commit 401ff6b

Please sign in to comment.