Skip to content

Commit

Permalink
modules: don't re-export synthetic expanded classes into new modules.
Browse files Browse the repository at this point in the history
Fixes #471
  • Loading branch information
oyvindberg committed Sep 29, 2022
1 parent b92eb1c commit 07eb5da
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.7.1
1 change: 1 addition & 0 deletions tests/pixi.js/check-3/e/eventemitter3/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.10.0")
2 changes: 1 addition & 1 deletion tests/pixi.js/check-3/p/pixi__utils/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
organization := "org.scalablytyped"
name := "pixi__utils"
version := "0.0-unknown-98d092"
version := "0.0-unknown-05e0f6"
scalaVersion := "3.1.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.7.1
1 change: 1 addition & 0 deletions tests/pixi.js/check-3/p/pixi__utils/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.10.0")
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ object mod {
val EventEmitter: EventEmitterStatic = js.native

/* This class was inferred from a value with a constructor, it was renamed because a distinct type already exists with the same name. */
@JSImport("@pixi/utils", "EventEmitter.EventEmitterCls")
@JSImport("@pixi/utils", "EventEmitter.EventEmitter")
@js.native
open class EventEmitterCls[EventTypes] ()
extends typings.eventemitter3.mod.EventEmitterCls[EventTypes]
extends StObject
with typings.eventemitter3.mod.EventEmitter[EventTypes]

type _To = js.Object & EventEmitterStatic

Expand Down
4 changes: 2 additions & 2 deletions tests/pixi.js/check-3/p/pixi_dot_js/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "pixi_dot_js"
version := "0.0-unknown-3024a5"
version := "0.0-unknown-ba7eae"
scalaVersion := "3.1.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "eventemitter3" % "0.0-unknown-292498",
"org.scalablytyped" %%% "pixi__utils" % "0.0-unknown-98d092")
"org.scalablytyped" %%% "pixi__utils" % "0.0-unknown-05e0f6")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.7.1
1 change: 1 addition & 0 deletions tests/pixi.js/check-3/p/pixi_dot_js/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.10.0")
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object mod {
@js.native
open class ^[EventTypes] ()
extends StObject
with typings.pixiUtils.mod.^[EventTypes]
with typings.eventemitter3.mod.EventEmitter[EventTypes]

@JSImport("pixi.js", "utils.EventEmitter")
@js.native
Expand All @@ -31,10 +31,11 @@ object mod {
val EventEmitter: EventEmitterStatic = js.native

/* This class was inferred from a value with a constructor, it was renamed because a distinct type already exists with the same name. */
@JSImport("pixi.js", "utils.EventEmitter.EventEmitterCls")
@JSImport("pixi.js", "utils.EventEmitter.EventEmitter")
@js.native
open class EventEmitterCls[EventTypes] ()
extends typings.pixiUtils.mod.EventEmitter.EventEmitterCls[EventTypes]
extends StObject
with typings.eventemitter3.mod.EventEmitter[EventTypes]

type _To = js.Object & EventEmitterStatic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ object DeriveCopy {
val name = rename.getOrElse(origName)

val derived = x match {
// these are synthetic, and should be re-expanded downstream
case _: TsDeclClass if x.comments.has[Marker.ExpandedClass.type] =>
IArray.Empty

case x: TsDeclClass =>
IArray(
x.copy(
Expand Down

0 comments on commit 07eb5da

Please sign in to comment.