From 0917c02d40aa0138b0f2984f26ee0f2249d363e1 Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Thu, 5 Mar 2026 12:42:03 +0100 Subject: [PATCH 1/2] Update elm-pages --- bun.lock | 8 ++++---- cli/elm.json | 5 ++--- package.json | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bun.lock b/bun.lock index 7a8ccd2f..b0b03bf3 100644 --- a/bun.lock +++ b/bun.lock @@ -11,7 +11,7 @@ "elm-codegen": "^0.6.3", "elm-format": "0.8.7", "elm-optimize-level-2": "0.3.5", - "elm-pages": "^3.1.1", + "elm-pages": "^3.2.0", "elm-review": "^2.13.5", "elm-test": "^0.19.1-revision17", "lamdera": "^0.19.1-1.4.0", @@ -458,7 +458,7 @@ "destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="], - "devcert": ["devcert@1.2.2", "", { "dependencies": { "@types/configstore": "^2.1.1", "@types/debug": "^0.0.30", "@types/get-port": "^3.2.0", "@types/glob": "^5.0.34", "@types/lodash": "^4.14.92", "@types/mkdirp": "^0.5.2", "@types/node": "^8.5.7", "@types/rimraf": "^2.0.2", "@types/tmp": "^0.0.33", "application-config-path": "^0.1.0", "command-exists": "^1.2.4", "debug": "^3.1.0", "eol": "^0.9.1", "get-port": "^3.2.0", "glob": "^7.1.2", "is-valid-domain": "^0.1.6", "lodash": "^4.17.4", "mkdirp": "^0.5.1", "password-prompt": "^1.0.4", "rimraf": "^2.6.2", "sudo-prompt": "^8.2.0", "tmp": "^0.0.33", "tslib": "^1.10.0" } }, "sha512-UsLqvtJGPiGwsIZnJINUnFYaWgK7CroreGRndWHZkRD58tPFr3pVbbSyHR8lbh41+azR4jKvuNZ+eCoBZGA5kA=="], + "devcert": ["devcert@1.2.3", "", { "dependencies": { "@types/configstore": "^2.1.1", "@types/debug": "^0.0.30", "@types/get-port": "^3.2.0", "@types/glob": "^5.0.34", "@types/lodash": "^4.14.92", "@types/mkdirp": "^0.5.2", "@types/node": "^8.5.7", "@types/rimraf": "^2.0.2", "@types/tmp": "^0.0.33", "application-config-path": "^0.1.0", "command-exists": "^1.2.4", "debug": "^3.1.0", "eol": "^0.9.1", "get-port": "^3.2.0", "glob": "^7.1.2", "is-valid-domain": "^0.1.6", "lodash": "^4.17.4", "mkdirp": "^0.5.1", "password-prompt": "^1.0.4", "rimraf": "^2.6.2", "sudo-prompt": "^8.2.0", "tmp": "^0.0.33", "tslib": "^1.10.0" } }, "sha512-vmLo0hDNHmZ47HED1ZiouJ7cAcamL8HY7qa9YdmCBkXxHEVtdDgT9pN/Xy3ZkcF3pFjF0sqq8WMV93HF2nmHHw=="], "diff-sequences": ["diff-sequences@27.5.1", "", {}, "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ=="], @@ -490,7 +490,7 @@ "elm-optimize-level-2": ["elm-optimize-level-2@0.3.5", "", { "dependencies": { "@types/jest": "^27.0.3", "chalk": "^4.1.0", "commander": "^6.0.0", "node-elm-compiler": "^5.0.4", "ts-union": "^2.2.1", "typescript": "^4.5.5" }, "bin": { "elm-optimize-level-2": "bin/elm-optimize-level-2" } }, "sha512-t1xl8zR9UBspdmEMuLBE/qTLP+Ew3L4PzKLhSY/PsO21HU3jZ1ULmKxDtZmJPVG4ciqsY1JSl/GFbaSdQ1sX9Q=="], - "elm-pages": ["elm-pages@3.1.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "busboy": "^1.6.0", "chokidar": "^5.0.0", "cli-cursor": "^5.0.0", "commander": "^14.0.3", "connect": "^3.7.0", "cookie-signature": "^1.2.2", "cross-spawn": "7.0.6", "devcert": "^1.2.2", "elm-doc-preview": "^6.0.1", "elm-hot": "^1.1.6", "esbuild": "^0.27.3", "fs-extra": "^11.3.3", "globby": "16.1.0", "gray-matter": "^4.0.3", "jsesc": "^3.1.0", "kleur": "^4.1.5", "make-fetch-happen": "^15.0.3", "memfs": "^4.56.10", "micromatch": "^4.0.8", "serve-static": "^2.2.1", "terser": "^5.44.1", "vite": "^7.3.1", "which": "^6.0.1" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "4.55.1" }, "bin": { "elm-pages": "generator/src/cli.js" } }, "sha512-cikCE5gjJpBjxhkcxbZUynojq/pyWvl+uGwXsWnJsyQNYYCgOY/HcNjwue8T2LlbhOQED4FTnyMSMRuY7dqDuQ=="], + "elm-pages": ["elm-pages@3.2.0", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "busboy": "^1.6.0", "chokidar": "^5.0.0", "cli-cursor": "^5.0.0", "commander": "^14.0.3", "connect": "^3.7.0", "cookie-signature": "^1.2.2", "cross-spawn": "7.0.6", "devcert": "^1.2.3", "elm-doc-preview": "^6.0.1", "elm-hot": "^1.1.6", "esbuild": "^0.27.3", "fs-extra": "^11.3.3", "globby": "16.1.1", "gray-matter": "^4.0.3", "jsesc": "^3.1.0", "kleur": "^4.1.5", "make-fetch-happen": "^15.0.3", "memfs": "^4.56.10", "micromatch": "^4.0.8", "serve-static": "^2.2.1", "terser": "^5.44.1", "vite": "^7.3.1", "which": "^6.0.1" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "4.55.1" }, "bin": { "elm-pages": "generator/src/cli.js" } }, "sha512-5Q4b4EThcr6vFcZm7gUboZSfYETiPv/pC4n7gWt//jXJ8kjvnnbnL6T7OmuAXihFkvXMsmbXGwUtOpweYCsZXw=="], "elm-review": ["elm-review@2.13.5", "", { "dependencies": { "chalk": "^4.0.0", "chokidar": "^3.5.2", "cross-spawn": "^7.0.3", "elm-solve-deps-wasm": "^1.0.2 || ^2.0.0", "fastest-levenshtein": "^1.0.16", "find-up": "^4.1.0 || ^5.0.0", "folder-hash": "^3.3.0", "got": "^11.8.5", "graceful-fs": "^4.2.11", "minimist": "^1.2.6", "ora": "^5.4.0", "path-key": "^3.1.1", "prompts": "^2.2.1", "strip-ansi": "^6.0.0", "terminal-link": "^2.1.1", "tinyglobby": "^0.2.10", "which": "^2.0.2", "wrap-ansi": "^7.0.0" }, "bin": { "elm-review": "bin/elm-review" } }, "sha512-Iw3YztGjmuGyn4nIEVOxqx+dacJialprpB0ZVrBHA0sBBOQ9+QhBaQnQ0tp0G8U8UoIAush0M7XoBqzUN1F/+A=="], @@ -634,7 +634,7 @@ "globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="], - "globby": ["globby@16.1.0", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "fast-glob": "^3.3.3", "ignore": "^7.0.5", "is-path-inside": "^4.0.0", "slash": "^5.1.0", "unicorn-magic": "^0.4.0" } }, "sha512-+A4Hq7m7Ze592k9gZRy4gJ27DrXRNnC1vPjxTt1qQxEY8RxagBkBxivkCwg7FxSTG0iLLEMaUx13oOr0R2/qcQ=="], + "globby": ["globby@16.1.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "fast-glob": "^3.3.3", "ignore": "^7.0.5", "is-path-inside": "^4.0.0", "slash": "^5.1.0", "unicorn-magic": "^0.4.0" } }, "sha512-dW7vl+yiAJSp6aCekaVnVJxurRv7DCOLyXqEG3RYMYUg7AuJ2jCqPkZTA8ooqC2vtnkaMcV5WfFBMuEnTu1OQg=="], "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], diff --git a/cli/elm.json b/cli/elm.json index c302587a..eb4aa417 100644 --- a/cli/elm.json +++ b/cli/elm.json @@ -9,7 +9,7 @@ "direct": { "MaybeJustJames/yaml": "2.1.7", "dillonkearns/elm-cli-options-parser": "4.0.0", - "dillonkearns/elm-pages": "11.0.0", + "dillonkearns/elm-pages": "12.0.2", "elm/bytes": "1.0.8", "elm/core": "1.0.5", "elm/json": "1.1.4", @@ -19,7 +19,7 @@ "json-tools/json-schema": "1.0.2", "json-tools/json-value": "1.0.1", "mdgriffith/elm-codegen": "6.0.1", - "miniBill/elm-fast-dict": "1.2.4", + "miniBill/elm-fast-dict": "1.2.5", "robinheghan/murmur3": "1.0.0", "the-sett/elm-pretty-printer": "3.3.0", "wolfadex/elm-ansi": "3.0.1", @@ -29,7 +29,6 @@ "Chadtech/elm-bool-extra": "2.4.2", "NoRedInk/elm-json-decode-pipeline": "1.0.1", "avh4/elm-color": "1.0.0", - "danfishgold/base64-bytes": "1.1.0", "danyx23/elm-mimetype": "4.0.1", "dillonkearns/elm-bcp47-language-tag": "2.0.0", "dillonkearns/elm-date-or-date-time": "2.0.0", diff --git a/package.json b/package.json index 17611426..cd1d7013 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "elm-codegen": "^0.6.3", "elm-format": "0.8.7", "elm-optimize-level-2": "0.3.5", - "elm-pages": "^3.1.1", + "elm-pages": "^3.2.0", "elm-review": "^2.13.5", "elm-test": "^0.19.1-revision17", "lamdera": "^0.19.1-1.4.0", From 9fa89d0c86aaa7a77f2a2265dc9ee527aca178c8 Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Thu, 5 Mar 2026 14:08:37 +0100 Subject: [PATCH 2/2] Remove workaround now that elm-pages handles no-tty scenarios --- cli/src/Cli.elm | 68 +++++++------------------------------------------ 1 file changed, 9 insertions(+), 59 deletions(-) diff --git a/cli/src/Cli.elm b/cli/src/Cli.elm index ea51b62f..82f9e597 100644 --- a/cli/src/Cli.elm +++ b/cli/src/Cli.elm @@ -4,8 +4,6 @@ import Ansi import Ansi.Color import Ansi.Font import BackendTask exposing (BackendTask) -import BackendTask.Custom -import BackendTask.Env import BackendTask.Extra import BackendTask.File import BackendTask.Http @@ -398,9 +396,7 @@ parseCliOptions cliOptions = type alias Step a = - ( Pages.Script.Spinner.Steps FatalError a - , BackendTask FatalError a - ) + Pages.Script.Spinner.Steps FatalError a withStep : @@ -408,15 +404,8 @@ withStep : -> (a -> BackendTask FatalError b) -> Step a -> Step b -withStep label toTask ( steps, task ) = - ( Pages.Script.Spinner.withStep label toTask steps - , task - |> BackendTask.andThen - (\input -> - Pages.Script.log label - |> BackendTask.andThen (\() -> toTask input) - ) - ) +withStep label toTask steps = + Pages.Script.Spinner.withStep label toTask steps withInnerStep : @@ -426,7 +415,7 @@ withInnerStep : -> (a -> BackendTask FatalError b) -> Step ( a, c, d ) -> Step ( b, c, d ) -withInnerStep index total label toTask ( steps, task ) = +withInnerStep index total label toTask steps = let fullLabel : String fullLabel = @@ -436,16 +425,9 @@ withInnerStep index total label toTask ( steps, task ) = combinedTask ( input, acc1, acc2 ) = toTask input |> BackendTask.map (\result -> ( result, acc1, acc2 )) in - ( Pages.Script.Spinner.withStep fullLabel + Pages.Script.Spinner.withStep fullLabel combinedTask steps - , task - |> BackendTask.andThen - (\( input, acc1, acc2 ) -> - Pages.Script.log fullLabel - |> BackendTask.andThen (\() -> combinedTask ( input, acc1, acc2 )) - ) - ) withConfig : OpenApi.Config.Config -> BackendTask FatalError () @@ -527,10 +509,8 @@ withConfig config = ) ) ( 1 - , ( Pages.Script.Spinner.steps - |> Pages.Script.Spinner.withStep "Collecting configuration" (\_ -> BackendTask.succeed ( (), [], [] )) - , Pages.Script.log "Collecting configuration" |> BackendTask.map (\() -> ( (), [], [] )) - ) + , Pages.Script.Spinner.steps + |> Pages.Script.Spinner.withStep "Collecting configuration" (\_ -> BackendTask.succeed ( (), [], [] )) ) (OpenApi.Config.inputs config) |> Tuple.second @@ -546,31 +526,11 @@ withConfig config = withStep "Format with elm-format" (onFirst attemptToFormat) ) |> withStep "Write to disk" (onFirst (writeSdkToDisk (OpenApi.Config.outputDirectory config))) - |> (\( steps, task ) -> - terminalInfo - |> BackendTask.andThen - (\{ isTTY, noColor } -> - if isTTY && not noColor then - Pages.Script.Spinner.runSteps steps - - else - task - ) - ) + |> Pages.Script.Spinner.runSteps |> BackendTask.map convertElmCodegenWarnings |> BackendTask.andThen printSuccessMessageAndWarnings -terminalInfo : BackendTask FatalError { isTTY : Bool, noColor : Bool } -terminalInfo = - BackendTask.map2 (\isTTY noColor -> { isTTY = isTTY, noColor = noColor }) - (BackendTask.Custom.run "isTTY" Json.Encode.null Json.Decode.bool - |> BackendTask.allowFatal - |> BackendTask.quiet - ) - (BackendTask.Env.get "NO_COLOR" |> BackendTask.map (\nc -> nc /= Nothing && nc /= Just "")) - - convertElmCodegenWarnings : ( List ( String, List { declaration : String, warning : String } ) , { warnings : List OpenApi.Generate.Message, requiredPackages : FastSet.Set String } @@ -806,17 +766,7 @@ convertToSwaggerAndThenDecode config input value = parseOriginal input swagger |> BackendTask.andThen mergeOverrides ) - |> (\task -> - terminalInfo - |> BackendTask.andThen - (\{ isTTY, noColor } -> - if isTTY && not noColor then - Pages.Script.Spinner.runTask "Convert Swagger to Open API" task - - else - task - ) - ) + |> Pages.Script.Spinner.runTask "Convert Swagger to Open API" |> BackendTask.andThen (\converted -> decodeOpenApiSpecOrFail { hasAttemptedToConvertFromSwagger = True } config input converted)