From 38517576eec03e650ffd2dac7f155b9b640ed16f Mon Sep 17 00:00:00 2001 From: Damian Reeves <957246+DamianReeves@users.noreply.github.com> Date: Wed, 4 Feb 2026 23:11:39 -0600 Subject: [PATCH 1/6] chore: update morphir-moonbit submodule to latest --- ecosystem/morphir-moonbit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem/morphir-moonbit b/ecosystem/morphir-moonbit index c0e2be1b..44a04d43 160000 --- a/ecosystem/morphir-moonbit +++ b/ecosystem/morphir-moonbit @@ -1 +1 @@ -Subproject commit c0e2be1be1f6accc0d5ba7c0a96316beb2bd983c +Subproject commit 44a04d432507b7cbfcd7f476a8b23b7b3de8be09 From 9ffd40666912583bc61fd930772bb588aff8d698 Mon Sep 17 00:00:00 2001 From: Damian Reeves <957246+DamianReeves@users.noreply.github.com> Date: Wed, 4 Feb 2026 23:34:31 -0600 Subject: [PATCH 2/6] feat(mise): add build and test tasks for morphir-moonbit Add mise tasks to build and test MoonBit packages from the top-level repo: - build:morphir-moonbit: builds all packages for wasm and wasm-gc targets - test:morphir-moonbit: runs tests for all packages Both tasks accept optional package name arguments to filter which packages to build/test. Valid packages: morphir-sdk, morphir-core, morphir-moonbit-bindings Update documentation in AGENTS.md and ecosystem/ to reflect new tasks. --- .config/mise/config.toml | 9 ++ .../tasks/ecosystem/build_morphir_moonbit.py | 87 +++++++++++++++++++ .../tasks/ecosystem/test_morphir_moonbit.py | 84 ++++++++++++++++++ AGENTS.md | 11 +++ ecosystem/AGENTS.md | 27 +++++- ecosystem/README.md | 22 +++++ 6 files changed, 238 insertions(+), 2 deletions(-) create mode 100644 .config/mise/tasks/ecosystem/build_morphir_moonbit.py create mode 100644 .config/mise/tasks/ecosystem/test_morphir_moonbit.py diff --git a/.config/mise/config.toml b/.config/mise/config.toml index cb985572..801a425c 100644 --- a/.config/mise/config.toml +++ b/.config/mise/config.toml @@ -149,6 +149,15 @@ run = "npm run typecheck" dir = "website" depends = ["website:install"] +# ===== Ecosystem Build Tasks ===== +[tasks."build:morphir-moonbit"] +description = "Build all MoonBit packages in morphir-moonbit" +run = "python .config/mise/tasks/ecosystem/build_morphir_moonbit.py" + +[tasks."test:morphir-moonbit"] +description = "Run tests for all MoonBit packages in morphir-moonbit" +run = "python .config/mise/tasks/ecosystem/test_morphir_moonbit.py" + # ===== Submodule Tasks ===== [tasks."submodules:init"] description = "Initialize and fetch all submodules (first-time or after clone without --recurse-submodules)" diff --git a/.config/mise/tasks/ecosystem/build_morphir_moonbit.py b/.config/mise/tasks/ecosystem/build_morphir_moonbit.py new file mode 100644 index 00000000..e1adca83 --- /dev/null +++ b/.config/mise/tasks/ecosystem/build_morphir_moonbit.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +""" +Build MoonBit packages in morphir-moonbit. + +This script builds packages in the morphir-moonbit submodule +for both WASM and WASM-GC targets. + +Usage: + python build_morphir_moonbit.py [package...] + +Arguments: + package Optional package names to build. If not provided, builds all packages. + Valid packages: morphir-sdk, morphir-core, morphir-moonbit-bindings + +Examples: + python build_morphir_moonbit.py # Build all packages + python build_morphir_moonbit.py morphir-sdk # Build only morphir-sdk + python build_morphir_moonbit.py morphir-sdk morphir-core # Build specific packages +""" + +import subprocess +import sys +from pathlib import Path + +ALL_PACKAGES = ["morphir-sdk", "morphir-core", "morphir-moonbit-bindings"] +TARGETS = ["wasm", "wasm-gc"] + + +def run_moon_command(cmd: list[str], cwd: Path) -> bool: + """Run a moon command and return success status.""" + result = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True) + if result.returncode != 0: + print(f" Error: {result.stderr}", file=sys.stderr) + if result.stdout: + print(f" Output: {result.stdout}", file=sys.stderr) + return False + return True + + +def main() -> int: + """Build MoonBit packages.""" + repo_root = Path(__file__).resolve().parents[4] + moonbit_dir = repo_root / "ecosystem" / "morphir-moonbit" + pkgs_dir = moonbit_dir / "pkgs" + + if not pkgs_dir.exists(): + print(f"Error: Packages directory not found: {pkgs_dir}", file=sys.stderr) + return 1 + + # Determine which packages to build + if len(sys.argv) > 1: + packages = sys.argv[1:] + # Validate package names + invalid = [p for p in packages if p not in ALL_PACKAGES] + if invalid: + print(f"Error: Unknown package(s): {', '.join(invalid)}", file=sys.stderr) + print(f"Valid packages: {', '.join(ALL_PACKAGES)}", file=sys.stderr) + return 1 + else: + packages = ALL_PACKAGES + + print(f"Building MoonBit packages: {', '.join(packages)}...") + + errors = [] + for pkg in packages: + pkg_dir = pkgs_dir / pkg + if not pkg_dir.exists(): + print(f" Skipping {pkg} (not found)") + continue + + print(f" Building {pkg}...") + + for target in TARGETS: + print(f" Target: {target}") + if not run_moon_command(["moon", "build", "--target", target], pkg_dir): + errors.append(f"{pkg} ({target})") + + if errors: + print(f"\nBuild failed for: {', '.join(errors)}", file=sys.stderr) + return 1 + + print("\nAll MoonBit packages built successfully!") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.config/mise/tasks/ecosystem/test_morphir_moonbit.py b/.config/mise/tasks/ecosystem/test_morphir_moonbit.py new file mode 100644 index 00000000..fbfbc484 --- /dev/null +++ b/.config/mise/tasks/ecosystem/test_morphir_moonbit.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +""" +Run tests for MoonBit packages in morphir-moonbit. + +This script runs tests for packages in the morphir-moonbit submodule. + +Usage: + python test_morphir_moonbit.py [package...] + +Arguments: + package Optional package names to test. If not provided, tests all packages. + Valid packages: morphir-sdk, morphir-core, morphir-moonbit-bindings + +Examples: + python test_morphir_moonbit.py # Test all packages + python test_morphir_moonbit.py morphir-sdk # Test only morphir-sdk + python test_morphir_moonbit.py morphir-sdk morphir-core # Test specific packages +""" + +import subprocess +import sys +from pathlib import Path + +ALL_PACKAGES = ["morphir-sdk", "morphir-core", "morphir-moonbit-bindings"] + + +def run_moon_command(cmd: list[str], cwd: Path) -> bool: + """Run a moon command and return success status.""" + result = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True) + if result.returncode != 0: + print(f" Error: {result.stderr}", file=sys.stderr) + if result.stdout: + print(f" Output: {result.stdout}", file=sys.stderr) + return False + if result.stdout: + print(result.stdout) + return True + + +def main() -> int: + """Run tests for MoonBit packages.""" + repo_root = Path(__file__).resolve().parents[4] + moonbit_dir = repo_root / "ecosystem" / "morphir-moonbit" + pkgs_dir = moonbit_dir / "pkgs" + + if not pkgs_dir.exists(): + print(f"Error: Packages directory not found: {pkgs_dir}", file=sys.stderr) + return 1 + + # Determine which packages to test + if len(sys.argv) > 1: + packages = sys.argv[1:] + # Validate package names + invalid = [p for p in packages if p not in ALL_PACKAGES] + if invalid: + print(f"Error: Unknown package(s): {', '.join(invalid)}", file=sys.stderr) + print(f"Valid packages: {', '.join(ALL_PACKAGES)}", file=sys.stderr) + return 1 + else: + packages = ALL_PACKAGES + + print(f"Running MoonBit tests: {', '.join(packages)}...") + + errors = [] + for pkg in packages: + pkg_dir = pkgs_dir / pkg + if not pkg_dir.exists(): + print(f" Skipping {pkg} (not found)") + continue + + print(f" Testing {pkg}...") + if not run_moon_command(["moon", "test"], pkg_dir): + errors.append(pkg) + + if errors: + print(f"\nTests failed for: {', '.join(errors)}", file=sys.stderr) + return 1 + + print("\nAll MoonBit tests passed!") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/AGENTS.md b/AGENTS.md index b7a5303b..21ca3149 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -150,6 +150,17 @@ Use `mise` task runner (`mise run `) for build orchestration: - `mise run submodules:status` - Show submodule status - `mise run submodules:add -- [url]` - Add a new ecosystem submodule +### Ecosystem Build Tasks + +Build and test ecosystem submodules from the top-level repo: + +- `mise run build:morphir-moonbit` - Build all MoonBit packages +- `mise run build:morphir-moonbit -- ` - Build specific package(s) +- `mise run test:morphir-moonbit` - Run all MoonBit tests +- `mise run test:morphir-moonbit -- ` - Test specific package(s) + +Valid package names: `morphir-sdk`, `morphir-core`, `morphir-moonbit-bindings` + ## When Contributing ### Code Style diff --git a/ecosystem/AGENTS.md b/ecosystem/AGENTS.md index 5d225086..151a67e1 100644 --- a/ecosystem/AGENTS.md +++ b/ecosystem/AGENTS.md @@ -21,14 +21,37 @@ Do not edit submodule content in-place for long-term changes. Prefer contributin Same as root [AGENTS.md](../AGENTS.md): **do not** add AI assistants as co-authors in commits (EasyCLA). -## Testing +## Building and Testing -To run tests inside a submodule: +### morphir-rust + +To run tests inside morphir-rust: ```bash cd ecosystem/morphir-rust && cargo test ``` +### morphir-moonbit + +Build and test MoonBit packages from the repo root using mise tasks: + +```bash +# Build all packages (wasm and wasm-gc targets) +mise run build:morphir-moonbit + +# Build specific package(s) +mise run build:morphir-moonbit -- morphir-sdk +mise run build:morphir-moonbit -- morphir-sdk morphir-core + +# Run all tests +mise run test:morphir-moonbit + +# Test specific package(s) +mise run test:morphir-moonbit -- morphir-sdk +``` + +Valid package names: `morphir-sdk`, `morphir-core`, `morphir-moonbit-bindings` + Changes inside submodules are committed in the submodule repo. The morphir repo only commits the submodule ref when intentionally updating to a new revision. ## Future submodules diff --git a/ecosystem/README.md b/ecosystem/README.md index 0e9a6b86..0c27786d 100644 --- a/ecosystem/README.md +++ b/ecosystem/README.md @@ -60,6 +60,28 @@ mise run submodules:status - **morphir-rust**: The morphir-live app and the morphir CLI (in `crates/`) depend on morphir-rust crates via Cargo path dependencies (e.g. `morphir-core`, `morphir-common`). The submodule is required to build those crates. - **morphir-examples**: Used for examples, documentation, and tests. See each submodule's own README for build and usage. +- **morphir-moonbit**: MoonBit implementation with packages for SDK, core types, and WASM bindings. See below for build commands. + +## Building and testing morphir-moonbit + +Build and test MoonBit packages from the repo root: + +```bash +# Build all packages (wasm and wasm-gc targets) +mise run build:morphir-moonbit + +# Build specific package(s) +mise run build:morphir-moonbit -- morphir-sdk +mise run build:morphir-moonbit -- morphir-sdk morphir-core + +# Run all tests +mise run test:morphir-moonbit + +# Test specific package(s) +mise run test:morphir-moonbit -- morphir-core +``` + +Valid package names: `morphir-sdk`, `morphir-core`, `morphir-moonbit-bindings` ## Adding a new submodule From e262d1d50e428cfd009f300f00b74946204b3005 Mon Sep 17 00:00:00 2001 From: Damian Reeves <957246+DamianReeves@users.noreply.github.com> Date: Wed, 4 Feb 2026 23:44:07 -0600 Subject: [PATCH 3/6] chore: update morphir-moonbit submodule (src directory refactor) --- ecosystem/morphir-moonbit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem/morphir-moonbit b/ecosystem/morphir-moonbit index 44a04d43..1f355839 160000 --- a/ecosystem/morphir-moonbit +++ b/ecosystem/morphir-moonbit @@ -1 +1 @@ -Subproject commit 44a04d432507b7cbfcd7f476a8b23b7b3de8be09 +Subproject commit 1f355839e6431bba665fb7fcfc79f89eb46f4dc6 From ff867558a345c5877f8c228fb3a8ecc4d40c5f08 Mon Sep 17 00:00:00 2001 From: Damian Reeves <957246+DamianReeves@users.noreply.github.com> Date: Wed, 4 Feb 2026 23:57:53 -0600 Subject: [PATCH 4/6] feat(ecosystem): add morphir-elm submodule tracking remixed branch Add morphir-elm as a submodule in ecosystem/, tracking the remixed branch which uses Mise + Bun for builds instead of Gulp. morphir-elm is the reference implementation containing: - IR definition - Elm compiler for authoring Morphir applications - Visualization components and developer tools - Backend processors (Scala, JSON Schema, TypeScript, etc.) Update ecosystem documentation to include morphir-elm. --- .gitmodules | 4 ++++ ecosystem/AGENTS.md | 3 ++- ecosystem/README.md | 12 +++++++----- ecosystem/morphir-elm | 1 + 4 files changed, 14 insertions(+), 6 deletions(-) create mode 160000 ecosystem/morphir-elm diff --git a/.gitmodules b/.gitmodules index 7096a1ae..026fcd0a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,7 @@ [submodule "ecosystem/morphir-moonbit"] path = ecosystem/morphir-moonbit url = https://github.com/finos/morphir-moonbit.git +[submodule "ecosystem/morphir-elm"] + path = ecosystem/morphir-elm + url = https://github.com/finos/morphir-elm.git + branch = remixed diff --git a/ecosystem/AGENTS.md b/ecosystem/AGENTS.md index 151a67e1..bff0332d 100644 --- a/ecosystem/AGENTS.md +++ b/ecosystem/AGENTS.md @@ -4,6 +4,7 @@ This directory holds **git submodules** for Morphir ecosystem repositories. Use ## What lives here +- **morphir-elm** – Reference Elm implementation (tracking `remixed` branch). Contains IR definition, Elm compiler, visualization components, and backend processors. - **morphir-rust** – Rust workspace (morphir-core, morphir-common, morphir-daemon, morphir-ext, etc.). The **morphir** CLI binary lives in this repo under `crates/morphir`, not in the submodule; it depends on morphir-rust crates via path. - **morphir-examples** – Example Morphir projects. - **morphir-moonbit** – MoonBit implementation of Morphir tooling. @@ -56,4 +57,4 @@ Changes inside submodules are committed in the submodule repo. The morphir repo ## Future submodules -When morphir-go, morphir-elm, morphir-python, or others are added, they will live under `ecosystem/` with the same pattern. Document any language- or repo-specific usage in this file. +When morphir-go, morphir-python, or others are added, they will live under `ecosystem/` with the same pattern. Document any language- or repo-specific usage in this file. diff --git a/ecosystem/README.md b/ecosystem/README.md index 0c27786d..5b883457 100644 --- a/ecosystem/README.md +++ b/ecosystem/README.md @@ -4,11 +4,12 @@ This directory contains [git submodules](https://git-scm.com/book/en/v2/Git-Tool ## Submodules -| Submodule | Repository | Purpose | -|------------------|------------|--------| -| **morphir-rust** | [finos/morphir-rust](https://github.com/finos/morphir-rust) | Rust libraries (morphir-core, morphir-common, etc.) used by morphir-live and the morphir CLI in this repo | -| **morphir-examples** | [finos/morphir-examples](https://github.com/finos/morphir-examples) | Example Morphir projects; used for docs, tests, and reference | -| **morphir-moonbit** | [finos/morphir-moonbit](https://github.com/finos/morphir-moonbit) | MoonBit implementation of Morphir tooling | +| Submodule | Repository | Branch | Purpose | +|------------------|------------|--------|---------| +| **morphir-elm** | [finos/morphir-elm](https://github.com/finos/morphir-elm) | remixed | Reference Elm implementation; IR definition, compilers, visualization, and backend processors | +| **morphir-rust** | [finos/morphir-rust](https://github.com/finos/morphir-rust) | main | Rust libraries (morphir-core, morphir-common, etc.) used by morphir-live and the morphir CLI in this repo | +| **morphir-examples** | [finos/morphir-examples](https://github.com/finos/morphir-examples) | main | Example Morphir projects; used for docs, tests, and reference | +| **morphir-moonbit** | [finos/morphir-moonbit](https://github.com/finos/morphir-moonbit) | main | MoonBit implementation of Morphir tooling | ## First-time clone @@ -58,6 +59,7 @@ mise run submodules:status ## How morphir uses them +- **morphir-elm**: The reference implementation containing the IR definition, Elm compiler, visualization components, and backend processors (Scala, JSON Schema, TypeScript, etc.). Tracks the `remixed` branch which uses Mise + Bun for builds. - **morphir-rust**: The morphir-live app and the morphir CLI (in `crates/`) depend on morphir-rust crates via Cargo path dependencies (e.g. `morphir-core`, `morphir-common`). The submodule is required to build those crates. - **morphir-examples**: Used for examples, documentation, and tests. See each submodule's own README for build and usage. - **morphir-moonbit**: MoonBit implementation with packages for SDK, core types, and WASM bindings. See below for build commands. diff --git a/ecosystem/morphir-elm b/ecosystem/morphir-elm new file mode 160000 index 00000000..b36c00c8 --- /dev/null +++ b/ecosystem/morphir-elm @@ -0,0 +1 @@ +Subproject commit b36c00c8b2b8481763cfe2606e1c5d8f18e38865 From ae85bb4a0697a1d5fa5c5e237ed3fd41db849f6c Mon Sep 17 00:00:00 2001 From: Damian Reeves <957246+DamianReeves@users.noreply.github.com> Date: Thu, 5 Feb 2026 01:44:44 -0600 Subject: [PATCH 5/6] chore: update morphir-moonbit submodule (NameToken validation) --- ecosystem/morphir-moonbit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem/morphir-moonbit b/ecosystem/morphir-moonbit index 1f355839..49913bd1 160000 --- a/ecosystem/morphir-moonbit +++ b/ecosystem/morphir-moonbit @@ -1 +1 @@ -Subproject commit 1f355839e6431bba665fb7fcfc79f89eb46f4dc6 +Subproject commit 49913bd1efb15405bea3ef94106bc94d69fbffd0 From 1818e545ae70a88f89d773bebc2dd0734048fbb0 Mon Sep 17 00:00:00 2001 From: Damian Reeves <957246+DamianReeves@users.noreply.github.com> Date: Sat, 21 Feb 2026 12:20:41 -0600 Subject: [PATCH 6/6] chore: update morphir-moonbit submodule (classic IR types: FQName, Path, QName, ModuleName, PackageName) --- ecosystem/morphir-moonbit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem/morphir-moonbit b/ecosystem/morphir-moonbit index 49913bd1..6d473c7e 160000 --- a/ecosystem/morphir-moonbit +++ b/ecosystem/morphir-moonbit @@ -1 +1 @@ -Subproject commit 49913bd1efb15405bea3ef94106bc94d69fbffd0 +Subproject commit 6d473c7e1bc9b717cb4c25583cf3eb03b060510d