Uh oh!
There was an error while loading. Please reload this page.
feat: add console grouping (group, groupCollapsed, groupEnd, grouped) - #7
Merged
Unisay merged 1 commit intoJul 14, 2026
Merged
Conversation
Upstream purescript-console v6.1.0 exports group, groupCollapsed and groupEnd; the fork had none of them, so code written against the registry package failed to compile against the fork. A terminal has no collapsible groups, so the Lua FFI approximates the JS semantics with an indentation level: group/groupCollapsed print their label and indent subsequent console output by two spaces per open group; groupEnd closes the innermost group and is a no-op at level zero. grouped and the MonadEffect versions in Effect.Class.Console mirror upstream verbatim, and the inherited upstream Console.js gains the same exports to stay a faithful mirror. Extends the regression guard to pin the chosen output behaviour. Closespurescript-lua/purescript-lua#268
There was a problem hiding this comment.
Pull request overview
Adds missing console grouping APIs to this PureScript→Lua fork to match upstream purescript-console v6.1.0, preventing downstream code (written against the registry package) from failing to compile. Since terminals don’t support collapsible console groups, the Lua FFI implements grouping via a shared indentation level across console output.
Changes:
- Add
group,groupCollapsed,groupEnd, andgroupedtoEffect.ConsoleandEffect.Class.Console. - Implement Lua-side grouping via indentation and update all console outputs (stdout/stderr) to respect the current indentation level.
- Add a regression test covering grouping semantics and document the change via a changelog fragment.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/regression/console.lua | Adds regression coverage for grouping output/indent behavior (stdout + stderr) and groupEnd at level 0 being a no-op. |
| src/Effect/Console.purs | Exposes new foreign imports (group*) and adds grouped helper in Effect. |
| src/Effect/Console.lua | Implements grouping via indentation and applies indentation consistently to log/warn/error/info/debug. |
| src/Effect/Console.js | Adds upstream-parity JS exports for group, groupCollapsed, groupEnd. |
| src/Effect/Class/Console.purs | Adds MonadEffect-lifted counterparts plus grouped. |
| changelog.d/20260713_120000_yura_group.md | Documents the addition and Lua-specific grouping semantics. |
| .gitignore | Ignores /dist/ artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closespurescript-lua/purescript-lua#268.
Upstream purescript-console v6.1.0 exports
group,groupCollapsedandgroupEnd; the fork had none of them, so code written against the registry package failed to compile against the fork.A terminal has no collapsible groups, so the Lua FFI approximates the JS semantics with an indentation level:
group/groupCollapsedprint their label and indent subsequent console output by two spaces per open group;groupEndcloses the innermost group and is a no-op at level zero.groupedand theMonadEffectversions inEffect.Class.Consolemirror upstream verbatim, and the inherited upstreamConsole.jsgains the same exports so it keeps matching its upstream counterpart.The regression guard (
test/regression/console.lua) pins the chosen output behaviour: label printed at the current indent, two spaces per open group on stdout and stderr alike,groupCollapsed=group, andgroupEndwithout an open group staying a no-op. The whole path is verified:spago buildand the pslua link succeed, and the linked module prints the expected indented output.Follow-up (not in this PR): console fork patch release, then a package-set bump.