Skip to content

Conversation

@bnimit
Copy link
Contributor

@bnimit bnimit commented Dec 4, 2025

This PR updates outdated dependencies across the project, bringing build tools, type definitions, and linting to their latest stable versions.

Summary of Changes

Phase 1: Type Definitions & Safe Updates

  • @types/react: 18.0.24 → 18.3.27
  • @types/react-dom: 18.0.8 → 18.3.7
  • @types/react-beautiful-dnd: 13.1.2 → 13.1.8
  • postcss: 8.4.18 → 8.5.6
  • eslint-config-reearth: 0.2.1 → 0.3.8

Phase 2: Build Tools (Safe)

  • prettier: 2.7.1 → 3.7.4
  • typescript: 4.8.4 → 5.9.3
  • tslib: Added 2.8.1 (required for TypeScript importHelpers)

Phase 3: Vite Ecosystem (Major Version Bumps)

  • vite: 3.2.1 → 7.2.6 (4 major versions)
  • vitest: 0.24.3 → 4.0.15 (4 major versions)
  • @vitejs/plugin-react: 2.2.0 → 5.1.1 (3 major versions)
  • vite-plugin-dts: 1.6.6 → 4.5.4 (3 major versions)
  • vite-plugin-css-injected-by-js: 2.1.1 → 3.5.2
  • vite-plugin-svgr: 2.2.2 → 4.5.0 (2 major versions)

Phase 4: Linting

  • eslint: 8.26.0 → 9.39.1 (major version upgrade)
  • husky: 8.0.1 → 9.1.7

Breaking Changes & Fixes

Vite 7 Migration

  • Updated SVG imports to use ?react suffix (vite-plugin-svgr v4 API change)
  • Moved CSS injection plugin from rollupOptions to main plugins array
  • Updated Vite config structure for Vite 7 compatibility

ESLint 9 Migration

  • Migrated from .eslintrc.yml to eslint.config.mjs (flat config format)
  • Removed .eslintignore (ignores now defined in config)
  • Updated eslint-config-reearth integration

TypeScript Configuration

  • Added exclude for example directory to prevent duplicate type definitions
  • Added yarn resolutions to force consistent @types/react versions across dependencies

Testing

  • Added placeholder .todo() tests for future implementation
  • Tests passing with Vitest 4

New Features

Automated Release Workflow

  • GitHub Actions workflow for automated release PR creation
  • Automatic version bumping (patch/minor/major)
  • Changelog generation from git commits
  • Documentation in .github/RELEASE.md

Testing

✅ All builds passing
✅ All tests passing (5 todo tests as placeholders)
✅ Linting working with 1 pre-existing warning
✅ Type checking successful

Notes

  • react-beautiful-dnd remains deprecated but not replaced (would require major refactor)
  • Node version requirement still >=10 (could be updated in future PR)
  • React 18 maintained (React 19 upgrade deferred for separate effort)

