Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
c1821f1
convert to ts part 1
yell0wsuit May 27, 2025
f7e3907
fix eslint error
yell0wsuit May 27, 2025
b595cbd
convert to ts part 2
yell0wsuit May 27, 2025
06f898a
convert to ts part 3
yell0wsuit May 27, 2025
5464233
convert to ts part 4
yell0wsuit May 27, 2025
a9f4142
convert to ts part 5
yell0wsuit May 27, 2025
268fc49
convert to ts part 6
yell0wsuit May 27, 2025
78d07ed
convert to ts part 7
yell0wsuit May 27, 2025
4715723
convert to ts part 8
yell0wsuit May 27, 2025
2f67a95
convert to ts part 9
yell0wsuit May 27, 2025
095a834
convert to ts part 10
yell0wsuit May 27, 2025
8e5590e
convert to ts part 11
yell0wsuit May 27, 2025
0e72c31
Create tsconfig.json
yell0wsuit May 27, 2025
3447f50
convert to ts part 12
yell0wsuit May 27, 2025
7c511c2
convert to ts part 13
yell0wsuit May 27, 2025
da2ee65
convert to ts part 14
yell0wsuit May 27, 2025
e1a22b1
update express server code
yell0wsuit May 27, 2025
be58b27
convert forge config to ts
yell0wsuit May 27, 2025
51e84df
fix lint error right in tsconfig lol
yell0wsuit May 27, 2025
9f1ab04
format eslint config file
yell0wsuit May 27, 2025
d529eca
fix lint errors
yell0wsuit May 27, 2025
a91d6f5
Update tsconfig.json
yell0wsuit May 27, 2025
a1ade74
Update eslint.config.js
yell0wsuit May 27, 2025
473bfff
update videoFileOperation to conform eslint rule
yell0wsuit May 27, 2025
983fd18
update pronunciationOperations to conform eslint rule
yell0wsuit May 27, 2025
22aa33a
update main.ts to conform eslint rule
yell0wsuit May 27, 2025
c732026
update zipOperation to conform eslint rule
yell0wsuit May 27, 2025
a5cf2c7
Update createWindow.ts
yell0wsuit May 27, 2025
4bb9fd8
Update customFolderLocationOperation.ts
yell0wsuit May 27, 2025
155441e
add ts dependencies
yell0wsuit May 27, 2025
8777bda
use correct types for expressServer
yell0wsuit May 27, 2025
be1be98
Update filePath.ts
yell0wsuit May 27, 2025
fd47ec0
Update isDeniedSystemFolder.ts
yell0wsuit May 27, 2025
81a43b3
Update pronunciationCheckerIPC.ts
yell0wsuit May 27, 2025
fb1bdb4
Update logOperations.ts
yell0wsuit May 27, 2025
675b304
update preload to use ts
yell0wsuit May 27, 2025
d9c51cc
Update tsconfig.json
yell0wsuit May 27, 2025
43e34d4
update useScrollTo
yell0wsuit May 27, 2025
40833d9
update ThemeContext
yell0wsuit May 27, 2025
5bb44ad
update sonnerCustomToast
yell0wsuit May 27, 2025
11104ef
update ShuffleArray
yell0wsuit May 27, 2025
14a4978
Delete phonemeUtils.jsx
yell0wsuit May 27, 2025
21267c6
update levenshtein
yell0wsuit May 27, 2025
69d430d
update isTouchDevice
yell0wsuit May 27, 2025
2557ba2
update isElectron
yell0wsuit May 27, 2025
3f667cf
update AccentLocalStorage
yell0wsuit May 27, 2025
d17db5d
Update eslint.config.js
yell0wsuit May 27, 2025
abd2123
update @types/react version
yell0wsuit May 27, 2025
413b52e
update useCountdownTimer
yell0wsuit May 27, 2025
564aa9c
Create global.d.ts
yell0wsuit May 27, 2025
9de4844
update openExternal
yell0wsuit May 27, 2025
48e0b59
update databaseOperations
yell0wsuit May 27, 2025
8a4aea1
update ffmpegWavConverter
yell0wsuit May 27, 2025
fa95127
update Container (UI)
yell0wsuit May 27, 2025
4571238
ignore `__APP_VERSION__` lint error
yell0wsuit May 27, 2025
318cfe9
update ErrorBoundary to use ts
yell0wsuit May 27, 2025
8f9cc4a
update LogoLightOrDark
yell0wsuit May 27, 2025
6ec92cb
update Footer
yell0wsuit May 27, 2025
aadd8cf
update LoadingOverlay
yell0wsuit May 27, 2025
c79de76
update NotFound component
yell0wsuit May 27, 2025
715de0e
update TopNavBar component
yell0wsuit May 27, 2025
344b834
update AccentDropDown component
yell0wsuit May 27, 2025
7f42c8a
Update AccentDropdown.tsx
yell0wsuit May 27, 2025
9761c8b
update VersionUpdateDialog
yell0wsuit May 27, 2025
837c093
Update .gitignore
yell0wsuit May 27, 2025
59f271d
temporary ignore error for JS7z
yell0wsuit May 27, 2025
7d07960
update Homepage
yell0wsuit May 28, 2025
1bbb3c0
sound page: update SoundMain
yell0wsuit May 28, 2025
471232a
sound page: update SoundPracticeCard
yell0wsuit May 28, 2025
23fec49
update SoundList
yell0wsuit May 28, 2025
902adcf
sound: update WatchVideoCard
yell0wsuit May 28, 2025
23a66ef
sound: update TongueTwister
yell0wsuit May 28, 2025
3e3a121
sound: update ReviewCard
yell0wsuit May 28, 2025
52c9a1f
sound: concise WatchVideoCard colorScheme type
yell0wsuit May 28, 2025
cae0831
sound page: update hook files
yell0wsuit May 28, 2025
0c33f43
sound: fix SoundMain remaining lint errors
yell0wsuit May 28, 2025
8a8e254
word page: update syllableParser and ipaUtils
yell0wsuit May 28, 2025
b963854
word page: update WordList
yell0wsuit May 29, 2025
9533879
word page: update Pagination
yell0wsuit May 29, 2025
9bdf99c
word page: update WordDetails
yell0wsuit May 29, 2025
2a6eac3
word page: update PronunciationChecker
yell0wsuit May 29, 2025
1008414
update App.jsx
yell0wsuit May 29, 2025
85ec051
add @types/he
yell0wsuit May 29, 2025
8d0dab0
update index.jsx to index.tsx
yell0wsuit May 29, 2025
e7ac3ce
Update index.html
yell0wsuit May 29, 2025
f4d7d7d
word page: update ReviewRecording
yell0wsuit May 29, 2025
567a377
word page: update useWaveformTheme
yell0wsuit May 29, 2025
33dd68e
word page: update RecordingWaveform
yell0wsuit May 29, 2025
17ffc90
word page: update remaining lint errors
yell0wsuit May 29, 2025
0ed7537
update DownloadPage
yell0wsuit May 29, 2025
ab1f215
conversation page: update WatchAndStudyTab
yell0wsuit May 30, 2025
9ef060f
conversation page: update ReviewTab
yell0wsuit May 30, 2025
373afac
conversation page: update PracticeTab
yell0wsuit May 30, 2025
42a70ea
fix short-circuit expression with an explicit if statement
yell0wsuit May 30, 2025
45a8bf9
conversation page: update ListeningTab
yell0wsuit May 30, 2025
faee9a8
conversation page: update ConversationDetailPage
yell0wsuit May 30, 2025
6b8f870
conversation page: update ConversationMenu
yell0wsuit May 30, 2025
584efc3
exam page: update ReviewTab
yell0wsuit May 30, 2025
97f9374
exam page: update ListeningTab
yell0wsuit May 30, 2025
16cf4c0
exam page: update PracticeTab
yell0wsuit May 30, 2025
7a4c62f
exam page: update WatchAndStudyTab
yell0wsuit May 30, 2025
516d4e5
exam page: update ExamDetailPage
yell0wsuit May 30, 2025
e33ee0f
Update ExamDetailPage.tsx
yell0wsuit May 30, 2025
34e22c1
exam page: update ExamPage
yell0wsuit May 30, 2025
de0847a
setting: update modelOptions and PronunciationUtils
yell0wsuit May 30, 2025
3b217ce
update Settings
yell0wsuit May 30, 2025
7b0c773
setting: update SavedRecordingLocationMenu
yell0wsuit May 30, 2025
79b2984
setting: update LanguageSwitcher
yell0wsuit May 30, 2025
4e0f4e0
sound page: fix wrong example data
yell0wsuit May 30, 2025
4b5c6b6
Exam and conversation pages: add missing strings, fix placeholder and…
yell0wsuit May 30, 2025
8324f1c
setting page: update Appearance
yell0wsuit May 31, 2025
2ca1ec0
setting page: update AppInfo
yell0wsuit May 31, 2025
529686b
setting page: update ExerciseTimer
yell0wsuit May 31, 2025
237c504
setting page: update LogSettings
yell0wsuit May 31, 2025
9dae5d5
setting page: update SaveFolderSettings
yell0wsuit May 31, 2025
1562003
setting page: update ResetSettings
yell0wsuit May 31, 2025
b520ffb
setting page: update VideoDownloadMenu
yell0wsuit May 31, 2025
d655787
setting page: update VideoDownloadTable
yell0wsuit May 31, 2025
c93b1ec
setting page: update VideoDownloadSubPage
yell0wsuit May 31, 2025
219ea6b
setting page: update pronunciationStepUtils
yell0wsuit May 31, 2025
72059fa
setting page: update PronunciationCheckerDialogContent
yell0wsuit May 31, 2025
1e5b646
setting page: update PronunciationCheckerInfo
yell0wsuit May 31, 2025
4f28899
setting page: update PronunciationSettings
yell0wsuit May 31, 2025
91c17e6
word page: update PronunciationChecker
yell0wsuit May 31, 2025
77bd932
exercise page: update SortableWord
yell0wsuit May 31, 2025
f77752a
exercise page: update SortingExercise
yell0wsuit May 31, 2025
beab41d
exercise page: update Snap
yell0wsuit May 31, 2025
db50a2f
exercise page: update Reordering
yell0wsuit May 31, 2025
c43e43c
remove leftover files
yell0wsuit May 31, 2025
bddd71a
exercise page: update OddOneOut
yell0wsuit May 31, 2025
7cb9a23
exercise page: update MemoryMatch
yell0wsuit May 31, 2025
b721ba0
exercise page: update SoundAndSpelling
yell0wsuit May 31, 2025
9732d3e
exercise page: update DictationQuiz
yell0wsuit May 31, 2025
47faba9
exercise page: update MatchUp
yell0wsuit May 31, 2025
3006acc
remove unnecessary React FC
yell0wsuit May 31, 2025
4d01838
exercise page: update ExercisePage
yell0wsuit May 31, 2025
2285017
exercise page: add types for child component, update ExerciseDetailPage
yell0wsuit May 31, 2025
938dcff
fix error TS2614
yell0wsuit May 31, 2025
8274646
add new script for post electron setup
yell0wsuit May 31, 2025
4705e12
fix TS2349
yell0wsuit May 31, 2025
97f8b2e
electron files organization
yell0wsuit May 31, 2025
62c38df
front end files organization
yell0wsuit May 31, 2025
6419029
organize files
yell0wsuit May 31, 2025
0efe1b9
Update .gitignore
yell0wsuit May 31, 2025
b86195c
Update minify-dist-jsons.js
yell0wsuit May 31, 2025
940b96e
createWindow.ts: update paths
yell0wsuit May 31, 2025
47d0c8e
getFileAndFolder.ts: update splash screen for dev and build release
yell0wsuit May 31, 2025
ef84f72
add electron files
yell0wsuit May 31, 2025
1c9d40c
remove leftover electron files
yell0wsuit May 31, 2025
d684647
frontend: fix lint errors
yell0wsuit May 31, 2025
5808fed
copy js7z to data
yell0wsuit May 31, 2025
fe4cf59
Update tsconfig.app.json
yell0wsuit May 31, 2025
ceaa9dc
fix path
yell0wsuit May 31, 2025
9e3755a
Update splash.html
yell0wsuit May 31, 2025
4436a74
update packages
yell0wsuit May 31, 2025
2478bd8
fix video download list location
yell0wsuit May 31, 2025
d690c14
update package script
yell0wsuit May 31, 2025
62703ae
fix exercise timer setting
yell0wsuit May 31, 2025
25cfb0e
update SoundPracticeCard title string
yell0wsuit May 31, 2025
05e2e9e
word page: add centralized types
yell0wsuit May 31, 2025
7cb8c2f
word page: update components to use centralized types
yell0wsuit May 31, 2025
c55afb1
Update CONTRIBUTING.md
yell0wsuit May 31, 2025
a70df73
Update netlify.toml
yell0wsuit May 31, 2025
7653a7f
consistent import extension
yell0wsuit May 31, 2025
f6105c2
Update CONTRIBUTING.md
yell0wsuit May 31, 2025
89afb22
Update CONTRIBUTING.md
yell0wsuit Jun 1, 2025
209f1ba
organize clean dist script
yell0wsuit Jun 1, 2025
fad7abd
update scripts to point correct dist location
yell0wsuit Jun 1, 2025
2b2a44b
surpress js7z not being callable TS2349
yell0wsuit Jun 1, 2025
96ea2aa
fix data extraction happens later than verification step
yell0wsuit Jun 1, 2025
e5591da
remove js7z file bundle, just use from npm
yell0wsuit Jun 1, 2025
76b27fa
Update forge.config.ts
yell0wsuit Jun 1, 2025
ef28706
add back cors code for development
yell0wsuit Jun 1, 2025
c3ed7f5
remove leftover makecli command
yell0wsuit Jun 1, 2025
ee4c4a2
update electron workflow
yell0wsuit Jun 1, 2025
9438dc8
disable source map output
yell0wsuit Jun 1, 2025
6f98385
fix video download modal overflow and progress bar
yell0wsuit Jun 1, 2025
59b77d0
minify electron js files
yell0wsuit Jun 1, 2025
a89e573
sound page: modular and update types
yell0wsuit Jun 2, 2025
b59fd8a
conversation page: modularize and update types
yell0wsuit Jun 2, 2025
02602bb
sound page: unify types
yell0wsuit Jun 2, 2025
cf52bd2
conversation page: unify types
yell0wsuit Jun 2, 2025
5eafd86
conversation page: fix types, beautify the iframe title
yell0wsuit Jun 2, 2025
08f4583
exam page: modularize and update types
yell0wsuit Jun 2, 2025
7e5bc28
exercise page: modularize and update types
yell0wsuit Jun 2, 2025
dca2ae1
sound page: add string type for toast for ReviewCard
yell0wsuit Jun 2, 2025
d19752c
Update eslint.config.js
yell0wsuit Jun 23, 2025
15a5e4c
update tsconfig
yell0wsuit Jun 23, 2025
afc1aa0
update packages, add zod
yell0wsuit Jun 23, 2025
9d7d75b
update timer setting code
yell0wsuit Jun 23, 2025
ee99744
Improve timer toggle to handle unsaved changes
yell0wsuit Jun 23, 2025
503c5c5
use zod for validating accent local storage
yell0wsuit Jun 23, 2025
c2410f9
Update types.ts
yell0wsuit Jun 23, 2025
3c7cef5
Fix accent prop usage in ExamDetailPage
yell0wsuit Jun 23, 2025
0267bd3
Add zod validation for localstorage in ReviewTab
yell0wsuit Jun 23, 2025
a2861f3
add zod validation to ReviewTab localstorage handling
yell0wsuit Jun 23, 2025
7af3ee4
add error notification for word recording function
yell0wsuit Jun 24, 2025
5140cee
word page: fix review cannot be clicked after recording
yell0wsuit Jun 24, 2025
9238797
Refactor localStorage logic with Zod utilities
yell0wsuit Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/electron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ jobs:
- name: Build Vite App
run: npm run vitebuildcli

