Skip to content

HUL-48 | Modernize Development Environment and Testing Infrastructure#49

Merged
jorilindell merged 16 commits into
mainfrom
HUL-48-dependency-upgrades
Jan 7, 2026
Merged

HUL-48 | Modernize Development Environment and Testing Infrastructure#49
jorilindell merged 16 commits into
mainfrom
HUL-48-dependency-upgrades

Conversation

@jorilindell

Copy link
Copy Markdown
Contributor

Overview

This PR comprehensively modernizes the sports-maintenance-dashboard development environment by migrating from legacy tools to modern alternatives, resolving security vulnerabilities, and improving the overall developer experience.

Major Changes

Test Framework Migration: Karma → Jest

  • Replaced Karma with Jest 30.2.0 for modern JavaScript testing
  • Integrated React Testing Library 16.3.1 for component testing best practices
  • Added jsdom environment with V8 coverage provider for better performance
  • Reorganized test structure following React community conventions:
    • Moved component tests to co-located __tests__ directories
    • Renamed test files to .test.js/.test.jsx convention
    • Simplified Jest configuration with optimized glob patterns

Build Tool Modernization

  • Upgraded webpack to 5.91.0 with webpack-dev-server 5.2.2
  • Modernized asset handling using native webpack 5 asset modules
  • Replaced webpack-dotenv-plugin with dotenv-webpack for better Docker compatibility
  • Fixed NODE_ENV conflicts between development and production builds
  • Streamlined Babel configuration removing redundant polyfills and plugins

Security & Dependencies

  • Resolved all security vulnerabilities (0 vulnerabilities after audit)
  • Added yarn resolutions for @babel/runtime ^7.26.10 security patch
  • Upgraded ESLint to 9.39.2 with flat config migration
  • Updated rimraf to 6.1.2 with improved clean script preserving dist/README.md
  • Removed deprecated dependencies: karma ecosystem, puppeteer, mocha, glob

Developer Experience Improvements

  • Simplified configuration files with consistent structure
  • Enhanced SASS compilation eliminating deprecation warnings
  • Improved error handling for missing environment variables
  • Added proper TypeScript-style imports using webpack module resolution

- Update sass-loader to use modern API instead of legacy JS API
- Add sass:math and sass:color module imports to SASS files
- Replace deprecated ceil(), floor(), and darken() functions with modern equivalents
- Configure sass-loader to suppress import deprecation warnings from bootstrap-sass
- Add quietDeps and silenceDeprecations options to reduce build noise
@jorilindell jorilindell force-pushed the HUL-48-dependency-upgrades branch from f96701d to f4aa333 Compare January 7, 2026 15:33
- Add @testing-library/react and @testing-library/dom for modern component testing
- Replace deprecated isparta-loader with babel-plugin-istanbul for code coverage
- Update chai to v4.3.10 (CommonJS compatible version)
- Remove legacy babel-core v5 and associated deprecated testing utilities
- Clean up unused testing dependencies and modernize test infrastructure
- Migrate from webpack-dotenv-plugin to dotenv-webpack for better webpack 5 compatibility
- Update webpack-dev-server to v4 API with async/await pattern replacing deprecated callbacks
- Modernize webpack development configuration:
  - Remove deprecated HMR plugins (HotModuleReplacementPlugin, NoEmitOnErrorsPlugin)
  - Update entry configuration for webpack 5
  - Add modern optimization settings with emitOnErrors: false
- Update devServer configuration with webpack-dev-server v4 API:
  - Add client overlay configuration
  - Update devMiddleware settings
  - Configure host and allowedHosts for broader accessibility
- Add webpack 5 compatible babel-plugin-istanbul for code coverage
- Fix ESLint configuration for Node.js environment compatibility
- Remove 16 redundant Babel plugins now handled by @babel/preset-env:
  - Remove @babel/plugin-proposal-class-properties (ES2022 standard)
  - Remove @babel/plugin-proposal-json-strings (ES2019 standard)
  - Remove @babel/plugin-proposal-logical-assignment-operators (ES2021 standard)
  - Remove @babel/plugin-proposal-nullish-coalescing-operator (ES2020 standard)
  - Remove @babel/plugin-proposal-numeric-separator (ES2021 standard)
  - Remove @babel/plugin-proposal-optional-chaining (ES2020 standard)
  - Remove experimental/unused proposal plugins for do-expressions,
    export-default-from, export-namespace-from, function-bind,
    function-sent, pipeline-operator, throw-expressions
  - Remove syntax plugins covered by preset-env (dynamic-import, import-meta)

- Replace deprecated @babel/polyfill with modern core-js/stable import
- Keep only essential Babel packages:
  - @babel/plugin-proposal-decorators (legacy mode still needed)
  - Core Babel packages (@babel/core, presets, eslint-parser)

- Simplify .babelrc to use only presets + decorators plugin
- Update package.json and yarn.lock to reflect reduced dependency footprint
- Replace file-loader with Webpack 5 native asset/resource modules
- Remove unused url-loader dependency
- Update webpack configuration to use modern asset handling for mp4/ogg/svg files
- Remove es6-promise and isomorphic-fetch as they're redundant with core-js
- Move sass-loader from dependencies to devDependencies where it belongs
- Remove unnecessary polyfill imports from index.js
- Replace Karma test runner with Jest 30.2.0 and jsdom environment
- Add comprehensive Jest configuration with module mapping and coverage
- Convert test syntax from Mocha/Chai to Jest expectations
- Remove 9+ legacy Karma packages (karma, karma-*, chai, mocha, puppeteer)
- Configure V8 coverage provider to avoid Istanbul compatibility issues
- Update ESLint environment from mocha to jest
- Modernize test setup with @testing-library/jest-dom matchers
- Remove redundant DefinePlugin NODE_ENV definitions from webpack configs
- Use webpack mode setting for NODE_ENV (production for build, development for dev)
- Configure dotenv-webpack with safe=false and defaults for Docker builds
- Update @babel/core to ^7.22.0 to resolve plugin compatibility issues
- Updates rimraf from 5.0.10 to 6.1.2 to resolve glob security vulnerability.
Fixes high severity command injection issue in transitive dependency.
- Updates eslint from 8.57.0 to 9.39.2 for latest security patches,
performance improvements, and bug fixes.
Automatically fixes 8 vulnerabilities:
- @babel/runtime: RegExp complexity issue
- brace-expansion: RegExp denial of service
- glob: Command injection vulnerability
- nanoid: Predictable generation results
- node-forge: ASN.1 vulnerabilities
- on-headers: HTTP header manipulation
- webpack: DOM clobbering XSS
Add yarn resolution to force @babel/runtime ^7.26.10 to fix
RegExp complexity vulnerability in transitive dependency from history.
- Move component tests to co-located __tests__ directories
- Rename test files to follow .test.js/.test.jsx convention
- Simplify Jest testMatch patterns using glob syntax
- Remove empty .keep files from unused test directories
- Update clean script to use find command instead of rimraf to selectively
remove all files in dist/ directory except README.md, preventing
accidental removal of version-controlled documentation.
@jorilindell jorilindell force-pushed the HUL-48-dependency-upgrades branch from f4aa333 to 0c52500 Compare January 7, 2026 15:37
@jorilindell jorilindell requested a review from mhieta January 7, 2026 15:48
@sonarqubecloud

sonarqubecloud Bot commented Jan 7, 2026

Copy link
Copy Markdown

@mhieta mhieta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! 💯

@jorilindell jorilindell merged commit 6d7550a into main Jan 7, 2026
5 checks passed
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.

2 participants