Modernize Mod Uploader 1.8.0 - #5
Open
lemon07r wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Modernizes Mod Uploader to v1.8.0 by rebasing onto upstream, upgrading the Electron/Vite/TypeScript/React toolchain, and standardizing the project around Bun with added validation and testable modules for workshop uploads and metadata parsing.
Changes:
- Upgrades core toolchain and adjusts Vite/Electron bundling to keep native Steamworks/runtime dependencies external.
- Introduces Bun-based typecheck/test/release validation, plus CLI smoke coverage and new release notes/docs updates.
- Extracts workshop upload validation/error handling and ZIP metadata parsing into focused, testable modules.
Reviewed changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Migrates build config to Vite 8/Rolldown and uses notBundle() to externalize native/runtime deps. |
| tsconfig.json | Updates TS compiler settings for bundler-style resolution and Bun typing; expands includes/excludes. |
| scripts/cli-smoke.js | Adds a CLI smoke test script for help/version/JSON failure behavior. |
| RELEASE_NOTES_1.8.0.md | Adds release notes for 1.8.0. |
| README.md | Updates prerequisites/build instructions and documents new CLI validation behavior + release validation steps. |
| package.json | Bumps version to 1.8.0, pins Bun via packageManager, adds typecheck/test/validate scripts and new deps. |
| electron/main/workshop-service.ts | Refactors workshop upload logic to use extracted validation/details/error helpers. |
| electron/main/workshop-errors.ts | Extracts Steam auth detection + error normalization. |
| electron/main/upload-details.ts | Adds upload-data validation, workshop ID parsing, and update payload construction. |
| electron/main/upload-details.test.ts | Adds Bun tests for workshop ID validation, visibility behavior, and error normalization. |
| electron/main/mod-parser.ts | Refactors ZIP metadata extraction to delegate parsing to extracted module(s). |
| electron/main/metadata-content.ts | Adds reusable metadata parsing helpers for package/bundled mod metadata. |
| electron/main/metadata-content.test.ts | Adds Bun tests for metadata parsing helpers. |
| electron/main/image-utils.ts | Moves getImageSizeInfo into a dedicated module and re-exports it. |
| electron/main/image-utils.test.ts | Adds Bun test coverage for missing preview behavior via new helpers. |
| electron/main/image-files.ts | Adds shared image file helpers (getImageSizeInfo, validatePreviewInput). |
| electron/main/cli.ts | Refactors CLI entry to use extracted option parsing/validation and adds --version. |
| electron/main/cli-options.ts | Adds isolated CLI arg parsing/building/validation helpers. |
| electron/main/cli-options.test.ts | Adds Bun tests for CLI parsing and pre-Steam validation failures. |
| bun.lock | Updates lockfile for upgraded dependencies and new Bun/TS/Vite/Electron versions. |
| .github/workflows/release.yml | Moves version stamping and validation to Bun; adds release:validate step. |
Comments suppressed due to low confidence (1)
electron/main/mod-parser.ts:12
formatModNameis now duplicated here and inmetadata-content.ts. Duplicating the same formatting logic makes it easy for behavior to diverge over time. Prefer re-exporting the shared helper frommetadata-content.tsinstead of maintaining a second copy.
export function formatModName(name: string): string {
if (!name) return name;
return name
.replace(/[-_]/g, ' ')
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+32
to
+36
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
|
|
Comment on lines
+12
to
+13
| "cli:smoke": "node scripts/cli-smoke.js", | ||
| "release:validate": "bun run typecheck && bun run test && bun run build && bun run cli:smoke", |
Comment on lines
+1
to
+21
| import * as fs from 'node:fs'; | ||
|
|
||
| export function getImageSizeInfo(imagePath: string): { | ||
| size: number; | ||
| exceedsLimit: boolean; | ||
| sizeFormatted: string; | ||
| } { | ||
| try { | ||
| const size = fs.statSync(imagePath).size; | ||
| return { | ||
| size, | ||
| exceedsLimit: size > 1024 * 1024, | ||
| sizeFormatted: | ||
| size >= 1024 * 1024 | ||
| ? `${(size / 1024 / 1024).toFixed(2)} MB` | ||
| : `${(size / 1024).toFixed(1)} KB`, | ||
| }; | ||
| } catch { | ||
| return { size: 0, exceedsLimit: false, sizeFormatted: '0 KB' }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
v1.7.1and keepsthe improved tagging UI introduced there.
Steamworks 0.12.2, electron-builder 26.15, and electron-updater 6.8.
lock, and validates before packaging.
vite-plugin-electron1.xnotBundle()so native Steamworks binariesremain external and are packaged correctly.
visibility, defaults new items public, and adds
--version.Lyeeedar/ModUploader.Validation
bun install --frozen-lockfilebun run release:validate