- name: Upload Vite Build Artifact
- name: Zip dist-react and dist-electron
run: |
zip -r vite-builds.zip dist-react dist-electron

- name: Upload Vite Build Artifacts Zip
uses: actions/upload-artifact@main
with:
name: vite-dist
path: ./dist
name: vite-builds-zip
path: vite-builds.zip

build:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand All @@ -80,11 +84,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@main

- name: Download Vite Build Artifact
- name: Download Vite Build Artifacts Zip
uses: actions/download-artifact@main
with:
name: vite-dist
path: ./dist
name: vite-builds-zip
path: .

- name: Unzip dist-react and dist-electron
run: |
unzip -o vite-builds.zip
# dist-react and dist-electron are now in the workspace root

- name: Get version from package.json
id: get_version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build && cp ./dist/index.html ./dist/404.html
run: npm run build && cp ./dist-react/index.html ./dist-react/404.html
- name: Setup Pages
uses: actions/configure-pages@main
- name: Upload artifact
uses: actions/upload-pages-artifact@main
with:
# Upload dist folder
path: "./dist"
path: "./dist-react"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ node_modules
dist
dist-ssr
*.local
production
dist-electron
dist-react

# Editor directories and files
.vscode/*
Expand Down
62 changes: 45 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,37 @@ Thank you for your interest in contributing! Please take a moment to review this

## 📬 Submitting issues, feature requests, or translations

- To report bugs or request features, please [open an issue](https://github.com/learnercraft/ispeakerreact/issues/new/choose) and choose the appropriate category.
- To report bugs or request features, [open an issue](https://github.com/learnercraft/ispeakerreact/issues/new/choose) and choose the appropriate category.

- For translation contributions, please [refer to this issue](https://github.com/learnercraft/ispeakerreact/issues/18) for more information.
- For translation contributions, [refer to this issue](https://github.com/learnercraft/ispeakerreact/issues/18) for more information.

## 🔀 Submitting pull requests
## ▶️ Run the code locally

To run the code locally, you need the latest **LTS (Long Term Support)** version of [Node.js](https://nodejs.org/en/) installed.

Then, clone the repository using either [Git](https://git-scm.com/downloads) (if you are familiar with the command line) or [GitHub Desktop](https://desktop.github.com/).

Install dependencies with `npm install`, then start the development server using one of the following commands:

- Web: `npm run dev`
- Electron: `npm run start`

### 📌 Project note
To test the production build:

- This project **does not use TypeScript** or any kind of static type checking yet.
- In the meantime, **use** `PropTypes` to validate component props for basic type safety.
- Web: `npm run build`, then `npm run preview`
- Electron: `npm run make` — the executable will appear in the `./out` folder

## 🔀 Submitting pull requests

As of [pull request #65](https://github.com/learnercraft/ispeakerreact/pull/65), this project uses TypeScript for improved type safety and developer experience.

### ✅ What you should do

- **Use a code editor** (e.g., Visual Studio Code) to write and format code efficiently.

- **Format your code** before committing and pushing. You must use **Prettier with our configuration** to ensure consistent formatting.

- **Test your code thoroughly** before pushing. Resolve any ESLint errors if possible.
- An exception is allowed for variables defined in `vite.config.js` and available only at build time. If ESLint complains about these (e.g., the `__APP_VERSION__` variable), you can safely ignore the warning.
- **Format your code** before committing using Prettier with the project's configuration.

- **Use clear, concise variable names** written in `camelCase`. Names should be self-explanatory and reflect their purpose.
- **Test your code thoroughly** before pushing. Resolve any TypeScript and ESLint errors if possible.

- **Use a clear, concise pull request title**. We recommend following [semantic commit message conventions](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716). Examples:
- `fix: handle audio timeout error on older devices`
Expand All @@ -38,20 +48,35 @@ Thank you for your interest in contributing! Please take a moment to review this

- Before submitting a **large pull request** or major change, open an issue first and select the appropriate category. After a review by our team, you can start your work.

### 💻 Coding style

- Follow the latest ECMAScript standards. This project is built with modern JavaScript in mind, so polyfills are typically unnecessary.
- Be mindful of browser compatibility. Check [Can I use...](https://caniuse.com/) before using experimental APIs.

- Do not use deprecated APIs. Refer to [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API) for up-to-date information.

- **Use clear, concise variable names** written in `camelCase`. For React components, use `PascalCase`. Names should be self-explanatory and reflect their purpose.

- Prefer **arrow functions** over `function` declarations to avoid hoisting issues and for consistency.

- Use `async` and `await` instead of `.then()` where possible for readability.

- In React components, wrap expensive computations in `useMemo` and functions in `useCallback` hooks when appropriate.

### 🧪 Review process

- All PRs are reviewed before merging. Please be responsive to feedback.
When resolving comments, **make a new commit with**:
When addressing review comments, commit with a message like:
`address feedback by @<username>`

### 🤔 What you should NOT do

- Submit pull requests that only include **cosmetic changes** like whitespace tweaks or code reformatting without any functional impact.
These changes clutter diffs and make code reviews harder. [See this comment by the Rails team](https://github.com/rails/rails/pull/13771#issuecomment-32746700).

- Submit a pull request with **one or several giant commit(s)**. This makes it difficult to review.
- Submit pull requests that consist of a single large commit or several oversized commits. Break your changes into logical, reviewable commits.

- Use unclear, vague, or default commit messages like `Update file`, `fix`, or `misc changes`.
- Use vague or default commit messages like `update file`, `fix`, or `misc changes`.

- Modify configuration files (e.g., `.prettierrc`, `eslint.config.js`, etc.), or any files in the `.github` folder without prior discussion.

Expand All @@ -60,12 +85,15 @@ Thank you for your interest in contributing! Please take a moment to review this
- Add code or commits that:
- Are **obscure** or **unclear** in intent
- Are **malicious** or **unsafe**
- **Executes scripts from external sources** associated with malicious, unsafe, or illegal behavior
- **Executes scripts from external sources** associated with **malicious, unsafe, or illegal behavior**
- Attempts to introduce **backdoors** or hidden functionality

If we find any code that violates these rules, you will be blocked from further contributions and reported to GitHub for Terms of Use violations.
Violations will result in being blocked from contributing. In severe cases, you may also be reported to GitHub for Terms of Use violations.

- Commit **hardcoded secrets, tokens, or sensitive user information**.
While our project includes a secret-scanning tool, it is still your responsibility to ensure that no sensitive data is committed to the repository.

- Use expletives or offensive language. This project is intended for everyone, and we strive to maintain a respectful environment for all contributors and users.
- Use **expletives** or **offensive language**. This project is intended for everyone, and we strive to maintain a respectful environment for all contributors and users. Any inappropriate comments will be removed and treated as a final warning.

---

Expand Down
25 changes: 17 additions & 8 deletions data/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,13 @@
</head>
<body>
<div>
<img
class="img-fluid"
src="../dist/images/icons/windows11/Wide310x150Logo.scale-400.png"
id="splash"
alt="Splash Image"
/>
<img class="img-fluid" id="splash" alt="Splash Image" />
</div>
<script>
const htmlEl = document.documentElement;
const bodyElement = document.body;
const splashImage = document.getElementById("splash");

const splashImageDark = "../dist/images/icons/logo-splash-dark.png";
const splashImageLight = "../dist/images/icons/windows11/Wide310x150Logo.scale-400.png";
const bodyElementDark = "#222";
const bodyElementLight = "#f2f2f2";

Expand All @@ -46,13 +39,29 @@
};

document.addEventListener("DOMContentLoaded", async () => {
const nodeEnv = await window.electron.ipcRenderer.invoke("get-node-env");
const srcBase = nodeEnv === "development" ? "../public" : "../dist-react";
const splashImageDark = `${srcBase}/images/icons/logo-splash-dark.png`;
const splashImageLight = `${srcBase}/images/icons/windows11/Wide310x150Logo.scale-400.png`;

let storedTheme;
storedTheme = await window.electron.ipcRenderer.invoke(
"get-theme",
"ispeakerreact-ui-theme"
);
if (storedTheme === "dark") storedTheme = "dim";

const darkElement = () => {
htmlEl.setAttribute("data-theme", "dim");
splashImage.src = splashImageDark;
bodyElement.style.backgroundColor = bodyElementDark;
};
const lightElement = () => {
htmlEl.setAttribute("data-theme", "light");
splashImage.src = splashImageLight;
bodyElement.style.backgroundColor = bodyElementLight;
};

const applyTheme = (theme) => {
switch (theme) {
case "dim":
Expand Down
82 changes: 45 additions & 37 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,46 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import js from "@eslint/js";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tseslint from "typescript-eslint";

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [
js.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
__APP_VERSION__: "readonly",
},
},
plugins: {
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
settings: { react: { version: "detect" } },
rules: {
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": {
descriptionFormat: "^: TS\\d+ because .+$",
},
},
],
},
}
);
37 changes: 19 additions & 18 deletions forge.config.cjs → forge.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const { FusesPlugin } = require("@electron-forge/plugin-fuses");
const { FuseV1Options, FuseVersion } = require("@electron/fuses");
const path = require("path");
import { FusesPlugin } from "@electron-forge/plugin-fuses";
import type { ForgeConfig } from "@electron-forge/shared-types";
import { FuseV1Options, FuseVersion } from "@electron/fuses";
import path from "node:path";

module.exports = {
const config: ForgeConfig = {
packagerConfig: {
asar: true,
name: "iSpeakerReact",
Expand All @@ -16,7 +17,7 @@ module.exports = {
ProductName: "iSpeakerReact",
},
prune: true,
icon: path.join(__dirname, "dist", "appicon"),
icon: path.join(__dirname, "dist-react", "appicon"),
ignore: [
"^/\\.github$", // Ignore the .github directory
"^/venv$", // Ignore the venv directory
Expand All @@ -30,41 +31,39 @@ module.exports = {
"^/public$",
"^/src$",
"^/netlify.toml$",
"^/*\\.ts*$", // Ignore typescript,
"^/stats.html$"
],
},
rebuildConfig: {},
makers: [
{
name: "@electron-forge/maker-zip",
platforms: ["linux", "win32", "darwin"],
config: {},
},
/*{
name: "@electron-forge/maker-dmg",
config: {
options: {
icon: path.join(__dirname, "dist", "appicon.icns"),
},
},
},*/
{
name: "@electron-forge/maker-deb",
config: {
options: {
icon: path.join(__dirname, "dist", "appicon.png"),
icon: path.join(__dirname, "dist-react", "appicon.png"),
},
},
},
{
name: "@electron-forge/maker-rpm",
options: {
icon: path.join(__dirname, "dist", "appicon.png"),
platforms: ["linux"],
config: {
options: {
icon: path.join(__dirname, "dist-react", "appicon.png"),
},
},
},
/*{
name: "@electron-forge/maker-squirrel",
config: (arch) => ({
setupIcon: path.join(__dirname, "dist", "appicon.ico"),
iconUrl: path.join(__dirname, "dist", "appicon.ico"),
setupIcon: path.join(__dirname, "dist-react", "appicon.ico"),
iconUrl: path.join(__dirname, "dist-react", "appicon.ico"),
setupExe: `iSpeakerReact-win32-${arch}-Setup.exe`,
}),
},*/
Expand All @@ -87,3 +86,5 @@ module.exports = {
}),
],
};

export default config;
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
<script type="module" src="/src/frontend/index.jsx"></script>
</body>
</html>
Loading