This guide explains how to work with this repository, including how to set up your development environment and run all available tasks.
This project uses mise (formerly rtx) to manage tool versions and tasks. Make sure you have mise installed before proceeding.
The project requires:
- Node.js 24
- Elm 0.19.1
- actionlint 1.7.10
All tools are automatically installed by mise when you run tasks.
To set up the project for the first time, run:
mise run setupThis will:
- Install all npm dependencies
- Install Elm dependencies
- Install Elm test dependencies
- Set up Husky git hooks
All tasks are run using mise run <task-name>. Here's a comprehensive guide to all available tasks:
Complete project setup including dependencies and git hooks.
mise run setupSet up Husky git hooks (automatically runs as part of setup).
mise run husky-setupInstall npm dependencies. This task is cached and will only re-run when package.json or package-lock.json changes.
mise run npm-installInstall Elm dependencies. This task is cached and will only re-run when elm.json or source files change.
mise run elm-installInstall Elm test dependencies. This task is cached and will only re-run when elm.json or test files change.
mise run elm-test-installThese tasks ensure dependencies are installed without running builds or tests. Useful for CI/CD or when you want to restore dependencies.
Restore project dependencies (npm and Elm).
mise run restoreRestore test dependencies (Elm test packages).
mise run restore-test-dependenciesRestore all project and test dependencies.
mise run restore-allBuild both Elm and Morphir. This is the main build task.
mise run buildBuild and validate Elm code.
mise run elm-buildGenerate Morphir IR from Elm sources.
mise run morphir-buildFormat all Elm code in src/ and tests/ directories using elm-format.
mise run formatCheck if Elm code is properly formatted without making changes. This is useful for CI/CD.
mise run format-checkRun all tests using elm-test-rs.
mise run testRun all linting tasks (currently includes workflow linting).
mise run lintLint GitHub Actions workflow YAML files using actionlint.
mise run lint-workflowsRun all code quality checks: lint, format-check, and test. This is the comprehensive verification task.
mise run verifyThis task is also run automatically by the pre-push git hook to ensure code quality before pushing.
Clean all build outputs (npm, Elm, and Morphir).
mise run cleanClean npm build outputs (node_modules/).
mise run clean-npmClean Elm build outputs (elm-stuff/).
mise run clean-elmClean Morphir build outputs (IR JSON files).
mise run clean-morphirTrigger a release by creating and pushing a version tag. This will automatically trigger the GitHub Actions release workflow.
mise run trigger-release v1.0.0The version must follow semantic versioning format (e.g., v1.0.0, v2.3.4, v1.0.0-beta.1).
Requirements:
- No uncommitted changes
- Tag must not already exist
- Must be run from a git repository
What it does:
- Validates the version format
- Checks for uncommitted changes
- Verifies the tag doesn't already exist
- Fetches latest tags from remote
- Creates the tag locally
- Pushes the tag to trigger the release workflow
Generate release notes for a given version tag by comparing it to the previous tag.
mise run generate-release-notes v1.0.0 [repository-url]Determine release tag from event type (used internally by the release workflow).
mise run determine-release-tag <event-name> [version-input] [github-ref]Create a gzipped tar archive of Morphir IR artifacts.
mise run create-morphir-archive v1.0.0Run the train-build-release tool.
mise run train-build-release-
Set up the project (if not already done):
mise run setup
-
Make your changes to the code
-
Format your code:
mise run format
-
Run tests:
mise run test -
Verify everything:
mise run verify
-
Commit and push (the pre-push hook will run
verifyautomatically)
Run the verification task to ensure everything is correct:
mise run verifyThis will:
- Lint workflow files
- Check code formatting
- Run all tests
If you need to start fresh or free up disk space:
mise run cleanThen restore dependencies:
mise run restore-allTo create a new release:
-
Ensure everything is committed and pushed:
git status # Should show no uncommitted changes -
Run verification to ensure code quality:
mise run verify
-
Trigger the release:
mise run trigger-release v1.0.0
Replace
v1.0.0with your desired version number (must follow semantic versioning). -
Monitor the release workflow: The script will provide a link to monitor the GitHub Actions workflow. The workflow will:
- Run the test suite
- Build Morphir IR
- Generate release notes
- Create a Morphir IR archive
- Create a GitHub release with all artifacts attached
Note: The release workflow is triggered automatically when you push a tag matching the pattern v*.*.*. You can also trigger it manually from the GitHub Actions UI by using the "Run workflow" button and providing a version.
This project uses Husky to manage git hooks:
- pre-push: Automatically runs
mise run verifybefore pushing to ensure code quality
The hooks are set up automatically when you run mise run setup.
Many tasks use mise's caching mechanism to avoid unnecessary work:
- Tasks with
sourcesandoutputsdefined will only re-run when source files change - This makes subsequent runs much faster
- For example,
npm-installonly runs whenpackage.jsonorpackage-lock.jsonchanges
To see all available tasks and their descriptions:
mise tasks lsTo see detailed information about a specific task:
mise tasks info <task-name>To see the dependency graph for a task:
mise tasks deps <task-name>