{"id":25957,"library":"morphir-elm","title":"morphir-elm","description":"morphir-elm is an NPM package providing a CLI and Elm integration for the Morphir ecosystem (v2.100.0, active development, releases every few weeks). It parses Elm source code into Morphir IR (intermediate representation), enabling transpilation to Scala, TypeScript, and other languages, as well as visualization. Key differentiators: it bridges Elm's type system with FINOS's technology-agnostic Morphir format, supports both NPM and Elm package distribution, and includes a TypeScript SDK for structural equality and Maybe types. Alternatives include custom transpilers, but morphir-elm provides a standardised, multi-language pipeline.","status":"active","version":"2.100.0","language":"javascript","source_language":"en","source_url":"https://github.com/finos/morphir-elm","tags":["javascript","morphir","elm","typescript"],"install":[{"cmd":"npm install morphir-elm","lang":"bash","label":"npm"},{"cmd":"yarn add morphir-elm","lang":"bash","label":"yarn"},{"cmd":"pnpm add morphir-elm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for Elm compilation (Elm binary required in PATH)","package":"elm","optional":true}],"imports":[{"note":"The -f flag is recommended as of v2.100.0 to use the old CLI; new CLI may be unstable.","wrong":"npm install -g morphir-elm && morphir-elm make (without -f flag)","symbol":"morphir-elm CLI","correct":"npx morphir-elm make -f"},{"note":"In Elm, use the `exposing` keyword; importing as a named tuple is not valid Elm syntax.","wrong":"import Morphir.IR (IR)","symbol":"Morphir.IR from Elm package","correct":"import Morphir.IR exposing (IR)"},{"note":"The TypeScript SDK is provided as a sub-path export under 'morphir-elm/ts-sdk'; top-level import may not exist.","wrong":"import { equal } from 'morphir-elm'","symbol":"TypeScript SDK","correct":"import { equal } from 'morphir-elm/ts-sdk/Basics'"}],"quickstart":{"code":"// Create morphir.json\n{\n  \"name\": \"My.Package\",\n  \"sourceDirectory\": \"src\",\n  \"exposedModules\": [\"Foo\"]\n}\n\n// In terminal:\nmkdir -p src/My/Package\necho \"module My.Package.Foo exposing (..)\" > src/My/Package/Foo.elm\necho \"foo = 42\" >> src/My/Package/Foo.elm\nnpx morphir-elm make -f -p . -o morphir-ir.json\n\n// morphir-ir.json now contains the IR","lang":"typescript","description":"Creates a minimal Elm project, generates Morphir IR JSON via the CLI."},"warnings":[{"fix":"Use -f flag: morphir-elm make -f","message":"As of v2.96.0, CLI subcommand 'make' requires -f flag for old CLI; new CLI may break without it","severity":"breaking","affected_versions":">=2.96.0"},{"fix":"Use Mise and Bun for building; Gulp scripts no longer available.","message":"Gulp build system removed in v2.100.0","severity":"deprecated","affected_versions":">=2.100.0"},{"fix":"Monitor releases; update scripts to handle both old and new CLI.","message":"The -f flag is recommended only; new CLI may become default in future breaking change","severity":"gotcha","affected_versions":">=2.96.0"},{"fix":"Import from 'morphir-elm/ts-sdk/Basics' etc.","message":"TypeScript SDK exports are under sub-path 'morphir-elm/ts-sdk'; not at top-level","severity":"gotcha","affected_versions":">=2.95.0"},{"fix":"Use bun test instead of jest.","message":"Jest testing removed, replaced with Bun test runner in v2.100.0","severity":"deprecated","affected_versions":">=2.100.0"},{"fix":"Ensure morphir.json exists in project directory with required fields.","message":"Elm source parsing may fail without morphir.json file; missing config","severity":"breaking","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import from 'morphir-elm/ts-sdk/...' or install the Elm package.","cause":"Using top-level import instead of sub-path","error":"Error: Cannot find module 'morphir-elm'"},{"fix":"Use npx morphir-elm or install globally: npm install -g morphir-elm","cause":"Package not installed globally or not using npx","error":"morphir-elm: command not found"},{"fix":"Add -f flag: morphir-elm make -f","cause":"New CLI requires -f flag for old behavior since v2.96.0","error":"Error: Unrecognized command: make (use -f flag)"},{"fix":"Check morphir.json sourceDirectory and ensure Elm files are placed correctly.","cause":"Missing or mismatched sourceDirectory in morphir.json","error":"Error: Module 'My.Package.Foo' not found in sourceDirectory"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}