diff --git a/.changeset/lazy-lizards-collect.md b/.changeset/lazy-lizards-collect.md new file mode 100644 index 0000000..d692e71 --- /dev/null +++ b/.changeset/lazy-lizards-collect.md @@ -0,0 +1,5 @@ +--- +"@effect/cli": minor +--- + +update effect diff --git a/examples/minigit.ts b/examples/minigit.ts index 3579a7a..d32a263 100644 --- a/examples/minigit.ts +++ b/examples/minigit.ts @@ -55,7 +55,7 @@ const minigitClone = Command.make("clone", { depth: Options.integer("depth").pipe(Options.optional) }, ({ depth, directory, repository }) => { const optionsAndArgs = pipe( - ReadonlyArray.compact([ + ReadonlyArray.getSomes([ Option.map(depth, (depth) => `--depth ${depth}`), Option.some(repository), directory diff --git a/examples/naval-fate.ts b/examples/naval-fate.ts index c387647..cb985c8 100644 --- a/examples/naval-fate.ts +++ b/examples/naval-fate.ts @@ -112,7 +112,7 @@ const run = Command.make("naval_fate").pipe( const main = Effect.suspend(() => run(globalThis.process.argv.slice(2))) const MainLayer = NavalFateStore.layer.pipe( - Layer.use(KeyValueStore.layerFileSystem("naval-fate-store")), + Layer.provide(KeyValueStore.layerFileSystem("naval-fate-store")), Layer.merge(NodeContext.layer) ) diff --git a/package.json b/package.json index 9dfaade..ea8136d 100644 --- a/package.json +++ b/package.json @@ -57,11 +57,11 @@ "coverage": "vitest run --coverage" }, "peerDependencies": { - "@effect/platform": "^0.31.2", - "@effect/printer": "^0.24.0", - "@effect/printer-ansi": "^0.25.0", - "@effect/schema": "^0.50.0", - "effect": "2.0.0-next.56" + "@effect/platform": "^0.32.0", + "@effect/printer": "^0.25.0", + "@effect/printer-ansi": "^0.26.0", + "@effect/schema": "^0.51.0", + "effect": "2.0.0-next.57" }, "devDependencies": { "@babel/cli": "^7.23.4", @@ -74,17 +74,17 @@ "@effect/docgen": "^0.3.6", "@effect/eslint-plugin": "^0.1.2", "@effect/language-service": "^0.0.21", - "@effect/platform": "^0.31.2", - "@effect/platform-node": "^0.32.3", - "@effect/printer": "^0.24.0", - "@effect/printer-ansi": "^0.25.0", - "@effect/schema": "^0.50.0", + "@effect/platform": "^0.32.0", + "@effect/platform-node": "^0.33.0", + "@effect/printer": "^0.25.0", + "@effect/printer-ansi": "^0.26.0", + "@effect/schema": "^0.51.0", "@types/node": "^20.10.1", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", "@vitest/coverage-v8": "^0.34.6", "babel-plugin-annotate-pure-calls": "^0.4.0", - "effect": "2.0.0-next.56", + "effect": "2.0.0-next.57", "error-stack-parser": "^2.1.4", "eslint": "^8.54.0", "eslint-import-resolver-typescript": "^3.6.1", @@ -97,7 +97,7 @@ "madge": "^6.1.0", "rimraf": "^5.0.5", "stackframe": "^1.3.4", - "tsx": "^4.6.0", + "tsx": "^4.6.1", "typescript": "^5.3.2", "vite": "^5.0.4", "vitest": "^0.34.6" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 25f62e1..8eabe8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,7 @@ devDependencies: version: 0.5.0 '@effect/docgen': specifier: ^0.3.6 - version: 0.3.6(tsx@4.6.0)(typescript@5.3.2) + version: 0.3.6(tsx@4.6.1)(typescript@5.3.2) '@effect/eslint-plugin': specifier: ^0.1.2 version: 0.1.2 @@ -36,20 +36,20 @@ devDependencies: specifier: ^0.0.21 version: 0.0.21 '@effect/platform': - specifier: ^0.31.2 - version: 0.31.2(@effect/schema@0.50.0)(effect@2.0.0-next.56) + specifier: ^0.32.0 + version: 0.32.0(@effect/schema@0.51.0)(effect@2.0.0-next.57) '@effect/platform-node': - specifier: ^0.32.3 - version: 0.32.3(@effect/schema@0.50.0)(effect@2.0.0-next.56) + specifier: ^0.33.0 + version: 0.33.0(@effect/schema@0.51.0)(effect@2.0.0-next.57) '@effect/printer': - specifier: ^0.24.0 - version: 0.24.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56) - '@effect/printer-ansi': specifier: ^0.25.0 - version: 0.25.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56) + version: 0.25.0(@effect/typeclass@0.17.0)(effect@2.0.0-next.57) + '@effect/printer-ansi': + specifier: ^0.26.0 + version: 0.26.0(@effect/typeclass@0.17.0)(effect@2.0.0-next.57) '@effect/schema': - specifier: ^0.50.0 - version: 0.50.0(effect@2.0.0-next.56)(fast-check@3.14.0) + specifier: ^0.51.0 + version: 0.51.0(effect@2.0.0-next.57)(fast-check@3.14.0) '@types/node': specifier: ^20.10.1 version: 20.10.1 @@ -66,8 +66,8 @@ devDependencies: specifier: ^0.4.0 version: 0.4.0(@babel/core@7.23.5) effect: - specifier: 2.0.0-next.56 - version: 2.0.0-next.56 + specifier: 2.0.0-next.57 + version: 2.0.0-next.57 error-stack-parser: specifier: ^2.1.4 version: 2.1.4 @@ -105,8 +105,8 @@ devDependencies: specifier: ^1.3.4 version: 1.3.4 tsx: - specifier: ^4.6.0 - version: 4.6.0 + specifier: ^4.6.1 + version: 4.6.1 typescript: specifier: ^5.3.2 version: 5.3.2 @@ -654,7 +654,7 @@ packages: hasBin: true dev: true - /@effect/docgen@0.3.6(tsx@4.6.0)(typescript@5.3.2): + /@effect/docgen@0.3.6(tsx@4.6.1)(typescript@5.3.2): resolution: {integrity: sha512-GjEL+DWb/ttzPNvJ1GplOh5hCVVukqpTuZVVImaWkWMcYEphMKyPgw3HcXcEv7Jl/lLWzrjfuz9ClXN2+Zgxiw==} engines: {node: '>=16.17.1'} hasBin: true @@ -666,7 +666,7 @@ packages: glob: 10.3.10 markdown-toc: github.com/effect-ts/markdown-toc/4bfeb0f140105440ea0d12df2fa23199cc3ec1d5 prettier: 3.1.0 - tsx: 4.6.0 + tsx: 4.6.1 typescript: 5.3.2 dev: true @@ -682,69 +682,69 @@ packages: resolution: {integrity: sha512-e8vfKbjnbYiyneBincEFS0tzXluopGK77OkVFbPRtUbNDS5tJfb+jiwOQEiqASDsadcZmd+9J9+Q6v/z7GuN2g==} dev: true - /@effect/platform-node@0.32.3(@effect/schema@0.50.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-/ybYoQiFTsTGfE5ghg8CGYbb0Y8+3Eyu4L7/X5N78fSQPF3ftJxUoRQg/72SMc+BwlQoknHqZtBnnXde641thA==} + /@effect/platform-node@0.33.0(@effect/schema@0.51.0)(effect@2.0.0-next.57): + resolution: {integrity: sha512-6+ESstZro8Ljsww6aj0VUyo8Bf5mVg+S6SRnzFyPONP3r0H2nzMhAIEFby1mHPaoIKoB3LaAkg2aY5G3M1XGCQ==} peerDependencies: - effect: 2.0.0-next.56 + effect: 2.0.0-next.57 dependencies: - '@effect/platform': 0.31.2(@effect/schema@0.50.0)(effect@2.0.0-next.56) - effect: 2.0.0-next.56 - mime: 3.0.0 + '@effect/platform': 0.32.0(@effect/schema@0.51.0)(effect@2.0.0-next.57) + effect: 2.0.0-next.57 + mime: 4.0.0 multipasta: 0.1.19 transitivePeerDependencies: - '@effect/schema' dev: true - /@effect/platform@0.31.2(@effect/schema@0.50.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-XpuaXxuXlGz21dRczZI+v1NhhEl/rTbSWGq08abqXuZlwB1u2J/aGhL4p+KaNAqrDqWVot+OWGee4xMMXRD4ng==} + /@effect/platform@0.32.0(@effect/schema@0.51.0)(effect@2.0.0-next.57): + resolution: {integrity: sha512-Cdg7Z7jR0h+BAPLts+pE9JF9KGo5fMdrQb/fmK0SXjYzZJ+ll3wAIIaDdxVbCSW9jMqIRB3wjoffM9ZTAlxSbA==} peerDependencies: - '@effect/schema': ^0.49.0 - effect: 2.0.0-next.56 + '@effect/schema': ^0.51.0 + effect: 2.0.0-next.57 dependencies: - '@effect/schema': 0.50.0(effect@2.0.0-next.56)(fast-check@3.14.0) - effect: 2.0.0-next.56 + '@effect/schema': 0.51.0(effect@2.0.0-next.57)(fast-check@3.14.0) + effect: 2.0.0-next.57 find-my-way: 7.7.0 multipasta: 0.1.19 path-browserify: 1.0.1 dev: true - /@effect/printer-ansi@0.25.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-aa1g07Roe345koQVJ/7Iok9VGW2a2Afeut+B4NGwQ5AiPVfAZJaSOMxzXrzBM+IKsSePz5O6Rmv30qfUJGaP3w==} + /@effect/printer-ansi@0.26.0(@effect/typeclass@0.17.0)(effect@2.0.0-next.57): + resolution: {integrity: sha512-fxru809tPG6HezhqvleVuDsPU1H/3ummXCk6XCJNhfCi9ONZDEEYfV7u8uekPbC5a76FC758882W8MAt0eM0hg==} peerDependencies: - '@effect/typeclass': ^0.16.0 - effect: 2.0.0-next.56 + '@effect/typeclass': ^0.17.0 + effect: 2.0.0-next.57 dependencies: - '@effect/printer': 0.24.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56) - '@effect/typeclass': 0.16.0(effect@2.0.0-next.56) - effect: 2.0.0-next.56 + '@effect/printer': 0.25.0(@effect/typeclass@0.17.0)(effect@2.0.0-next.57) + '@effect/typeclass': 0.17.0(effect@2.0.0-next.57) + effect: 2.0.0-next.57 dev: true - /@effect/printer@0.24.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-uP+pWqZhVSVMHl3n1rtmUs27LJXWQSJXJ/sOrhRcs3qsLO7LruI3CjOwSbl3VI9ob8dmgFoeh6saEVBzWS48OQ==} + /@effect/printer@0.25.0(@effect/typeclass@0.17.0)(effect@2.0.0-next.57): + resolution: {integrity: sha512-010incji7WafGxRdOHa5h9YGZuU+uy5a1VzSkhNnmb/0u92BqtT0NiQF0CKnxtb8ifONXjzJaMXm5VJw+mcxhQ==} peerDependencies: - '@effect/typeclass': ^0.16.0 - effect: 2.0.0-next.56 + '@effect/typeclass': ^0.17.0 + effect: 2.0.0-next.57 dependencies: - '@effect/typeclass': 0.16.0(effect@2.0.0-next.56) - effect: 2.0.0-next.56 + '@effect/typeclass': 0.17.0(effect@2.0.0-next.57) + effect: 2.0.0-next.57 dev: true - /@effect/schema@0.50.0(effect@2.0.0-next.56)(fast-check@3.14.0): - resolution: {integrity: sha512-kzFwbKDvv7TjHe0ZL1jq9KmZ6HzeVd8m4acpfRxfMKglEVQq/srT0JmvW1AD4kBLrN+4IAuCZBL892E9Z0YhWQ==} + /@effect/schema@0.51.0(effect@2.0.0-next.57)(fast-check@3.14.0): + resolution: {integrity: sha512-KacmzkeloC4iQjFL3SzpzpdPyizuPWEU/mhhkpb6QL9RVAlTQMnebek9l9GixTEkxCnGZJXReYMhjXx4uONikg==} peerDependencies: - effect: 2.0.0-next.56 + effect: 2.0.0-next.57 fast-check: ^3.13.2 dependencies: - effect: 2.0.0-next.56 + effect: 2.0.0-next.57 fast-check: 3.14.0 dev: true - /@effect/typeclass@0.16.0(effect@2.0.0-next.56): - resolution: {integrity: sha512-W7K9BucF+/rd2E6HdhWamDW/IbShwG1duhRk1N9/CiP0JacAqghvP8CA+P2UQLqU9k9d+vBW5Lka1F/LF00Wrw==} + /@effect/typeclass@0.17.0(effect@2.0.0-next.57): + resolution: {integrity: sha512-BIkrVzJARvCG8kTBSd0CzvGGpiDc8U4Le6K6YvScYp9bzwLhIF1oHlrzEtd/6+jTOXsTJpp9ic9Q8qkLvJ9LOg==} peerDependencies: - effect: 2.0.0-next.56 + effect: 2.0.0-next.57 dependencies: - effect: 2.0.0-next.56 + effect: 2.0.0-next.57 dev: true /@esbuild/android-arm64@0.18.20: @@ -2750,8 +2750,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /effect@2.0.0-next.56: - resolution: {integrity: sha512-Z6L9rf78OveZorl4pC82hUM/kNhQ8epChuCBVNIjVsookbb6iqTuP9goi3qi6CR7xUZE+HnOKF2bzMIdOOP+Vw==} + /effect@2.0.0-next.57: + resolution: {integrity: sha512-riZE0QZt/v7pko4TJj/px3uF2P72N2VufBkjadVxW0JNgBg769+L6TZ3RQtXjFFq/jAfgSJYDiQGNXWCZvHTuQ==} dev: true /electron-to-chromium@1.4.597: @@ -4612,9 +4612,9 @@ packages: picomatch: 2.3.1 dev: true - /mime@3.0.0: - resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} - engines: {node: '>=10.0.0'} + /mime@4.0.0: + resolution: {integrity: sha512-pzhgdeqU5pJ9t5WK9m4RT4GgGWqYJylxUf62Yb9datXRwdcw5MjiD1BYI5evF8AgTXN9gtKX3CFLvCUL5fAhEA==} + engines: {node: '>=16'} hasBin: true dev: true @@ -5981,8 +5981,8 @@ packages: typescript: 5.3.2 dev: true - /tsx@4.6.0: - resolution: {integrity: sha512-HLHaDQ78mly4Pd5co6tWQOiNVYoYYAPUcwSSZK4bcs3zSEsg+/67LS/ReHook0E7DKPfe1J5jc0ocIhUrnaR4w==} + /tsx@4.6.1: + resolution: {integrity: sha512-OQ4TAPHXAPUo/NZAmmIybl0o8LFOTlycQxFepLBAp6EV87U88fOKYGCQI2viGAEOVU9UW/cgQcxcOMnfEKVY3Q==} engines: {node: '>=18.0.0'} hasBin: true dependencies: diff --git a/src/internal/args.ts b/src/internal/args.ts index f7ab128..3c4d559 100644 --- a/src/internal/args.ts +++ b/src/internal/args.ts @@ -449,7 +449,7 @@ const getIdentifierInternal = (self: Instruction): Option.Option => { return getIdentifierInternal(self.args as Instruction) } case "Both": { - const ids = ReadonlyArray.compact([ + const ids = ReadonlyArray.getSomes([ getIdentifierInternal(self.left as Instruction), getIdentifierInternal(self.right as Instruction) ]) diff --git a/src/internal/options.ts b/src/internal/options.ts index e655e10..b5fe78f 100644 --- a/src/internal/options.ts +++ b/src/internal/options.ts @@ -680,7 +680,7 @@ const getIdentifierInternal = (self: Instruction): Option.Option => { } case "Both": case "OrElse": { - const ids = ReadonlyArray.compact([ + const ids = ReadonlyArray.getSomes([ getIdentifierInternal(self.left as Instruction), getIdentifierInternal(self.right as Instruction) ]) @@ -1228,7 +1228,7 @@ const wizardInternal = (self: Instruction, config: CliConfig.CliConfig): Effect. InternalHelpDoc.sequence(alternativeHelp) ) const makeChoice = (title: string, value: Instruction) => ({ title, value }) - const choices = ReadonlyArray.compact([ + const choices = ReadonlyArray.getSomes([ Option.map( getIdentifierInternal(self.left as Instruction), (title) => makeChoice(title, self.left as Instruction)