Skip to content

v2.1.0 - Improved Module Compatibility and Package Configuration

Latest
Compare
Choose a tag to compare
@SeanLuis SeanLuis released this 26 Oct 14:57

What's New

This release focuses on enhancing module compatibility and fixing package configuration issues to ensure seamless integration with various Node.js frameworks and environments.

Changes

  • Module Generation:

    • Generate both ESM (.mjs) and CommonJS (.js) modules.
    • Adjusted tsup configuration for proper module formats.
  • Package Configuration:

    • Updated package.json to correctly reference modules in the main, module, and types fields.
    • Removed invalid types condition from the exports field.
  • Testing Configuration:

    • Renamed jest.config.js to jest.config.cjs to resolve ESM-related errors.
    • Updated Jest configuration for ESM compatibility.
  • File Cleanup:

    • Modified the build process to exclude unnecessary .ts and .cts files from the dist directory.
  • Compatibility:

    • Verified compatibility with frameworks like NestJS, Express, Koa, Fastify, and others.
    • Users can now import the package in both CommonJS and ESM environments without issues.

Upgrade Notes

  • Ensure your project uses Node.js version 18 or higher.
  • Update your import statements if necessary, according to your environment (CommonJS or ESM).

Feedback

Thank you for using rest-data-validator. Your feedback is valuable, and we encourage you to report any issues or suggestions.