Skip to content
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

refactor: migrate from webpack to vitejs bundler #240

Merged
merged 14 commits into from
Nov 5, 2024

Conversation

cswni
Copy link
Contributor

@cswni cswni commented Nov 5, 2024

This pull request includes significant changes to the project configuration and codebase, focusing on migrating to Vite, updating ESLint configuration, and refactoring import paths for consistency. The most important changes include the removal of the .eslintrc file, the addition of an eslint.config.js file, updates to package.json to support the Vite build tool, and numerous import path updates across various files.

Configuration Updates:

  • Removed the .eslintrc file and replaced it with an eslint.config.js file, introducing a new ESLint configuration that includes plugins for React hooks and refresh. [1] [2]
  • Updated package.json to replace react-scripts with Vite, added necessary Vite plugins, and adjusted the start and build scripts to use Vite. [1] [2] [3] [4] [5] [6]

HTML and Asset Updates:

  • Renamed public/index.html to index.html and updated paths for manifest and favicon files, as well as added a script tag to load the main entry point. [1] [2]

Import Path Refactoring:

  • Refactored import paths in src/App.tsx to use absolute paths with the @src alias for improved consistency and maintainability. [1] [2]
  • Updated import paths in various _mock files to use the @src alias. [1] [2] [3] [4]
  • Adjusted import paths in API files to use the @src alias. [1] [2] [3]
  • Modified import paths in several component files to use the @src alias. [1] [2] [3] [4] [5] [6] [7] [8]

cswni added 8 commits November 4, 2024 18:48
Removed the `.eslintrc` file that defined the project's ESLint rules and settings. This change might impact linting automation and developer workflows which relied on these configurations.
Changes across project files to use dynamically import format suggested by vitejs
- Renamed 'public/index.html' to 'index.html'
- Updated paths for manifest and favicon links to relative paths
- Removed unnecessary 'noscript' tag
- Added script tag to load 'index.tsx'
- Update `package.json` to add Vite as the build and start tool.
- Remove `react-scripts` and associated dependencies.
- Add Vite and related plugins to `devDependencies`.
- Create `vite.config.ts` to configure Vite with environment variables and path aliases.
- Replaced single tsconfig.json with tsconfig.app.json and tsconfig.node.json
- tsconfig.app.json setup for application-specific settings
- tsconfig.node.json tailored for Node.js-specific settings
Introduce a new ESLint configuration to maintain code quality and consistency. The config:
- Utilizes recommended settings from ESLint and TypeScript
- Integrates plugins for React hooks and React Refresh
- Ignores the 'dist' directory to avoid linting built files
- Created `src/init.js` to ensure `window.global` is defined.
- This change prevents potential issues with environments lacking `global` definition.
- Update `package.json` to add Vite as the build and start tool.
- Remove `react-scripts` and associated dependencies.
- Add Vite and related plugins to `devDependencies`.
- Create `vite.config.ts` to configure Vite with environment variables and path aliases.
@cswni cswni requested review from geolffreym and Jadapema November 5, 2024 01:08
@cswni cswni self-assigned this Nov 5, 2024
@cswni cswni linked an issue Nov 5, 2024 that may be closed by this pull request
cswni added 2 commits November 4, 2024 19:17
Removed the vite-plugin-simple-html package from the dependencies in package.json as it is no longer needed. This helps simplify the dependency graph and reduces potential security vulnerabilities. No other changes in the package functionality were affected.
Introduce a new Makefile to streamline development tasks.
- Auto-load environment variables from .env file.
- Set default goal, silence make output.
- Add targets for running tests, test coverage, and linting.
@cswni cswni changed the title refactor: mgirate from webpack to vitejs bundler refactor: migrate from webpack to vitejs bundler Nov 5, 2024
cswni added 4 commits November 4, 2024 20:01
This commit focuses on a variety of code optimizations and improvements:
- Removed unused imports from several files.
- Optimized imports by using '@src' alias in various files.
- Improved code formatting for better readability.
This commit fixes the lint command in the Makefile to ensure proper execution.
- Removed an unnecessary unintended backslash at the end of the eslint command.
- Ensures that eslint will run correctly on all specified file types.
- Removed unnecessary eslint-disable-next-line no-empty-pattern.
- Ignored TypeScript error for unused variable in movie-details-description.
- Cleaned up props in MovieDetailsDescription component.
Updated CarouselItem and CarouselLargeItem components to use Readonly type for their props to ensure immutability.
- Modified CarouselLargeItem in carousel-mixed.tsx.
- Modified CarouselItem in carousel-main.tsx.
Copy link

sonarqubecloud bot commented Nov 5, 2024

Copy link
Member

@Jadapema Jadapema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jadapema Jadapema merged commit 84c09ac into v2/mvp_redesign Nov 5, 2024
3 checks passed
@cswni cswni deleted the migrate/webpack/to/vite branch November 5, 2024 20:28
@cswni cswni added Done Task completed UI labels Nov 5, 2024
@cswni cswni restored the migrate/webpack/to/vite branch March 6, 2025 02:05
@cswni cswni deleted the migrate/webpack/to/vite branch March 6, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done Task completed UI
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

feat: migrar de webpack a vite
2 participants