Skip to content

Conversation

@marshallswain
Copy link
Member

Modernize Package

This PR modernizes the feathers-dataloader package with updated tooling, TypeScript, and modern best practices.

Changes

TypeScript Migration

  • Converted all source files from JavaScript to TypeScript
  • Converted all test files to TypeScript
  • Added comprehensive type definitions with JSDoc comments
  • Exports all types for consumers: Params, CacheParams, CacheParamsFn, ServiceLoaderOptions, AppLoaderOptions, CacheMap, etc.

Test Framework

  • Replaced Mocha/Chai with Vitest
  • Replaced Istanbul with Vitest v8 coverage
  • Colocated test files next to source files (src/*.test.ts)
  • 36 tests passing with 97% coverage

Build System

  • Replaced tsc with tsup for building
  • Dual ESM/CJS output with type definitions
  • Proper exports field in package.json for modern Node.js resolution

Linting & Formatting

  • Added ESLint flat config with TypeScript support
  • Prettier integration via eslint-config-prettier
  • Added typecheck, ci scripts for local validation

CI/CD

  • Removed Travis CI (.travis.yml)
  • Added GitHub Actions workflow
  • Tests against Node.js 18, 20, and 22

Package Manager

  • Switched from npm to pnpm
  • Added packageManager field to package.json

Dependencies

  • Updated @feathersjs/feathers to stable v5.x
  • Updated @feathersjs/errors to v5.x
  • Replaced feathers-memory with @feathersjs/memory
  • Updated typescript to 5.x
  • Updated dataloader to 2.2.x
  • Removed obsolete dependencies: mocha, chai, istanbul, dtslint

Other

  • Removed obsolete config files: .travis.yml, .istanbul.yml, .mocharc.js
  • Updated Node.js requirement to >= 18
  • Added Zed editor settings for Prettier

Breaking Changes

  • Node.js 18+ required (was 12+)
  • Package is now ESM-first (CJS still supported via exports)

Testing

pnpm install
pnpm run ci      # typecheck + lint + prettier + test
pnpm run build   # build dist/

- Convert all source and test files to TypeScript
- Replace Mocha/Chai with Vitest (36 tests, 97% coverage)
- Replace Istanbul with Vitest v8 coverage
- Replace tsc with tsup for dual ESM/CJS builds
- Add ESLint flat config with TypeScript support
- Replace Travis CI with GitHub Actions (Node 18/20/22)
- Switch from npm to pnpm
- Colocate test files next to source files
- Update to Feathers v5 stable dependencies
- Add JSDoc comments to interfaces
- Require Node.js >= 18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the feathers-dataloader package by migrating from JavaScript to TypeScript, replacing Mocha/Chai with Vitest for testing, upgrading the build system from tsc to tsup, and updating CI/CD from Travis to GitHub Actions. The package now requires Node.js 18+ and uses pnpm as the package manager.

Key Changes:

  • Complete TypeScript migration with comprehensive type definitions and JSDoc comments
  • Test framework migration to Vitest with colocated test files and 97% coverage
  • Modern dual ESM/CJS build output with proper exports configuration

Reviewed changes

Copilot reviewed 23 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vitest.config.ts New Vitest configuration with v8 coverage provider
tsup.config.ts Build configuration for dual ESM/CJS output with type definitions
tsconfig.json TypeScript configuration targeting ES2022 with strict mode
eslint.config.js Flat ESLint config with TypeScript and Prettier integration
package.json Updated dependencies, scripts, and exports for modern Node.js
.github/workflows/ci.yml GitHub Actions workflow for Node.js 18, 20, and 22
src/utils.ts TypeScript conversion with comprehensive type definitions
src/serviceLoader.ts TypeScript conversion with detailed interfaces and type safety
src/appLoader.ts TypeScript conversion with proper type exports
src/index.ts Updated entry point with type exports
tests/utils.ts Test utilities converted to TypeScript with proper imports
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@marshallswain marshallswain merged commit 735935c into main Dec 4, 2025
9 checks passed
@marshallswain marshallswain deleted the modernize branch December 4, 2025 15:12
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