@effect-app/infra 4.0.0-beta.152 → 4.0.0-beta.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/arbs.d.ts +1 -1
- package/eslint.config.mjs +2 -2
- package/package.json +5 -5
- package/test/repository-ext.test.ts +41 -39
- package/tsconfig.examples.json +1 -1
- package/tsconfig.json.bak +2 -2
- package/tsconfig.src.json +35 -35
- package/tsconfig.test.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/arbs.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { type S } from "effect-app";
|
|
|
2
2
|
import * as FastCheck from "effect/testing/FastCheck";
|
|
3
3
|
export declare function generate<T>(arb: FastCheck.Arbitrary<T>): FastCheck.Value<T>;
|
|
4
4
|
export declare function generateFromArbitrary<T>(arb: S.LazyArbitrary<T>): FastCheck.Value<T>;
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJicy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FyYnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxFQUFFLEtBQUssQ0FBQyxFQUFFLE1BQU0sWUFBWSxDQUFBO0FBRW5DLE9BQU8sS0FBSyxTQUFTLE1BQU0sMEJBQTBCLENBQUE7QUFVckQsd0JBQWdCLFFBQVEsQ0FBQyxDQUFDLEVBQUUsR0FBRyxFQUFFLFNBQVMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLHNCQUV0RDtBQUVELHdCQUFnQixxQkFBcUIsQ0FBQyxDQUFDLEVBQUUsR0FBRyxFQUFFLENBQUMsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDLHNCQUUvRCJ9
|
package/eslint.config.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { augmentedConfig } from "@effect-app/eslint-shared-config/eslint.base.config"
|
|
1
2
|
import path from "node:path"
|
|
2
3
|
import { fileURLToPath } from "node:url"
|
|
3
|
-
import { augmentedConfig } from "@effect-app/eslint-shared-config/eslint.base.config"
|
|
4
4
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url)
|
|
6
6
|
const __dirname = path.dirname(__filename)
|
|
@@ -18,7 +18,7 @@ export default [
|
|
|
18
18
|
{
|
|
19
19
|
rules: {
|
|
20
20
|
"@typescript-eslint/no-empty-interface": "off",
|
|
21
|
-
"@typescript-eslint/no-explicit-any": "warn"
|
|
21
|
+
"@typescript-eslint/no-explicit-any": "warn"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/infra",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.154",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"proper-lockfile": "^4.1.2",
|
|
14
14
|
"pure-rand": "8.4.0",
|
|
15
15
|
"query-string": "^9.3.1",
|
|
16
|
-
"effect-app": "4.0.0-beta.
|
|
16
|
+
"effect-app": "4.0.0-beta.154"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@azure/cosmos": "^4.9.3",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"strip-ansi": "^7.2.0",
|
|
34
34
|
"typescript": "npm:@typescript/native-preview@beta",
|
|
35
35
|
"vitest": "^4.1.5",
|
|
36
|
-
"@effect-app/eslint-shared-config": "0.6.0-beta.
|
|
36
|
+
"@effect-app/eslint-shared-config": "0.6.0-beta.15"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@azure/cosmos": "^4.9.3",
|
|
@@ -407,9 +407,9 @@
|
|
|
407
407
|
"circular:src": "madge --circular --ts-config ./tsconfig.json --extensions ts ./src",
|
|
408
408
|
"circular:dist": "madge --circular --extensions js ./dist",
|
|
409
409
|
"compile": "NODE_OPTIONS=--max-old-space-size=6144 tsgo --noEmit",
|
|
410
|
-
"lint": "oxlint ./src && NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint ./src",
|
|
410
|
+
"lint": "oxlint ./src && NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint ./src && pnpm exec dprint check --config ../../dprint.jsonc .",
|
|
411
411
|
"lint:watch": "ESLINT_TS=1 esw -w --changed --clear --ext ts,tsx .",
|
|
412
|
-
"lint-fix": "oxlint --fix ./src && NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint --fix ./src",
|
|
412
|
+
"lint-fix": "oxlint --fix ./src && NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint --fix ./src && pnpm exec dprint fmt --config ../../dprint.jsonc .",
|
|
413
413
|
"test": "vitest",
|
|
414
414
|
"test:run": "pnpm run test run --passWithNoTests",
|
|
415
415
|
"testsuite": "pnpm lint && pnpm circular && pnpm run test:run",
|
|
@@ -14,45 +14,47 @@ const TestStoreLive = Layer.merge(MemoryStoreLive, RepositoryRegistryLive)
|
|
|
14
14
|
|
|
15
15
|
describe("repository ext save/remove batching", () => {
|
|
16
16
|
it.effect("supports save batching overload", () =>
|
|
17
|
-
Effect
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
Effect
|
|
18
|
+
.gen(function*() {
|
|
19
|
+
const repo = yield* makeRepo("BatchItem", BatchItem, {})
|
|
20
|
+
const items = [
|
|
21
|
+
new BatchItem({ id: "1", label: "one" }),
|
|
22
|
+
new BatchItem({ id: "2", label: "two" }),
|
|
23
|
+
new BatchItem({ id: "3", label: "three" }),
|
|
24
|
+
new BatchItem({ id: "4", label: "four" })
|
|
25
|
+
] as const
|
|
26
|
+
|
|
27
|
+
yield* repo.save(items, { batch: 2 })
|
|
28
|
+
|
|
29
|
+
const all = yield* repo.all
|
|
30
|
+
expect(all).toHaveLength(4)
|
|
31
|
+
expect(all.map((_) => _.id).toSorted()).toEqual(["1", "2", "3", "4"])
|
|
32
|
+
})
|
|
33
|
+
.pipe(
|
|
34
|
+
setupRequestContextFromCurrent(),
|
|
35
|
+
Effect.provide(TestStoreLive)
|
|
36
|
+
))
|
|
36
37
|
|
|
37
38
|
it.effect("supports remove batching overload", () =>
|
|
38
|
-
Effect
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
Effect
|
|
40
|
+
.gen(function*() {
|
|
41
|
+
const repo = yield* makeRepo("BatchItem", BatchItem, {})
|
|
42
|
+
const items = [
|
|
43
|
+
new BatchItem({ id: "1", label: "one" }),
|
|
44
|
+
new BatchItem({ id: "2", label: "two" }),
|
|
45
|
+
new BatchItem({ id: "3", label: "three" }),
|
|
46
|
+
new BatchItem({ id: "4", label: "four" })
|
|
47
|
+
] as const
|
|
48
|
+
|
|
49
|
+
yield* repo.save(items)
|
|
50
|
+
yield* repo.remove([items[0], items[1], items[2]], { batch: true })
|
|
51
|
+
|
|
52
|
+
const all = yield* repo.all
|
|
53
|
+
expect(all).toHaveLength(1)
|
|
54
|
+
expect(all[0]?.id).toBe("4")
|
|
55
|
+
})
|
|
56
|
+
.pipe(
|
|
57
|
+
setupRequestContextFromCurrent(),
|
|
58
|
+
Effect.provide(TestStoreLive)
|
|
59
|
+
))
|
|
58
60
|
})
|
package/tsconfig.examples.json
CHANGED
package/tsconfig.json.bak
CHANGED
package/tsconfig.src.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
],
|
|
7
|
-
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"rootDir": "./src",
|
|
10
|
-
// keep in here, cause madge can't detect it from extended tsconfig
|
|
11
|
-
"moduleResolution": "Node16",
|
|
12
|
-
"types": [
|
|
13
|
-
"./types/modules"
|
|
14
|
-
],
|
|
15
|
-
"outDir": "./dist"
|
|
16
|
-
},
|
|
17
|
-
"include": [
|
|
18
|
-
"./src/**/*.ts"
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
"esnext"
|
|
19
6
|
],
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"**/*.d.ts.map",
|
|
28
|
-
".git",
|
|
29
|
-
".data",
|
|
30
|
-
"**/.*",
|
|
31
|
-
"**/*.tmp"
|
|
7
|
+
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"rootDir": "./src",
|
|
10
|
+
// keep in here, cause madge can't detect it from extended tsconfig
|
|
11
|
+
"moduleResolution": "Node16",
|
|
12
|
+
"types": [
|
|
13
|
+
"./types/modules"
|
|
32
14
|
],
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
15
|
+
"outDir": "./dist"
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"./src/**/*.ts"
|
|
19
|
+
],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"./dist",
|
|
22
|
+
"*.test.ts",
|
|
23
|
+
"node_modules",
|
|
24
|
+
"build",
|
|
25
|
+
"lib",
|
|
26
|
+
"dist",
|
|
27
|
+
"**/*.d.ts.map",
|
|
28
|
+
".git",
|
|
29
|
+
".data",
|
|
30
|
+
"**/.*",
|
|
31
|
+
"**/*.tmp"
|
|
32
|
+
],
|
|
33
|
+
"references": [
|
|
34
|
+
{
|
|
35
|
+
"path": "../effect-app"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
package/tsconfig.test.json
CHANGED