Skip to content

Commit

Permalink
Leaning on moon to help orchestrate polyglot builds
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianReeves committed May 30, 2024
1 parent 7e6f646 commit ec7e8c1
Show file tree
Hide file tree
Showing 18 changed files with 150 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ target/
.scala-build/
.metals/
.bloop/
.bsp/
.bsp/
# moon
.moon/cache
.moon/docker
34 changes: 34 additions & 0 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"
tasks:
build:
inputs: []
deps:
- target: "~:morphir-elm-build"
optional: true
- target: "~:elm-library-build"
optional: true
- target: "~:cargo-build"
optional: true
fmt:
inputs: []
deps:
- target: "~:elm-format"
optional: true
- target: "~:scala-format"
optional: true

lint:
inputs: []
deps:
- target: "~:elm-lint"
optional: true
- target: "~:scala-lint"
optional: true
test:
inputs: []
deps:
- target: "~:scala-jvm"
optional: true
- target: "~:elm-test"
optional: true

Empty file.
15 changes: 15 additions & 0 deletions .moon/tasks/tag-elm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fileGroups:
elmSources:
- "src"
tasks:
elm-lint:
command: |
yarn exec elm-format @dirs(elmSources) @files(elmSources) --validate --yes
inputs:
- "@files(elmSources)"

elm-format:
command: |
yarn exec elm-format @dirs(elmSources) @files(elmSources) --yes
inputs:
- "@files(elmSources)"
36 changes: 36 additions & 0 deletions .moon/tasks/tag-morphir-elm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
fileGroups:
morphirProjectFiles:
- "morphir.json"
morphirElmSources:
- "src/**/*.elm"
morphirElmArtifacts:
- "morphir-hashes.json"
- "morphir-ir.json"

tasks:
morphir-elm-build:
deps:
- "~:morphir-elm-make"

morphir-elm-rebuild:
deps:
- "~:morphir-elm-clean"
- "~:morphir-elm-build"

morphir-elm-clean:
command: |
rm -rf @files(morphirElmArtifacts)
inputs:
- "@files(morphirElmArtifacts)"

morphir-elm-make:
command: |
morphir make
inputs:
- "@files(morphirProjectFiles)"
- "@files(morphirElmArtifacts)"
- "package.json"
- "@files(morphirElmSources)"
outputs:
- "morphir-hashes.json"
- "morphir-ir.json"
Empty file added .moon/tasks/tag-rust.yml
Empty file.
3 changes: 3 additions & 0 deletions .moon/tasks/tag-scala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fileGroups:
scalaSources:
- "morphir/**/*.scala"
9 changes: 9 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$schema: "https://moonrepo.dev/schemas/toolchain.json"

bun:
syncProjectWorkspaceDependencies: true

node:
packageManager: bun

rust: {}
31 changes: 31 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# https://moonrepo.dev/docs/config/workspace
$schema: 'https://moonrepo.dev/schemas/workspace.json'

# Require a specific version of moon while running commands, otherwise fail.
# versionConstraint: '>=1.0.0'

# Extend and inherit an external configuration file. Must be a valid HTTPS URL or file system path.
# extends: './shared/workspace.yml'

# REQUIRED: A map of all projects found within the workspace, or a list or file system globs.
# When using a map, each entry requires a unique project ID as the map key, and a file system
# path to the project folder as the map value. File paths are relative from the workspace root,
# and cannot reference projects located outside the workspace boundary.
projects:
- '.'
- 'apps/*'
- 'crates/*'
- 'packages/*'

# Configures the version control system to utilize within the workspace. A VCS
# is required for determining touched (added, modified, etc) files, calculating file hashes,
# computing affected files, and much more.
vcs:
# The client to use when managing the repository.
# Accepts "git". Defaults to "git".
manager: 'git'

# The default branch (master/main/trunk) in the repository for comparing the
# local branch against. For git, this is is typically "master" or "main",
# and must include the remote prefix (before /).
defaultBranch: 'main'
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.12.0
6 changes: 5 additions & 1 deletion .prototools
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
bun = "1.1.10"
bun = "1.1.10"
moon = "1.25.1"

[plugins]
moon = "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
1 change: 1 addition & 0 deletions apps/js-cli/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: typescript
Binary file modified bun.lockb
Binary file not shown.
Empty file.
Empty file added crates/morphir-runtime/moon.yml
Empty file.
1 change: 1 addition & 0 deletions moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: elm
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
"tools/*"
],
"scripts": {
"build": "moon run :build",
"build:verify-elm-package": "zig build verify-elm-package --summary all",
"build:check-elm-docs": "zig build check-elm-docs --summary all",
"postinstall": "elm-tooling install"
"postinstall": "elm-tooling install",
"list-projects": "moon project-graph --json | bunx --bun node-jq '.projects| keys[]'"
},
"devDependencies": {
"elm-tooling": "^1.15.1"
"elm-tooling": "^1.15.1",
"node-jq": "4.4.0"
}
}
5 changes: 5 additions & 0 deletions packages/morphir-elm-compiler/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fileGroups:
elmSources:
- "src"
tags:
- "elm"

0 comments on commit ec7e8c1

Please sign in to comment.