diff --git a/.github/actions/setup-node-deps/action.yml b/.github/actions/setup-node-deps/action.yml index 45a1a25e..e6b026c1 100644 --- a/.github/actions/setup-node-deps/action.yml +++ b/.github/actions/setup-node-deps/action.yml @@ -1,5 +1,5 @@ name: Setup Node and dependencies -description: Install Node.js 22.x and npm dependencies from the lockfile. +description: Install Node.js 22.x and npm dependencies. runs: using: composite diff --git a/README.md b/README.md index 463a3c5c..e2844946 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ Don't worry- if you get stuck feel free to ask around in the [discord](https://d ```bash git clone https://github.com/YOUR_USERNAME_FORKED_WITH/BetterSEQTA-Plus cd BetterSEQTA-Plus -npm install --legacy-peer-deps +npm install npm run dev -```` +``` Then load `dist` in `chrome://extensions` (Developer Mode → Load unpacked). diff --git a/docs/GETTING_STARTED_CONTRIBUTING.md b/docs/GETTING_STARTED_CONTRIBUTING.md index 7adad9af..d5c883b3 100644 --- a/docs/GETTING_STARTED_CONTRIBUTING.md +++ b/docs/GETTING_STARTED_CONTRIBUTING.md @@ -17,7 +17,7 @@ Welcome to BetterSEQTA+! 🎉 This guide will walk you through making your first ## Before You Start ### What You'll Need -- **Node.js** (v16 or higher) - [Download here](https://nodejs.org/) +- **Node.js** (v22.12 or higher) - [Download here](https://nodejs.org/) - **Git** - [Download here](https://git-scm.com/) - **A code editor** - We recommend [VS Code](https://code.visualstudio.com/) - **A Chromium browser** (Chrome, Edge, Brave) for testing (recommended, however you can use firefox although it requires being built every time you make a change) diff --git a/docs/installation.md b/docs/installation.md index 698ecf0d..53ac5b83 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -8,7 +8,7 @@ This guide will walk you through the process of installing and setting up Better Before you begin, make sure you have the following installed: -- [npm](https://www.npmjs.com/) (v7 or higher) or [Bun](https://bun.sh/) (recommended) +- [Node.js](https://nodejs.org/) v22.12 or higher - A modern web browser (Chrome, Firefox, Edge, etc.) ## Installation Methods @@ -43,24 +43,16 @@ If you want to develop for BetterSEQTA+ or modify the code, follow these steps: ### 1. Clone the Repository ```bash -git clone https://github.com/SeqtaLearning/betterseqta-plus.git -cd betterseqta-plus +git clone https://github.com/BetterSEQTA/BetterSEQTA-Plus.git +cd BetterSEQTA-Plus ``` ### 2. Install Dependencies -Using npm: - ```bash npm install ``` -Using Bun (recommended): - -```bash -bun install -``` - ### 3. Set Up Environment Variables - Only required for pushing to extension stores from the command line Copy the example environment file: @@ -73,18 +65,10 @@ Edit the `.env` file with your SEQTA credentials and settings. ### 4. Start the Development Server -Using npm: - ```bash npm run dev ``` -Using Bun: - -```bash -bun run dev -``` - This will start a development server and build the extension in watch mode. ### 5. Load the Extension in Your Browser @@ -93,7 +77,7 @@ This will start a development server and build the extension in watch mode. 1. Open Chrome/Edge and navigate to `chrome://extensions` or `edge://extensions` 2. Enable "Developer mode" using the toggle in the top right -3. Click "Load unpacked" and select the `dist` folder in your BetterSEQTA+ directory +3. Click "Load unpacked" and select the `dist/chrome` folder in your BetterSEQTA+ directory 4. The extension should now appear in your extensions list #### Firefox @@ -124,13 +108,6 @@ rm -rf node_modules npm install ``` -Or with Bun: - -```bash -rm -rf node_modules -bun install -``` - #### Extension not appearing in SEQTA Make sure: @@ -168,14 +145,6 @@ npm install npm run dev ``` -Or with Bun: - -```bash -git pull -bun install -bun run dev -``` - ## Next Steps Now that you have BetterSEQTA+ installed, you can: diff --git a/package-lock.json b/package-lock.json index ee0e7d3a..5002d5eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "@types/qrcode": "^1.5.6", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", + "@types/semver": "^7.8.0", "@types/sortablejs": "^1.15.9", "@types/webextension-polyfill": "^0.12.6", "cross-env": "^10.1.0", @@ -4328,6 +4329,13 @@ "@types/react": "^19.3.0" } }, + "node_modules/@types/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/sortablejs": { "version": "1.15.9", "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.9.tgz", diff --git a/package.json b/package.json index 07a39a0a..2f7d26b2 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "@types/qrcode": "^1.5.6", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", + "@types/semver": "^7.8.0", "@types/sortablejs": "^1.15.9", "@types/webextension-polyfill": "^0.12.6", "cross-env": "^10.1.0", diff --git a/src/background.ts b/src/background.ts index 094a275e..085d3f0f 100644 --- a/src/background.ts +++ b/src/background.ts @@ -26,7 +26,7 @@ import { refreshRemoteConfig, } from "./background/remoteConfig"; import { BSPLUS_INSTALL_REGISTERED_AT_KEY } from "@/seqta/utils/remoteConfig/storageKeys"; -import { DEFAULT_BACKGROUND_PENDING_KEY } from "@/seqta/ui/defaultBackground"; +import { DEFAULT_BACKGROUND_PENDING_KEY } from "@/seqta/ui/defaultBackgroundKey"; import { handleSearchThemeStockPhotos } from "./background/searchThemeStockPhotos"; import { bsplusApiQueryParams, withBsplusApiQuery } from "@/seqta/utils/bsplusClientContext"; import { initTimetableClassmatesBackgroundSync } from "./background/timetableClassmatesSync"; @@ -769,11 +769,17 @@ async function resetThemeOfTheMonthDismissalFor370Upgrade( } } +async function disableAnimatedBackground(): Promise { + const key = "plugin.animated-background.settings"; + const stored = await browser.storage.local.get(key); + await browser.storage.local.set({ [key]: { ...(stored[key] as object), enabled: false } }); +} + browser.runtime.onInstalled.addListener(function (event) { browser.storage.local.remove(["justupdated"]); browser.storage.local.remove(["data"]); - void ensureSyncableStorageDefaults(); + const defaultsReady = ensureSyncableStorageDefaults(); if (event.reason == "install" || event.reason == "update") { browser.storage.local.set({ justupdated: true }); @@ -792,6 +798,7 @@ browser.runtime.onInstalled.addListener(function (event) { if (event.reason === "install") { void refreshRemoteConfig(apiBase); void browser.storage.local.set({ [DEFAULT_BACKGROUND_PENDING_KEY]: true }); + void defaultsReady.catch(() => undefined).then(disableAnimatedBackground); } }); diff --git a/src/css/tailwind.css b/src/css/tailwind.css index 25c9a548..835483b5 100644 --- a/src/css/tailwind.css +++ b/src/css/tailwind.css @@ -1,4 +1,3 @@ -/* Shared Tailwind setup for every stylesheet that uses utilities. */ @import "tailwindcss" source("../"); @plugin "@tailwindcss/forms"; @@ -35,7 +34,6 @@ } @layer base { - /* Tailwind 4 defaults borders to `currentcolor`; keep the v3 look. */ *, ::after, ::before, diff --git a/src/interface/components/store/ThemeCard.svelte b/src/interface/components/store/ThemeCard.svelte index 64c484be..e7950f86 100644 --- a/src/interface/components/store/ThemeCard.svelte +++ b/src/interface/components/store/ThemeCard.svelte @@ -119,7 +119,7 @@