Skip to content

Comments

'react-scripts' dependencies vulnerabilities fixed#32

Merged
technologic-technologic merged 1 commit intogen-aifrom
18-fix-dependencies-vulnerabilities
Oct 15, 2025
Merged

'react-scripts' dependencies vulnerabilities fixed#32
technologic-technologic merged 1 commit intogen-aifrom
18-fix-dependencies-vulnerabilities

Conversation

@technologic-technologic
Copy link
Owner

* Dependency vulnerability fixed with Vite migration

Key changes

  • Build & Dev Server

    • Replaced CRA with Vite; kept app logic/components unchanged.
    • Removed react-scripts; added vite with minimal vite.config.ts.
    • Updated npm scripts:
      • dev → Vite dev server (vite) for local development.
      • buildvite build.
      • previewvite preview (future use).
      • lint → placeholder for later.
      • test → run all tests manually.
    • Adopted Vite layout (index.html at root; src/ unchanged).
    • Set client default port to 8080 in vite.config.ts; improved proxy rules.
    • Deleted IDE config files.
    • No dependency upgrades beyond the toolchain swap.
  • Data Fetching & Context

    • Fixed duplicate backend calls by consolidating fetches in DataProvider.
    • Exposed a single data context entry point for consumer components.
  • Testing

    • Migrated to Vitest; aligned environment with Vite.
    • Added jsdom to devDependencies and enabled globals in test config.
    • Added app-level test parameters for smoother runs.
    • Updated .gitignore; finalized package-lock.json one last time.
    • Added test script to package.json.
    • Created new context tests: DataContext.test.tsx, SearchContext.test.tsx.
    • Fixed component tests: InventoryTablePageSelector.test.tsx, InventoryTable.test.tsx, NewProductButton.test.tsx, ProductForm.test.tsx.
    • Refactored for new context management: InventoryTable.tsx, InventoryTableObj.tsx, InventoryTablePageSelector.tsx, EncoraContent.tsx.

Breaking or pending changes

  • Update documentation to the new version.

* Vite migration, port update, API calls fix, and testing overhaul

## Key changes
- **Build & Dev Server**
  - Replaced CRA with Vite; kept app logic/components unchanged.
  - Removed `react-scripts`; added `vite` with minimal `vite.config.ts`.
  - Updated npm scripts:
    - `dev` → Vite dev server (`vite`) for local development.
    - `build` → `vite build`.
    - `preview` → `vite preview` (future use).
    - `lint` → placeholder for later.
    - `test` → run all tests manually.
  - Adopted Vite layout (`index.html` at root; `src/` unchanged).
  - Set client default port to **8080** in `vite.config.ts`; improved proxy rules.
  - Deleted IDE config files.
  - No dependency upgrades beyond the toolchain swap.

- **Data Fetching & Context**
  - Fixed duplicate backend calls by consolidating fetches in `DataProvider`.
  - Exposed a single data context entry point for consumer components.

- **Testing**
  - Migrated to Vitest; aligned environment with Vite.
  - Added `jsdom` to `devDependencies` and enabled globals in test config.
  - Added app-level test parameters for smoother runs.
  - Updated `.gitignore`; finalized `package-lock.json` one last time.
  - Added `test` script to `package.json`.
  - Created new context tests: `DataContext.test.tsx`, `SearchContext.test.tsx`.
  - Fixed component tests: `InventoryTablePageSelector.test.tsx`, `InventoryTable.test.tsx`, `NewProductButton.test.tsx`, `ProductForm.test.tsx`.
  - Refactored for new context management: `InventoryTable.tsx`, `InventoryTableObj.tsx`, `InventoryTablePageSelector.tsx`, `EncoraContent.tsx`.

## Breaking or pending changes
- `SearchBar` component testing is still pending.
- Update documentation to the new version.


---------

Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
@github-actions
Copy link

PR Summary

  • WHAT Changed:

    • Removed the documentation.docx file.
    • Updated .gitignore to include new log files and directories.
    • Replaced the README.md content to reflect a new project structure using React, TypeScript, and Vite.
    • Added a new eslint.config.js file for ESLint configuration.
    • Introduced a new index.html file for the project.
    • Deleted the jest.config.ts file.
    • Updated package-lock.json to reflect new dependencies and versions.
  • WHY It Matters:

    • The changes transition the project to a modern stack (React + TypeScript + Vite), improving development speed and performance.
    • Enhanced ESLint configuration helps maintain code quality and consistency.
    • Updated dependencies ensure compatibility with the latest features and security patches.
  • RISKS:

    • Potential issues with existing code compatibility due to the transition to Vite and TypeScript.
    • Removal of Jest configuration may affect testing capabilities unless replaced with a new testing strategy.
  • TESTS to Add:

    • Implement tests for the new setup, especially for the React components.
    • Ensure ESLint rules are enforced and functioning as expected.
  • BREAKING CHANGES:

    • The removal of Jest configuration means existing tests may need to be rewritten or adapted to a new testing framework.
    • The project structure has changed, which may require updates to any build or deployment scripts.
  • Changed File Paths:

    • documentation/documentation.docx (deleted)
    • inventory-manager/.gitignore (updated)
    • inventory-manager/README.md (updated)
    • inventory-manager/eslint.config.js (new)
    • inventory-manager/index.html (new)
    • inventory-manager/jest.config.ts (deleted)
    • inventory-manager/package-lock.json (updated)

@technologic-technologic technologic-technologic added bug Something isn't working invalid This doesn't seem right labels Oct 15, 2025
@technologic-technologic technologic-technologic linked an issue Oct 15, 2025 that may be closed by this pull request
@technologic-technologic technologic-technologic added this to the Major fixes milestone Oct 15, 2025
@technologic-technologic technologic-technologic merged commit 5aec6a2 into gen-ai Oct 15, 2025
1 check passed
@technologic-technologic technologic-technologic deleted the 18-fix-dependencies-vulnerabilities branch October 15, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix dependencies vulnerabilities

1 participant