Skip to content

Conversation

@Oksamies
Copy link
Contributor

@Oksamies Oksamies commented Dec 1, 2025

chore: migrate build system to Vite and update TS config

  • 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.

Run pre-commit on all files for sorting imports

@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

Important

Review skipped

More 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 reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 12-01-chore_migrate_build_system_to_vite_and_update_ts_config

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Oksamies Oksamies requested a review from Copilot December 1, 2025 19:03
Copy link

Copilot AI left a 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 moduleResolution changed from node to bundler across all packages
  • Import sorting standardized via Prettier plugin
  • Updated types field 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);
Copy link

Copilot AI Dec 1, 2025

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.

Copilot uses AI. Check for mistakes.
return { value: team, label: team };
}
return { value: team.name, label: team.name };
return { value: team, label: team };
Copy link

Copilot AI Dec 1, 2025

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.

Suggested change
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: "" };
}

Copilot uses AI. Check for mistakes.
"experimentalDecorators": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": false,
Copy link

Copilot AI Dec 1, 2025

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.

Suggested change
"verbatimModuleSyntax": false,

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
"@babel/runtime": "^7.25.6",
"zod": "^3.23.8"
Copy link

Copilot AI Dec 1, 2025

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.

Copilot uses AI. Check for mistakes.
This was referenced Dec 2, 2025
- 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.
@Oksamies Oksamies force-pushed the 12-01-chore_migrate_build_system_to_vite_and_update_ts_config branch from 0e9d28f to 19be637 Compare December 3, 2025 01:44

import pkg from "./package.json";

const { dependencies, peerDependencies } = pkg as any;

Check failure

Code scanning / ESLint

Disallow the `any` type Error

Unexpected any. Specify a different type.
Copy link
Contributor

@Roffenlund Roffenlund left a 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.

@Oksamies
Copy link
Contributor Author

Oksamies commented Dec 3, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants