Skip to content

Commit

Permalink
Resolve conversations. Scala js cli version hygene, clearer path logi…
Browse files Browse the repository at this point in the history
…c for import file.
  • Loading branch information
Quafadas committed Feb 16, 2024
1 parent c06c63a commit 8b6264c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final case class ScalaJsOptions(

@Group(HelpGroup.ScalaJs.toString)
@HelpMessage("A file relative to the root directory containing import maps for ES module imports")
@Tag(tags.experimental)
@Tag(tags.restricted)
jsEsModuleImportMap: Option[String] = None,

@Group(HelpGroup.ScalaJs.toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,7 @@ final case class ScalaJs(
)

def absFilePath(pathStr: String): Either[ImportMapNotFound, Path] = {
Try {
os.Path(pathStr)
}.orElse(
Try{
os.Path(pathStr, base = os.pwd)
}
).toEither.fold(ex =>
Try(os.Path(pathStr, os.pwd)).toEither.fold(ex =>
Left(ImportMapNotFound(s"""Invalid path to EsImportMap. Please check your "using jsEsModuleImportMap xxxx" directive. Does this file exist $pathStr ?""", ex)),
path =>
os.isFile(path) && os.exists(path) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ trait RunScalaJsTestDefinitions { _: RunTestDefinitions =>
fileName,
"--js",
"--js-module-kind", "ESModule",
"--js-cli-version", "1.15.0.1",
"-o", outFile,
"-f"
).call(cwd = root).out.trim()
Expand Down Expand Up @@ -378,7 +377,6 @@ trait RunScalaJsTestDefinitions { _: RunTestDefinitions =>
fileName,
"--js",
"--js-module-kind", "ESModule",
"--js-cli-version", "1.15.0.1",
"-o", outFile,
"-f"
).call(cwd = root,check = false, mergeErrIntoOut = true).out.trim()
Expand Down Expand Up @@ -428,7 +426,6 @@ trait RunScalaJsTestDefinitions { _: RunTestDefinitions =>
fileName,
"--js",
"--js-module-kind", "ESModule",
"--js-cli-version", "1.15.0.1",
"-o", outFile,
"-f",
"--js-es-module-import-map", importmapFile
Expand Down

0 comments on commit 8b6264c

Please sign in to comment.