From 6854f8e428a92ec8ebe7fb2877d2d441bd8d4221 Mon Sep 17 00:00:00 2001 From: Maxwell Brown Date: Thu, 30 Nov 2023 08:41:53 -0500 Subject: [PATCH] refactor the internals of prompt rendering --- examples/prompt.ts | 94 +-- package.json | 34 +- pnpm-lock.yaml | 977 +++++++++++++++++------------- src/internal/helpDoc.ts | 16 +- src/internal/helpDoc/span.ts | 15 +- src/internal/prompt.ts | 5 +- src/internal/prompt/ansi-utils.ts | 214 +------ src/internal/prompt/confirm.ts | 71 ++- src/internal/prompt/date.ts | 95 ++- src/internal/prompt/number.ts | 119 ++-- src/internal/prompt/select.ts | 118 ++-- src/internal/prompt/text.ts | 95 ++- src/internal/prompt/toggle.ts | 42 +- 13 files changed, 883 insertions(+), 1012 deletions(-) diff --git a/examples/prompt.ts b/examples/prompt.ts index ddb62d7..9873457 100644 --- a/examples/prompt.ts +++ b/examples/prompt.ts @@ -1,5 +1,6 @@ -import * as Command from "@effect/cli/Command" -import * as Prompt from "@effect/cli/Prompt" +// import * as Command from "@effect/cli/Command" +import * as Prompt from "../src/internal/prompt/select.js" +// import * as Prompt from "@effect/cli/Prompt" import * as NodeContext from "@effect/platform-node/NodeContext" import * as Runtime from "@effect/platform-node/Runtime" import * as Effect from "effect/Effect" @@ -13,55 +14,60 @@ const colorPrompt = Prompt.select({ ] }) -const confirmPrompt = Prompt.confirm({ - message: "Can you please confirm?" -}) +// const confirmPrompt = Prompt.confirm({ +// message: "Can you please confirm?" +// }) -const datePrompt = Prompt.date({ - message: "What's your birth day?", - dateMask: - "\"Year:\" YYYY, \"Month:\" MM, \"Day:\" DD \\\\\\\\||// \\Hour: HH, \\Minute: mm, \"Seconds:\" ss", - validate: (date) => - date.getTime() > Date.now() - ? Effect.fail("Your birth day can't be in the future") - : Effect.succeed(date) -}) +// const datePrompt = Prompt.date({ +// message: "What's your birth day?", +// dateMask: +// "\"Year:\" YYYY, \"Month:\" MM, \"Day:\" DD \\\\\\\\||// \\Hour: HH, \\Minute: mm, \"Seconds:\" ss", +// validate: (date) => +// date.getTime() > Date.now() +// ? Effect.fail("Your birth day can't be in the future") +// : Effect.succeed(date) +// }) -const numberPrompt = Prompt.float({ - message: `What is your favorite number?`, - validate: (n) => n > 0 ? Effect.succeed(n) : Effect.fail("must be greater than 0") -}) +// const numberPrompt = Prompt.float({ +// message: `What is your favorite number?`, +// validate: (n) => n > 0 ? Effect.succeed(n) : Effect.fail("must be greater than 0") +// }) -const textPrompt = Prompt.text({ - message: `Please answer the following question\nWhat is your favorite food?`, - type: "hidden", - validate: (value) => - value.length === 0 - ? Effect.fail("must be non-empty\nyou entered " + value) - : Effect.succeed(value) -}) +// const textPrompt = Prompt.text({ +// message: "What is your password?", +// type: "password", +// validate: (value) => +// value.length === 0 +// ? Effect.fail("Password must be non-empty") +// : Effect.succeed(value) +// }) -const togglePrompt = Prompt.toggle({ - message: "Can you confirm?", - active: "yes", - inactive: "no" -}) +// const togglePrompt = Prompt.toggle({ +// message: "Can you confirm?", +// active: "yes", +// inactive: "no" +// }) -const prompt = Prompt.all([ - colorPrompt, - confirmPrompt, - datePrompt, - numberPrompt, - textPrompt, - togglePrompt -]) +// const prompt = Prompt.all([ +// colorPrompt, +// confirmPrompt, +// datePrompt, +// numberPrompt, +// textPrompt, +// togglePrompt +// ]) -const cli = Command.run(Command.prompt("favorites", prompt, Effect.log), { - name: "Prompt Examples", - version: "0.0.1" -}) +// const cli = Command.run(Command.prompt("favorites", textPrompt, Effect.log), { +// name: "Prompt Examples", +// version: "0.0.1" +// }) -Effect.suspend(() => cli(process.argv.slice(2))).pipe( +colorPrompt.pipe( Effect.provide(NodeContext.layer), Runtime.runMain ) + +// Effect.suspend(() => cli(process.argv.slice(2))).pipe( +// Effect.provide(NodeContext.layer), +// Runtime.runMain +// ) diff --git a/package.json b/package.json index e918e8c..9dfaade 100644 --- a/package.json +++ b/package.json @@ -57,38 +57,38 @@ "coverage": "vitest run --coverage" }, "peerDependencies": { - "@effect/platform": "^0.31.0", + "@effect/platform": "^0.31.2", "@effect/printer": "^0.24.0", - "@effect/printer-ansi": "^0.24.0", - "@effect/schema": "^0.49.0", + "@effect/printer-ansi": "^0.25.0", + "@effect/schema": "^0.50.0", "effect": "2.0.0-next.56" }, "devDependencies": { "@babel/cli": "^7.23.4", - "@babel/core": "^7.23.3", + "@babel/core": "^7.23.5", "@babel/plugin-transform-export-namespace-from": "^7.23.4", "@babel/plugin-transform-modules-commonjs": "^7.23.3", - "@changesets/changelog-github": "^0.4.8", - "@changesets/cli": "^2.26.2", + "@changesets/changelog-github": "^0.5.0", + "@changesets/cli": "^2.27.1", "@effect/build-utils": "^0.5.0", - "@effect/docgen": "^0.3.5", + "@effect/docgen": "^0.3.6", "@effect/eslint-plugin": "^0.1.2", "@effect/language-service": "^0.0.21", - "@effect/platform": "^0.31.0", - "@effect/platform-node": "^0.32.0", + "@effect/platform": "^0.31.2", + "@effect/platform-node": "^0.32.3", "@effect/printer": "^0.24.0", - "@effect/printer-ansi": "^0.24.0", - "@effect/schema": "^0.49.0", - "@types/node": "^20.9.2", - "@typescript-eslint/eslint-plugin": "^6.12.0", - "@typescript-eslint/parser": "^6.12.0", + "@effect/printer-ansi": "^0.25.0", + "@effect/schema": "^0.50.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", "error-stack-parser": "^2.1.4", "eslint": "^8.54.0", "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-codegen": "^0.18.1", + "eslint-plugin-codegen": "^0.21.0", "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-import": "^2.29.0", "eslint-plugin-simple-import-sort": "^10.0.0", @@ -97,9 +97,9 @@ "madge": "^6.1.0", "rimraf": "^5.0.5", "stackframe": "^1.3.4", - "tsx": "^4.1.4", + "tsx": "^4.6.0", "typescript": "^5.3.2", - "vite": "^5.0.0", + "vite": "^5.0.4", "vitest": "^0.34.6" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 70b4768..25f62e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,28 +7,28 @@ settings: devDependencies: '@babel/cli': specifier: ^7.23.4 - version: 7.23.4(@babel/core@7.23.3) + version: 7.23.4(@babel/core@7.23.5) '@babel/core': - specifier: ^7.23.3 - version: 7.23.3 + specifier: ^7.23.5 + version: 7.23.5 '@babel/plugin-transform-export-namespace-from': specifier: ^7.23.4 - version: 7.23.4(@babel/core@7.23.3) + version: 7.23.4(@babel/core@7.23.5) '@babel/plugin-transform-modules-commonjs': specifier: ^7.23.3 - version: 7.23.3(@babel/core@7.23.3) + version: 7.23.3(@babel/core@7.23.5) '@changesets/changelog-github': - specifier: ^0.4.8 - version: 0.4.8 + specifier: ^0.5.0 + version: 0.5.0 '@changesets/cli': - specifier: ^2.26.2 - version: 2.26.2 + specifier: ^2.27.1 + version: 2.27.1 '@effect/build-utils': specifier: ^0.5.0 version: 0.5.0 '@effect/docgen': - specifier: ^0.3.5 - version: 0.3.5(tsx@4.1.4)(typescript@5.3.2) + specifier: ^0.3.6 + version: 0.3.6(tsx@4.6.0)(typescript@5.3.2) '@effect/eslint-plugin': specifier: ^0.1.2 version: 0.1.2 @@ -36,35 +36,35 @@ devDependencies: specifier: ^0.0.21 version: 0.0.21 '@effect/platform': - specifier: ^0.31.0 - version: 0.31.0(@effect/schema@0.49.0)(effect@2.0.0-next.56) + specifier: ^0.31.2 + version: 0.31.2(@effect/schema@0.50.0)(effect@2.0.0-next.56) '@effect/platform-node': - specifier: ^0.32.0 - version: 0.32.0(@effect/schema@0.49.0)(effect@2.0.0-next.56) + specifier: ^0.32.3 + version: 0.32.3(@effect/schema@0.50.0)(effect@2.0.0-next.56) '@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.24.0 - version: 0.24.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56) + specifier: ^0.25.0 + version: 0.25.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56) '@effect/schema': - specifier: ^0.49.0 - version: 0.49.0(effect@2.0.0-next.56)(fast-check@3.14.0) + specifier: ^0.50.0 + version: 0.50.0(effect@2.0.0-next.56)(fast-check@3.14.0) '@types/node': - specifier: ^20.9.2 - version: 20.9.2 + specifier: ^20.10.1 + version: 20.10.1 '@typescript-eslint/eslint-plugin': - specifier: ^6.12.0 - version: 6.12.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0)(typescript@5.3.2) + specifier: ^6.13.1 + version: 6.13.1(@typescript-eslint/parser@6.13.1)(eslint@8.54.0)(typescript@5.3.2) '@typescript-eslint/parser': - specifier: ^6.12.0 - version: 6.12.0(eslint@8.54.0)(typescript@5.3.2) + specifier: ^6.13.1 + version: 6.13.1(eslint@8.54.0)(typescript@5.3.2) '@vitest/coverage-v8': specifier: ^0.34.6 version: 0.34.6(vitest@0.34.6) babel-plugin-annotate-pure-calls: specifier: ^0.4.0 - version: 0.4.0(@babel/core@7.23.3) + version: 0.4.0(@babel/core@7.23.5) effect: specifier: 2.0.0-next.56 version: 2.0.0-next.56 @@ -76,16 +76,16 @@ devDependencies: version: 8.54.0 eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@6.12.0)(eslint-plugin-import@2.29.0)(eslint@8.54.0) + version: 3.6.1(@typescript-eslint/parser@6.13.1)(eslint-plugin-import@2.29.0)(eslint@8.54.0) eslint-plugin-codegen: - specifier: ^0.18.1 - version: 0.18.1 + specifier: ^0.21.0 + version: 0.21.0(eslint@8.54.0) eslint-plugin-deprecation: specifier: ^2.0.0 version: 2.0.0(eslint@8.54.0)(typescript@5.3.2) eslint-plugin-import: specifier: ^2.29.0 - version: 2.29.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) + version: 2.29.0(@typescript-eslint/parser@6.13.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) eslint-plugin-simple-import-sort: specifier: ^10.0.0 version: 10.0.0(eslint@8.54.0) @@ -105,14 +105,14 @@ devDependencies: specifier: ^1.3.4 version: 1.3.4 tsx: - specifier: ^4.1.4 - version: 4.1.4 + specifier: ^4.6.0 + version: 4.6.0 typescript: specifier: ^5.3.2 version: 5.3.2 vite: - specifier: ^5.0.0 - version: 5.0.0(@types/node@20.9.2) + specifier: ^5.0.4 + version: 5.0.4(@types/node@20.10.1) vitest: specifier: ^0.34.6 version: 0.34.6 @@ -132,14 +132,14 @@ packages: '@jridgewell/trace-mapping': 0.3.20 dev: true - /@babel/cli@7.23.4(@babel/core@7.23.3): + /@babel/cli@7.23.4(@babel/core@7.23.5): resolution: {integrity: sha512-j3luA9xGKCXVyCa5R7lJvOMM+Kc2JEnAEIgz2ggtjQ/j5YUVgfsg/WsG95bbsgq7YLHuiCOzMnoSasuY16qiCw==} engines: {node: '>=6.9.0'} hasBin: true peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.3 + '@babel/core': 7.23.5 '@jridgewell/trace-mapping': 0.3.20 commander: 4.1.1 convert-source-map: 2.0.0 @@ -152,33 +152,33 @@ packages: chokidar: 3.5.3 dev: true - /@babel/code-frame@7.22.13: - resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.22.20 + '@babel/highlight': 7.23.4 chalk: 2.4.2 dev: true - /@babel/compat-data@7.23.3: - resolution: {integrity: sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==} + /@babel/compat-data@7.23.5: + resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.23.3: - resolution: {integrity: sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==} + /@babel/core@7.23.5: + resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.23.3 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.3) - '@babel/helpers': 7.23.2 - '@babel/parser': 7.23.3 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helpers': 7.23.5 + '@babel/parser': 7.23.5 '@babel/template': 7.22.15 - '@babel/traverse': 7.23.3 - '@babel/types': 7.23.3 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -191,26 +191,16 @@ packages: /@babel/generator@7.12.17: resolution: {integrity: sha512-DSA7ruZrY4WI8VxuS1jWSRezFnghEoYEFrZcw9BizQRmOZiUsiHl59+qEARGPqPikwA/GPTyRCi7isuCK/oyqg==} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 jsesc: 2.5.2 source-map: 0.5.7 dev: true - /@babel/generator@7.23.0: - resolution: {integrity: sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==} + /@babel/generator@7.23.5: + resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - jsesc: 2.5.2 - dev: true - - /@babel/generator@7.23.3: - resolution: {integrity: sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.23.5 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.20 jsesc: 2.5.2 @@ -220,8 +210,8 @@ packages: resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/compat-data': 7.23.3 - '@babel/helper-validator-option': 7.22.15 + '@babel/compat-data': 7.23.5 + '@babel/helper-validator-option': 7.23.5 browserslist: 4.22.1 lru-cache: 5.1.1 semver: 6.3.1 @@ -237,14 +227,14 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.15 - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-module-imports@7.22.15: @@ -254,13 +244,13 @@ packages: '@babel/types': 7.23.3 dev: true - /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.3): + /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.3 + '@babel/core': 7.23.5 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-module-imports': 7.22.15 '@babel/helper-simple-access': 7.22.5 @@ -292,29 +282,34 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.22.15: - resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} + /@babel/helper-validator-option@7.23.5: + resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.23.2: - resolution: {integrity: sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==} + /@babel/helpers@7.23.5: + resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.15 - '@babel/traverse': 7.23.3 - '@babel/types': 7.23.3 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 transitivePeerDependencies: - supports-color dev: true - /@babel/highlight@7.22.20: - resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.22.20 @@ -327,51 +322,51 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true - /@babel/parser@7.23.3: - resolution: {integrity: sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==} + /@babel/parser@7.23.5: + resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.23.5 dev: true - /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.3): + /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.3 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.23.3): + /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.23.5): resolution: {integrity: sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.3 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.3) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.3): + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.5): resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.3 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.3) + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 dev: true - /@babel/runtime@7.23.1: - resolution: {integrity: sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==} + /@babel/runtime@7.23.5: + resolution: {integrity: sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.0 @@ -381,41 +376,23 @@ packages: resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 - '@babel/parser': 7.23.3 - '@babel/types': 7.23.3 + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 dev: true - /@babel/traverse@7.23.2: - resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} + /@babel/traverse@7.23.5: + resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.23.0 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/traverse@7.23.3: - resolution: {integrity: sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.23.3 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.3 - '@babel/types': 7.23.3 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -440,18 +417,27 @@ packages: to-fast-properties: 2.0.0 dev: true + /@babel/types@7.23.5: + resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@changesets/apply-release-plan@6.1.4: - resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} + /@changesets/apply-release-plan@7.0.0: + resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/config': 2.3.1 - '@changesets/get-version-range-type': 0.3.2 - '@changesets/git': 2.0.0 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/config': 3.0.0 + '@changesets/get-version-range-type': 0.4.0 + '@changesets/git': 3.0.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 fs-extra: 7.0.1 @@ -462,61 +448,60 @@ packages: semver: 7.5.4 dev: true - /@changesets/assemble-release-plan@5.2.4: - resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} + /@changesets/assemble-release-plan@6.0.0: + resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.6 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.0.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 semver: 7.5.4 dev: true - /@changesets/changelog-git@0.1.14: - resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} + /@changesets/changelog-git@0.2.0: + resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} dependencies: - '@changesets/types': 5.2.1 + '@changesets/types': 6.0.0 dev: true - /@changesets/changelog-github@0.4.8: - resolution: {integrity: sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==} + /@changesets/changelog-github@0.5.0: + resolution: {integrity: sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==} dependencies: - '@changesets/get-github-info': 0.5.2 - '@changesets/types': 5.2.1 + '@changesets/get-github-info': 0.6.0 + '@changesets/types': 6.0.0 dotenv: 8.6.0 transitivePeerDependencies: - encoding dev: true - /@changesets/cli@2.26.2: - resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} + /@changesets/cli@2.27.1: + resolution: {integrity: sha512-iJ91xlvRnnrJnELTp4eJJEOPjgpF3NOh4qeQehM6Ugiz9gJPRZ2t+TsXun6E3AMN4hScZKjqVXl0TX+C7AB3ZQ==} hasBin: true dependencies: - '@babel/runtime': 7.23.1 - '@changesets/apply-release-plan': 6.1.4 - '@changesets/assemble-release-plan': 5.2.4 - '@changesets/changelog-git': 0.1.14 - '@changesets/config': 2.3.1 - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.6 - '@changesets/get-release-plan': 3.0.17 - '@changesets/git': 2.0.0 - '@changesets/logger': 0.0.5 - '@changesets/pre': 1.0.14 - '@changesets/read': 0.5.9 - '@changesets/types': 5.2.1 - '@changesets/write': 0.2.3 + '@babel/runtime': 7.23.5 + '@changesets/apply-release-plan': 7.0.0 + '@changesets/assemble-release-plan': 6.0.0 + '@changesets/changelog-git': 0.2.0 + '@changesets/config': 3.0.0 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.0.0 + '@changesets/get-release-plan': 4.0.0 + '@changesets/git': 3.0.0 + '@changesets/logger': 0.1.0 + '@changesets/pre': 2.0.0 + '@changesets/read': 0.6.0 + '@changesets/types': 6.0.0 + '@changesets/write': 0.3.0 '@manypkg/get-packages': 1.1.3 - '@types/is-ci': 3.0.2 - '@types/semver': 7.5.3 + '@types/semver': 7.5.6 ansi-colors: 4.1.3 chalk: 2.4.2 + ci-info: 3.9.0 enquirer: 2.4.1 external-editor: 3.1.0 fs-extra: 7.0.1 human-id: 1.0.2 - is-ci: 3.0.1 meow: 6.1.1 outdent: 0.5.0 p-limit: 2.3.0 @@ -525,39 +510,39 @@ packages: semver: 7.5.4 spawndamnit: 2.0.0 term-size: 2.2.1 - tty-table: 4.2.2 + tty-table: 4.2.3 dev: true - /@changesets/config@2.3.1: - resolution: {integrity: sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==} + /@changesets/config@3.0.0: + resolution: {integrity: sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==} dependencies: - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.6 - '@changesets/logger': 0.0.5 - '@changesets/types': 5.2.1 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.0.0 + '@changesets/logger': 0.1.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 micromatch: 4.0.5 dev: true - /@changesets/errors@0.1.4: - resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} + /@changesets/errors@0.2.0: + resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} dependencies: extendable-error: 0.1.7 dev: true - /@changesets/get-dependents-graph@1.3.6: - resolution: {integrity: sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==} + /@changesets/get-dependents-graph@2.0.0: + resolution: {integrity: sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==} dependencies: - '@changesets/types': 5.2.1 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 semver: 7.5.4 dev: true - /@changesets/get-github-info@0.5.2: - resolution: {integrity: sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==} + /@changesets/get-github-info@0.6.0: + resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==} dependencies: dataloader: 1.4.0 node-fetch: 2.7.0 @@ -565,65 +550,65 @@ packages: - encoding dev: true - /@changesets/get-release-plan@3.0.17: - resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} + /@changesets/get-release-plan@4.0.0: + resolution: {integrity: sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/assemble-release-plan': 5.2.4 - '@changesets/config': 2.3.1 - '@changesets/pre': 1.0.14 - '@changesets/read': 0.5.9 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/assemble-release-plan': 6.0.0 + '@changesets/config': 3.0.0 + '@changesets/pre': 2.0.0 + '@changesets/read': 0.6.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 dev: true - /@changesets/get-version-range-type@0.3.2: - resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} + /@changesets/get-version-range-type@0.4.0: + resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} dev: true - /@changesets/git@2.0.0: - resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} + /@changesets/git@3.0.0: + resolution: {integrity: sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/errors': 0.2.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 micromatch: 4.0.5 spawndamnit: 2.0.0 dev: true - /@changesets/logger@0.0.5: - resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} + /@changesets/logger@0.1.0: + resolution: {integrity: sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g==} dependencies: chalk: 2.4.2 dev: true - /@changesets/parse@0.3.16: - resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} + /@changesets/parse@0.4.0: + resolution: {integrity: sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==} dependencies: - '@changesets/types': 5.2.1 + '@changesets/types': 6.0.0 js-yaml: 3.14.1 dev: true - /@changesets/pre@1.0.14: - resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} + /@changesets/pre@2.0.0: + resolution: {integrity: sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/errors': 0.2.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 dev: true - /@changesets/read@0.5.9: - resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} + /@changesets/read@0.6.0: + resolution: {integrity: sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/git': 2.0.0 - '@changesets/logger': 0.0.5 - '@changesets/parse': 0.3.16 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/git': 3.0.0 + '@changesets/logger': 0.1.0 + '@changesets/parse': 0.4.0 + '@changesets/types': 6.0.0 chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 @@ -633,15 +618,15 @@ packages: resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} dev: true - /@changesets/types@5.2.1: - resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} + /@changesets/types@6.0.0: + resolution: {integrity: sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==} dev: true - /@changesets/write@0.2.3: - resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} + /@changesets/write@0.3.0: + resolution: {integrity: sha512-slGLb21fxZVUYbyea+94uFiD6ntQW0M2hIKNznFizDhZPDgn2c/fv1UzzlW43RVzh1BEDuIqW6hzlJ1OflNmcw==} dependencies: - '@babel/runtime': 7.23.1 - '@changesets/types': 5.2.1 + '@babel/runtime': 7.23.5 + '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 prettier: 2.8.8 @@ -669,8 +654,8 @@ packages: hasBin: true dev: true - /@effect/docgen@0.3.5(tsx@4.1.4)(typescript@5.3.2): - resolution: {integrity: sha512-si/ciZ8lyKOFwMeZmlTx9SeoqKqJWouespHnU0omSfSfyrVHhzY0TbZV1kmUZ6H++RPeNFk5JGZ8wkn2Ia9udw==} + /@effect/docgen@0.3.6(tsx@4.6.0)(typescript@5.3.2): + resolution: {integrity: sha512-GjEL+DWb/ttzPNvJ1GplOh5hCVVukqpTuZVVImaWkWMcYEphMKyPgw3HcXcEv7Jl/lLWzrjfuz9ClXN2+Zgxiw==} engines: {node: '>=16.17.1'} hasBin: true peerDependencies: @@ -681,7 +666,7 @@ packages: glob: 10.3.10 markdown-toc: github.com/effect-ts/markdown-toc/4bfeb0f140105440ea0d12df2fa23199cc3ec1d5 prettier: 3.1.0 - tsx: 4.1.4 + tsx: 4.6.0 typescript: 5.3.2 dev: true @@ -697,12 +682,12 @@ packages: resolution: {integrity: sha512-e8vfKbjnbYiyneBincEFS0tzXluopGK77OkVFbPRtUbNDS5tJfb+jiwOQEiqASDsadcZmd+9J9+Q6v/z7GuN2g==} dev: true - /@effect/platform-node@0.32.0(@effect/schema@0.49.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-uecg3JEOKFacf+UnmGtOca4SAtV9d+gi3upxpoKdgQ/jsRTXY6eRTdIFbwGFj3jIMu3r38O/Gv2P7FPgUHdJPw==} + /@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==} peerDependencies: effect: 2.0.0-next.56 dependencies: - '@effect/platform': 0.31.0(@effect/schema@0.49.0)(effect@2.0.0-next.56) + '@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 multipasta: 0.1.19 @@ -710,21 +695,21 @@ packages: - '@effect/schema' dev: true - /@effect/platform@0.31.0(@effect/schema@0.49.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-gCb79OtcPPjkmgZscm66ko2np+GLPtGbwXCo96XsGBqg1gOeTe+n9inMdRFOV5Dmk1qpPWEj4mkbyB7If4No8g==} + /@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==} peerDependencies: '@effect/schema': ^0.49.0 effect: 2.0.0-next.56 dependencies: - '@effect/schema': 0.49.0(effect@2.0.0-next.56)(fast-check@3.14.0) + '@effect/schema': 0.50.0(effect@2.0.0-next.56)(fast-check@3.14.0) effect: 2.0.0-next.56 find-my-way: 7.7.0 multipasta: 0.1.19 path-browserify: 1.0.1 dev: true - /@effect/printer-ansi@0.24.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56): - resolution: {integrity: sha512-274m6cBtgpyfe7yjyTs6QvMhEy3IERrFzmYSUNSqCJPFPE+U8dD+DtEpNKKN4v8IITrCgRhhlV2rm11xs2oktA==} + /@effect/printer-ansi@0.25.0(@effect/typeclass@0.16.0)(effect@2.0.0-next.56): + resolution: {integrity: sha512-aa1g07Roe345koQVJ/7Iok9VGW2a2Afeut+B4NGwQ5AiPVfAZJaSOMxzXrzBM+IKsSePz5O6Rmv30qfUJGaP3w==} peerDependencies: '@effect/typeclass': ^0.16.0 effect: 2.0.0-next.56 @@ -744,8 +729,8 @@ packages: effect: 2.0.0-next.56 dev: true - /@effect/schema@0.49.0(effect@2.0.0-next.56)(fast-check@3.14.0): - resolution: {integrity: sha512-mz6F+l2r1w02243tyKlVvJ6SZ1VEAHkHf4pGa8kmTDtWzYqqA3dBq6x5198WqSlcFzAa+61QcjcJqJsY9yfszg==} + /@effect/schema@0.50.0(effect@2.0.0-next.56)(fast-check@3.14.0): + resolution: {integrity: sha512-kzFwbKDvv7TjHe0ZL1jq9KmZ6HzeVd8m4acpfRxfMKglEVQq/srT0JmvW1AD4kBLrN+4IAuCZBL892E9Z0YhWQ==} peerDependencies: effect: 2.0.0-next.56 fast-check: ^3.13.2 @@ -1232,6 +1217,13 @@ packages: engines: {node: '>=8'} dev: true + /@jest/expect-utils@29.7.0: + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.6.3 + dev: true + /@jest/schemas@29.6.3: resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1239,14 +1231,15 @@ packages: '@sinclair/typebox': 0.27.8 dev: true - /@jest/types@26.6.2: - resolution: {integrity: sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==} - engines: {node: '>= 10.14.2'} + /@jest/types@29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: + '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.9.2 - '@types/yargs': 15.0.17 + '@types/node': 20.10.1 + '@types/yargs': 17.0.32 chalk: 4.1.2 dev: true @@ -1290,7 +1283,7 @@ packages: /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@babel/runtime': 7.23.1 + '@babel/runtime': 7.23.5 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 @@ -1299,7 +1292,7 @@ packages: /@manypkg/get-packages@1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} dependencies: - '@babel/runtime': 7.23.1 + '@babel/runtime': 7.23.5 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -1341,96 +1334,96 @@ packages: dev: true optional: true - /@rollup/rollup-android-arm-eabi@4.5.0: - resolution: {integrity: sha512-OINaBGY+Wc++U0rdr7BLuFClxcoWaVW3vQYqmQq6B3bqQ/2olkaoz+K8+af/Mmka/C2yN5j+L9scBkv4BtKsDA==} + /@rollup/rollup-android-arm-eabi@4.6.0: + resolution: {integrity: sha512-keHkkWAe7OtdALGoutLY3utvthkGF+Y17ws9LYT8pxMBYXaCoH/8dXS2uzo6e8+sEhY7y/zi5RFo22Dy2lFpDw==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.5.0: - resolution: {integrity: sha512-UdMf1pOQc4ZmUA/NTmKhgJTBimbSKnhPS2zJqucqFyBRFPnPDtwA8MzrGNTjDeQbIAWfpJVAlxejw+/lQyBK/w==} + /@rollup/rollup-android-arm64@4.6.0: + resolution: {integrity: sha512-y3Kt+34smKQNWilicPbBz/MXEY7QwDzMFNgwEWeYiOhUt9MTWKjHqe3EVkXwT2fR7izOvHpDWZ0o2IyD9SWX7A==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.5.0: - resolution: {integrity: sha512-L0/CA5p/idVKI+c9PcAPGorH6CwXn6+J0Ys7Gg1axCbTPgI8MeMlhA6fLM9fK+ssFhqogMHFC8HDvZuetOii7w==} + /@rollup/rollup-darwin-arm64@4.6.0: + resolution: {integrity: sha512-oLzzxcUIHltHxOCmaXl+pkIlU+uhSxef5HfntW7RsLh1eHm+vJzjD9Oo4oUKso4YuP4PpbFJNlZjJuOrxo8dPg==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.5.0: - resolution: {integrity: sha512-QZCbVqU26mNlLn8zi/XDDquNmvcr4ON5FYAHQQsyhrHx8q+sQi/6xduoznYXwk/KmKIXG5dLfR0CvY+NAWpFYQ==} + /@rollup/rollup-darwin-x64@4.6.0: + resolution: {integrity: sha512-+ANnmjkcOBaV25n0+M0Bere3roeVAnwlKW65qagtuAfIxXF9YxUneRyAn/RDcIdRa7QrjRNJL3jR7T43ObGe8Q==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.5.0: - resolution: {integrity: sha512-VpSQ+xm93AeV33QbYslgf44wc5eJGYfYitlQzAi3OObu9iwrGXEnmu5S3ilkqE3Pr/FkgOiJKV/2p0ewf4Hrtg==} + /@rollup/rollup-linux-arm-gnueabihf@4.6.0: + resolution: {integrity: sha512-tBTSIkjSVUyrekddpkAqKOosnj1Fc0ZY0rJL2bIEWPKqlEQk0paORL9pUIlt7lcGJi3LzMIlUGXvtNi1Z6MOCQ==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.5.0: - resolution: {integrity: sha512-OrEyIfpxSsMal44JpEVx9AEcGpdBQG1ZuWISAanaQTSMeStBW+oHWwOkoqR54bw3x8heP8gBOyoJiGg+fLY8qQ==} + /@rollup/rollup-linux-arm64-gnu@4.6.0: + resolution: {integrity: sha512-Ed8uJI3kM11de9S0j67wAV07JUNhbAqIrDYhQBrQW42jGopgheyk/cdcshgGO4fW5Wjq97COCY/BHogdGvKVNQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.5.0: - resolution: {integrity: sha512-1H7wBbQuE6igQdxMSTjtFfD+DGAudcYWhp106z/9zBA8OQhsJRnemO4XGavdzHpGhRtRxbgmUGdO3YQgrWf2RA==} + /@rollup/rollup-linux-arm64-musl@4.6.0: + resolution: {integrity: sha512-mZoNQ/qK4D7SSY8v6kEsAAyDgznzLLuSFCA3aBHZTmf3HP/dW4tNLTtWh9+LfyO0Z1aUn+ecpT7IQ3WtIg3ViQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.5.0: - resolution: {integrity: sha512-FVyFI13tXw5aE65sZdBpNjPVIi4Q5mARnL/39UIkxvSgRAIqCo5sCpCELk0JtXHGee2owZz5aNLbWNfBHzr71Q==} + /@rollup/rollup-linux-x64-gnu@4.6.0: + resolution: {integrity: sha512-rouezFHpwCqdEXsqAfNsTgSWO0FoZ5hKv5p+TGO5KFhyN/dvYXNMqMolOb8BkyKcPqjYRBeT+Z6V3aM26rPaYg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.5.0: - resolution: {integrity: sha512-eBPYl2sLpH/o8qbSz6vPwWlDyThnQjJfcDOGFbNjmjb44XKC1F5dQfakOsADRVrXCNzM6ZsSIPDG5dc6HHLNFg==} + /@rollup/rollup-linux-x64-musl@4.6.0: + resolution: {integrity: sha512-Bbm+fyn3S6u51urfj3YnqBXg5vI2jQPncRRELaucmhBVyZkbWClQ1fEsRmdnCPpQOQfkpg9gZArvtMVkOMsh1w==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.5.0: - resolution: {integrity: sha512-xaOHIfLOZypoQ5U2I6rEaugS4IYtTgP030xzvrBf5js7p9WI9wik07iHmsKaej8Z83ZDxN5GyypfoyKV5O5TJA==} + /@rollup/rollup-win32-arm64-msvc@4.6.0: + resolution: {integrity: sha512-+MRMcyx9L2kTrTUzYmR61+XVsliMG4odFb5UmqtiT8xOfEicfYAGEuF/D1Pww1+uZkYhBqAHpvju7VN+GnC3ng==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.5.0: - resolution: {integrity: sha512-Al6quztQUrHwcOoU2TuFblUQ5L+/AmPBXFR6dUvyo4nRj2yQRK0WIUaGMF/uwKulvRcXkpHe3k9A8Vf93VDktA==} + /@rollup/rollup-win32-ia32-msvc@4.6.0: + resolution: {integrity: sha512-rxfeE6K6s/Xl2HGeK6cO8SiQq3k/3BYpw7cfhW5Bk2euXNEpuzi2cc7llxx1si1QgwfjNtdRNTGqdBzGlFZGFw==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.5.0: - resolution: {integrity: sha512-8kdW+brNhI/NzJ4fxDufuJUjepzINqJKLGHuxyAtpPG9bMbn8P5mtaCcbOm0EzLJ+atg+kF9dwg8jpclkVqx5w==} + /@rollup/rollup-win32-x64-msvc@4.6.0: + resolution: {integrity: sha512-QqmCsydHS172Y0Kc13bkMXvipbJSvzeglBncJG3LsYJSiPlxYACz7MmJBs4A8l1oU+jfhYEIC/+AUSlvjmiX/g==} cpu: [x64] os: [win32] requiresBuild: true @@ -1451,10 +1444,26 @@ packages: resolution: {integrity: sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg==} dev: true - /@types/is-ci@3.0.2: - resolution: {integrity: sha512-9PyP1rgCro6xO3R7zOEoMgx5U9HpLhIg1FFb9p2mWX/x5QI8KMuCWWYtCT1dUQpicp84OsxEAw3iqwIKQY5Pog==} + /@types/dedent@0.7.0: + resolution: {integrity: sha512-EGlKlgMhnLt/cM4DbUSafFdrkeJoC9Mvnj0PUCU7tFmTjMjNRT957kXCx0wYm3JuEq4o4ZsS5vG+NlkM2DMd2A==} + dev: true + + /@types/eslint@8.44.7: + resolution: {integrity: sha512-f5ORu2hcBbKei97U73mf+l9t4zTGl74IqZ0GQk4oVea/VS8tQZYkUveSYojk+frraAVYId0V2WC9O4PTNru2FQ==} dependencies: - ci-info: 3.9.0 + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + dev: true + + /@types/estree@1.0.5: + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + dev: true + + /@types/glob@7.1.3: + resolution: {integrity: sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==} + dependencies: + '@types/minimatch': 5.1.2 + '@types/node': 20.10.1 dev: true /@types/istanbul-lib-coverage@2.0.4: @@ -1477,6 +1486,17 @@ packages: '@types/istanbul-lib-report': 3.0.3 dev: true + /@types/jest@29.0.0: + resolution: {integrity: sha512-X6Zjz3WO4cT39Gkl0lZ2baFRaEMqJl5NC1OjElkwtNzAlbkr2K/WJXkBkH5VP0zx4Hgsd2TZYdOEfvp2Dxia+Q==} + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + dev: true + + /@types/js-yaml@3.12.5: + resolution: {integrity: sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww==} + dev: true + /@types/json-schema@7.0.13: resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} dev: true @@ -1489,48 +1509,66 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true - /@types/minimist@1.2.3: - resolution: {integrity: sha512-ZYFzrvyWUNhaPomn80dsMNgMeXxNWZBdkuG/hWlUvXvbdUH8ZERNBGXnU87McuGcWDsyzX2aChCv/SVN348k3A==} + /@types/lodash@4.14.202: + resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} + dev: true + + /@types/mdast@3.0.15: + resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} + dependencies: + '@types/unist': 2.0.10 + dev: true + + /@types/minimatch@5.1.2: + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} + dev: true + + /@types/minimist@1.2.5: + resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} dev: true /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@20.9.2: - resolution: {integrity: sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==} + /@types/node@20.10.1: + resolution: {integrity: sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==} dependencies: undici-types: 5.26.5 dev: true - /@types/normalize-package-data@2.4.2: - resolution: {integrity: sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==} + /@types/normalize-package-data@2.4.4: + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true /@types/semver@7.5.3: resolution: {integrity: sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==} dev: true - /@types/semver@7.5.5: - resolution: {integrity: sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==} + /@types/semver@7.5.6: + resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true /@types/stack-utils@2.0.3: resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} dev: true - /@types/yargs-parser@21.0.2: - resolution: {integrity: sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==} + /@types/unist@2.0.10: + resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} + dev: true + + /@types/yargs-parser@21.0.3: + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} dev: true - /@types/yargs@15.0.17: - resolution: {integrity: sha512-cj53I8GUcWJIgWVTSVe2L7NJAB5XWGdsoMosVvUgv1jEnMbAcsbaCzt1coUcyi8Sda5PgTWAooG8jNyDTD+CWA==} + /@types/yargs@17.0.32: + resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} dependencies: - '@types/yargs-parser': 21.0.2 + '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@6.12.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0)(typescript@5.3.2): - resolution: {integrity: sha512-XOpZ3IyJUIV1b15M7HVOpgQxPPF7lGXgsfcEIu3yDxFPaf/xZKt7s9QO/pbk7vpWQyVulpJbu4E5LwpZiQo4kA==} + /@typescript-eslint/eslint-plugin@6.13.1(@typescript-eslint/parser@6.13.1)(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-5bQDGkXaxD46bPvQt08BUz9YSaO4S0fB1LB5JHQuXTfkGPI3+UUeS387C/e9jRie5GqT8u5kFTrMvAjtX4O5kA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1541,11 +1579,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) - '@typescript-eslint/scope-manager': 6.12.0 - '@typescript-eslint/type-utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) - '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) - '@typescript-eslint/visitor-keys': 6.12.0 + '@typescript-eslint/parser': 6.13.1(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/scope-manager': 6.13.1 + '@typescript-eslint/type-utils': 6.13.1(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/utils': 6.13.1(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/visitor-keys': 6.13.1 debug: 4.3.4 eslint: 8.54.0 graphemer: 1.4.0 @@ -1558,8 +1596,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.12.0(eslint@8.54.0)(typescript@5.3.2): - resolution: {integrity: sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==} + /@typescript-eslint/parser@6.13.1(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-fs2XOhWCzRhqMmQf0eicLa/CWSaYss2feXsy7xBD/pLyWke/jCIVc2s1ikEAtSW7ina1HNhv7kONoEfVNEcdDQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1568,10 +1606,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.12.0 - '@typescript-eslint/types': 6.12.0 - '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) - '@typescript-eslint/visitor-keys': 6.12.0 + '@typescript-eslint/scope-manager': 6.13.1 + '@typescript-eslint/types': 6.13.1 + '@typescript-eslint/typescript-estree': 6.13.1(typescript@5.3.2) + '@typescript-eslint/visitor-keys': 6.13.1 debug: 4.3.4 eslint: 8.54.0 typescript: 5.3.2 @@ -1579,12 +1617,12 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.12.0: - resolution: {integrity: sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==} + /@typescript-eslint/scope-manager@6.13.1: + resolution: {integrity: sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.12.0 - '@typescript-eslint/visitor-keys': 6.12.0 + '@typescript-eslint/types': 6.13.1 + '@typescript-eslint/visitor-keys': 6.13.1 dev: true /@typescript-eslint/scope-manager@6.7.5: @@ -1595,8 +1633,8 @@ packages: '@typescript-eslint/visitor-keys': 6.7.5 dev: true - /@typescript-eslint/type-utils@6.12.0(eslint@8.54.0)(typescript@5.3.2): - resolution: {integrity: sha512-WWmRXxhm1X8Wlquj+MhsAG4dU/Blvf1xDgGaYCzfvStP2NwPQh6KBvCDbiOEvaE0filhranjIlK/2fSTVwtBng==} + /@typescript-eslint/type-utils@6.13.1(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1605,8 +1643,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) - '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/typescript-estree': 6.13.1(typescript@5.3.2) + '@typescript-eslint/utils': 6.13.1(eslint@8.54.0)(typescript@5.3.2) debug: 4.3.4 eslint: 8.54.0 ts-api-utils: 1.0.3(typescript@5.3.2) @@ -1625,8 +1663,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@6.12.0: - resolution: {integrity: sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==} + /@typescript-eslint/types@6.13.1: + resolution: {integrity: sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -1677,8 +1715,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.12.0(typescript@5.3.2): - resolution: {integrity: sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==} + /@typescript-eslint/typescript-estree@6.13.1(typescript@5.3.2): + resolution: {integrity: sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1686,8 +1724,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.12.0 - '@typescript-eslint/visitor-keys': 6.12.0 + '@typescript-eslint/types': 6.13.1 + '@typescript-eslint/visitor-keys': 6.13.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1719,18 +1757,18 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.12.0(eslint@8.54.0)(typescript@5.3.2): - resolution: {integrity: sha512-LywPm8h3tGEbgfyjYnu3dauZ0U7R60m+miXgKcZS8c7QALO9uWJdvNoP+duKTk2XMWc7/Q3d/QiCuLN9X6SWyQ==} + /@typescript-eslint/utils@6.13.1(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.54.0) '@types/json-schema': 7.0.15 - '@types/semver': 7.5.5 - '@typescript-eslint/scope-manager': 6.12.0 - '@typescript-eslint/types': 6.12.0 - '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) + '@types/semver': 7.5.6 + '@typescript-eslint/scope-manager': 6.13.1 + '@typescript-eslint/types': 6.13.1 + '@typescript-eslint/typescript-estree': 6.13.1(typescript@5.3.2) eslint: 8.54.0 semver: 7.5.4 transitivePeerDependencies: @@ -1773,11 +1811,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.12.0: - resolution: {integrity: sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==} + /@typescript-eslint/visitor-keys@6.13.1: + resolution: {integrity: sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/types': 6.13.1 eslint-visitor-keys: 3.4.3 dev: true @@ -2048,12 +2086,12 @@ packages: engines: {node: '>= 0.4'} dev: true - /babel-plugin-annotate-pure-calls@0.4.0(@babel/core@7.23.3): + /babel-plugin-annotate-pure-calls@0.4.0(@babel/core@7.23.5): resolution: {integrity: sha512-oi4M/PWUJOU9ZyRGoPTfPMqdyMp06jbJAomd3RcyYuzUtBOddv98BqLm96Lucpi2QFoQHkdGQt0ACvw7VzVEQA==} peerDependencies: '@babel/core': ^6.0.0-0 || 7.x dependencies: - '@babel/core': 7.23.3 + '@babel/core': 7.23.5 dev: true /balanced-match@1.0.2: @@ -2117,8 +2155,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001561 - electron-to-chromium: 1.4.580 + caniuse-lite: 1.0.30001565 + electron-to-chromium: 1.4.597 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) dev: true @@ -2173,8 +2211,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001561: - resolution: {integrity: sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==} + /caniuse-lite@1.0.30001565: + resolution: {integrity: sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==} dev: true /chai@4.3.10: @@ -2207,6 +2245,18 @@ packages: supports-color: 7.2.0 dev: true + /character-entities-legacy@1.1.4: + resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} + dev: true + + /character-entities@1.2.4: + resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} + dev: true + + /character-reference-invalid@1.1.4: + resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + dev: true + /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true @@ -2424,6 +2474,15 @@ packages: engines: {node: '>=0.10.0'} dev: true + /dedent@1.5.1: + resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + dev: true + /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} engines: {node: '>=6'} @@ -2651,11 +2710,6 @@ packages: engines: {node: '>=0.8.0'} dev: true - /diff-sequences@26.6.2: - resolution: {integrity: sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==} - engines: {node: '>= 10.14.2'} - dev: true - /diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2700,8 +2754,8 @@ packages: resolution: {integrity: sha512-Z6L9rf78OveZorl4pC82hUM/kNhQ8epChuCBVNIjVsookbb6iqTuP9goi3qi6CR7xUZE+HnOKF2bzMIdOOP+Vw==} dev: true - /electron-to-chromium@1.4.580: - resolution: {integrity: sha512-T5q3pjQon853xxxHUq3ZP68ZpvJHuSMY2+BZaW3QzjS4HvNuvsMmZ/+lU+nCrftre1jFZ+OSlExynXWBihnXzw==} + /electron-to-chromium@1.4.597: + resolution: {integrity: sha512-0XOQNqHhg2YgRVRUrS4M4vWjFCFIP2ETXcXe/0KIQBjXE9Cpy+tgzzYfuq6HGai3hWq0YywtG+5XK8fyG08EjA==} dev: true /emoji-regex@8.0.0: @@ -2971,7 +3025,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.12.0)(eslint-plugin-import@2.29.0)(eslint@8.54.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.13.1)(eslint-plugin-import@2.29.0)(eslint@8.54.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2981,8 +3035,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.54.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.13.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.13.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.0 @@ -2994,7 +3048,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.13.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3015,24 +3069,33 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/parser': 6.13.1(eslint@8.54.0)(typescript@5.3.2) debug: 3.2.7 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.12.0)(eslint-plugin-import@2.29.0)(eslint@8.54.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.13.1)(eslint-plugin-import@2.29.0)(eslint@8.54.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-codegen@0.18.1: - resolution: {integrity: sha512-Sy5nJ7tMahHWygM02w2gAO70MX6Lp0ZK0PD9kMpPPGtoQhyS2n1oN7s9zLpDx5pmFDf3woj6LadqztNpJ5RepQ==} + /eslint-plugin-codegen@0.21.0(eslint@8.54.0): + resolution: {integrity: sha512-L7xNLx8Eskp0oBPUOdtKCd8c2K458baEiJz/3eXVYaST4kuzBguGDpXrjR7ohsVbHJsTgdiJGK0UjkAdu4hdXw==} engines: {node: '>=12.0.0'} dependencies: - '@babel/core': 7.23.3 + '@babel/core': 7.23.5 '@babel/generator': 7.12.17 - '@babel/parser': 7.23.0 - '@babel/traverse': 7.23.2 - expect: 26.6.2 + '@babel/parser': 7.23.5 + '@babel/traverse': 7.23.5 + '@types/dedent': 0.7.0 + '@types/eslint': 8.44.7 + '@types/glob': 7.1.3 + '@types/jest': 29.0.0 + '@types/js-yaml': 3.12.5 + '@types/lodash': 4.14.202 + '@types/node': 20.10.1 + dedent: 1.5.1 + eslint-plugin-markdown: 3.0.1(eslint@8.54.0) + expect: 29.7.0 fp-ts: 2.16.1 glob: 10.3.10 io-ts: 2.2.20(fp-ts@2.16.1) @@ -3042,6 +3105,8 @@ packages: read-pkg-up: 7.0.1 string.prototype.matchall: 4.0.10 transitivePeerDependencies: + - babel-plugin-macros + - eslint - supports-color dev: true @@ -3060,7 +3125,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0): + /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.13.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -3070,7 +3135,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/parser': 6.13.1(eslint@8.54.0)(typescript@5.3.2) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -3079,7 +3144,7 @@ packages: doctrine: 2.1.0 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.13.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.54.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -3095,6 +3160,18 @@ packages: - supports-color dev: true + /eslint-plugin-markdown@3.0.1(eslint@8.54.0): + resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + eslint: 8.54.0 + mdast-util-from-markdown: 0.8.5 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-simple-import-sort@10.0.0(eslint@8.54.0): resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==} peerDependencies: @@ -3224,16 +3301,15 @@ packages: fill-range: 2.2.4 dev: true - /expect@26.6.2: - resolution: {integrity: sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==} - engines: {node: '>= 10.14.2'} + /expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 26.6.2 - ansi-styles: 4.3.0 - jest-get-type: 26.3.0 - jest-matcher-utils: 26.6.2 - jest-message-util: 26.6.2 - jest-regex-util: 26.0.0 + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 dev: true /extend-shallow@2.0.1: @@ -3816,6 +3892,17 @@ packages: fp-ts: 2.16.1 dev: true + /is-alphabetical@1.0.4: + resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} + dev: true + + /is-alphanumerical@1.0.4: + resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} + dependencies: + is-alphabetical: 1.0.4 + is-decimal: 1.0.4 + dev: true + /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: @@ -3860,13 +3947,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-ci@3.0.1: - resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} - hasBin: true - dependencies: - ci-info: 3.9.0 - dev: true - /is-core-module@2.13.0: resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} dependencies: @@ -3886,6 +3966,10 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-decimal@1.0.4: + resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} + dev: true + /is-extendable@0.1.1: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} @@ -3915,6 +3999,10 @@ packages: is-extglob: 2.1.1 dev: true + /is-hexadecimal@1.0.4: + resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} + dev: true + /is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} @@ -4114,49 +4202,56 @@ packages: '@pkgjs/parseargs': 0.11.0 dev: true - /jest-diff@26.6.2: - resolution: {integrity: sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==} - engines: {node: '>= 10.14.2'} + /jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - diff-sequences: 26.6.2 - jest-get-type: 26.3.0 - pretty-format: 26.6.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 dev: true - /jest-get-type@26.3.0: - resolution: {integrity: sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==} - engines: {node: '>= 10.14.2'} + /jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-matcher-utils@26.6.2: - resolution: {integrity: sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==} - engines: {node: '>= 10.14.2'} + /jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 26.6.2 - jest-get-type: 26.3.0 - pretty-format: 26.6.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 dev: true - /jest-message-util@26.6.2: - resolution: {integrity: sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==} - engines: {node: '>= 10.14.2'} + /jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/code-frame': 7.22.13 - '@jest/types': 26.6.2 + '@babel/code-frame': 7.23.5 + '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 graceful-fs: 4.2.11 micromatch: 4.0.5 - pretty-format: 26.6.2 + pretty-format: 29.7.0 slash: 3.0.0 stack-utils: 2.0.6 dev: true - /jest-regex-util@26.0.0: - resolution: {integrity: sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==} - engines: {node: '>= 10.14.2'} + /jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.10.1 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 dev: true /js-tokens@4.0.0: @@ -4462,11 +4557,27 @@ packages: resolution: {integrity: sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==} dev: true + /mdast-util-from-markdown@0.8.5: + resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} + dependencies: + '@types/mdast': 3.0.15 + mdast-util-to-string: 2.0.0 + micromark: 2.11.4 + parse-entities: 2.0.0 + unist-util-stringify-position: 2.0.3 + transitivePeerDependencies: + - supports-color + dev: true + + /mdast-util-to-string@2.0.0: + resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} + dev: true + /meow@6.1.1: resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} engines: {node: '>=8'} dependencies: - '@types/minimist': 1.2.3 + '@types/minimist': 1.2.5 camelcase-keys: 6.2.2 decamelize-keys: 1.1.1 hard-rejection: 2.1.0 @@ -4484,6 +4595,15 @@ packages: engines: {node: '>= 8'} dev: true + /micromark@2.11.4: + resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} + dependencies: + debug: 4.3.4 + parse-entities: 2.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -4547,8 +4667,8 @@ packages: is-extendable: 1.0.1 dev: true - /mixme@0.5.9: - resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} + /mixme@0.5.10: + resolution: {integrity: sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==} engines: {node: '>= 8.0.0'} dev: true @@ -4639,7 +4759,7 @@ packages: resolution: {integrity: sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==} engines: {node: '>=6.0'} dependencies: - '@babel/parser': 7.23.0 + '@babel/parser': 7.23.5 dev: true /node-source-walk@5.0.2: @@ -4653,7 +4773,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.6 + resolve: 1.22.8 semver: 5.7.2 validate-npm-package-license: 3.0.4 dev: true @@ -4830,11 +4950,22 @@ packages: callsites: 3.1.0 dev: true + /parse-entities@2.0.0: + resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + dependencies: + character-entities: 1.2.4 + character-entities-legacy: 1.1.4 + character-reference-invalid: 1.1.4 + is-alphanumerical: 1.0.4 + is-decimal: 1.0.4 + is-hexadecimal: 1.0.4 + dev: true + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -5023,16 +5154,6 @@ packages: hasBin: true dev: true - /pretty-format@26.6.2: - resolution: {integrity: sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==} - engines: {node: '>= 10'} - dependencies: - '@jest/types': 26.6.2 - ansi-regex: 5.0.1 - ansi-styles: 4.3.0 - react-is: 17.0.2 - dev: true - /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5098,10 +5219,6 @@ packages: strip-json-comments: 2.0.1 dev: true - /react-is@17.0.2: - resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} - dev: true - /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true @@ -5119,7 +5236,7 @@ packages: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} dependencies: - '@types/normalize-package-data': 2.4.2 + '@types/normalize-package-data': 2.4.4 normalize-package-data: 2.5.0 parse-json: 5.2.0 type-fest: 0.6.0 @@ -5298,23 +5415,23 @@ packages: glob: 10.3.10 dev: true - /rollup@4.5.0: - resolution: {integrity: sha512-41xsWhzxqjMDASCxH5ibw1mXk+3c4TNI2UjKbLxe6iEzrSQnqOzmmK8/3mufCPbzHNJ2e04Fc1ddI35hHy+8zg==} + /rollup@4.6.0: + resolution: {integrity: sha512-R8i5Her4oO1LiMQ3jKf7MUglYV/mhQ5g5OKeld5CnkmPdIGo79FDDQYqPhq/PCVuTQVuxsWgIbDy9F+zdHn80w==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.5.0 - '@rollup/rollup-android-arm64': 4.5.0 - '@rollup/rollup-darwin-arm64': 4.5.0 - '@rollup/rollup-darwin-x64': 4.5.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.5.0 - '@rollup/rollup-linux-arm64-gnu': 4.5.0 - '@rollup/rollup-linux-arm64-musl': 4.5.0 - '@rollup/rollup-linux-x64-gnu': 4.5.0 - '@rollup/rollup-linux-x64-musl': 4.5.0 - '@rollup/rollup-win32-arm64-msvc': 4.5.0 - '@rollup/rollup-win32-ia32-msvc': 4.5.0 - '@rollup/rollup-win32-x64-msvc': 4.5.0 + '@rollup/rollup-android-arm-eabi': 4.6.0 + '@rollup/rollup-android-arm64': 4.6.0 + '@rollup/rollup-darwin-arm64': 4.6.0 + '@rollup/rollup-darwin-x64': 4.6.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.6.0 + '@rollup/rollup-linux-arm64-gnu': 4.6.0 + '@rollup/rollup-linux-arm64-musl': 4.6.0 + '@rollup/rollup-linux-x64-gnu': 4.6.0 + '@rollup/rollup-linux-x64-musl': 4.6.0 + '@rollup/rollup-win32-arm64-msvc': 4.6.0 + '@rollup/rollup-win32-ia32-msvc': 4.6.0 + '@rollup/rollup-win32-x64-msvc': 4.6.0 fsevents: 2.3.3 dev: true @@ -5489,13 +5606,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /source-map-support@0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - dev: true - /source-map@0.5.7: resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} engines: {node: '>=0.10.0'} @@ -5567,7 +5677,7 @@ packages: /stream-transform@2.1.3: resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: - mixme: 0.5.9 + mixme: 0.5.10 dev: true /string-width@4.2.3: @@ -5871,20 +5981,19 @@ packages: typescript: 5.3.2 dev: true - /tsx@4.1.4: - resolution: {integrity: sha512-9X7uBCIyUsvMzIH+o8m+5o/5eL461cChCF+XUtOZsPr1a4pZx2lTQx0Muu5G5VwJWZwAGKBe3sJHLk82BENAVw==} + /tsx@4.6.0: + resolution: {integrity: sha512-HLHaDQ78mly4Pd5co6tWQOiNVYoYYAPUcwSSZK4bcs3zSEsg+/67LS/ReHook0E7DKPfe1J5jc0ocIhUrnaR4w==} engines: {node: '>=18.0.0'} hasBin: true dependencies: esbuild: 0.18.20 get-tsconfig: 4.7.2 - source-map-support: 0.5.21 optionalDependencies: fsevents: 2.3.3 dev: true - /tty-table@4.2.2: - resolution: {integrity: sha512-2gvCArMZLxgvpZ2NvQKdnYWIFLe7I/z5JClMuhrDXunmKgSZcQKcZRjN9XjAFiToMz2pUo1dEIXyrm0AwgV5Tw==} + /tty-table@4.2.3: + resolution: {integrity: sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==} engines: {node: '>=8.0.0'} hasBin: true dependencies: @@ -6010,6 +6119,12 @@ packages: resolution: {integrity: sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==} dev: true + /unist-util-stringify-position@2.0.3: + resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + dependencies: + '@types/unist': 2.0.10 + dev: true + /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -6052,7 +6167,7 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@0.34.6(@types/node@20.9.2): + /vite-node@0.34.6(@types/node@20.10.1): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6062,7 +6177,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 5.0.0(@types/node@20.9.2) + vite: 5.0.4(@types/node@20.10.1) transitivePeerDependencies: - '@types/node' - less @@ -6074,8 +6189,8 @@ packages: - terser dev: true - /vite@5.0.0(@types/node@20.9.2): - resolution: {integrity: sha512-ESJVM59mdyGpsiNAeHQOR/0fqNoOyWPYesFto8FFZugfmhdHx8Fzd8sF3Q/xkVhZsyOxHfdM7ieiVAorI9RjFw==} + /vite@5.0.4(@types/node@20.10.1): + resolution: {integrity: sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -6102,10 +6217,10 @@ packages: terser: optional: true dependencies: - '@types/node': 20.9.2 + '@types/node': 20.10.1 esbuild: 0.19.8 postcss: 8.4.31 - rollup: 4.5.0 + rollup: 4.6.0 optionalDependencies: fsevents: 2.3.3 dev: true @@ -6143,7 +6258,7 @@ packages: dependencies: '@types/chai': 4.3.10 '@types/chai-subset': 1.3.3 - '@types/node': 20.9.2 + '@types/node': 20.10.1 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 '@vitest/snapshot': 0.34.6 @@ -6162,8 +6277,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 - vite: 5.0.0(@types/node@20.9.2) - vite-node: 0.34.6(@types/node@20.9.2) + vite: 5.0.4(@types/node@20.10.1) + vite-node: 0.34.6(@types/node@20.10.1) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/src/internal/helpDoc.ts b/src/internal/helpDoc.ts index 3ca5f75..bd5dbfd 100644 --- a/src/internal/helpDoc.ts +++ b/src/internal/helpDoc.ts @@ -1,7 +1,5 @@ -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" -import * as Doc from "@effect/printer/Doc" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Optimize from "@effect/printer/Optimize" import { dual, pipe } from "effect/Function" import * as ReadonlyArray from "effect/ReadonlyArray" @@ -133,25 +131,25 @@ export const mapDescriptionList = dual< : self) /** @internal */ -export const toAnsiDoc = (self: HelpDoc.HelpDoc): AnsiDoc.AnsiDoc => +export const toAnsiDoc = (self: HelpDoc.HelpDoc): Doc.AnsiDoc => Optimize.optimize(toAnsiDocInternal(self), Optimize.Deep) /** @internal */ export const toAnsiText = (self: HelpDoc.HelpDoc): string => - AnsiRender.prettyDefault(toAnsiDoc(self)) + Doc.render(toAnsiDoc(self), { style: "pretty" }) // ============================================================================= // Internals // ============================================================================= -const toAnsiDocInternal = (self: HelpDoc.HelpDoc): AnsiDoc.AnsiDoc => { +const toAnsiDocInternal = (self: HelpDoc.HelpDoc): Doc.AnsiDoc => { switch (self._tag) { case "Empty": { return Doc.empty } case "Header": { return pipe( - Doc.annotate(InternalSpan.toAnsiDoc(self.value), AnsiStyle.bold), + Doc.annotate(InternalSpan.toAnsiDoc(self.value), Ansi.bold), Doc.cat(Doc.hardLine) ) } @@ -164,7 +162,7 @@ const toAnsiDocInternal = (self: HelpDoc.HelpDoc): AnsiDoc.AnsiDoc => { case "DescriptionList": { const definitions = self.definitions.map(([span, doc]) => Doc.cats([ - Doc.annotate(InternalSpan.toAnsiDoc(span), AnsiStyle.bold), + Doc.annotate(InternalSpan.toAnsiDoc(span), Ansi.bold), Doc.empty, Doc.indent(toAnsiDocInternal(doc), 2) ]) diff --git a/src/internal/helpDoc/span.ts b/src/internal/helpDoc/span.ts index 66dcc3f..3a30ebc 100644 --- a/src/internal/helpDoc/span.ts +++ b/src/internal/helpDoc/span.ts @@ -1,7 +1,6 @@ -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Color from "@effect/printer-ansi/Color" -import * as Doc from "@effect/printer/Doc" import { dual } from "effect/Function" import * as ReadonlyArray from "effect/ReadonlyArray" import type * as Span from "../../HelpDoc/Span.js" @@ -122,25 +121,25 @@ export const size = (self: Span.Span): number => { } /** @internal */ -export const toAnsiDoc = (self: Span.Span): AnsiDoc.AnsiDoc => { +export const toAnsiDoc = (self: Span.Span): Doc.AnsiDoc => { switch (self._tag) { case "Highlight": { - return Doc.annotate(toAnsiDoc(self.value), AnsiStyle.color(self.color)) + return Doc.annotate(toAnsiDoc(self.value), Ansi.color(self.color)) } case "Sequence": { return Doc.cat(toAnsiDoc(self.left), toAnsiDoc(self.right)) } case "Strong": { - return Doc.annotate(toAnsiDoc(self.value), AnsiStyle.bold) + return Doc.annotate(toAnsiDoc(self.value), Ansi.bold) } case "Text": { return Doc.text(self.value) } case "URI": { - return Doc.annotate(Doc.text(self.value), AnsiStyle.underlined) + return Doc.annotate(Doc.text(self.value), Ansi.underlined) } case "Weak": { - return Doc.annotate(toAnsiDoc(self.value), AnsiStyle.dullColor(Color.black)) + return Doc.annotate(toAnsiDoc(self.value), Ansi.black) } } } diff --git a/src/internal/prompt.ts b/src/internal/prompt.ts index 0ad1c85..60ae734 100644 --- a/src/internal/prompt.ts +++ b/src/internal/prompt.ts @@ -1,5 +1,5 @@ import * as Terminal from "@effect/platform/Terminal" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Effect from "effect/Effect" import * as Effectable from "effect/Effectable" import { dual } from "effect/Function" @@ -8,7 +8,6 @@ import * as Pipeable from "effect/Pipeable" import * as Ref from "effect/Ref" import type * as Prompt from "../Prompt.js" import type * as PromptAction from "../Prompt/Action.js" -import * as InternalAnsiUtils from "./prompt/ansi-utils.js" /** @internal */ const PromptSymbolKey = "@effect/cli/Prompt" @@ -209,7 +208,7 @@ export const run = ( }), // Always make sure to restore the display of the cursor Effect.ensuring(Effect.orDie( - terminal.display(AnsiRender.prettyDefault(InternalAnsiUtils.cursorShow)) + terminal.display(Doc.render(Doc.cursorShow, { style: "pretty" })) )) ) } diff --git a/src/internal/prompt/ansi-utils.ts b/src/internal/prompt/ansi-utils.ts index 3a5a88a..24186e3 100644 --- a/src/internal/prompt/ansi-utils.ts +++ b/src/internal/prompt/ansi-utils.ts @@ -1,5 +1,4 @@ -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as Doc from "@effect/printer/Doc" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Effect from "effect/Effect" import { pipe } from "effect/Function" import * as ReadonlyArray from "effect/ReadonlyArray" @@ -40,227 +39,26 @@ export const figures = Effect.map( (isWindows) => isWindows ? windowsFigures : defaultFigures ) -const BEEP = "\x07" -const ESC = "\x1B" -const CSI = `${ESC}[` - -/** - * Play a beeping sound. - * - * @internal - */ -export const beep: AnsiDoc.AnsiDoc = Doc.char(BEEP) - -/** - * Moves the cursor to the specified `row` and `column`. - * - * Though the ANSI Control Sequence for Cursor Position is `1`-based, this - * method takes row and column values starting from `0` and adjusts them to `1`- - * based values. - * - * @internal - */ -export const cursorTo = (row: number, column: number = 0): AnsiDoc.AnsiDoc => { - if (column === 0) { - return Doc.text(`${CSI}${row + 1}G`) - } - return Doc.text(`${CSI}${column + 1};${row + 1}H`) -} - -/** - * Move the cursor position the specified number of `rows` and `columns` - * relative to the current cursor position. - * - * If the cursor is already at the edge of the screen in either direction, then - * additional movement will have no effect. - * - * @internal - */ -export const cursorMove = (rows: number, columns: number = 0): AnsiDoc.AnsiDoc => { - let move: AnsiDoc.AnsiDoc = Doc.empty - if (rows > 0) { - move = Doc.cat(move, cursorForward(rows)) - } else if (rows < 0) { - move = Doc.cat(move, cursorBackward(-rows)) - } - if (columns > 0) { - move = Doc.cat(move, cursorDown(columns)) - } else if (columns < 0) { - move = Doc.cat(move, cursorUp(-columns)) - } - return move -} - -/** - * Moves the cursor up by the specified number of `rows` (default `1`) relative - * to the current cursor position. - * - * If the cursor is already at the edge of the screen, this has no effect. - * - * @internal - */ -export const cursorUp = (rows: number = 1): AnsiDoc.AnsiDoc => Doc.text(`${CSI}${rows}A`) - -/** - * Moves the cursor down by the specified number of `rows` (default `1`) - * relative to the current cursor position. - * - * If the cursor is already at the edge of the screen, this has no effect. - * - * @internal - */ -export const cursorDown = (rows: number = 1): AnsiDoc.AnsiDoc => Doc.text(`${CSI}${rows}B`) - -/** - * Moves the cursor backward by the specified number of `columns` (default `1`) - * relative to the current cursor position. - * - * If the cursor is already at the edge of the screen, this has no effect. - * - * @internal - */ -export const cursorBackward = (columns: number = 1): AnsiDoc.AnsiDoc => - Doc.text(`${CSI}${columns}D`) - -/** - * Moves the cursor forward by the specified number of `columns` (default `1`) - * relative to the current cursor position. - * - * If the cursor is already at the edge of the screen, this has no effect. - * - * @internal - */ -export const cursorForward = (columns: number = 1): AnsiDoc.AnsiDoc => Doc.text(`${CSI}${columns}C`) - -/** - * Moves the cursor to the first column. - * - * @internal - */ -export const cursorLeft: AnsiDoc.AnsiDoc = Doc.text(`${CSI}G`) - -/** - * Saves the cursor position, encoding shift state and formatting attributes. - * - * @internal - */ -export const cursorSave: AnsiDoc.AnsiDoc = Doc.text(`${ESC}7`) - -/** - * Restores the cursor position, encoding shift state and formatting attributes - * from the previous save, if any, otherwise resets these all to their defaults. - * - * @internal - */ -export const cursorRestore: AnsiDoc.AnsiDoc = Doc.text(`${ESC}8`) - -/** - * Saves the current cursor position. - * - * @internal - */ -export const cursorSavePosition: AnsiDoc.AnsiDoc = Doc.text(`${ESC}s`) - -/** - * Restores the cursor position from the previous save. - * - * @internal - */ -export const cursorRestorePosition: AnsiDoc.AnsiDoc = Doc.text(`${ESC}u`) - -/** - * Reports the cursor position (CPR) by transmitting `ESC[n;mR`, where `n` is - * the row and `m` is the column. - * - * @internal - */ -export const cursorGetPosition: AnsiDoc.AnsiDoc = Doc.text(`${ESC}6n`) - -/** - * Moves cursor to beginning of the line the specified number of rows down - * (default `1`). - * - * @internal - */ -export const cursorNextLine = (rows: number = 1): AnsiDoc.AnsiDoc => Doc.text(`${ESC}${rows}E`) - -/** - * Moves cursor to beginning of the line the specified number of rows up - * (default `1`). - * @internal - */ -export const cursorPreviousLine = (rows: number = 1): AnsiDoc.AnsiDoc => Doc.text(`${ESC}${rows}F`) - -/** - * Hides the cursor. - * - * @internal - */ -export const cursorHide: AnsiDoc.AnsiDoc = Doc.text(`${CSI}?25l`) - -/** - * Shows the cursor. - * - * @internal - */ -export const cursorShow: AnsiDoc.AnsiDoc = Doc.text(`${CSI}?25h`) - -/** - * Erases the entire current line. The cursor position does not change. - * - * @internal - */ -export const eraseLine: AnsiDoc.AnsiDoc = Doc.text(`${CSI}2K`) - -/** - * Erase from the current cursor position up the specified amount of rows. - * - * @internal - */ -export const eraseLines = (rows: number): AnsiDoc.AnsiDoc => { - let clear: AnsiDoc.AnsiDoc = Doc.empty - for (let i = 0; i < rows; i++) { - clear = Doc.cat(clear, Doc.cat(eraseLine, i < rows - 1 ? cursorUp(1) : Doc.empty)) - } - if (rows > 0) { - clear = Doc.cat(clear, cursorLeft) - } - return clear -} - /** * Clears all lines taken up by the specified `text`. * * @internal */ -export const eraseText = (text: string, columns: number): AnsiDoc.AnsiDoc => { +export const eraseText = (text: string, columns: number): Doc.AnsiDoc => { if (columns === 0) { - return Doc.cat(eraseLine, cursorTo(0)) + return Doc.cat(Doc.eraseLine, Doc.cursorTo(0)) } let rows = 0 const lines = text.split(/\r?\n/) for (const line of lines) { - rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / columns) + rows += 1 + Math.floor(Math.max(line.length - 1, 0) / columns) } - return eraseLines(rows) + return Doc.eraseLines(rows) } -/** @internal */ -export const strip = (str: string) => { - const pattern = [ - "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", - "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" - ].join("|") - const regex = new RegExp(pattern, "g") - return str.replace(regex, "") -} - -/** @internal */ -export const width = (str: string) => [...strip(str)].length - /** @internal */ export const lines = (prompt: string, columns: number): number => { - const lines = strip(prompt).split(/\r?\n/) + const lines = prompt.split(/\r?\n/) return columns === 0 ? lines.length : pipe( diff --git a/src/internal/prompt/confirm.ts b/src/internal/prompt/confirm.ts index 5b01733..5ebef0a 100644 --- a/src/internal/prompt/confirm.ts +++ b/src/internal/prompt/confirm.ts @@ -1,9 +1,6 @@ import * as Terminal from "@effect/platform/Terminal" -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" -import * as Color from "@effect/printer-ansi/Color" -import * as Doc from "@effect/printer/Doc" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Optimize from "@effect/printer/Optimize" import * as Effect from "effect/Effect" import { pipe } from "effect/Function" @@ -19,43 +16,43 @@ interface State { readonly value: boolean } -const renderBeep = AnsiRender.prettyDefault(InternalAnsiUtils.beep) +const renderBeep = Doc.render(Doc.beep, { style: "pretty" }) const renderClearScreen = ( prevState: Option.Option, options: Required, columns: number -): AnsiDoc.AnsiDoc => { - const clearPrompt = Doc.cat(InternalAnsiUtils.eraseLine, InternalAnsiUtils.cursorLeft) +): Doc.AnsiDoc => { + const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft) if (Option.isNone(prevState)) { - return clearPrompt + return resetCurrentLine } const clearOutput = InternalAnsiUtils.eraseText(options.message, columns) - return Doc.cat(clearOutput, clearPrompt) + return Doc.cat(clearOutput, resetCurrentLine) } const renderOutput = ( - confirm: AnsiDoc.AnsiDoc, - leadingSymbol: AnsiDoc.AnsiDoc, - trailingSymbol: AnsiDoc.AnsiDoc, + confirm: Doc.AnsiDoc, + leadingSymbol: Doc.AnsiDoc, + trailingSymbol: Doc.AnsiDoc, options: Required -): AnsiDoc.AnsiDoc => { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate(Doc.text(line), AnsiStyle.bold) - const promptLines = options.message.split(/\r?\n/) +): Doc.AnsiDoc => { + const annotateLine = (line: string): Doc.AnsiDoc => pipe(Doc.text(line), Doc.annotate(Ansi.bold)) const prefix = Doc.cat(leadingSymbol, Doc.space) - if (ReadonlyArray.isNonEmptyReadonlyArray(promptLines)) { - const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) - return pipe( - prefix, - Doc.cat(Doc.nest(Doc.vsep(lines), 2)), - Doc.cat(Doc.space), - Doc.cat(trailingSymbol), - Doc.cat(Doc.space), - Doc.cat(confirm) - ) - } - return Doc.hsep([prefix, trailingSymbol, confirm]) + return ReadonlyArray.match(options.message.split(/\r?\n/), { + onEmpty: () => Doc.hsep([prefix, trailingSymbol, confirm]), + onNonEmpty: (promptLines) => { + const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) + return pipe( + prefix, + Doc.cat(Doc.nest(Doc.vsep(lines), 2)), + Doc.cat(Doc.space), + Doc.cat(trailingSymbol), + Doc.cat(Doc.space), + Doc.cat(confirm) + ) + } + }) } const renderNextFrame = ( @@ -67,9 +64,9 @@ const renderNextFrame = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(prevState, options, terminal.columns) - const leadingSymbol = Doc.annotate(Doc.text("?"), AnsiStyle.color(Color.cyan)) - const trailingSymbol = Doc.annotate(figures.pointerSmall, AnsiStyle.color(Color.black)) - const confirmAnnotation = AnsiStyle.color(Color.black) + const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyan) + const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.black) + const confirmAnnotation = Ansi.black // Marking these explicitly as present with `!` because they always will be // and there is really no value in adding a `DeepRequired` type helper just // for these internal cases @@ -80,10 +77,10 @@ const renderNextFrame = ( const promptMsg = renderOutput(confirm, leadingSymbol, trailingSymbol, options) return pipe( clearScreen, - Doc.cat(InternalAnsiUtils.cursorHide), + Doc.cat(Doc.cursorHide), Doc.cat(promptMsg), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -96,8 +93,8 @@ const renderSubmission = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(Option.some(nextState), options, terminal.columns) - const leadingSymbol = Doc.annotate(figures.tick, AnsiStyle.color(Color.green)) - const trailingSymbol = Doc.annotate(figures.ellipsis, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(figures.tick, Ansi.green) + const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.black) const confirmMessage = value ? options.label.confirm : options.label.deny const confirm = Doc.text(confirmMessage) const promptMsg = renderOutput(confirm, leadingSymbol, trailingSymbol, options) @@ -106,7 +103,7 @@ const renderSubmission = ( Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) diff --git a/src/internal/prompt/date.ts b/src/internal/prompt/date.ts index ba149e6..0f3bf2d 100644 --- a/src/internal/prompt/date.ts +++ b/src/internal/prompt/date.ts @@ -1,9 +1,6 @@ import * as Terminal from "@effect/platform/Terminal" -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" -import * as Color from "@effect/printer-ansi/Color" -import * as Doc from "@effect/printer/Doc" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Optimize from "@effect/printer/Optimize" import * as Effect from "effect/Effect" import { pipe } from "effect/Function" @@ -23,48 +20,45 @@ interface State { readonly error: Option.Option } -const renderBeep = AnsiRender.prettyDefault(InternalAnsiUtils.beep) +const renderBeep = Doc.render(Doc.beep, { style: "pretty" }) const renderClearScreen = ( prevState: Option.Option, options: Required, columns: number -): AnsiDoc.AnsiDoc => { - const clearPrompt = Doc.cat(InternalAnsiUtils.eraseLine, InternalAnsiUtils.cursorLeft) +): Doc.AnsiDoc => { + const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft) if (Option.isNone(prevState)) { - return clearPrompt + return resetCurrentLine } const clearError = Option.match(prevState.value.error, { onNone: () => Doc.empty, onSome: (error) => pipe( - InternalAnsiUtils.cursorDown(InternalAnsiUtils.lines(error, columns)), + Doc.cursorDown(InternalAnsiUtils.lines(error, columns)), Doc.cat(InternalAnsiUtils.eraseText(`\n${error}`, columns)) ) }) const clearOutput = InternalAnsiUtils.eraseText(options.message, columns) - return Doc.cat(clearError, Doc.cat(clearOutput, clearPrompt)) + return Doc.cat(clearError, Doc.cat(clearOutput, resetCurrentLine)) } -const renderError = (nextState: State, pointer: AnsiDoc.AnsiDoc): AnsiDoc.AnsiDoc => +const renderError = (nextState: State, pointer: Doc.AnsiDoc): Doc.AnsiDoc => Option.match(nextState.error, { onNone: () => Doc.empty, onSome: (error) => { const errorLines = error.split(/\r?\n/) if (ReadonlyArray.isNonEmptyReadonlyArray(errorLines)) { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate( - Doc.text(line), - AnsiStyle.combine(AnsiStyle.italicized, AnsiStyle.color(Color.red)) - ) - const prefix = Doc.cat(Doc.annotate(pointer, AnsiStyle.color(Color.red)), Doc.space) + const annotateLine = (line: string): Doc.AnsiDoc => + Doc.annotate(Doc.text(line), Ansi.combine(Ansi.italicized, Ansi.red)) + const prefix = Doc.cat(Doc.annotate(pointer, Ansi.red), Doc.space) const lines = ReadonlyArray.map(errorLines, (str) => annotateLine(str)) return pipe( - InternalAnsiUtils.cursorSave, + Doc.cursorSavePosition, Doc.cat(Doc.hardLine), Doc.cat(prefix), Doc.cat(Doc.align(Doc.vsep(lines))), - Doc.cat(InternalAnsiUtils.cursorRestore) + Doc.cat(Doc.cursorRestorePosition) ) } return Doc.empty @@ -74,11 +68,11 @@ const renderError = (nextState: State, pointer: AnsiDoc.AnsiDoc): AnsiDoc.AnsiDo const renderParts = (nextState: State, submitted: boolean = false) => ReadonlyArray.reduce( nextState.dateParts, - Doc.empty as AnsiDoc.AnsiDoc, + Doc.empty as Doc.AnsiDoc, (doc, part, currentIndex) => { const partDoc = Doc.text(part.toString()) if (currentIndex === nextState.cursor && !submitted) { - const annotation = AnsiStyle.combine(AnsiStyle.underlined, AnsiStyle.color(Color.cyan)) + const annotation = Ansi.combine(Ansi.underlined, Ansi.cyan) return Doc.cat(doc, Doc.annotate(partDoc, annotation)) } return Doc.cat(doc, partDoc) @@ -86,28 +80,27 @@ const renderParts = (nextState: State, submitted: boolean = false) => ) const renderOutput = ( - nextState: State, - leadingSymbol: AnsiDoc.AnsiDoc, - trailingSymbol: AnsiDoc.AnsiDoc, - parts: AnsiDoc.AnsiDoc, + leadingSymbol: Doc.AnsiDoc, + trailingSymbol: Doc.AnsiDoc, + parts: Doc.AnsiDoc, options: Required -): AnsiDoc.AnsiDoc => { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate(Doc.text(line), AnsiStyle.bold) - const promptLines = options.message.split(/\r?\n/) +): Doc.AnsiDoc => { + const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold) const prefix = Doc.cat(leadingSymbol, Doc.space) - if (ReadonlyArray.isNonEmptyReadonlyArray(promptLines)) { - const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) - return pipe( - prefix, - Doc.cat(Doc.nest(Doc.vsep(lines), 2)), - Doc.cat(Doc.space), - Doc.cat(trailingSymbol), - Doc.cat(Doc.space), - Doc.cat(parts) - ) - } - return Doc.hsep([prefix, trailingSymbol, parts]) + return ReadonlyArray.match(options.message.split(/\r?\n/), { + onEmpty: () => Doc.hsep([prefix, trailingSymbol, parts]), + onNonEmpty: (promptLines) => { + const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) + return pipe( + prefix, + Doc.cat(Doc.nest(Doc.vsep(lines), 2)), + Doc.cat(Doc.space), + Doc.cat(trailingSymbol), + Doc.cat(Doc.space), + Doc.cat(parts) + ) + } + }) } const renderNextFrame = ( @@ -119,18 +112,18 @@ const renderNextFrame = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(prevState, options, terminal.columns) - const leadingSymbol = Doc.annotate(Doc.text("?"), AnsiStyle.color(Color.cyan)) - const trailingSymbol = Doc.annotate(figures.pointerSmall, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyan) + const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.black) const parts = renderParts(nextState) - const promptMsg = renderOutput(nextState, leadingSymbol, trailingSymbol, parts, options) + const promptMsg = renderOutput(leadingSymbol, trailingSymbol, parts, options) const errorMsg = renderError(nextState, figures.pointerSmall) return pipe( clearScreen, - Doc.cat(InternalAnsiUtils.cursorHide), + Doc.cat(Doc.cursorHide), Doc.cat(promptMsg), Doc.cat(errorMsg), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -139,16 +132,16 @@ const renderSubmission = (nextState: State, options: Required, options: Required, columns: number -): AnsiDoc.AnsiDoc => { - // Erase the main prompt line and place the cursor in column one - const clearPrompt = Doc.cat(InternalAnsiUtils.eraseLine, InternalAnsiUtils.cursorLeft) - // If there is no previous state, then this is the first render, so there is - // no need to clear the error output or any previous prompt output - we can - // just clear the current line for the prompt +): Doc.AnsiDoc => { + const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft) if (Option.isNone(prevState)) { - return clearPrompt + return resetCurrentLine } - // If there was a previous state, check for any error output const clearError = Option.match(prevState.value.error, { onNone: () => Doc.empty, onSome: (error) => - // If there was an error, move the cursor down to the final error line and - // then clear all lines of error output pipe( - InternalAnsiUtils.cursorDown(InternalAnsiUtils.lines(error, columns)), + Doc.cursorDown(InternalAnsiUtils.lines(error, columns)), Doc.cat(InternalAnsiUtils.eraseText(`\n${error}`, columns)) ) }) - // Ensure that the prior prompt output is cleaned up const clearOutput = InternalAnsiUtils.eraseText(options.message, columns) - // Concatenate and return all documents - return Doc.cat(clearError, Doc.cat(clearOutput, clearPrompt)) + return Doc.cat(clearError, Doc.cat(clearOutput, resetCurrentLine)) } -const renderInput = (nextState: State): AnsiDoc.AnsiDoc => { +const renderInput = (nextState: State): Doc.AnsiDoc => { const annotation = Option.match(nextState.error, { - onNone: () => AnsiStyle.combine(AnsiStyle.underlined, AnsiStyle.color(Color.green)), - onSome: () => AnsiStyle.color(Color.red) + onNone: () => Ansi.combine(Ansi.underlined, Ansi.green), + onSome: () => Ansi.red }) const value = nextState.value === "" ? Doc.empty : Doc.text(`${nextState.value}`) return Doc.annotate(value, annotation) } -const renderError = (nextState: State, pointer: AnsiDoc.AnsiDoc): AnsiDoc.AnsiDoc => +const renderError = (nextState: State, pointer: Doc.AnsiDoc): Doc.AnsiDoc => Option.match(nextState.error, { onNone: () => Doc.empty, - onSome: (error) => { - const errorLines = error.split(/\r?\n/) - if (ReadonlyArray.isNonEmptyReadonlyArray(errorLines)) { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate( - Doc.text(line), - AnsiStyle.combine(AnsiStyle.italicized, AnsiStyle.color(Color.red)) + onSome: (error) => + ReadonlyArray.match(error.split(/\r?\n/), { + onEmpty: () => Doc.empty, + onNonEmpty: (errorLines) => { + const annotateLine = (line: string): Doc.AnsiDoc => + Doc.annotate(Doc.text(line), Ansi.combine(Ansi.italicized, Ansi.red)) + const prefix = Doc.cat(Doc.annotate(pointer, Ansi.red), Doc.space) + const lines = ReadonlyArray.map(errorLines, (str) => annotateLine(str)) + return pipe( + Doc.cursorSavePosition, + Doc.cat(Doc.hardLine), + Doc.cat(prefix), + Doc.cat(Doc.align(Doc.vsep(lines))), + Doc.cat(Doc.cursorRestorePosition) ) - const prefix = Doc.cat(Doc.annotate(pointer, AnsiStyle.color(Color.red)), Doc.space) - const lines = ReadonlyArray.map(errorLines, (str) => annotateLine(str)) - return pipe( - InternalAnsiUtils.cursorSave, - Doc.cat(Doc.hardLine), - Doc.cat(prefix), - Doc.cat(Doc.align(Doc.vsep(lines))), - Doc.cat(InternalAnsiUtils.cursorRestore) - ) - } - return Doc.empty - } + } + }) }) const renderOutput = ( nextState: State, - leadingSymbol: AnsiDoc.AnsiDoc, - trailingSymbol: AnsiDoc.AnsiDoc, + leadingSymbol: Doc.AnsiDoc, + trailingSymbol: Doc.AnsiDoc, options: Required -): AnsiDoc.AnsiDoc => { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate(Doc.text(line), AnsiStyle.bold) - const promptLines = options.message.split(/\r?\n/) +): Doc.AnsiDoc => { + const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold) const prefix = Doc.cat(leadingSymbol, Doc.space) - if (ReadonlyArray.isNonEmptyReadonlyArray(promptLines)) { - const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) - return pipe( - prefix, - Doc.cat(Doc.nest(Doc.vsep(lines), 2)), - Doc.cat(Doc.space), - Doc.cat(trailingSymbol), - Doc.cat(Doc.space), - Doc.cat(renderInput(nextState)) - ) - } - return Doc.hsep([prefix, trailingSymbol, renderInput(nextState)]) + return ReadonlyArray.match(options.message.split(/\r?\n/), { + onEmpty: () => Doc.hsep([prefix, trailingSymbol, renderInput(nextState)]), + onNonEmpty: (promptLines) => { + const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) + return pipe( + prefix, + Doc.cat(Doc.nest(Doc.vsep(lines), 2)), + Doc.cat(Doc.space), + Doc.cat(trailingSymbol), + Doc.cat(Doc.space), + Doc.cat(renderInput(nextState)) + ) + } + }) } const renderNextFrame = ( @@ -132,8 +117,8 @@ const renderNextFrame = ( Effect.gen(function*(_) { const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) - const leadingSymbol = Doc.annotate(Doc.text("?"), AnsiStyle.color(Color.cyan)) - const trailingSymbol = Doc.annotate(figures.pointerSmall, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyan) + const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.black) const clearScreen = renderClearScreen(prevState, options, terminal.columns) const errorMsg = renderError(nextState, figures.pointerSmall) const promptMsg = renderOutput(nextState, leadingSymbol, trailingSymbol, options) @@ -142,7 +127,7 @@ const renderNextFrame = ( Doc.cat(promptMsg), Doc.cat(errorMsg), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -154,15 +139,15 @@ const renderSubmission = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(Option.some(nextState), options, terminal.columns) - const leadingSymbol = Doc.annotate(figures.tick, AnsiStyle.color(Color.green)) - const trailingSymbol = Doc.annotate(figures.ellipsis, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(figures.tick, Ansi.green) + const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.black) const promptMsg = renderOutput(nextState, leadingSymbol, trailingSymbol, options) return pipe( clearScreen, Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) diff --git a/src/internal/prompt/select.ts b/src/internal/prompt/select.ts index 6f4bea6..eba7dc1 100644 --- a/src/internal/prompt/select.ts +++ b/src/internal/prompt/select.ts @@ -1,9 +1,6 @@ import * as Terminal from "@effect/platform/Terminal" -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" -import * as Color from "@effect/printer-ansi/Color" -import * as Doc from "@effect/printer/Doc" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Effect from "effect/Effect" import { pipe } from "effect/Function" import * as Option from "effect/Option" @@ -18,18 +15,18 @@ interface State { readonly cursor: number } -const renderBeep = AnsiRender.prettyDefault(InternalAnsiUtils.beep) +const renderBeep = Doc.render(Doc.beep, { style: "pretty" }) const renderClearScreen = ( prevState: Option.Option, - options: Prompt.Prompt.SelectOptions, + options: Required>, columns: number -): AnsiDoc.AnsiDoc => { - const clearPrompt = Doc.cat(InternalAnsiUtils.eraseLine, InternalAnsiUtils.cursorLeft) +): Doc.AnsiDoc => { + const clearPrompt = Doc.cat(Doc.eraseLine, Doc.cursorLeft) if (Option.isNone(prevState)) { return clearPrompt } - const text = "\n".repeat(options.choices.length) + options.message + const text = "\n".repeat(Math.min(options.choices.length, options.maxPerPage)) + options.message const clearOutput = InternalAnsiUtils.eraseText(text, columns) return Doc.cat(clearOutput, clearPrompt) } @@ -40,58 +37,51 @@ const renderChoicePrefix = ( toDisplay: { readonly startIndex: number; readonly endIndex: number }, currentIndex: number, figures: Effect.Effect.Success -): AnsiDoc.AnsiDoc => { - let prefix: AnsiDoc.AnsiDoc = Doc.space +): Doc.AnsiDoc => { + let prefix: Doc.AnsiDoc = Doc.space if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) { prefix = figures.arrowUp } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < choices.length) { prefix = figures.arrowDown } - if (choices[currentIndex]!.disabled) { - const annotation = AnsiStyle.combine(AnsiStyle.bold, AnsiStyle.color(Color.black)) + if (choices[currentIndex].disabled) { + const annotation = Ansi.combine(Ansi.bold, Ansi.black) return nextState.cursor === currentIndex - ? pipe( - Doc.annotate(figures.pointer, annotation), - Doc.cat(prefix) - ) - : Doc.cat(Doc.space, prefix) + ? pipe(figures.pointer, Doc.annotate(annotation), Doc.cat(prefix)) + : pipe(prefix, Doc.cat(Doc.space)) } return nextState.cursor === currentIndex - ? pipe( - Doc.annotate(figures.pointer, AnsiStyle.color(Color.green)), - Doc.cat(prefix) - ) - : Doc.cat(Doc.space, prefix) + ? pipe(figures.pointer, Doc.annotate(Ansi.green), Doc.cat(prefix)) + : pipe(prefix, Doc.cat(Doc.space)) } const renderChoiceTitle = ( choice: Prompt.Prompt.SelectChoice, isSelected: boolean -): AnsiDoc.AnsiDoc => { +): Doc.AnsiDoc => { const title = Doc.text(choice.title) - const blackUnderlined = AnsiStyle.combine(AnsiStyle.underlined, AnsiStyle.color(Color.black)) - const greenUnderlined = AnsiStyle.combine(AnsiStyle.underlined, AnsiStyle.color(Color.green)) + const disabledAnnotation = Ansi.combine(Ansi.strikethrough, Ansi.black) + const selectedAnnotaion = Ansi.combine(Ansi.underlined, Ansi.green) if (isSelected) { return choice.disabled - ? Doc.annotate(title, blackUnderlined) - : Doc.annotate(title, greenUnderlined) + ? Doc.annotate(title, disabledAnnotation) + : Doc.annotate(title, selectedAnnotaion) } return choice.disabled - // TODO: strikethrough in printer? - ? Doc.annotate(title, blackUnderlined) + ? Doc.annotate(title, disabledAnnotation) : title } const renderChoiceDescription = ( choice: Prompt.Prompt.SelectChoice, isSelected: boolean -): AnsiDoc.AnsiDoc => { +): Doc.AnsiDoc => { if (!choice.disabled && choice.description && isSelected) { return pipe( Doc.char("-"), Doc.cat(Doc.space), Doc.cat(Doc.text(choice.description)), - Doc.annotate(AnsiStyle.color(Color.black)) + Doc.annotate(Ansi.black) ) } return Doc.empty @@ -101,7 +91,7 @@ const renderChoices = ( nextState: State, options: Prompt.Prompt.SelectOptions, figures: Effect.Effect.Success -): AnsiDoc.AnsiDoc => { +): Doc.AnsiDoc => { const choices = options.choices const toDisplay = entriesToDisplay(nextState.cursor, choices.length, options.maxPerPage) const choicesToRender = choices.slice(toDisplay.startIndex, toDisplay.endIndex) @@ -115,25 +105,25 @@ const renderChoices = ( } const renderOutput = ( - leadingSymbol: AnsiDoc.AnsiDoc, - trailingSymbol: AnsiDoc.AnsiDoc, + leadingSymbol: Doc.AnsiDoc, + trailingSymbol: Doc.AnsiDoc, options: Required> -): AnsiDoc.AnsiDoc => { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate(Doc.text(line), AnsiStyle.bold) - const promptLines = options.message.split(/\r?\n/) +): Doc.AnsiDoc => { + const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold) const prefix = Doc.cat(leadingSymbol, Doc.space) - if (ReadonlyArray.isNonEmptyReadonlyArray(promptLines)) { - const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) - return pipe( - prefix, - Doc.cat(Doc.nest(Doc.vsep(lines), 2)), - Doc.cat(Doc.space), - Doc.cat(trailingSymbol), - Doc.cat(Doc.space) - ) - } - return Doc.hsep([prefix, trailingSymbol]) + return ReadonlyArray.match(options.message.split(/\r?\n/), { + onEmpty: () => Doc.hsep([prefix, trailingSymbol]), + onNonEmpty: (promptLines) => { + const lines = ReadonlyArray.map(promptLines, (line) => annotateLine(line)) + return pipe( + prefix, + Doc.cat(Doc.nest(Doc.vsep(lines), 2)), + Doc.cat(Doc.space), + Doc.cat(trailingSymbol), + Doc.cat(Doc.space) + ) + } + }) } const renderNextFrame = ( @@ -146,18 +136,16 @@ const renderNextFrame = ( const figures = yield* _(InternalAnsiUtils.figures) const choices = renderChoices(nextState, options, figures) const clearScreen = renderClearScreen(prevState, options, terminal.columns) - const leadingSymbol = Doc.annotate(Doc.text("?"), AnsiStyle.color(Color.cyan)) - const trailingSymbol = Doc.annotate(figures.pointerSmall, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyan) + const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.black) const promptMsg = renderOutput(leadingSymbol, trailingSymbol, options) return pipe( clearScreen, - Doc.cat(InternalAnsiUtils.cursorHide), + Doc.cat(Doc.cursorHide), Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Doc.cat(choices), - // TODO: figure out what the bug is here that screws up formatting - // Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -170,18 +158,16 @@ const renderSubmission = ( const figures = yield* _(InternalAnsiUtils.figures) const selected = Doc.text(options.choices[state.cursor].title) const clearScreen = renderClearScreen(Option.some(state), options, terminal.columns) - const leadingSymbol = Doc.annotate(figures.tick, AnsiStyle.color(Color.green)) - const trailingSymbol = Doc.annotate(figures.ellipsis, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(figures.tick, Ansi.green) + const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.black) const promptMsg = renderOutput(leadingSymbol, trailingSymbol, options) return pipe( clearScreen, Doc.cat(promptMsg), Doc.cat(Doc.space), - Doc.cat(Doc.annotate(selected, AnsiStyle.color(Color.white))), + Doc.cat(Doc.annotate(selected, Ansi.white)), Doc.cat(Doc.hardLine), - // TODO: figure out what the bug is here that screws up formatting - // Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -240,7 +226,11 @@ export const select = (options: Prompt.Prompt.SelectOptions): Prompt.Promp } case "enter": case "return": { - return Effect.succeed(InternalPromptAction.submit(opts.choices[state.cursor].value)) + const selected = opts.choices[state.cursor] + if (selected.disabled) { + return Effect.succeed(InternalPromptAction.beep) + } + return Effect.succeed(InternalPromptAction.submit(selected.value)) } default: { return Effect.succeed(InternalPromptAction.beep) diff --git a/src/internal/prompt/text.ts b/src/internal/prompt/text.ts index 129fddd..75de64d 100644 --- a/src/internal/prompt/text.ts +++ b/src/internal/prompt/text.ts @@ -1,9 +1,6 @@ import * as Terminal from "@effect/platform/Terminal" -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" -import * as Color from "@effect/printer-ansi/Color" -import * as Doc from "@effect/printer/Doc" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Optimize from "@effect/printer/Optimize" import * as Effect from "effect/Effect" import { pipe } from "effect/Function" @@ -21,20 +18,20 @@ interface State { readonly error: Option.Option } -const renderBeep = AnsiRender.prettyDefault(InternalAnsiUtils.beep) +const renderBeep = Doc.render(Doc.beep, { style: "pretty" }) const renderClearScreen = ( prevState: Option.Option, options: Required, columns: number -): AnsiDoc.AnsiDoc => { - // Erase the main prompt line and place the cursor in column one - const clearPrompt = Doc.cat(InternalAnsiUtils.eraseLine, InternalAnsiUtils.cursorLeft) +): Doc.AnsiDoc => { + // Erase the current line and place the cursor in column one + const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft) // If there is no previous state, then this is the first render, so there is // no need to clear the error output or any previous prompt output - we can // just clear the current line for the prompt if (Option.isNone(prevState)) { - return clearPrompt + return resetCurrentLine } // If there was a previous state, check for any error output const clearError = Option.match(prevState.value.error, { @@ -43,27 +40,26 @@ const renderClearScreen = ( // If there was an error, move the cursor down to the final error line and // then clear all lines of error output pipe( - InternalAnsiUtils.cursorDown(InternalAnsiUtils.lines(error, columns)), + Doc.cursorDown(InternalAnsiUtils.lines(error, columns)), + // Add a leading newline to the error message to ensure that the corrrect + // number of error lines are erased Doc.cat(InternalAnsiUtils.eraseText(`\n${error}`, columns)) ) }) // Ensure that the prior prompt output is cleaned up const clearOutput = InternalAnsiUtils.eraseText(options.message, columns) // Concatenate and return all documents - return Doc.cat(clearError, Doc.cat(clearOutput, clearPrompt)) + return Doc.cat(clearError, Doc.cat(clearOutput, resetCurrentLine)) } const renderInput = ( nextState: State, options: Required, submitted: boolean = false -): AnsiDoc.AnsiDoc => { +): Doc.AnsiDoc => { const annotation = Option.match(nextState.error, { - onNone: () => - submitted - ? AnsiStyle.color(Color.white) - : AnsiStyle.combine(AnsiStyle.underlined, AnsiStyle.color(Color.green)), - onSome: () => AnsiStyle.color(Color.red) + onNone: () => submitted ? Ansi.white : Ansi.combine(Ansi.underlined, Ansi.green), + onSome: () => Ansi.red }) switch (options.type) { case "hidden": { @@ -78,39 +74,38 @@ const renderInput = ( } } -const renderError = (nextState: State, pointer: AnsiDoc.AnsiDoc): AnsiDoc.AnsiDoc => +const renderError = (nextState: State, pointer: Doc.AnsiDoc): Doc.AnsiDoc => Option.match(nextState.error, { onNone: () => Doc.empty, - onSome: (error) => { - const errorLines = error.split(/\r?\n/) - if (ReadonlyArray.isNonEmptyReadonlyArray(errorLines)) { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate( - Doc.text(line), - AnsiStyle.combine(AnsiStyle.italicized, AnsiStyle.color(Color.red)) + onSome: (error) => + ReadonlyArray.match(error.split(/\r?\n/), { + onEmpty: () => Doc.empty, + onNonEmpty: (errorLines) => { + const annotateLine = (line: string): Doc.AnsiDoc => + pipe( + Doc.text(line), + Doc.annotate(Ansi.combine(Ansi.italicized, Ansi.red)) + ) + const prefix = Doc.cat(Doc.annotate(pointer, Ansi.red), Doc.space) + const lines = ReadonlyArray.map(errorLines, (str) => annotateLine(str)) + return pipe( + Doc.cursorSavePosition, + Doc.cat(Doc.hardLine), + Doc.cat(prefix), + Doc.cat(Doc.align(Doc.vsep(lines))), + Doc.cat(Doc.cursorRestorePosition) ) - const prefix = Doc.cat(Doc.annotate(pointer, AnsiStyle.color(Color.red)), Doc.space) - const lines = ReadonlyArray.map(errorLines, (str) => annotateLine(str)) - return pipe( - InternalAnsiUtils.cursorSave, - Doc.cat(Doc.hardLine), - Doc.cat(prefix), - Doc.cat(Doc.align(Doc.vsep(lines))), - Doc.cat(InternalAnsiUtils.cursorRestore) - ) - } - return Doc.empty - } + } + }) }) const renderOutput = ( nextState: State, - leadingSymbol: AnsiDoc.AnsiDoc, - trailingSymbol: AnsiDoc.AnsiDoc, + leadingSymbol: Doc.AnsiDoc, + trailingSymbol: Doc.AnsiDoc, options: Required -): AnsiDoc.AnsiDoc => { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate(Doc.text(line), AnsiStyle.bold) +): Doc.AnsiDoc => { + const annotateLine = (line: string): Doc.AnsiDoc => pipe(Doc.text(line), Doc.annotate(Ansi.bold)) const promptLines = options.message.split(/\r?\n/) const prefix = Doc.cat(leadingSymbol, Doc.space) if (ReadonlyArray.isNonEmptyReadonlyArray(promptLines)) { @@ -136,17 +131,17 @@ const renderNextFrame = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(prevState, options, terminal.columns) - const leadingSymbol = Doc.annotate(Doc.text("?"), AnsiStyle.color(Color.cyan)) - const trailingSymbol = Doc.annotate(figures.pointerSmall, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyan) + const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.black) const promptMsg = renderOutput(nextState, leadingSymbol, trailingSymbol, options) const errorMsg = renderError(nextState, figures.pointerSmall) return pipe( clearScreen, Doc.cat(promptMsg), Doc.cat(errorMsg), - Doc.cat(InternalAnsiUtils.cursorMove(nextState.offset)), + Doc.cat(Doc.cursorMove(nextState.offset)), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -158,15 +153,15 @@ const renderSubmission = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(Option.some(nextState), options, terminal.columns) - const leadingSymbol = Doc.annotate(figures.tick, AnsiStyle.color(Color.green)) - const trailingSymbol = Doc.annotate(figures.ellipsis, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(figures.tick, Ansi.green) + const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.black) const promptMsg = renderOutput(nextState, leadingSymbol, trailingSymbol, options) return pipe( clearScreen, Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) diff --git a/src/internal/prompt/toggle.ts b/src/internal/prompt/toggle.ts index 7348ee7..f8738e4 100644 --- a/src/internal/prompt/toggle.ts +++ b/src/internal/prompt/toggle.ts @@ -1,9 +1,6 @@ import * as Terminal from "@effect/platform/Terminal" -import type * as AnsiDoc from "@effect/printer-ansi/AnsiDoc" -import * as AnsiRender from "@effect/printer-ansi/AnsiRender" -import * as AnsiStyle from "@effect/printer-ansi/AnsiStyle" -import * as Color from "@effect/printer-ansi/Color" -import * as Doc from "@effect/printer/Doc" +import * as Ansi from "@effect/printer-ansi/Ansi" +import * as Doc from "@effect/printer-ansi/AnsiDoc" import * as Optimize from "@effect/printer/Optimize" import * as Effect from "effect/Effect" import { pipe } from "effect/Function" @@ -18,14 +15,14 @@ interface State { readonly value: boolean } -const renderBeep = AnsiRender.prettyDefault(InternalAnsiUtils.beep) +const renderBeep = Doc.render(Doc.beep, { style: "pretty" }) const renderClearScreen = ( prevState: Option.Option, options: Required, columns: number -): AnsiDoc.AnsiDoc => { - const clearPrompt = Doc.cat(InternalAnsiUtils.eraseLine, InternalAnsiUtils.cursorLeft) +): Doc.AnsiDoc => { + const clearPrompt = Doc.cat(Doc.eraseLine, Doc.cursorLeft) if (Option.isNone(prevState)) { return clearPrompt } @@ -34,8 +31,8 @@ const renderClearScreen = ( } const renderToggle = (value: boolean, options: Required) => { - const separator = Doc.annotate(Doc.char("/"), AnsiStyle.color(Color.black)) - const selectedAnnotation = AnsiStyle.combine(AnsiStyle.underlined, AnsiStyle.color(Color.cyan)) + const separator = pipe(Doc.char("/"), Doc.annotate(Ansi.black)) + const selectedAnnotation = Ansi.combine(Ansi.underlined, Ansi.cyan) const inactive = value ? Doc.text(options.inactive) : Doc.annotate(Doc.text(options.inactive), selectedAnnotation) @@ -46,13 +43,12 @@ const renderToggle = (value: boolean, options: Required -): AnsiDoc.AnsiDoc => { - const annotateLine = (line: string): AnsiDoc.AnsiDoc => - Doc.annotate(Doc.text(line), AnsiStyle.bold) +): Doc.AnsiDoc => { + const annotateLine = (line: string): Doc.AnsiDoc => pipe(Doc.text(line), Doc.annotate(Ansi.bold)) const promptLines = options.message.split(/\r?\n/) const prefix = Doc.cat(leadingSymbol, Doc.space) if (ReadonlyArray.isNonEmptyReadonlyArray(promptLines)) { @@ -78,16 +74,16 @@ const renderNextFrame = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(prevState, options, terminal.columns) - const leadingSymbol = Doc.annotate(Doc.text("?"), AnsiStyle.color(Color.cyan)) - const trailingSymbol = Doc.annotate(figures.pointerSmall, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyan) + const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.black) const toggle = renderToggle(nextState.value, options) const promptMsg = renderOutput(toggle, leadingSymbol, trailingSymbol, options) return pipe( clearScreen, - Doc.cat(InternalAnsiUtils.cursorHide), + Doc.cat(Doc.cursorHide), Doc.cat(promptMsg), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) }) @@ -100,8 +96,8 @@ const renderSubmission = ( const terminal = yield* _(Terminal.Terminal) const figures = yield* _(InternalAnsiUtils.figures) const clearScreen = renderClearScreen(Option.some(nextState), options, terminal.columns) - const leadingSymbol = Doc.annotate(figures.tick, AnsiStyle.color(Color.green)) - const trailingSymbol = Doc.annotate(figures.ellipsis, AnsiStyle.color(Color.black)) + const leadingSymbol = Doc.annotate(figures.tick, Ansi.green) + const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.black) const toggle = renderToggle(value, options) const promptMsg = renderOutput(toggle, leadingSymbol, trailingSymbol, options) return pipe( @@ -109,7 +105,7 @@ const renderSubmission = ( Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), - AnsiRender.prettyDefault + Doc.render({ style: "pretty" }) ) })