From a10c5be6899f816e9f80a91c741626855e00d5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Thu, 18 Jun 2020 00:16:40 +0200 Subject: [PATCH] Enforce custom package for library plugin --- .../plugin/ScalablyTypedConverterGenSourcePlugin.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbt-converter/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterGenSourcePlugin.scala b/sbt-converter/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterGenSourcePlugin.scala index 4c808b7e3f..b8e2d1c0cb 100644 --- a/sbt-converter/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterGenSourcePlugin.scala +++ b/sbt-converter/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterGenSourcePlugin.scala @@ -6,7 +6,7 @@ import java.time.Instant import com.olvind.logging import com.olvind.logging.LogLevel import org.scalablytyped.converter.internal.importer.jsonCodecs.{FileDecoder, FileEncoder} -import org.scalablytyped.converter.internal.scalajs.QualifiedName +import org.scalablytyped.converter.internal.scalajs.{Name, QualifiedName} import org.scalablytyped.converter.internal.ts.TsIdentLibrary import org.scalablytyped.converter.internal._ import sbt.Keys._ @@ -63,6 +63,10 @@ object ScalablyTypedConverterGenSourcePlugin extends AutoPlugin { } val conversion = stConversionOptions.value + if (conversion.outputPackage == Name.typings) { + logger.fatal("You must set `stOutputPackage` to a custom package") + } + val minimizeKeep = IArray .fromTraversable(stMinimizeKeep.value) .map(str => QualifiedName(conversion.outputPackage +: QualifiedName(str).parts))