finos / morphir-scala Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://morphir.finos.org/docs/scala/
License: Apache License 2.0
Home Page: https://morphir.finos.org/docs/scala/
License: Apache License 2.0
Create a Morphir Mill plugin that is tasked with wrapping the morphir-elm CLI and will also support direct morphir-scala
tasks/commands.
Morphir is capable of using its morphir-elm make
, morphir-elm gen
, and morphir-elm test
commands to generate code and run tests.
We have a need to generate Morphir IR and use morphir-elm
's code generation capability within Scala builds.
We should create a Mill plugin that allows us to accomplish this.
While we can bootstrap this process by doing Mill specific file and process creation, it should be noted we will want to accomplish the same behavior for abt
and scala-cli
(and possibly Gradle).
Need to add the actual name of the enum e.g. "MyEnum" into the Enum class.
Since upgrading to mill 0.11.x
some used types are deprecated, address these deprecations.
[#0] [warn] Jvm.runLocal("mdoc.Main", cp, dirParams)
[#0] [warn] ^
[#0] [warn] /home/runner/work/morphir-scala/morphir-scala/project/modules/docs.sc:48:9: value Jvm in package modules is deprecated (since Mill 0.11.0-M9): use mill.util.Jvm
[#0] [warn] Jvm.runLocal("mdoc.Main", cp, dirParams ++ Seq("--watch"))
[#0] [warn] ^
[#0] [warn] /home/runner/work/morphir-scala/morphir-scala/project/modules/docs.sc:56:26: type Sources in package define is deprecated (since Mill after 0.11.0-M8): Use mill.define.Target instead.
[#0] [warn] def docusaurusSources: Sources
[#0] [warn] ^
[#0] [warn] /home/runner/work/morphir-scala/morphir-scala/project/modules/docs.sc:57:22: type Sources in package define is deprecated (since Mill after 0.11.0-M8): Use mill.define.Target instead.
[#0] [warn] def compiledMdocs: Sources
[#0] [warn] ^
[#0] [warn] /home/runner/work/morphir-scala/morphir-scala/project/modules/docs.sc:77:[19](https://github.com/finos/morphir-scala/actions/runs/5615735487/job/15216636429?pr=265#step:5:20): value Jvm in package modules is deprecated (since Mill 0.11.0-M9): use mill.util.Jvm
[#0] [warn] val process = Jvm.spawnSubprocess(
[#0] [warn] ^
[#0] [warn] /home/runner/work/morphir-scala/morphir-scala/project/modules/docs.sc:153:14: value Jvm in package modules is deprecated (since Mill 0.11.0-M9): use mill.util.Jvm
[#0] [warn] val p2 = Jvm.spawnSubprocess(
[#0] [warn] ^
[#0] [warn] /home/runner/work/morphir-scala/morphir-scala/project/modules/docs.sc:169:5: value Jvm in package modules is deprecated (since Mill 0.11.0-M9): use mill.util.Jvm
[#0] [warn] Jvm.runSubprocess(
Create a morphir-elm sbt plugin that is tasked with wrapping the morphir-elm CLI
Morphir is capable of using its morphir-elm make
, morphir-elm gen
, and morphir-elm test
commands to generate code and run tests.
We have a need to generate Morphir IR and use morphir-elm
's code generation capability within Scala builds.
We should create an SBT plugin that allows us to accomplish this.
While we can bootstrap this process by doing SBT specific file and process creation, it should be noted we will want to accomplish the same behavior for Mill
and scala-cli
(and possibly Gradle).
Add support for transforming/encoding from zio-schema to the morphir datamodel.
By supporting zio-schema
we will enable additional scenarios
The morphir-tools-launcher
should setup the morphir tooling, it should:
Thinks to keep in mind:
.morphir-version
file to control which version of Morphir-cli is downloaded A possible issue here is the package name collisions (only one will survive). Any specific way we should deal with this?
Originally posted by @dmitrykozinets in #462 (comment)
Implement the Morphir.SDK.Bool module in corelib.
Provide a definition of the Morphir.SDK.Bool module.
Simplify the project structure:
Today we have quite a few modules/projects, which is an artifact of how development has been done (trying some ideas, and wanting to not mix that with core Morphir, as well as previously having a Scala 3 compiler plugin as a goal while wanting to still Support Scala 2).
Today, it feels like there are a bit too many projects (at least for the core of what we are doing).
Going to aim for something along the lines of the following:
.
└── morphir
├── build
│ └── integration
│ ├── mill
│ └── sbt
├── interop
│ ├── tapir
│ ├── vulcan
│ └── zio
│ ├── json
│ └── schema
├── knowledge
├── macros
├── main
├── testing
└── web
├── client
└── server
Let's discuss what we have here:
Here's as summary of the thinking here:
Project | Description |
---|---|
morphir |
This project contains what you need to work with the Morphir data formats: IR & MDM (Morphir data model). It will also contain the implementation of the SDK and the runtime. |
morphir/build/integration |
Projects contained in this folder house various build integrations morphir-scala intends on providing |
morphir/interop |
Projects contained in this folder, are meant to house the different interop libraries we will provide with other libraries (i.e.): zio-json (for JSON), zio-schema , tapir (for API/OpenAPI), vulcan (for Avro), and others |
knowledge |
An implementation of logic programming meant to eventually interop better with Morphir. |
macros |
Macros needed to support the main morphir module. |
main |
The main CLI that allows users to interact with Morphir. |
testing |
Testing helpers used internally by the project |
web/client |
Client-side code for the morphir develop /morphir live tooling you can run in the browser. |
...what problem are you trying to solve that the project doesn't currently solve?
...please resist the temptation to describe your request in terms of a solution. Job Story form ("When [triggering condition], I want to [motivation/goal], so I can [outcome].") can help ensure you're expressing a problem statement.
...clearly and concisely describe what you want to happen. Add any considered drawbacks.
... if you've considered alternatives, clearly and concisely describe those too.
Currently the GitHub actions builds the project more times than we actually need to.
Firstly:
Secondly:
Create a Windows shell script that can acquire the "morphir launcher" from Maven and start it up with the appropriate Java options similar to maven-wrapper
, gradle-wrapper
, or millw
.
There needs to be a way to actually acquire the morphir tooling.
Maven has a decent story around this where it uses the maven-wrapper
as a means to use shell scripts to acquire the maven application.
Sbt also has an sbt-launcher
which is a lightweight application which setups sbt for execution and pulls down the rest of "sbt proper".
We will use the morphir-tools-launcher
jar as a lightweight tool for acquiring the morphir tooling and getting us started. This issue is around creating a shell script that can pull down the morphir-tools-launcher
from a maven/ivy style repo like Maven Central or an internal Artifactory instance.
Provide an IRI for each Morphir SDK Type
It will be simpler to attribute/annotate the Morphir IR in a meaningful way if we encode the attributes in a manner consistent with RDF we should provide an URI which describes each morphir SDK type that is rooted at: https://morphir.finos.org/shemas/sdk.
We should provide these URIs/IRIs in both documentation and code form.
Create a bash script that can acquire the "morphir launcher" from Maven and start it up with the appropriate Java options similar to maven-wrapper
, gradle-wrapper
, or millw
.
There needs to be a way to actually acquire the morphir tooling.
Maven has a decent story around this where it uses the maven-wrapper
as a means to use shell scripts to acquire the maven application.
Sbt also has an sbt-launcher
which is a lightweight application which setups sbt for execution and pulls down the rest of "sbt proper".
We will use the morphir-tools-launcher
jar as a lightweight tool for acquiring the morphir tooling and getting us started. This issue is around creating a shell script that can pull down the morphir-tools-launcher
from a maven/ivy style repo like Maven Central or an internal Artifactory instance.
Provide an IRI for each Morphir IR Node
It will be simpler to attribute/annotate the Morphir IR in a meaningful way if we encode the attributes in a manner consistent with RDF we should provide an URI which describes each morphir SDK type that is rooted at: https://morphir.finos.org/shemas/ir.
We should provide these URIs/IRIs in both documentation and code form.
In Morphir datamodel use the same Name
, Path
, PackageName
, QName
, etc. naming objects used by the IR.
Currently we have separate naming primitives, but once we consolidate the IR and Datamodel into the same project, it will be easier to use the same naming structures.
Depends On: #275
Running docusaurus build and serve using mill takes a long time to finish.
...clearly and concisely describe what you want to happen. Add any considered drawbacks.
... if you've considered alternatives, clearly and concisely describe those too.
Add support for transforming/encoding from tapir to the morphir datamodel
Add support for generating the Morphir Datamodel (MDM) from Avro through Vulcan
Update GitHub Actions CI build to accomodate cross-platform.
We could use portions from this for an example: https://github.com/com-lihaoyi/upickle/blob/main/.github/workflows/actions.yml#L14-L73
The goal is to be able to separate: JS, JVM, and Native builds out (note native is for all intents and purposes disabled but work is in progress to enable it shortly)
EvaluationLibrary.scala, and its platform specific variants, should be removed. Loading distributions should be on the Distribution companion object.
This fils is old and vestigial. The core of its functionality was removed long ago, and it only endures because it implements the platform specific behavior needed to work around a js compatibility issue (which hopefully will cease to be a problem soon.)
Remove EvaluationLibrary
Add loading code to Distribution
If ZIO does not have cross-compiling file support by the time this is done, include platform specific supertraits of Distribution
MorphirRuntime has a number of ZPure functions. In at least one upcoming case (unit testin'), these can only be called after the user has performed some side effecting operations to get the required inputs. It would be helpful to have ZIO versions as well to wrap this functionality, which is not something that fits into the model of ZPure
Very specifically, when calling runUnitTests
, I should not have to provide the unit test framework IR myself; there should be at least one entry point that loads it for me.
It should be fairly easy to add ZIO versions of these functions with support for file handling (esp. once cross-compiled file handling with js has been resolved)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.