Skip to content

Exports to <object><ref>Mod rather than <object>Mod #555

@bphenriques

Description

@bphenriques

Hello,

The converter is exporting Tauri's dialog interface (https://tauri.app/v1/api/js/dialog) to dialog20ff401cMod rather than just dialogMod. In which situations does this occur and how can I avoid it?

Context

I am unable to find the culprit. I thought it was related to a dependency bump or the addition of stFlavour := Flavour.ScalajsReact but it might not be it. I was able to bump and build the frontend of the following sample project[1] using the latest versions (tested using sbt buildFrontend):

  • sbt: 1.9.2
  • converter: 1.0.0-beta42
  • scalajs: 1.13.2
  • scala version: 3.3.0

Saying might not be it because I applied the same changes to a separate project using a different stOutputPackage and now I am unable to compile. Is that related?

I am pretty sure that I am missing something and after several hours my mind is playing tricks on me. I am hopeful that there is simple explanation.

Notes

Reproducing the issue is confusing as it seems that I need to clean-up files between each conversion (see [2])? I followed the cache path mentioned in the docs.

Plus, without looking at the source-code, it is unclear where the 20ff401c comes from (doesn't match a git SHA).

Thank you!


[1]

diff --git a/build.sbt b/build.sbt
index fc3c74d..ff56d07 100644
--- a/build.sbt
+++ b/build.sbt
@@ -8,10 +8,10 @@ lazy val tauri = project
   .settings(
     organization := "com.indoorvivants.tauri",
     moduleName := "api",
-    scalaVersion := "3.1.2",
+    scalaVersion := "3.3.0",
     libraryDependencies += "com.raquo" %%% "laminar" % "0.14.2",
     externalNpm := {
-      sys.process.Process("yarn", baseDirectory.value).!
+      //sys.process.Process("yarn", baseDirectory.value).!
       baseDirectory.value
     },
     stOutputPackage := "com.indoorvivants.tauri",
@@ -21,6 +21,7 @@ lazy val tauri = project
       config
         .withModuleKind(ModuleKind.ESModule)
     },
+    stFlavour := Flavour.ScalajsReact,
     scalaJSUseMainModuleInitializer := true,
     Compile / packageSrc / mappings ++= {
       val base = (Compile / sourceManaged).value
diff --git a/project/build.properties b/project/build.properties
index c8fcab5..875b706 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=1.6.2
+sbt.version=1.9.2
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 65ed377..55d07fa 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,5 +1,5 @@
 addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
 addSbtPlugin("com.indoorvivants" % "sbt-commandmatrix" % "0.0.5")
-addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta37")
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
+addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta42")
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")

diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index cfe710c..4130eaf 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,8 +1,8 @@
 {
   "$schema": "../node_modules/@tauri-apps/cli/schema.json",
   "build": {
-    "beforeBuildCommand": "npm run build",
-    "beforeDevCommand": "npm run dev",
+    "beforeBuildCommand": "yarn run build",
+    "beforeDevCommand": "yarn run dev",
     "devPath": "http://localhost:3000",
     "distDir": "../dist",
     "withGlobalTauri": true
diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala
index 30cc998..fe1ce8a 100644
--- a/src/main/scala/Main.scala
+++ b/src/main/scala/Main.scala
@@ -2,8 +2,6 @@ import com.indoorvivants.tauri.tauriAppsApi.*
 import scalajs.js.Thenable.Implicits.*
 import concurrent.ExecutionContext.Implicits.global

-import tauriAppsApiMod as tauri
-import tauriAppsApiMod as tauri
 import org.scalajs.dom
 import org.scalablytyped.runtime.StringDictionary

[2]

rm -rf ~/.ivy2/local/org.scalablytyped.com.indoorvivants.tauri ~/.cache/scalablytyped project/target project/project target/ ~/.ivy2/local/org.scalablytyped/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions