Skip to content

Commit

Permalink
Merge pull request finos#265 from finos/modern-monorepo
Browse files Browse the repository at this point in the history
Provide a good starting point for using this repo as a monorepo for the Morphir ecosystem
  • Loading branch information
DamianReeves authored May 31, 2024
2 parents 724db60 + eab7893 commit 115153b
Show file tree
Hide file tree
Showing 913 changed files with 382,150 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.lockb binary diff=lockb
31 changes: 28 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
# Node, Bun, and Deno Related
package-lock.json
node_modules/

# IDE Related
.idea/
.fake
.ionide

.vscode/
package-lock.json
node_modules/


# Elm related
elm-stuff/

# Zig related
zig-cache/
zig-out/

# Build Artifacts
.out/
out/
dist/
target/

# Scala
.scala-build/
.metals/
.bloop/
.bsp/
# moon
.moon/cache
.moon/docker
51 changes: 51 additions & 0 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
$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
- target: "~:cargo-format"
optional: true

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

38 changes: 38 additions & 0 deletions .moon/tasks/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
fileGroups:
sources:
- 'apps/cli/src/**/*'
- 'crates/*/src/**/*'
- 'crates/*/Cargo.toml'
- 'Cargo.toml'
tests:
- 'crates/*/benches/**/*'
- 'crates/*/tests/**/*'

tasks:
cargo-build-base:
command: 'cargo'
args:
- "build"
inputs:
- '@globs(sources)'
cargo-build:
extends: 'cargo-build-base'
cargo-check:
command: 'cargo check --workspace'
inputs:
- '@globs(sources)'
cargo-format:
command: 'cargo fmt --all --check'
inputs:
- '@globs(sources)'
- '@globs(tests)'
cargo-lint:
command: 'cargo clippy --workspace'
inputs:
- '@globs(sources)'
- '@globs(tests)'
cargo-test:
command: 'cargo test --workspace'
inputs:
- '@globs(sources)'
- '@globs(tests)'
Empty file.
27 changes: 27 additions & 0 deletions .moon/tasks/tag-elm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
fileGroups:
elm-sources:
- 'src/**/*.elm'
- 'elm.json'
elmSources:
- "src"
tasks:
elm-lint:
platform: bun
command: |
elm-format @dirs(elmSources) @files(elmSources) --validate --yes
inputs:
- "@files(elmSources)"

elm-format:
platform: bun
command: |
elm-format @dirs(elmSources) @files(elmSources) --yes
inputs:
- "@files(elmSources)"
elm-library-make:
description: "Compile an Elm library. Note: This amounts mostly to type-checking, since libraries don't compile to anything."
platform: bun
command: |
elm make --output=/dev/null
inputs:
- "@files(elm-sources)"
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"
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"
28 changes: 28 additions & 0 deletions .moon/tasks/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
fileGroups:
sources:
- 'src/**/*'
- 'tsconfig.json'
- 'tsconfig.cjs.json'
- 'types/**/*'
tasks:
type-check-esm:
command: tsc
args:
- '--project'
- 'tsconfig.json'
inputs:
- '@globs(sources)'

type-check-cjs:
command: tsc
args:
- '--project'
- 'tsconfig.cjs.json'
inputs:
- '@globs(sources)'

type-check:
inputs: []
deps:
- target: '~:type-check-esm'
- target: '~:type-check-cjs'
14 changes: 14 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$schema: "https://moonrepo.dev/schemas/toolchain.json"

bun:
syncProjectWorkspaceDependencies: true

node:
packageManager: bun

rust:
bins:
- 'cargo-make@0.37.12'
- 'cargo-nextest'

typescript: {}
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
5 changes: 5 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bun = "1.1.10"
moon = "1.25.1"

[plugins]
moon = "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
2 changes: 2 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = "3.7.15"
runner.dialect = scala3
Loading

0 comments on commit 115153b

Please sign in to comment.