Skip to content

Commit

Permalink
update to adaptive naming scheme, new webpack-dev-server again
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg committed Jan 20, 2020
1 parent cfa6a74 commit e135fc5
Show file tree
Hide file tree
Showing 49 changed files with 2,051 additions and 19,864 deletions.
6 changes: 3 additions & 3 deletions antd/src/main/scala/demo/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import slinky.core.facade.{Hooks, ReactElement}
import slinky.web.html._
import typingsSlinky.antd.antdStrings
import typingsSlinky.antd.components.{List => _, _}
import typingsSlinky.antd.libIconMod.ThemeType
import typingsSlinky.antd.libNotificationMod.{ArgsProps, default => Notification}
import typingsSlinky.antd.libTableInterfaceMod.ColumnProps
import typingsSlinky.antd.iconMod.ThemeType
import typingsSlinky.antd.notificationMod.{ArgsProps, default => Notification}
import typingsSlinky.antd.tableInterfaceMod.ColumnProps

import scala.language.implicitConversions
import scala.scalajs.js
Expand Down
6 changes: 3 additions & 3 deletions antd/src/main/scala/demo/CoordinatedDemo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import slinky.core.{ExternalComponent, SyntheticEvent, TagMod}
import slinky.web.html._
import typingsSlinky.antd.antdStrings
import typingsSlinky.antd.components._
import typingsSlinky.antd.libFormFormMod.{FormCreateOption, GetFieldDecoratorOptions, ValidationRule, WrappedFormUtils}
import typingsSlinky.antd.libGridColMod.ColProps
import typingsSlinky.antd.formFormMod.{FormCreateOption, GetFieldDecoratorOptions, ValidationRule, WrappedFormUtils}
import typingsSlinky.antd.gridColMod.ColProps

