odin icon indicating copy to clipboard operation
odin copied to clipboard

Add scala-js 1.x support (#59)

Open mprevel opened this issue 4 years ago • 4 comments

Hi,

This PR adds support for scala.js 1.x

What does this code change:

  1. Reworks build.sbt to be able to handle scala and scala.js
  2. Adds the plugins for this support to plugins.sbt
  3. Moves sources from cross projects modules in dedicated folders (shared for common code, jvm for code specific to the JVM platform (especially file related with rolling dates using LocalDateTime), and js folder for code dedicated to the javascript platform)
  4. Replaces tests calls Task.runSyncUnsafe to Task.runToFuture because JS target does not allow blocking API
  5. Adds a dependency on a SHA-256 hash library (only in the js context) I wrote for this PR because there was no library published for scala.js yet

Do not hesitate to ask for changes in this PR :)

Regards,

mprevel avatar Jul 17 '20 22:07 mprevel

Pipeline failed due to the fact that scoverage has not been released for scala.js 1.x In fact Scoverage seems to be abandoned : The issue https://github.com/scoverage/scalac-scoverage-plugin/issues/290 The associated PR https://github.com/scoverage/scalac-scoverage-plugin/pull/287

mprevel avatar Jul 17 '20 23:07 mprevel

Codecov Report

Merging #162 into master will increase coverage by 2.50%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
+ Coverage   93.30%   95.80%   +2.50%     
==========================================
  Files          32       29       -3     
  Lines         478      453      -25     
  Branches       12       13       +1     
==========================================
- Hits          446      434      -12     
+ Misses         32       19      -13     
Flag Coverage Δ
#unittests 95.80% <100.00%> (+2.50%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...n/scala/io/odin/config/FileNamePatternSyntax.scala 100.00% <ø> (ø)
...vm/src/main/scala/io/odin/loggers/FileLogger.scala 100.00% <ø> (ø)
...main/scala/io/odin/loggers/RollingFileLogger.scala 100.00% <ø> (ø)
core/shared/src/main/scala/io/odin/Level.scala 93.33% <ø> (ø)
core/shared/src/main/scala/io/odin/Logger.scala 97.36% <ø> (ø)
...src/main/scala/io/odin/config/DefaultBuilder.scala 100.00% <ø> (ø)
...c/main/scala/io/odin/config/EnclosureRouting.scala 100.00% <ø> (ø)
...shared/src/main/scala/io/odin/config/Routing.scala 100.00% <ø> (ø)
...d/src/main/scala/io/odin/formatter/Formatter.scala 98.59% <ø> (ø)
...la/io/odin/formatter/options/ThrowableFormat.scala 50.00% <ø> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9e99814...47a0e20. Read the comment docs.

codecov[bot] avatar Jul 18 '20 12:07 codecov[bot]

@mprevel do you have time to update this PR? If not, I might be able to give it a shot together with a possible Scala Native addition.

kubukoz avatar Sep 26 '22 17:09 kubukoz

Hi @kubukoz

I don't know yet. Firstly, because I don't have much time for now, so it would be in 2 or 3 weeks at least. Nonetheless, I don't know if it makes sense. It is a 2 years old PR with no feedback. There was also an open issue that got no answer. So, I'm a bit scared about doing the PR update and having it waiting forever again. I'm also not using Odin anymore.

mprevel avatar Sep 26 '22 18:09 mprevel