Skip to content

Commit

Permalink
feat: listed versioning for beta builds (Longhorn-Developers#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
Razboy20 authored and caseycharleston committed Mar 30, 2024
1 parent da10f0f commit 9d7862b
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 55 deletions.
1 change: 0 additions & 1 deletion .env.development

This file was deleted.

Empty file removed .env.production
Empty file.
13 changes: 0 additions & 13 deletions @types/css-imports.d.ts

This file was deleted.

22 changes: 0 additions & 22 deletions @types/environment.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions @types/svg-import.d.ts

This file was deleted.

10 changes: 10 additions & 0 deletions @types/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_PACKAGE_VERSION: string;
readonly VITE_BETA_BUILD?: 'true';
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "ut-registration-plus",
"displayName": "UT Registration Plus",
"version": "2.0.0-beta1",
"description": "The UT Registration Plus extension is a Chrome extension that allows students to easily register for classes at The University of Texas at Austin.",
"version": "2.0.0-beta2",
"description": "UT Registration Plus is a Chrome extension that allows students to easily register for classes.",
"private": true,
"homepage": "sriramhariharan.com",
"homepage": "https://github.com/Longhorn-Developers/UT-Registration-Plus",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
24 changes: 23 additions & 1 deletion src/pages/options/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ExtensionRoot from '@views/components/common/ExtensionRoot/ExtensionRoot';
import Link from '@views/components/common/Link';
import React from 'react';

/**
Expand All @@ -7,7 +8,28 @@ import React from 'react';
export default function App() {
return (
<ExtensionRoot>
<div>hello how are you doing today.</div>
<div className='text-base'>
<div className='font-serif'>
<i>&ldquo;Real powerusers modify the sourcecode instead of using settings&rdquo;</i> - doprz
</div>
<div className='font-serif'>
<i>
&ldquo;become hackerman, go to{' '}
<Link
href='https://github.com/Longhorn-Developers/UT-Registration-Plus'
className='link font-serif! italic!'
>
github
</Link>{' '}
yay&rdquo;
</i>{' '}
- razboy20
</div>
<p className='mt-2.5 text-sm text-ut-gray'>
{import.meta.env.VITE_PACKAGE_VERSION} - {import.meta.env.MODE}{' '}
{import.meta.env.VITE_BETA_BUILD ? 'beta' : ''}
</p>
</div>
</ExtensionRoot>
);
}
4 changes: 2 additions & 2 deletions src/views/components/calendar/CalendarFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export default function CalendarFooter(): JSX.Element {
<Link className='linkanimate' href='#'>
<InstagramIcon className='h-6 w-6' />
</Link>
<Link className='linkanimate' href='#'>
<Link className='linkanimate' href='https://discord.gg/bVh9g6VFwB'>
<DiscordIcon className='h-6 w-6' />
</Link>
<Link className='linkanimate' href='#'>
<Link className='linkanimate' href='https://github.com/Longhorn-Developers/UT-Registration-Plus'>
<GithubIcon className='h-6 w-6' />
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/calendar/TeamLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const links: LinkItem[] = [
},
{
text: 'Become a Beta Tester',
url: '#',
url: 'https://discord.gg/bVh9g6VFwB',
},
];

Expand Down
14 changes: 12 additions & 2 deletions src/views/components/common/LogoIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export function SmallLogo({ className }: { className?: string }): JSX.Element {
<LogoIcon />
<div className='flex flex-col text-lg font-medium leading-[1em]'>
<p className='text-nowrap text-ut-burntorange'>UT Registration</p>
<p className='text-ut-orange'>Plus</p>
<p className='text-ut-orange'>
Plus{' '}
<span className='text-xs'>
{import.meta.env.VITE_BETA_BUILD ? `(${import.meta.env.VITE_PACKAGE_VERSION})` : ''}
</span>
</p>
</div>
</div>
);
Expand All @@ -48,7 +53,12 @@ export function LargeLogo({ className }: { className?: string }): JSX.Element {
<LogoIcon className='h-12 w-12' />
<div className='hidden flex-col text-[1.35rem] font-medium leading-[1em] md:flex screenshot:flex'>
<p className='text-nowrap text-ut-burntorange'>UT Registration</p>
<p className='text-ut-orange'>Plus</p>
<p className='text-ut-orange'>
Plus{' '}
<span className='text-sm'>
{import.meta.env.VITE_BETA_BUILD ? `(${import.meta.env.VITE_PACKAGE_VERSION})` : ''}
</span>
</p>
</div>
</div>
);
Expand Down
10 changes: 8 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"module": "esnext",
"noEmit": true,
"jsx": "react",
"typeRoots": ["./node_modules/@types", "./@types/"],
"typeRoots": [
"./node_modules/@types",
"@types"
],
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
Expand All @@ -32,12 +35,15 @@
"src",
"utils",
"vite.config.ts",
"@types",
"node_modules/@types",
"src/manifest.ts",
"package.json",
".eslintrc.cjs",
"postcss.config.cjs",
".storybook",
"unocss.config.ts"
]
,
"@types"
]
}
8 changes: 6 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import type { Plugin, ResolvedConfig, Rollup, ViteDevServer } from 'vite';
import { defineConfig } from 'vite';
import inspect from 'vite-plugin-inspect';

import packageJson from './package.json';
import manifest from './src/manifest';

const root = resolve(__dirname, 'src');
const pagesDir = resolve(root, 'pages');
const assetsDir = resolve(root, 'assets');
const outDir = resolve(__dirname, 'dist');
const publicDir = resolve(__dirname, 'public');

const isDev = process.env.NODE_ENV === 'development';
const isBeta = !!process.env.BETA;
if (isBeta) {
process.env.VITE_BETA_BUILD = 'true';
}
process.env.VITE_PACKAGE_VERSION = packageJson.version;

export const preambleCode = `
import RefreshRuntime from "__BASE__@react-refresh"
Expand Down

0 comments on commit 9d7862b

Please sign in to comment.