ScalablyTyped / Converter

Typescript to Scala.js converter
https://scalablytyped.org
GNU General Public License v3.0
218 stars 43 forks source link

@okta/okta-auth-js and @okta/okta-react modules not displaying all modules fields/methods necessary for actual use. #598

Open ackory opened 7 months ago

ackory commented 7 months ago

Hi,

I'm hoping I can get some help here. I am trying to integrate okta authentication with my scala js application. I was recommended to use scalablytyped to help with generating the javascript facades needed. It seems though that while I can get the top level modules working with both @okta/okta-auth-js and @okta/okta-react, I am unable to view or use all methods/properties for the various classes and objects. It seems most are missing.

As an example, the typings.oktaOktaAuthJs.mod.OktaAuth module does not have all the fields/methods available described in the within the npm okta webpage. When I use the js.Object.getOwnPropertyNames method and pass the OktaAuth instantiated object as an argument to it, I am able to view all the fields that are available to the object, but not all of them are available (or displaying) to the actual object when I attempt to use them through the scalablytyped facades.

This is just one example, but I am wondering if I did something wrong when integrating scalablytyped to my application. It seemed to have worked fine, but the missing modules will prevent me from really using this. I'll have to manually type in the js facades, but I was hoping to avoid that. It seems like it should work and provide everything necessary to get okta to function.

Here is my build file with the js settings if that helps:

.jsSettings( //Compile / scalaSource := baseDirectory.value / "src", libraryDependencies ++= Seq( "org.scala-js" %%% "scalajs-dom" % "2.1.0", "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.github.japgolly.scalajs-react" %%% "extra" % "2.1.1", "com.github.japgolly.scalacss" %%% "core" % "1.0.0", "com.github.japgolly.scalacss" %%% "ext-react" % "1.0.0", "org.gnieh" %%% "fs2-data-csv" % "1.7.1", "org.gnieh" %%% "fs2-data-csv-generic" % "1.7.1" ), versionPolicyIntention := Compatibility.BinaryAndSourceCompatible, scalaJSUseMainModuleInitializer := true, jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(), scalaJSLinkerConfig ~= { _.withSourceMap(true).withModuleKind(ModuleKind.CommonJSModule) }, Compile / npmDependencies ++= Seq( "react" -> "17.0.2", "react-dom" -> "17.0.2", "react-router-dom" -> "6.21.3", "react-scripts" -> "5.0.1", "@types/react" -> "17.0.2", "@types/react-dom" -> "17.0.2", "snabbdom" -> "0.5.3", "@okta/okta-auth-js" -> "7.5.0", "@okta/okta-react" -> "6.7.0" ), useYarn := true, stFlavour := Flavour.ScalajsReact, stUseScalaJsDom := false ).jsConfigure { project => project.enablePlugins(ScalaJSBundlerPlugin, ScalaJSPlugin, ScalablyTypedConverterPlugin) }

My apologies if I sound confusing anywhere. Please let me know if I can clarify anything to make better sense of my issue.

Thank you and I appreciate any help you can provide.

mlvn23 commented 7 months ago

Look at the resulting class and/or src_managed in the target directory with your editor

ackory commented 7 months ago

Look at the resulting class and/or src_managed in the target directory with your editor

Thanks for the response. I had a discussion on the scala js discord server on this issue. Looks like the okta library is only exposing the top level modules with scalablytyped. I am hoping this can be fixed at some point, but as for now it was recommended for me to build the js facades manually. I was able to successfully do that and get okta to work.

Thanks.

oyvindberg commented 7 months ago

Likely related to https://github.com/ScalablyTyped/Converter/pull/488 . ST picks out a subset of typescript code in the library, I intend to not do that anymore.

ackory commented 7 months ago

Likely related to #488 . ST picks out a subset of typescript code in the library, I intend to not do that anymore.

Thanks. I'm assuming it's probably a large task and would take some time. For now I am relying on creating facades. Hope to easily integrate these changes soon. Would be very useful to seamlessly use npm packages in scala js without missing modules.

Really appreciate your work on all this.