From 67db26514bd38284cf12606c938387e65aa06645 Mon Sep 17 00:00:00 2001 From: Thorsten Lorenz Date: Mon, 29 Jan 2024 16:17:09 +0100 Subject: [PATCH] feat: delete snapshots + minor improvs (#2) * chore: fix config to work locally * feat: add delete snapshots action --- next.config.mjs | 6 ++++-- src/lib/luzid-methods.ts | 6 ++++++ src/pages/index.tsx | 16 ++++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 5a3b779..19d2fa7 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,3 +1,5 @@ +const buildingGhPages = process.env.CI != null + /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, @@ -6,14 +8,14 @@ const nextConfig = { * * @see https://nextjs.org/docs/app/building-your-application/deploying/static-exports */ - output: 'export', + output: buildingGhPages ? 'export' : 'standalone', /** * Set base path. This is the slug of your GitHub repository. * * @see https://nextjs.org/docs/app/api-reference/next-config-js/basePath */ - basePath: '/ex-tictactoe.web', + basePath: buildingGhPages ? '/ex-tictactoe.web' : '', /** * Disable server-based image optimization. Next.js does not support diff --git a/src/lib/luzid-methods.ts b/src/lib/luzid-methods.ts index 6b8ba61..6489b7f 100644 --- a/src/lib/luzid-methods.ts +++ b/src/lib/luzid-methods.ts @@ -62,4 +62,10 @@ export class GameLuzid { ).setData(data, { size }) ) } + + async deleteAppSnapshots() { + return this.luzid.snapshot.deleteSnapshotsMatching({ + group: SNAPSHOT_GROUP, + }) + } } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e658d22..6738fe1 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -142,6 +142,14 @@ export default function Home() { > Set Winning State +