-
Notifications
You must be signed in to change notification settings - Fork 3
chore(web): migrate-to-vite #55
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
Conversation
WalkthroughThe project has undergone significant changes, primarily transitioning from Parcel to Vite as the build tool. This includes updates to configuration files, import statements, and the handling of environment variables. The modifications enhance compatibility with modern JavaScript practices, particularly through the adoption of ES modules and streamlined import paths for assets. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WebApp
participant Vite
User->>WebApp: Start Development
WebApp->>Vite: Build Project
Vite->>WebApp: Serve Files
WebApp->>User: Display Application
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for curate-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
web/src/assets/svgs/icons/book.svg
is excluded by!**/*.svg
web/src/assets/svgs/icons/pile-coins.svg
is excluded by!**/*.svg
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (14)
- .gitignore (1 hunks)
- contracts/.gitignore (1 hunks)
- web/.gitignore (1 hunks)
- web/netlify.toml (1 hunks)
- web/package.json (4 hunks)
- web/scripts/gitInfo.js (1 hunks)
- web/src/components/HeroImage.tsx (1 hunks)
- web/src/components/InfoCard.tsx (1 hunks)
- web/src/consts/index.ts (2 hunks)
- web/src/context/Web3Provider.tsx (1 hunks)
- web/src/pages/SubmitItem/Policy/index.tsx (1 hunks)
- web/src/utils/getGraphqlUrl.ts (1 hunks)
- web/src/utils/sentry.ts (1 hunks)
- web/vite.config.js (1 hunks)
Files not reviewed due to server errors (3)
- web/src/utils/sentry.ts
- web/src/context/Web3Provider.tsx
- web/package.json
Files skipped from review due to trivial changes (5)
- .gitignore
- contracts/.gitignore
- web/netlify.toml
- web/src/components/HeroImage.tsx
- web/src/components/InfoCard.tsx
Additional comments not posted (7)
web/src/utils/getGraphqlUrl.ts (1)
5-6
: LGTM!The changes are consistent with the migration to Vite. The switch to
import.meta.env
is the correct way to access environment variables in a Vite project.web/.gitignore (1)
9-12
: LGTM!The changes are consistent with the migration to Vite. The removed entries are Parcel-specific, and the added entries are Vite-specific. The changes ensure that the correct directories are ignored in the Vite project.
web/src/pages/SubmitItem/Policy/index.tsx (1)
24-27
: LGTM!The change improves the clarity and correctness of the route calculation. The ternary operator is more appropriate in this case, as it ensures that the previous route is accurately determined based on the actual length of
fieldProps
.web/vite.config.js (1)
1-32
: LGTM!The Vite configuration looks good and follows best practices. The use of plugins enhances the development experience and provides additional functionality. The
envPrefix
property ensures that only specific environment variables are exposed to the application. The suppression of certain rollup warnings in theonwarn
function is justified to avoid unnecessary warnings.web/scripts/gitInfo.js (1)
2-6
: LGTM!The changes to the import statements align the code with modern JavaScript practices and ES module syntax. The JSON type assertion for
packageJson
import enhances the explicit handling of JSON imports. These changes improve the clarity and maintainability of the code.web/src/consts/index.ts (2)
5-5
: LGTM!The change to use
import.meta.env.REACT_APP_IPFS_GATEWAY
for theIPFS_GATEWAY
constant reflects a shift towards using the ES module syntax for accessing environment variables. This change improves compatibility with module-based environments. The fallback value ensures a default value is used if the environment variable is not set.
23-23
: LGTM!The change to use
import.meta.env.COURT_SITE
for theCOURT_SITE
constant reflects a shift towards using the ES module syntax for accessing environment variables. This change improves compatibility with module-based environments. The nullish coalescing operator (??
) ensures a default value is used if the environment variable is not set or isundefined
.
PR-Codex overview
This PR updates the project from Parcel to Vite, replaces environment variables access, and refactors imports for better tool compatibility.
Detailed summary
import.meta.env
tsconfig
paths for ViteSummary by CodeRabbit
New Features
vite.config.js
file for Vite configuration, including plugins for SVG handling and TypeScript path mappings.Bug Fixes
Policy
component, ensuring accurate navigation.Documentation
import.meta.env
.