Skip to content

Commit 7aa584c

Browse files
Format templates with ReScript 12
1 parent dddd366 commit 7aa584c

6 files changed

Lines changed: 28 additions & 24 deletions

File tree

templates/rescript-template-nextjs/src/layouts/MainLayout.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module Navigation = {
1717
<a
1818
className="px-3 font-bold"
1919
target="_blank"
20-
href="https://github.com/rescript-lang/create-rescript-app/tree/master/templates/rescript-template-nextjs">
20+
href="https://github.com/rescript-lang/create-rescript-app/tree/master/templates/rescript-template-nextjs"
21+
>
2122
{React.string("Github")}
2223
</a>
2324
</div>

templates/rescript-template-vite/src/App.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ let make = () => {
2525
<p className="text-center font-thin text-stone-400">
2626
{React.string("Learn more about ")}
2727
<a
28-
href="https://rescript-lang.org/" target="_blank" className="text-blue-500 hover:underline">
28+
href="https://rescript-lang.org/" target="_blank" className="text-blue-500 hover:underline"
29+
>
2930
{React.string("ReScript")}
3031
{React.string(".")}
3132
</a>

templates/rescript-template-xote-ssr/src/Counter.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ let make = () => {
77

88
<div class="flex items-center gap-3 p-6">
99
<button
10-
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700"
11-
onClick={decrement}>
10+
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700" onClick={decrement}
11+
>
1212
{View.text("-")}
1313
</button>
1414
<span class="font-mono text-xl tabular-nums">
1515
{View.signalText(() => Signal.get(count)->Int.toString)}
1616
</span>
1717
<button
18-
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700"
19-
onClick={increment}>
18+
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700" onClick={increment}
19+
>
2020
{View.text("+")}
2121
</button>
2222
</div>

templates/rescript-template-xote-ssr/src/Page.res

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
let make = () => {
33
<main class="min-h-screen bg-slate-50 text-slate-900 flex items-center justify-center p-6">
44
<div
5-
class="max-w-2xl w-full bg-white rounded-2xl shadow-sm border border-slate-200 p-8 space-y-8">
5+
class="max-w-2xl w-full bg-white rounded-2xl shadow-sm border border-slate-200 p-8 space-y-8"
6+
>
67
<header class="space-y-2">
78
<p class="text-xs uppercase tracking-widest text-slate-500">
89
{View.text("xote · ssr template")}
910
</p>
10-
<h1 class="text-3xl font-semibold">{View.text("Welcome to xote")}</h1>
11+
<h1 class="text-3xl font-semibold"> {View.text("Welcome to xote")} </h1>
1112
<p class="text-slate-600">
1213
{View.text(
1314
"A clean slate for building reactive UIs in ReScript, rendered on the server and hydrated on the client.",
1415
)}
1516
</p>
1617
</header>
1718
<section class="space-y-2">
18-
<h2 class="text-sm font-medium text-slate-700">{View.text("Tech stack")}</h2>
19+
<h2 class="text-sm font-medium text-slate-700"> {View.text("Tech stack")} </h2>
1920
<ul class="text-sm text-slate-600 space-y-1 list-disc pl-5">
2021
<li> {View.text("ReScript v12 — typed language compiling to clean JavaScript")} </li>
2122
<li> {View.text("xote — fine-grained reactivity with SSR + hydration")} </li>
@@ -24,10 +25,10 @@ let make = () => {
2425
</ul>
2526
</section>
2627
<section class="space-y-2">
27-
<h2 class="text-sm font-medium text-slate-700">
28-
{View.text("Reactive counter demo")}
29-
</h2>
30-
<div class="border border-slate-200 rounded-lg"> <Counter /> </div>
28+
<h2 class="text-sm font-medium text-slate-700"> {View.text("Reactive counter demo")} </h2>
29+
<div class="border border-slate-200 rounded-lg">
30+
<Counter />
31+
</div>
3132
<p class="text-xs text-slate-500">
3233
{View.text("State is rendered on the server and survives hydration via SSRState.")}
3334
</p>

templates/rescript-template-xote/src/Counter.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ let make = () => {
77

88
<div class="flex items-center gap-3 p-6">
99
<button
10-
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700"
11-
onClick={decrement}>
10+
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700" onClick={decrement}
11+
>
1212
{View.text("-")}
1313
</button>
1414
<span class="font-mono text-xl tabular-nums">
1515
{View.signalText(() => Signal.get(count)->Int.toString)}
1616
</span>
1717
<button
18-
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700"
19-
onClick={increment}>
18+
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700" onClick={increment}
19+
>
2020
{View.text("+")}
2121
</button>
2222
</div>

templates/rescript-template-xote/src/Page.res

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
let make = () => {
33
<main class="min-h-screen bg-slate-50 text-slate-900 flex items-center justify-center p-6">
44
<div
5-
class="max-w-2xl w-full bg-white rounded-2xl shadow-sm border border-slate-200 p-8 space-y-8">
5+
class="max-w-2xl w-full bg-white rounded-2xl shadow-sm border border-slate-200 p-8 space-y-8"
6+
>
67
<header class="space-y-2">
78
<p class="text-xs uppercase tracking-widest text-slate-500">
89
{View.text("xote · csr template")}
910
</p>
10-
<h1 class="text-3xl font-semibold">{View.text("Welcome to xote")}</h1>
11+
<h1 class="text-3xl font-semibold"> {View.text("Welcome to xote")} </h1>
1112
<p class="text-slate-600">
1213
{View.text("A clean slate for building reactive UIs in ReScript.")}
1314
</p>
1415
</header>
1516
<section class="space-y-2">
16-
<h2 class="text-sm font-medium text-slate-700">{View.text("Tech stack")}</h2>
17+
<h2 class="text-sm font-medium text-slate-700"> {View.text("Tech stack")} </h2>
1718
<ul class="text-sm text-slate-600 space-y-1 list-disc pl-5">
1819
<li> {View.text("ReScript v12 — typed language compiling to clean JavaScript")} </li>
1920
<li> {View.text("xote — fine-grained reactivity, no virtual DOM")} </li>
@@ -22,10 +23,10 @@ let make = () => {
2223
</ul>
2324
</section>
2425
<section class="space-y-2">
25-
<h2 class="text-sm font-medium text-slate-700">
26-
{View.text("Reactive counter demo")}
27-
</h2>
28-
<div class="border border-slate-200 rounded-lg"> <Counter /> </div>
26+
<h2 class="text-sm font-medium text-slate-700"> {View.text("Reactive counter demo")} </h2>
27+
<div class="border border-slate-200 rounded-lg">
28+
<Counter />
29+
</div>
2930
</section>
3031
<footer class="text-xs text-slate-500">
3132
{View.text("Edit src/Page.res and src/Counter.res to start building.")}

0 commit comments

Comments
 (0)