import scala.scalajs.js
import scala.scalajs.js.{|, JSON}
Expand All @@ -21,7 +21,7 @@ object CoordinatedDemo {

object Facade {

import typingsSlinky.antd.libFormFormMod.default.{create => createForm}
import typingsSlinky.antd.formFormMod.default.{create => createForm}

/**
* This is an example of something a bit more complicated than just rewriting component types, and which a manually
Expand Down
3,128 changes: 271 additions & 2,857 deletions antd/yarn.lock

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ import org.scalajs.core.tools.linker.ModuleKind

import scala.sys.process.Process

onLoad in Global := {
println("""
|Welcome to ScalablyTyped demos!
|
|These demos demonstrate the Slinky flavour of ScalablyTyped.
|
|For documentation see https://scalablytyped.org .
|
|Note that compiling all the demos at once can be computationally quite
| expensive, so you might have a better experience running `<project>/start`
| than starting all with `start` (though you can!)
|""".stripMargin)
(onLoad in Global).value
}

/**
* Custom task to start demo with webpack-dev-server, use as `<project>/start`.
* Just `start` also works, and starts all frontend demos
Expand Down Expand Up @@ -227,7 +242,7 @@ lazy val scalajsBundler: Project => Project =
_.enablePlugins(ScalaJSBundlerPlugin)
.settings(
/* Specify current versions and modes */
startWebpackDevServer / version := "3.1.11",
startWebpackDevServer / version := "3.10.0",
webpack / version := "4.26.1",
Compile / fastOptJS / webpackExtraArgs += "--mode=development",
Compile / fullOptJS / webpackExtraArgs += "--mode=production",
Expand Down Expand Up @@ -258,13 +273,13 @@ lazy val browserProject: Project => Project =
start := {
(Compile / fastOptJS / startWebpackDevServer).value
val indexFrom = baseDirectory.value / "assets/index.html"
val indexTo = (Compile / fastOptJS / crossTarget).value / "index.html"
val indexTo = (Compile / fastOptJS / crossTarget).value / "index.html"
Files.copy(indexFrom.toPath, indexTo.toPath, REPLACE_EXISTING)
},
dist := {
val artifacts = (Compile / fullOptJS / webpack).value
val artifacts = (Compile / fullOptJS / webpack).value
val artifactFolder = (Compile / fullOptJS / crossTarget).value
val distFolder = (ThisBuild / baseDirectory).value / "docs" / moduleName.value
val distFolder = (ThisBuild / baseDirectory).value / "docs" / moduleName.value

distFolder.mkdirs()
artifacts.foreach { artifact =>
Expand All @@ -277,7 +292,7 @@ lazy val browserProject: Project => Project =
}

val indexFrom = baseDirectory.value / "assets/index.html"
val indexTo = distFolder / "index.html"
val indexTo = distFolder / "index.html"

val indexPatchedContent = {
import collection.JavaConverters._
Expand Down
2 changes: 1 addition & 1 deletion docs/antd/antd-opt-bundle.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/material-ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Material-ui demo</title>
</head>
<body>
<div id="container"></div>

<script type="text/javascript" src="material-ui-opt-bundle.js"></script>
</body>
</html>
63 changes: 63 additions & 0 deletions docs/material-ui/material-ui-opt-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/react-big-calendar/react-big-calendar-opt-bundle.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/react-mobx/react-mobx-opt-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/react-router-dom/react-router-dom-opt-bundle.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/react-slick/react-slick-opt-bundle.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/semantic-ui-react/semantic-ui-react-opt-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/storybook-react/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
}</script><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.841118c09633e6bc5aae.bundle.js"></script><script src="vendors~main.841118c09633e6bc5aae.bundle.js"></script><script src="main.841118c09633e6bc5aae.bundle.js"></script></body></html>
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.2e49a3ee47566fccc925.bundle.js"></script><script src="vendors~main.2e49a3ee47566fccc925.bundle.js"></script><script src="main.2e49a3ee47566fccc925.bundle.js"></script></body></html>

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions material-ui/src/main/scala/demo/Demo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import slinky.core.annotations.react
import slinky.core.facade.{Hooks, ReactElement}
import slinky.web.ReactDOM
import slinky.web.html._
import typingsSlinky.atMaterialDashUiCore.stylesCreateMuiThemeMod.Theme
import typingsSlinky.atMaterialDashUiCore.stylesWithStylesMod.CSSProperties
import typingsSlinky.atMaterialDashUiCore.textFieldTextFieldMod.StandardTextFieldProps
import typingsSlinky.atMaterialDashUiCore.{atMaterialDashUiCoreStrings => MuiStrings, components => Mui}
import typingsSlinky.react.Anon_Children
import typingsSlinky.materialUiCore.createMuiThemeMod.Theme
import typingsSlinky.materialUiCore.withStylesMod.CSSProperties
import typingsSlinky.materialUiCore.textFieldTextFieldMod.StandardTextFieldProps
import typingsSlinky.materialUiCore.{materialUiCoreStrings => MuiStrings, components => Mui}
import typingsSlinky.react.AnonChildren

import scala.scalajs.js
import scala.scalajs.js.|
Expand Down Expand Up @@ -141,14 +141,14 @@ object ButtonTest {
//object StyledFC {
// import scala.language.higherKinds
//
// @inline private def stylesMod = typingsSlinky.atMaterialDashUiCore.stylesMod.asInstanceOf[js.Dynamic]
// @inline private def stylesMod = typingsSlinky.atMaterialUiCore.stylesMod.asInstanceOf[js.Dynamic]
//
// trait GeneratedClassNames[Styles[_] <: js.Object] extends js.Object {
// val classes: Styles[String]
// }
//
// @inline def apply[Styles[_] <: js.Object, P <: js.Object](
// styles: Styles[CSSProperties] | js.Function1[Theme, Styles[CSSProperties]]
// )(f: js.Function1[P with Anon_Children with GeneratedClassNames[Styles], ReactNode]): FC[P] =
// )(f: js.Function1[P with AnonChildren with GeneratedClassNames[Styles], ReactNode]): FC[P] =
// stylesMod.withStyles(styles.asInstanceOf[js.Any])(f).asInstanceOf[FC[P]]
//}
Loading

0 comments on commit e135fc5

Please sign in to comment.