-
Notifications
You must be signed in to change notification settings - Fork 4
chore: migrate build system to Vite and update TS config #1648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
chore: migrate build system to Vite and update TS config #1648
Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 193 files out of 300 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the build system from Preconstruct to Vite for several packages (cyberstorm, cyberstorm-theme, ts-uploader) and standardizes TypeScript configurations across the monorepo. The migration includes updating module resolution settings, adding Prettier import sorting, and ensuring consistent build outputs.
Key changes:
- Migration of build tooling from Preconstruct/TSC to Vite for three packages
- TypeScript
moduleResolutionchanged fromnodetobundleracross all packages - Import sorting standardized via Prettier plugin
- Updated
typesfield in package.json files to point to source files
Reviewed changes
Copilot reviewed 300 out of 304 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cyberstorm/vite.config.ts | New Vite configuration for cyberstorm package build |
| packages/cyberstorm-theme/vite.config.ts | New Vite configuration for cyberstorm-theme package build |
| packages/ts-uploader/vite.config.ts | New Vite configuration for ts-uploader package build |
| package.json | Updated build script to include Vite-built packages and excluded them from Preconstruct |
| .prettierrc | Added import sorting plugin configuration |
| Multiple tsconfig.json files | Changed moduleResolution from "node" to "bundler" |
| Multiple package.json files | Updated types field to point to source files and added @babel/runtime dependency |
| Multiple source files | Import statements reordered according to new Prettier rules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } catch (e) { | ||
| if (onSubmitError) { | ||
| onSubmitError(e); | ||
| onSubmitError(e as Error | ApiError); |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type assertion added to handle error parameter. While this fixes the type error, consider checking the error type with a type guard (e.g., isApiError(e)) before passing to onSubmitError to ensure type safety at runtime.
| return { value: team, label: team }; | ||
| } | ||
| return { value: team.name, label: team.name }; | ||
| return { value: team, label: team }; |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code assumes team is a string, but the removed conditional suggests teams could be objects with a name property. This change may break if currentUser.teams contains objects instead of strings. Verify that the API always returns teams as strings, or restore the type checking.
| return { value: team, label: team }; | |
| if (typeof team === "string") { | |
| return { value: team, label: team }; | |
| } else if (team && typeof team === "object" && typeof team.name === "string") { | |
| return { value: team.name, label: team.name }; | |
| } else { | |
| return { value: "", label: "" }; | |
| } |
| "experimentalDecorators": true, | ||
| "resolveJsonModule": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "verbatimModuleSyntax": false, |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting verbatimModuleSyntax to false is discouraged when using moduleResolution: bundler. Consider removing this option or setting it to true to ensure TypeScript's import/export statements are preserved as-is, which is the recommended practice with bundler module resolution.
| "verbatimModuleSyntax": false, |
| "@babel/runtime": "^7.25.6", | ||
| "zod": "^3.23.8" |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving zod from devDependencies to dependencies changes its role in the package. Verify that zod is actually used at runtime in consuming packages, as it may be sufficient as a devDependency if it's only used for type definitions and build-time validation.
- Migrate `cyberstorm`, `cyberstorm-theme`, and `ts-uploader` to use Vite for building. - Update root `package.json` to exclude Vite-built packages from Preconstruct and add explicit build steps. - Switch `moduleResolution` to `bundler` across all packages. - Add root `tsconfig.json` with project references. - Update `types` fields in `package.json` for various packages. - Add `@babel/runtime` dependency to multiple packages.
0e9d28f to
19be637
Compare
Roffenlund
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot build the project with the changes done in this PR. I get the following error:
[plugin:vite:import-analysis] Failed to resolve entry for package "@thunderstore/cyberstorm". The package may have incorrect main/module/exports specified in its package.json.
I tried running yarn install followed by yarn install --check-files in order to try and force a re-install. Not sure if this was the correct procedure, but it seemed to have the expected effect when switching back to the master branch.
Ah, ye, I'll take a look at it. It's probably the removal of preconstruct from few packages that creates this issue. Thanks for testing, I'll get back to this at some point. |

chore: migrate build system to Vite and update TS config
cyberstorm,cyberstorm-theme, andts-uploaderto use Vite for building.package.jsonto exclude Vite-built packages from Preconstruct and add explicit build steps.moduleResolutiontobundleracross all packages.tsconfig.jsonwith project references.typesfields inpackage.jsonfor various packages.@babel/runtimedependency to multiple packages.Run pre-commit on all files for sorting imports