-
Notifications
You must be signed in to change notification settings - Fork 85
feat: Replace react-script to vite #3327
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
|
/package |
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.
PR Overview
This PR migrates the project from react-scripts to Vite by updating the Storybook configuration and adapting SVG asset imports. It also makes adjustments to ESLint settings and Electron mocks to support the Vite environment.
- Update Storybook configuration: switched to '@storybook/react-vite' and '@storybook/builder-vite', and re-configured the Electron alias.
- Modify ESLint configuration by adding a Vitest setup file and adjusting rules.
- Update multiple component files to import SVGs using the Vite-specific "?react" query.
- Replace process.env.NODE_ENV with import.meta.env.MODE in ErrorBoundary for environment detection.
Reviewed Changes
| File | Description |
|---|---|
| packages/neuron-ui/.storybook/main.ts | Updated Storybook config for Vite, changed framework and alias settings. |
| packages/neuron-ui/.eslintrc.js | Added Vitest setup in devDependencies and adjusted ESLint rules. |
| packages/neuron-ui/.storybook/electron.js | Converted CommonJS to ES module exports for Electron mocks. |
| packages/neuron-ui/src/components/ErrorBoundary/index.tsx | Replaced process.env check with import.meta.env.MODE for Vite usage. |
| packages/neuron-ui/src/components/LanguageDialog/index.tsx | Updated SVG icon imports to use the Vite-specific "?react" query. |
| packages/neuron-ui/src/components/NetworkSetting/index.tsx | Updated SVG icon imports to use "?react". |
| packages/neuron-ui/src/components/HardwareSign/success.tsx | Updated SVG icon imports to use "?react". |
| packages/neuron-ui/src/components/ImportHardware/import-success.tsx | Updated SVG icon import to use "?react". |
| packages/neuron-ui/src/components/OfflineSign/index.tsx | Updated SVG icon import to use "?react". |
| packages/neuron-ui/src/components/CompensationPeriodTooltip/index.tsx | Removed redundant CONSTANTS extraction and fixed import paths. |
| packages/neuron-ui/src/components/ImportHardware/import-error.tsx | Updated SVG icon import to use "?react". |
| packages/neuron-ui/src/components/ImportHardware/confirming.tsx | Updated SVG icon import to use "?react". |
| packages/neuron-ui/src/components/History/index.tsx | Updated SVG icon import to use "?react" and removed an extraneous line. |
| packages/neuron-ui/src/components/GeneralSetting/index.tsx | Updated SVG icon imports to use "?react". |
| packages/neuron-ui/src/components/ImportHardware/detect-device.tsx | Updated SVG icon import to use "?react". |
Copilot reviewed 101 out of 101 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
packages/neuron-ui/.storybook/main.ts:20
- Verify that the new alias for 'electron' correctly points to the intended directory to avoid breaking Electron mocks in Storybook.
alias: { electron: path.resolve(__dirname, '../.storybook/electron') },
packages/neuron-ui/.storybook/electron.js:16
- [nitpick] If these stub functions are intentional, consider adding a comment to clarify that they are dummy implementations for Storybook use.
export const clipboard = () => {}
|
/package |
issue:
react-scriptto another Magickbase/neuron-public-issues#356