Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions apps/bulls-and-cows/astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import solid from "@astrojs/solid-js";
import tailwindcss from "@tailwindcss/vite";
import { AstroPWAIntegration } from "@vite-pwa/astro";
import { defineConfig } from "astro/config";

export default defineConfig({
output: "static",
integrations: [solid()],
integrations: [
solid(),
AstroPWAIntegration({
manifest: {
name: "Bulls and Cows",
short_name: "Bulls and Cows",
theme_color: "#1B163A",
icons: [
{ src: "icons/192x192.png", sizes: "192x192", type: "image/png" },
{ src: "icons/512x512.png", sizes: "512x512", type: "image/png" },
],
},
}),
],
vite: { plugins: [tailwindcss()], build: { cssTarget: "safari15" } },
site: "https://bulls-and-cows.rman.dev",
});
5 changes: 5 additions & 0 deletions apps/bulls-and-cows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"devDependencies": {
"@astrojs/solid-js": "catalog:",
"@tailwindcss/vite": "catalog:",
"@unplugin-pwa/core": "catalog:",
"@vite-pwa/astro": "catalog:",
"@vite-pwa/workbox-window": "catalog:",
"magicast": "catalog:",
"rolldown": "catalog:",
"wrangler": "catalog:"
}
}
Binary file added apps/bulls-and-cows/public/favicon.ico
Binary file not shown.
Binary file added apps/bulls-and-cows/public/icons/192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/bulls-and-cows/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="@unplugin-pwa/core/info" />
/// <reference types="@unplugin-pwa/core/vanillajs" />

/// <reference types="@vite-pwa/workbox-window" />
/// <reference types="magicast" />
/// <reference types="rolldown" />

declare module "#styles" {}
19 changes: 16 additions & 3 deletions apps/bulls-and-cows/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
---
import { pwaInfo } from "virtual:pwa-info";

import type { JSXElement } from "solid-js";

interface Props {
title: string;
description: string;
canonical: string;
thumbnail: string;
children: () => JSXElement;
}

const { title, description, canonical, thumbnail } = Astro.props;
const { title, description, canonical } = Astro.props;

const thumbnail = "/icons/512x512.png";
---

<html lang="en">
Expand All @@ -33,7 +36,17 @@ const { title, description, canonical, thumbnail } = Astro.props;
<meta name="twitter:image" content={thumbnail} />

<link rel="canonical" href={canonical} />
<link rel="shortcut icon" href={thumbnail} type="image/x-icon" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />

<link rel="apple-touch-icon" href="/icons/192x192.png" />

{pwaInfo && <Fragment set:html={pwaInfo.webManifest.linkTag} />}

<script>
import { registerSW } from "virtual:pwa-register";

registerSW({ immediate: true });
</script>
</head>

<body
Expand Down
3 changes: 1 addition & 2 deletions apps/bulls-and-cows/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ const id = "bulls-and-cows";
const title = "Bulls and Cows";
const canonical = `https://games.rman.dev/${id}`;
const description = `Classic Bulls and Cows game. Play on ${canonical}`;
const thumbnail = `/images/${id}.png`;
---

<Layout {title} {description} {canonical} {thumbnail}>
<Layout {title} {description} {canonical}>
<Game client:load />
</Layout>
78 changes: 56 additions & 22 deletions bun.lock

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
],
"catalog": {
"@astrojs/solid-js": "7.1.1",
"@tailwindcss/vite": "4.3.3",
"@tailwindcss/vite": "4.3.5",
"@unplugin-pwa/core": "0.0.3",
"@vite-pwa/astro": "2.0.0",
"@vite-pwa/workbox-window": "8.0.14",
"astro": "7.4.2",
"magicast": "0.5.5",
"rolldown": "1.2.15",
"solid-js": "1.9.17",
"tailwindcss": "4.3.3",
"tailwindcss": "4.3.5",
"wrangler": "4.152.0"
}
},
Expand Down
Loading