Skip to content

refactor(cmd): back generic execution with shellout (#20) - #34

Merged
GG-O-BP merged 1 commit into
mainfrom
refactor/shellout-command-issue-20
Sep 7, 2026
Merged

refactor(cmd): back generic execution with shellout (#20)#34
GG-O-BP merged 1 commit into
mainfrom
refactor/shellout-command-issue-20

Conversation

@GG-O-BP

@GG-O-BP GG-O-BP commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves #20 by backing generic command execution with the maintained shellout
package instead of the bespoke cmd_ffi shell wrapper, reducing custom FFI
surface while preserving the public API and cross-platform behavior.

Changes

  • Add shellout ~> 1.8.0 dependency; route cmd.exec through shellout's
    synchronous command.
  • Preserve the existing shell-command-string semantics:
    • Unix: /bin/sh -c
    • Windows: ComSpec /d /s /c
  • Keep the public contract stable:
    • cmd.exec(command:) -> Result(Nil, CommandError)
    • failures surface as CommandFailed("execute command", reason)
  • Introduce src/glendix/command.gleam (+ FFI) as the focused execution module,
    with a contract test that verifies the shellout.LetBeStdout SIGINT listener
    is cleaned up after a command completes.
  • Retain the small custom FFI only where shellout/plinth do not fit
    (Gleam warning filtering), documented in the READMEs (en/ko/ja).

Design notes

  • plinth/node/child_process was not adopted: it lacks synchronous completion,
    typed exit status, and typed stdio results needed here.
  • Bridge, watcher, experimental-native, Node/npm shims, and Rollup/WASM code are
    intentionally left as custom.

Verification

  • gleam format --check, gleam check, gleam build --warnings-as-errors,
    gleam docs build — pass
  • gleam test --runtime bun — 142 passed, no failures
  • Mechanical Gleam style + FFI export contract checks — pass
  • Repository boundary / sibling dependency direction — pass
  • ./scripts/verify.sh final (family-wide) — pass, including:
    • all standalone consumers (glendam/glendix/mendraw/mxpak)
    • all package tests
    • Glendam browser smoke/tests
    • widget .mpk build (com.glendix.family.GlendixLustreWidget)
    • Mendix full E2E — BUILD SUCCEEDED + post-boot browser smoke check
  • Dependency source contract preserved: glendix -> mendraw remains Hex;
    pushed-commit dependency check passes.

Closes #20

@GG-O-BP
GG-O-BP merged commit 0bf413d into main Sep 7, 2026
1 check passed
@GG-O-BP
GG-O-BP deleted the refactor/shellout-command-issue-20 branch September 7, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ffi] Evaluate shellout or child_process and isolate command-tooling FFI

1 participant