Skip to content

Commit

Permalink
feat: add release tag info
Browse files Browse the repository at this point in the history
- with the ci/cd this makes things easier to reason about
  • Loading branch information
thenick775 committed Nov 14, 2024
1 parent 3a4d500 commit 1b34abb
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 3 deletions.
178 changes: 178 additions & 0 deletions gbajs3/package-lock.json

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

1 change: 1 addition & 0 deletions gbajs3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"msw": "^2.0.14",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.1.3",
"unplugin-info": "^1.2.1",
"vite": "^5.0.0",
"vite-plugin-pwa": "^0.21.0",
"vitest": "^2.0.2"
Expand Down
33 changes: 30 additions & 3 deletions gbajs3/src/components/modals/about.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Button } from '@mui/material';
import { Button, Chip } from '@mui/material';
import { useLocalStorage } from '@uidotdev/usehooks';
import { BiCheckCircle } from 'react-icons/bi';
import { styled } from 'styled-components';

import { ModalBody } from './modal-body.tsx';
import { ModalFooter } from './modal-footer.tsx';
Expand All @@ -9,6 +11,20 @@ import { productTourLocalStorageKey } from '../product-tour/consts.tsx';

import type { CompletedProductTourSteps } from '../product-tour/product-tour-intro.tsx';

// eslint-disable-next-line import/no-unresolved -- virtual module
import { lastTag } from '~build/git';

const FlexWrapper = styled.div`
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
`;

const StyledP = styled.p`
margin-bottom: 0;
`;

export const AboutModal = () => {
const { setIsModalOpen } = useModalContext();
const [, setHasCompletedProductTourSteps] = useLocalStorage<
Expand Down Expand Up @@ -38,13 +54,24 @@ export const AboutModal = () => {
</li>
<li>Enjoy, your game will boot!</li>
</ul>
<p>
<StyledP>
See the{' '}
<a href="https://github.com/thenick775/gbajs3/wiki" target="_blank">
WIKI
</a>{' '}
and tour items for further information!
</p>
</StyledP>
<FlexWrapper>
<Chip
label={`Version ${lastTag}`}
component="a"
target="_blank"
href={`https://github.com/thenick775/gbajs3/releases/tag/${lastTag}`}
size="small"
icon={<BiCheckCircle />}
clickable
/>
</FlexWrapper>
</ModalBody>
<ModalFooter>
<Button
Expand Down
1 change: 1 addition & 0 deletions gbajs3/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="vite/client" />
/// <reference types="unplugin-info/client" />

interface ImportMetaEnv {
readonly VITE_GBA_SERVER_LOCATION: string;
Expand Down
2 changes: 2 additions & 0 deletions gbajs3/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { coverageConfigDefaults } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
import { visualizer } from 'rollup-plugin-visualizer';
import Info from 'unplugin-info/vite';

export default defineConfig({
base: './',
Expand Down Expand Up @@ -85,6 +86,7 @@ export default defineConfig({
globPatterns: ['**/*.{js,css,html,wasm}']
}
}),
Info(),
visualizer({ gzipSize: true })
],
optimizeDeps: {
Expand Down

0 comments on commit 1b34abb

Please sign in to comment.