Commits

  • Phase 1 and Safe Phase 2 updates
  • Phase 3 Vite/Vitest ecosystem updates
  • Husky 9 upgrade
  • Release workflow implementation
  • ESLint 9 upgrade with flat config migration

   Updated type definitions and build tools to latest stable versions:

   Phase 1 (Type definitions):
   - @types/react: 18.0.24 → 18.3.27
   - @types/react-dom: 18.0.8 → 18.3.7
   - @types/react-beautiful-dnd: 13.1.2 → 13.1.8
   - postcss: 8.4.18 → 8.5.6
   - eslint-config-reearth: 0.2.1 → 0.3.8

   Phase 2 (Safe build tools):
   - prettier: 2.7.1 → 3.7.4
   - typescript: 4.8.4 → 5.9.3

   Additional changes:
   - Added tslib 2.8.1 (required for TypeScript importHelpers)
   - Added yarn resolutions to prevent @types/react version conflicts
   - Build and tests passing successfully
   Updated type definitions and build tools to latest stable versions:

   Phase 1 (Type definitions):
   - @types/react: 18.0.24 → 18.3.27
   - @types/react-dom: 18.0.8 → 18.3.7
   - @types/react-beautiful-dnd: 13.1.2 → 13.1.8
   - postcss: 8.4.18 → 8.5.6
   - eslint-config-reearth: 0.2.1 → 0.3.8

   Phase 2 (Safe build tools):
   - prettier: 2.7.1 → 3.7.4
   - typescript: 4.8.4 → 5.9.3

   Additional changes:
   - Added tslib 2.8.1 (required for TypeScript importHelpers)
   - Added yarn resolutions to prevent @types/react version conflicts
   - Added todo test placeholders for future test implementation
   - Build and tests passing successfully
   Updated Vite ecosystem to latest versions with configuration updates:

   Build Tools:
   - vite: 3.2.1 → 7.2.6 (4 major versions)
   - vitest: 0.24.3 → 4.0.15 (4 major versions)
   - @vitejs/plugin-react: 2.2.0 → 5.1.1 (3 major versions)

   Vite Plugins:
   - vite-plugin-dts: 1.6.6 → 4.5.4 (3 major versions)
   - vite-plugin-css-injected-by-js: 2.1.1 → 3.5.2
   - vite-plugin-svgr: 2.2.2 → 4.5.0 (2 major versions)

   Breaking Changes Fixed:
   - Updated SVG imports to use ?react suffix (vite-plugin-svgr v4 API)
   - Moved CSS injection plugin from rollupOptions to main plugins array
   - Added exclude for example directory in tsconfig to prevent duplicate type definitions
   - Updated Vite config structure for Vite 7 compatibility
  Upgraded ESLint from 8.26.0 to 9.39.1 and migrated to flat config format.

  Breaking Changes:
  - Migrated from .eslintrc.yml to eslint.config.mjs (flat config)
  - Removed .eslintignore (ignores now in eslint.config.mjs)
  - Updated eslint-config-reearth usage for ESLint 9 compatibility

  Configuration:
  - Created eslint.config.mjs with reearth preset
  - Added ignores for dist/ and node_modules/
  - Used .mjs extension to explicitly mark as ES module

  ESLint now runs successfully with one warning in GridArea.tsx about
  explicit 'any' type usage (existing code issue, not introduced by upgrade).
@bnimit bnimit self-assigned this Dec 4, 2025
bnimit added 13 commits December 5, 2025 16:51
  Added yarn resolutions to force secure versions of vulnerable dependencies.

  Vulnerabilities Fixed:
  - Critical: Prototype Pollution in minimist (bumped to 1.2.8)
  - Moderate: Babel runtime RegExp complexity (bumped to 7.26.10)
  - Moderate: js-yaml prototype pollution (bumped to 4.1.1)

  Impact:
  - Resolved 12 vulnerabilities (1 critical, 4 moderate, 7 low)
  - All packages now using patched versions via yarn resolutions
  - No breaking changes - all functionality tested and working
  Added GitHub Actions CI workflow that runs on all pull requests and pushes to main.

  Workflow Features:
  - Matrix testing on Node.js 18.x and 20.x
  - Runs linter (eslint)
  - Runs type checking (tsc)
  - Runs test suite (vitest)
  - Builds the package
  - Security audit check (non-blocking)
  - Separate job for building example directory

  Triggers:
  - All pull requests (regardless of target branch)
  - Pushes to main branch

  Benefits:
  - Catches issues before merging
  - Ensures compatibility across Node versions
  - Validates all code changes automatically
  - Provides feedback directly in PRs

  This complements the existing release workflow and provides
  continuous validation of code quality.
  Updated CI workflow to test on Node 20.x and 22.x instead of 18.x,
  as the updated Vite ecosystem requires Node 20.19.0+.

  Changes:
  - Test matrix now uses [20.x, 22.x] instead of [18.x, 20.x]
  - Aligns with @vitejs/plugin-react@5.1.1 engine requirements
  - Matches Vite 7 recommended Node versions

  Reasoning:
  - @vitejs/plugin-react@5.1.1 requires ^20.19.0
   - Add recursive ignore patterns for all dist directories
   - Ignore minified JS files from linting
   - Auto-fix import ordering in test files per ESLint rules

   This resolves the 1700+ lint errors caused by ESLint attempting to
   lint build artifacts in example/dist/.
   Fixed SVG imports to work correctly with library build mode by removing the ?react suffix. The ?react suffix caused SVGs to be bundled as data URLs instead of React components in library mode.

   Changes:
   - Removed ?react suffix from SVG imports in src/Icon/icons.ts
   - Updated example to use Vite 3 and import from built library
   - Added custom SVG module type declarations in src/env.d.ts
   - Updated example README to document the configuration
   - Reverted example dependencies to older versions for compatibility testing
   Changed from require() style import to standard ES6 import syntax to comply with ESLint rules.
@bnimit bnimit merged commit cd8939e into main Dec 10, 2025
2 checks passed
@bnimit bnimit deleted the chore/repo-maintenance-dec-25 branch December 10, 2025 10:02
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