diff --git a/.env.example b/.env.example
new file mode 100644
index 00000000..1bfca606
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,3 @@
+# Optional OAuth client ID overrides (secrets live on accounts.betterseqta.org)
+# GOOGLE_OAUTH_CLIENT_ID=your-id.apps.googleusercontent.com
+# OUTLOOK_OAUTH_CLIENT_ID=your-azure-application-client-id
diff --git a/.github/actions/build-extension/action.yml b/.github/actions/build-extension/action.yml
index c5368033..57918b56 100644
--- a/.github/actions/build-extension/action.yml
+++ b/.github/actions/build-extension/action.yml
@@ -33,14 +33,8 @@ outputs:
runs:
using: composite
steps:
- - name: Use Node.js 20.x
- uses: actions/setup-node@v4
- with:
- node-version: 20.x
-
- - name: Install dependencies
- shell: bash
- run: npm install --legacy-peer-deps
+ - name: Setup Node and dependencies
+ uses: ./.github/actions/setup-node-deps
- name: Read version
id: version
@@ -62,14 +56,4 @@ runs:
env:
UPDATE_CHANNEL: ${{ inputs.update_channel }}
BUILD_LABEL: ${{ inputs.build_label }}
- run: |
- VERSION="${{ steps.version.outputs.version }}"
- if [ "$UPDATE_CHANNEL" = "nightly" ] && [ -n "$BUILD_LABEL" ]; then
- BASE="betterseqtaplus-nightly-${BUILD_LABEL}"
- else
- BASE="betterseqtaplus-${VERSION}"
- fi
- (cd dist/chrome && zip -r "../${BASE}-chrome.zip" .)
- (cd dist/firefox && zip -r "../${BASE}-firefox.zip" .)
- echo "chrome_zip=dist/${BASE}-chrome.zip" >> "$GITHUB_OUTPUT"
- echo "firefox_zip=dist/${BASE}-firefox.zip" >> "$GITHUB_OUTPUT"
+ run: node scripts/package-extension-zips.mjs "${{ steps.version.outputs.version }}"
diff --git a/.github/actions/run-lint/action.yml b/.github/actions/run-lint/action.yml
new file mode 100644
index 00000000..6f9e9ae4
--- /dev/null
+++ b/.github/actions/run-lint/action.yml
@@ -0,0 +1,11 @@
+name: Run lint
+description: Run ESLint on src.
+
+runs:
+ using: composite
+ steps:
+ - name: Lint
+ shell: bash
+ run: npm run lint
+ env:
+ ESLINT_USE_FLAT_CONFIG: "false"
diff --git a/.github/actions/run-smoke-tests/action.yml b/.github/actions/run-smoke-tests/action.yml
new file mode 100644
index 00000000..4723f5ce
--- /dev/null
+++ b/.github/actions/run-smoke-tests/action.yml
@@ -0,0 +1,9 @@
+name: Run smoke tests
+description: Verify built extension dist output.
+
+runs:
+ using: composite
+ steps:
+ - name: Smoke tests
+ shell: bash
+ run: npm run test:smoke
diff --git a/.github/actions/run-unit-tests/action.yml b/.github/actions/run-unit-tests/action.yml
new file mode 100644
index 00000000..6c92a48a
--- /dev/null
+++ b/.github/actions/run-unit-tests/action.yml
@@ -0,0 +1,9 @@
+name: Run unit tests
+description: Run Jest unit tests.
+
+runs:
+ using: composite
+ steps:
+ - name: Unit tests
+ shell: bash
+ run: npm run test:unit
diff --git a/.github/actions/setup-node-deps/action.yml b/.github/actions/setup-node-deps/action.yml
new file mode 100644
index 00000000..c1e247c6
--- /dev/null
+++ b/.github/actions/setup-node-deps/action.yml
@@ -0,0 +1,14 @@
+name: Setup Node and dependencies
+description: Install Node.js 22.x and npm dependencies.
+
+runs:
+ using: composite
+ steps:
+ - name: Use Node.js 22.x
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22.x
+
+ - name: Install dependencies
+ shell: bash
+ run: npm install --legacy-peer-deps
diff --git a/.github/workflows/mvp.yml b/.github/workflows/mvp.yml
deleted file mode 100644
index c461ef9f..00000000
--- a/.github/workflows/mvp.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-name: NodeJS Build
-
-on:
- push:
- branches: ["main"]
-
-jobs:
- build:
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- node-version: [20.x]
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node-version }}
-
- - name: Build
- run: |
- npm install --legacy-peer-deps
- npm run build
-
- - name: Zip dist folder
- run: |
- zip -r dist.zip dist
-
- - name: Upload artifact
- uses: actions/upload-artifact@v4
- with:
- name: dist-zip
- path: dist.zip
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 5974de2c..cc7dcb78 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -1,11 +1,18 @@
# Nightly release workflow — updates the same "nightly" release with fresh builds from main.
# Runs only on BetterSEQTA/BetterSEQTA-Plus. Uses the default GITHUB_TOKEN.
+#
+# Scheduled at midnight Australia/Adelaide (ACST/ACDT). GitHub cron is UTC-only, so we
+# trigger at 13:30 and 14:30 UTC and only proceed when Adelaide local time is 00:00.
+# Builds on windows-latest (matches local dev; Linux nightly builds were failing on Vite/Svelte).
name: Nightly Release
on:
schedule:
- - cron: "0 3 * * *"
+ # 13:30 UTC = 00:00 Adelaide during daylight saving (ACDT, UTC+10:30)
+ - cron: "30 13 * * *"
+ # 14:30 UTC = 00:00 Adelaide during standard time (ACST, UTC+9:30)
+ - cron: "30 14 * * *"
workflow_dispatch:
permissions:
@@ -13,19 +20,41 @@ permissions:
env:
NIGHTLY_TAG: nightly
+ GH_TOKEN: ${{ github.token }}
jobs:
nightly:
- runs-on: ubuntu-latest
+ runs-on: windows-latest
+ defaults:
+ run:
+ shell: bash
steps:
+ - name: Check Adelaide midnight
+ id: time_check
+ run: |
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
+ echo "proceed=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+ TZ=Australia/Adelaide
+ if [ "$(date +%H%M)" = "0000" ]; then
+ echo "proceed=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "proceed=false" >> "$GITHUB_OUTPUT"
+ echo "Skipping: not midnight Australia/Adelaide ($(date +%Y-%m-%d %H:%M %Z))"
+ fi
+
- uses: actions/checkout@v4
+ if: steps.time_check.outputs.proceed == 'true'
- name: Set build date
id: build_date
- run: echo "date=$(date -u +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
+ if: steps.time_check.outputs.proceed == 'true'
+ run: echo "date=$(TZ=Australia/Adelaide date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Build extension
id: build
+ if: steps.time_check.outputs.proceed == 'true'
uses: ./.github/actions/build-extension
with:
gh_release_update_check: "true"
@@ -34,6 +63,7 @@ jobs:
release_repo: ${{ github.repository }}
- name: Ensure nightly release exists
+ if: steps.time_check.outputs.proceed == 'true'
run: |
TITLE="Nightly (${{ steps.build_date.outputs.date }})"
if ! gh release view "${{ env.NIGHTLY_TAG }}" 2>/dev/null; then
@@ -46,6 +76,7 @@ jobs:
fi
- name: Upload nightly assets
+ if: steps.time_check.outputs.proceed == 'true'
run: |
gh release upload "${{ env.NIGHTLY_TAG }}" \
--clobber \
diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml
index dbc5ab58..fbf2ce76 100644
--- a/.github/workflows/pr-ci.yml
+++ b/.github/workflows/pr-ci.yml
@@ -1,35 +1,63 @@
-name: PR CI
+name: CI
on:
pull_request:
branches: ["main"]
+ push:
+ branches: ["main"]
jobs:
- ci:
- runs-on: ubuntu-latest
+ lint:
+ # windows-latest: Vite/Svelte build fails on Linux CI for layerchart vendor .svelte (see nightly.yml).
+ runs-on: windows-latest
+ defaults:
+ run:
+ shell: bash
steps:
- uses: actions/checkout@v4
- - name: Use Node.js 20.x
- uses: actions/setup-node@v4
- with:
- node-version: 20.x
+ - name: Setup Node and dependencies
+ uses: ./.github/actions/setup-node-deps
- - name: Install dependencies
- run: npm install --legacy-peer-deps
+ - name: Run lint
+ uses: ./.github/actions/run-lint
- - name: Lint
- run: npm run lint
- env:
- ESLINT_USE_FLAT_CONFIG: "false"
+ unit-tests:
+ runs-on: windows-latest
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v4
- - name: Unit tests
- run: npm test
+ - name: Setup Node and dependencies
+ uses: ./.github/actions/setup-node-deps
+
+ - name: Run unit tests
+ uses: ./.github/actions/run-unit-tests
+
+ build-and-smoke:
+ needs: [lint, unit-tests]
+ runs-on: windows-latest
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v4
- name: Build extension
+ id: build
uses: ./.github/actions/build-extension
with:
gh_release_update_check: "false"
- - name: Smoke tests
- run: npm run test:smoke
+ - name: Upload extension zips
+ uses: actions/upload-artifact@v4
+ with:
+ name: extension-zips
+ path: |
+ ${{ steps.build.outputs.chrome_zip }}
+ ${{ steps.build.outputs.firefox_zip }}
+
+ - name: Run smoke tests
+ uses: ./.github/actions/run-smoke-tests
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 10596a81..bbf2646f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -16,6 +16,9 @@ on:
permissions:
contents: write
+env:
+ GH_TOKEN: ${{ github.token }}
+
jobs:
release:
runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index 302d14da..311312a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,9 @@ bun.lock
# PDF.js extension assets (copied by postinstall from pdfjs-dist)
src/public/resources/pdfjs/pdf.worker.min.mjs
src/public/resources/pdfjs/pdf.legacy.min.mjs
+# ONNX Runtime WASM assets (copied by postinstall from @huggingface/transformers)
+src/public/resources/ort/ort-wasm-simd-threaded.jsep.mjs
+src/public/resources/ort/ort-wasm-simd-threaded.jsep.wasm
# Build
extension.zip
diff --git a/.parcelrc b/.parcelrc
deleted file mode 100644
index 6f883d01..00000000
--- a/.parcelrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-"transformers": {
- "raw:*": ["@parcel/transformer-raw"]
- }
-}
\ No newline at end of file
diff --git a/README.md b/README.md
index 8b8c83fa..463a3c5c 100644
--- a/README.md
+++ b/README.md
@@ -3,11 +3,11 @@
- A beautiful 🤩 Chrome Extension that adds additional features and gives an overall better experience for SEQTA Learn.Currently looking for contributors 🔥
+ A beautiful 🤩 browser extension that transforms SEQTA with modern themes, powerful customization, productivity tools, and an improved user experience. Contributions are always welcome!
-
+
@@ -16,15 +16,16 @@
-## 📚 Documentation
-All documentation has been moved to the [official docs site](https://docs.betterseqta.org):
+## Documentation
+
+Everything you need to get started with BetterSEQTA+ can be found in the [official documentation](https://docs.betterseqta.org).
Includes:
-- Getting started
-- Development setup
+- Getting Started
+- Installation & Development
- Architecture
-- Plugin system
-- Theme creation
+- Plugin System
+- Theme Creation
## Features
@@ -72,8 +73,7 @@ npm run dev
Then load `dist` in `chrome://extensions` (Developer Mode → Load unpacked).
-Full setup guide:
-[https://betterseqta.github.io/BetterSEQTA-Docs/install/#for-developers-development-environment](https://betterseqta.github.io/BetterSEQTA-Docs/install/#for-developers-development-environment)
+Full development setup guide can be found [here](https://docs.betterseqta.org/install/#for-developers-development-environment).
## Contributors
@@ -85,10 +85,9 @@ Want to contribute? [Click Here!](https://docs.betterseqta.org/contributing/)
## Credits
-This extension was initially developed by [Nulkem](https://github.com/Nulkem/betterseqta), was ported to manifest V3 by [MEGA-Dawg68](https://github.com/MEGA-Dawg68) and is currently under active development from lead developers [SethBurkart123](https://github.com/SethBurkart123) and [Crazypersonalph](https://github.com/Crazypersonalph) with help from other volunteers.
-Originally developed by [Nulkem](https://github.com/Nulkem/betterseqta)
-Ported to Manifest V3 by [MEGA-Dawg68](https://github.com/MEGA-Dawg68)
-Maintained by [SethBurkart123](https://github.com/SethBurkart123), [Crazypersonalph](https://github.com/Crazypersonalph) & the rest of the BetterSEQTA team!
+Originally developed by [Nulkem](https://github.com/Nulkem/betterseqta)
+Ported to Manifest V3 by [MEGA-Dawg68](https://github.com/MEGA-Dawg68)
+Maintained by [SethBurkart123](https://github.com/SethBurkart123), [Crazypersonalph](https://github.com/Crazypersonalph) & the rest of the BetterSEQTA team!
## Star History
diff --git a/SECURITY.md b/SECURITY.md
index f884bbf3..d8e4e370 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,15 +2,15 @@
## Supported Versions
-Below here is the supported versions of BetterSEQTA+. Anything older than this is not supported and contains bugs.
+The following versions of BetterSEQTA+ are currently supported.
| Version | Supported |
| ------- | --------- |
-| 3.4.3 | ✅ |
-| < 3.4.3 | :x: |
-
-`*` May not work on other devices.
+| 3.4.3 or later | ✅ |
+| Earlier than 3.4.3 | ❌ |
## Reporting a Vulnerability
-If you find vulnerabilities, REPORT IT IMMEDIATELY. open the [advisories tab](https://github.com/BetterSEQTA/BetterSEQTA-Plus/security/advisories) on the left and click the green "report a vulnerability" button or use [this quick-link](https://github.com/BetterSEQTA/BetterSEQTA-Plus/security/advisories/new) to create a new report
+If you discover a security vulnerability, please report it responsibly through GitHub Security Advisories:
+
+https://github.com/BetterSEQTA/BetterSEQTA-Plus/security/advisories/new
diff --git a/jest.config.js b/jest.config.js
index 428e2515..a63ca1c1 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -8,11 +8,17 @@ export default {
],
transform: {
'^.+\\.ts$': 'ts-jest',
+ '^.+\\.js$': ['ts-jest', { tsconfig: { allowJs: true } }],
},
+ transformIgnorePatterns: [
+ '/node_modules/(?!(color|color-string|color-convert|color-name)/)',
+ ],
moduleNameMapper: {
'^@/(.*)$': '/src/$1',
+ '^color$': '/src/test/mocks/color.ts',
'^webextension-polyfill$': '/src/test/mocks/webextension-polyfill.ts',
},
+ setupFilesAfterEnv: ['/src/test/jest.setup.ts'],
moduleFileExtensions: ['ts', 'js', 'json'],
collectCoverageFrom: [
'src/**/*.ts',
diff --git a/lib/closePlugin.ts b/lib/closePlugin.ts
index 7a043fd3..9494f298 100644
--- a/lib/closePlugin.ts
+++ b/lib/closePlugin.ts
@@ -1,58 +1,20 @@
// ref: https://stackoverflow.com/a/76920975
import type { Plugin } from "vite";
-/**
- * Creates a Vite plugin designed to gracefully handle the conclusion of the build process.
- * This plugin utilizes the `buildEnd` and `closeBundle` hooks provided by Vite.
- * It checks for errors at the end of the build:
- * - If an error occurred during the build (`buildEnd` hook receives an error), it logs the error
- * and explicitly exits the Node.js process with a status code of 1 (indicating failure).
- * - If the build completes without errors and the bundle is successfully generated
- * (`closeBundle` hook is called), it logs a success message and exits the process
- * with a status code of 0 (indicating success).
- * This explicit process exiting can be useful in CI/CD environments or scripts that
- * rely on the process status code to determine the build outcome.
- * The core logic for using these hooks to exit the process is inspired by
- * a solution found on StackOverflow (https://stackoverflow.com/a/76920975).
- *
- * @returns {Plugin} A Vite plugin object configured with `name`, `buildEnd`, and `closeBundle` hooks.
- */
+/** Exit with code 1 on build failure; do not exit on success (multi-target builds). */
export default function ClosePlugin(): Plugin {
return {
- /**
- * The unique name of this Vite plugin. This name is used by Vite for identification
- * purposes and will appear in warnings, errors, and logs related to this plugin.
- * @type {string}
- */
- name: "ClosePlugin", // required, will show up in warnings and errors
-
- /**
- * A Vite hook that is called when the build process has finished, regardless of
- * whether it was successful or encountered an error.
- *
- * @param {Error} [error] An optional error object. If the build failed, this parameter
- * will contain the error that occurred. If the build was successful,
- * this parameter will be undefined or null.
- */
+ name: "ClosePlugin",
buildEnd(error) {
if (error) {
- console.error("Error bundling");
- console.error(error);
- process.exit(1); // Exit with status 1 indicating an error
+ console.error("Error bundling", error);
+ process.exit(1);
} else {
- console.log("Build ended"); // Log successful completion of the build phase
+ console.log("Build ended");
}
},
-
- /**
- * A Vite hook that is called after the `buildEnd` hook, but only if the build
- * was successful (i.e., no errors were passed to `buildEnd`) and all output
- * files have been generated and written to disk. This signifies the successful
- * completion of the entire bundling process.
- */
closeBundle() {
- console.log("Bundle closed"); // Log successful closure of the bundle
- process.exit(0); // Exit with status 0 indicating a successful build
+ console.log("Bundle closed");
},
};
}
diff --git a/lib/extensionChunkUrls.ts b/lib/extensionChunkUrls.ts
new file mode 100644
index 00000000..0cc492ea
--- /dev/null
+++ b/lib/extensionChunkUrls.ts
@@ -0,0 +1,25 @@
+import type { Plugin } from "vite";
+
+/** Relative chunk/CSS URLs via chrome.runtime.getURL for content-script dynamic imports. */
+export function extensionChunkUrls(): Plugin {
+ return {
+ name: "extension-chunk-urls",
+ config() {
+ return {
+ base: "./",
+ experimental: {
+ renderBuiltUrl(filename, { hostType, type }) {
+ const path = filename.replace(/^\//, "");
+ if (type === "chunk" && hostType === "js") {
+ return { runtime: `chrome.runtime.getURL(${JSON.stringify(path)})` };
+ }
+ // JS-triggered CSS preloads only — extension HTML pages need static hrefs.
+ if (type === "asset" && hostType === "js" && path.endsWith(".css")) {
+ return { runtime: `chrome.runtime.getURL(${JSON.stringify(path)})` };
+ }
+ },
+ },
+ };
+ },
+ };
+}
diff --git a/lib/inlineWorker.ts b/lib/inlineWorker.ts
index a877a05b..cfd846b5 100644
--- a/lib/inlineWorker.ts
+++ b/lib/inlineWorker.ts
@@ -1,70 +1,32 @@
-// vite-plugin-inline-worker-dev.ts
-// vite-plugin-inline-worker-dev.ts
import { Plugin } from "vite";
-import fs from "fs/promises";
import { build } from "esbuild";
-/**
- * Creates a Vite plugin designed for bundling and inlining web worker scripts during development.
- * This plugin specifically targets module imports that include a `?inlineWorker` query parameter.
- * When such an import is encountered, the plugin bundles the worker script using `esbuild`
- * and then generates JavaScript code that inlines this bundled worker as a Blob,
- * creating the worker instance via `URL.createObjectURL()`.
- * The name "vite:inline-worker-dev" suggests it's primarily intended for development builds.
- *
- * @returns {Plugin} A Vite plugin object with `name` and `load` properties.
- */
+/** Bundle worker entry points imported with `?inlineWorker` as Blob-backed Workers in dev. */
export default function InlineWorkerDevPlugin(): Plugin {
return {
- /**
- * The unique name of this Vite plugin.
- * @type {string}
- */
name: "vite:inline-worker-dev",
- /**
- * The Vite hook responsible for loading and transforming modules.
- * This function intercepts modules imported with `?inlineWorker`.
- * For such modules, it bundles the worker script and returns JavaScript code
- * that, when executed, will create an instance of this worker from an inlined Blob.
- *
- * @async
- * @param {string} id The path or ID of the module Vite is attempting to load,
- * potentially including query parameters (e.g., "/path/to/worker.ts?inlineWorker").
- * @returns {Promise} A promise that resolves to:
- * - `null` if the module ID does not include `?inlineWorker`.
- * - A string of JavaScript code if the module is an inline worker.
- * This code will define a default export function (e.g., `InlineWorker`)
- * that, when called, creates and returns a new `Worker` instance
- * from the bundled and inlined worker script.
- */
async load(id) {
- if (id.includes("?inlineWorker")) {
- const [cleanPath] = id.split("?");
- // Note: Original code had `await fs.readFile(cleanPath, "utf-8");` but `code` wasn't used.
- // `esbuild` directly takes `cleanPath` as an entry point.
- const result = await build({
- entryPoints: [cleanPath], // esbuild uses the file path directly
- bundle: true,
- write: false, // We want the output in memory, not written to disk
- platform: "browser", // Target environment for the worker code
- format: "iife", // Immediately Invoked Function Expression, suitable for workers
- target: "esnext", // Transpile to modern JavaScript
- });
+ if (!id.includes("?inlineWorker")) return null;
- const workerCode = result.outputFiles[0].text;
+ const [cleanPath] = id.split("?");
+ const result = await build({
+ entryPoints: [cleanPath],
+ bundle: true,
+ write: false,
+ platform: "browser",
+ format: "iife",
+ target: "esnext",
+ external: ["webextension-polyfill"],
+ });
- // Construct JavaScript code that will create the worker from a Blob.
- // This code is what gets returned to Vite and replaces the original import.
- const workerBlobCode = `
- const code = ${JSON.stringify(workerCode)};
- export default function InlineWorker() {
- const blob = new Blob([code], { type: 'application/javascript' });
- return new Worker(URL.createObjectURL(blob), { type: 'module' });
- }
- `;
- return workerBlobCode;
- }
- return null; // Let Vite handle other modules normally
+ const workerCode = result.outputFiles[0].text;
+ return `
+ const code = ${JSON.stringify(workerCode)};
+ export default function InlineWorker() {
+ const blob = new Blob([code], { type: 'application/javascript' });
+ return new Worker(URL.createObjectURL(blob), { type: 'module' });
+ }
+ `;
},
};
}
diff --git a/lib/publish.js b/lib/publish.js
index a6263bf3..aba03a18 100644
--- a/lib/publish.js
+++ b/lib/publish.js
@@ -11,7 +11,7 @@
* or `node lib/publish.js --b firefox`
*/
-const glob = require("glob");
+const { globSync } = require("glob");
const semver = require("semver");
const { execSync } = require("child_process");
const path = require("path");
@@ -98,7 +98,7 @@ function getLatestFiles(browser) {
const pattern = `dist/betterseqtaplus@*-*${browser}.zip`;
console.log("Glob pattern:", pattern);
- const files = glob.sync(pattern);
+ const files = globSync(pattern);
console.log("Files found for browser", browser, ":", files);
if (files.length === 0) {
diff --git a/package.json b/package.json
index f3e12894..4bf8cc04 100644
--- a/package.json
+++ b/package.json
@@ -1,16 +1,17 @@
{
"name": "betterseqtaplus",
- "version": "3.7.2",
+ "version": "3.7.3",
"type": "module",
"description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development and add heaps more features!",
"browserslist": "> 0.5%, last 2 versions, not dead",
"scripts": {
- "postinstall": "node scripts/copy-pdfjs-assets.mjs",
+ "compile:layerchart": "node scripts/compile-layerchart-vendor.mjs",
+ "postinstall": "node scripts/copy-pdfjs-assets.mjs && node scripts/copy-ort-wasm-assets.mjs && npm run compile:layerchart",
"autoaudit": "npm audit && npm audit fix && npm run build",
"dev": "cross-env MODE=chrome vite dev",
"dev:firefox": "cross-env MODE=firefox vite build --watch",
"compile": "npm i && npm run build",
- "build": "cross-env MODE=chrome vite build && cross-env MODE=firefox vite build",
+ "build": "npm run compile:layerchart && cross-env MODE=chrome vite build && cross-env MODE=firefox vite build",
"build:chrome": "cross-env MODE=chrome vite build",
"build:firefox": "cross-env MODE=firefox vite build",
"build:safari": "cross-env MODE=safari vite build",
@@ -18,19 +19,14 @@
"convert:safari": "xcrun safari-web-extension-converter dist/safari --project-location . --app-name $npm_package_name-safari",
"dependency-graph": "depcruise src --include-only \"^src\" --output-type dot | dot -T svg > dependency-graph.svg",
"lint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint \"src/**/*.{js,ts}\"",
- "test": "jest",
+ "test": "npm run test:unit",
+ "test:unit": "jest",
"test:smoke": "node scripts/smoke-test.mjs",
+ "test:ci": "npm run test:unit && npm run build && npm run test:smoke",
"release": "gh release create $npm_package_version --repo BetterSEQTA/BetterSEQTA-Plus ./dist/*.zip --generate-notes",
"publish": "bun lib/publish.js --b",
"zip": "bedframe zip"
},
- "targets": {
- "prod": {
- "sourceMap": {
- "inline": false
- }
- }
- },
"keywords": [],
"author": {
"name": "SethBurkart123",
@@ -39,34 +35,44 @@
},
"license": "MIT",
"devDependencies": {
- "@babel/plugin-transform-runtime": "^7.26.9",
"@babel/runtime": "^7.26.9",
"@bedframe/cli": "^0.1.2",
"@crxjs/vite-plugin": "^2.6.1",
+ "@sveltejs/vite-plugin-svelte": "^5.0.3",
+ "@tailwindcss/forms": "^0.5.10",
+ "@tsconfig/svelte": "^5.0.4",
+ "@types/chrome": "^0.1.4",
+ "@types/color": "^4.2.0",
"@types/d3-scale": "^4.0.9",
"@types/d3-shape": "^3.1.8",
"@types/jest": "^30.0.0",
"@types/mime-types": "^3.0.1",
- "@types/react": "^19.0.10",
- "@types/react-dom": "^19.0.4",
+ "@types/node": "^24.3.0",
+ "@types/qrcode": "^1.5.6",
+ "@types/react": "^17.0.0",
+ "@types/react-dom": "^17.0.0",
+ "@types/sortablejs": "^1.15.8",
+ "@types/webextension-polyfill": "^0.12.3",
"@typescript-eslint/eslint-plugin": "^8.60.1",
"@typescript-eslint/parser": "^8.60.1",
+ "autoprefixer": "^10.4.21",
"cross-env": "^10.0.0",
"dependency-cruiser": "^17.0.1",
+ "esbuild": "^0.25.3",
"eslint": "^9.33.0",
"eslint-plugin-import": "^2.31.0",
- "glob": "^11.0.1",
+ "glob": "^13.0.6",
"jest": "^30.4.2",
+ "jest-environment-jsdom": "^30.4.1",
"mime-types": "^3.0.1",
+ "postcss": "^8.5.3",
"prettier": "^3.5.3",
- "process": "^0.11.10",
"publish-browser-extension": "^4.0.4",
"sass": "^1.85.1",
- "sass-loader": "^16.0.5",
- "semver": "^7.7.1",
"tailwindcss": "3",
"ts-jest": "^29.4.11",
- "url": "^0.11.4"
+ "typescript": "^5.8.2",
+ "vite": "^6.2.1"
},
"dependencies": {
"@bedframe/core": "^0.1.0",
@@ -77,22 +83,10 @@
"@codemirror/search": "^6.5.10",
"@codemirror/state": "^6.5.2",
"@codemirror/view": "^6.36.4",
- "@sveltejs/vite-plugin-svelte": "^5.0.3",
- "@tailwindcss/forms": "^0.5.10",
- "@tsconfig/svelte": "^5.0.4",
- "@types/chrome": "^0.1.4",
- "@types/color": "^4.2.0",
- "@types/lodash": "^4.17.16",
- "@types/node": "^24.3.0",
- "@types/qrcode": "^1.5.6",
- "@types/sortablejs": "^1.15.8",
- "@types/uuid": "^10.0.0",
- "@types/webextension-polyfill": "^0.12.3",
+ "@huggingface/transformers": "^3.8.1",
"@uiw/codemirror-extensions-color": "^4.23.10",
"@uiw/codemirror-theme-github": "^4.23.10",
- "autoprefixer": "^10.4.21",
"canvas-confetti": "^1.9.3",
- "codemirror": "^6.0.1",
"color": "^5.0.0",
"d3-scale": "^4.0.2",
"d3-shape": "^3.2.0",
@@ -100,29 +94,28 @@
"embeddia": "^1.3.0",
"embla-carousel-autoplay": "^8.5.2",
"embla-carousel-svelte": "^8.5.2",
- "esbuild": "^0.25.3",
- "events": "^3.3.0",
- "flexsearch": "^0.8.147",
"fuse.js": "^7.1.0",
- "idb": "^8.0.2",
"layerchart": "2.0.0-next.27",
"localforage": "^1.10.0",
- "lodash": "^4.17.21",
"mathjs": "^14.4.0",
- "million": "^3.1.11",
"motion": "^12.4.12",
"pdfjs-dist": "^5.4.530",
- "postcss": "^8.5.3",
"qrcode": "^1.5.4",
"react": "17",
"react-best-gradient-color-picker": "3.0.11",
"react-dom": "17",
"rss-parser": "^3.13.0",
+ "semver": "^7.7.1",
"sortablejs": "^1.15.6",
"svelte": "^5.46.4",
- "typescript": "^5.8.2",
- "uuid": "^11.1.0",
- "vite": "^6.2.1",
"webextension-polyfill": "^0.12.0"
+ },
+ "overrides": {
+ "glob": "^13.0.6"
+ },
+ "pnpm": {
+ "overrides": {
+ "glob": "^13.0.6"
+ }
}
}
diff --git a/scripts/compile-layerchart-vendor.mjs b/scripts/compile-layerchart-vendor.mjs
new file mode 100644
index 00000000..c3f84ea2
--- /dev/null
+++ b/scripts/compile-layerchart-vendor.mjs
@@ -0,0 +1,80 @@
+/**
+ * Pre-compile layerchart `.svelte` sources to `.js` so Rollup/Vite CI builds succeed.
+ */
+import { compile } from "svelte/compiler";
+import { readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const root = join(dirname(fileURLToPath(import.meta.url)), "..");
+const layerchartRoot = join(root, "node_modules", "layerchart");
+const layerchartDist = join(layerchartRoot, "dist");
+const stampPath = join(layerchartDist, ".bsplus-compiled");
+const COMPILE_ALGO_VERSION = "2";
+const importSuffixPattern = /\.svelte(?=['"])/g;
+
+const exists = (path) => {
+ try {
+ statSync(path);
+ return true;
+ } catch {
+ return false;
+ }
+};
+
+if (!exists(layerchartDist)) {
+ console.log("compile-layerchart-vendor: layerchart not installed, skipping");
+ process.exit(0);
+}
+
+const layerchartVersion = JSON.parse(
+ readFileSync(join(layerchartRoot, "package.json"), "utf8"),
+).version;
+const stampContent = `${layerchartVersion}\n${COMPILE_ALGO_VERSION}`;
+
+if (exists(stampPath) && readFileSync(stampPath, "utf8").trim() === stampContent) {
+ console.log(`compile-layerchart-vendor: layerchart@${layerchartVersion} already compiled, skipping`);
+ process.exit(0);
+}
+
+const walkFiles = (dir, files = []) => {
+ for (const name of readdirSync(dir)) {
+ if (name === "node_modules") continue;
+ const path = join(dir, name);
+ if (statSync(path).isDirectory()) walkFiles(path, files);
+ else files.push(path);
+ }
+ return files;
+};
+
+const patchSvelteImports = (content) => content.replace(importSuffixPattern, ".js");
+const stripRollupBreakingSyntax = (code) =>
+ code
+ .replace(/(\w+)\?(?=\s*[,)\]])/g, "$1")
+ .replace(/(\w+)\?(?=\s*:)/g, "$1");
+
+const svelteFiles = walkFiles(layerchartDist).filter((f) => f.endsWith(".svelte"));
+
+for (const sveltePath of svelteFiles) {
+ const source = readFileSync(sveltePath, "utf8");
+ if (!source.includes("
-