Skip to content

Commit

Permalink
Fix live demo (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheleb committed Oct 6, 2023
1 parent 43cbf7e commit 2798f68
Show file tree
Hide file tree
Showing 8 changed files with 2,208 additions and 774 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches: ["master", "fix-live-demo"]
paths-ignore:
- "**/*.md"

Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
run: |
cd example/client
npm install
- name: ScalaJS build
run: sbt example-client/fastLinkJS
# - name: ScalaJS build
# run: sbt example-client/fastLinkJS
- name: Vite build
run: |
cd example/client
Expand Down
20 changes: 20 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//import ProjectDef._
import java.nio.charset.StandardCharsets
import org.scalajs.linker.interface.ModuleSplitStyle

val scala33 = "3.3.1"
Expand Down Expand Up @@ -177,3 +178,22 @@ def scalajsProject(projectId: String, folder: Option[String] = None): Project =
"-Xfatal-warnings"
)
)

Global / onLoad := {
val scalaVersionValue = (example / scalaVersion).value
val outputFile =
baseDirectory.value / "example" / "client" / "scala-metadata.js"
IO.writeLines(
outputFile,
s"""
|const scalaVersion = "$scalaVersionValue"
|
|exports.scalaMetadata = {
| scalaVersion: scalaVersion
|}
|""".stripMargin.split("\n").toList,
StandardCharsets.UTF_8
)

(Global / onLoad).value
}
10 changes: 4 additions & 6 deletions example/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/png" href="https://sap.github.io/ui5-webcomponents/assets/images/ui5-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/style.css" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/default.min.css" />
<!-- Loads the Quicksand font -->
<link href="https://fonts.googleapis.com/css?family=Quicksand:300,400,500,700" rel="stylesheet" />
<title>Vite App</title>
<title>Demo Laminar SAP UI5 bindings</title>
</head>

<body>
<div id="app"></div>
<!-- <script type="module" src="/target/scala-3.3.0-RC6/example-client-fastopt/main.js"></script> -->
<script type="module" src="/target/scala-3.3.1/example-client-fastopt/main.js"></script>
<%- script %>
</body>

</html>
Loading

0 comments on commit 2798f68

Please sign in to comment.