feat: listed versioning for beta builds (#192)

This commit is contained in:
Razboy20
2024-03-22 12:15:44 -05:00
committed by GitHub
parent 36ac8607a9
commit 0c42979423
13 changed files with 65 additions and 55 deletions

View File

@@ -1 +0,0 @@
MANIFEST_KEY=

View File

View File

@@ -1,13 +0,0 @@
declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}
declare module '*.module.scss' {
const classes: { [key: string]: string };
export default classes;
}
declare module '*.mp3' {
const src: string;
export default src;
}

View File

@@ -1,22 +0,0 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'development' | 'production';
CI?: string;
/** set this to make sure the extension id is the same for unpacked extensions
* @see https://developer.chrome.com/docs/apps/app_identity/#copy_key */
MANIFEST_KEY?: string;
/**
* The Node semantic versioning-compatible version of the extension. For preview-style releases, this variable
* converts versions like 1.0.0.100 to 1.0.0-beta.1.
*/
SEMANTIC_VERSION?: string;
}
}
type Environment = typeof process.env.NODE_ENV;
}
// If this file has no import/export statements (i.e. is a script)
// convert it into a module by adding an empty export statement.
export {};

View File

@@ -1,6 +0,0 @@
declare module "*.svg" {
import { ReactElement, SVGProps } from "react";
const ReactComponent: (props: SVGProps<SVGElement>) => ReactElement;
export default ReactComponent;
}

10
@types/vite-env.d.ts vendored Normal file
View File

@@ -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;
}

View File

@@ -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",

View File

@@ -1,4 +1,5 @@
import ExtensionRoot from '@views/components/common/ExtensionRoot/ExtensionRoot';
import Link from '@views/components/common/Link';
import React from 'react';
/**
@@ -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>
);
}

View File

@@ -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>

View File

@@ -24,7 +24,7 @@ const links: LinkItem[] = [
},
{
text: 'Become a Beta Tester',
url: '#',
url: 'https://discord.gg/bVh9g6VFwB',
},
];

View File

@@ -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>
);
@@ -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>
);

View File

@@ -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,
@@ -32,6 +35,7 @@
"src",
"utils",
"vite.config.ts",
"@types",
"node_modules/@types",
"src/manifest.ts",
"package.json",
@@ -39,5 +43,7 @@
"postcss.config.cjs",
".storybook",
"unocss.config.ts"
]
,
"@types"
]
}

View File

@@ -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"