Skip to content

node-env-resolver-vite@2.0.0

Choose a tag to compare

@github-actions github-actions released this 19 Oct 17:39
· 42 commits to main since this release
66a158e

Major Changes

  • 0678bb0: # Breaking Changes: Validator Functions Moved to Separate Module

    This release introduces a breaking change to improve code organization and tree-shaking capabilities.

    What Changed

    Validator Functions Moved

    • Before: All validator functions (e.g., string, number, url, postgres) were exported from 'node-env-resolver/resolvers'
    • After: Validator functions are now exported from 'node-env-resolver/validators'

    Function Rename

    • enums() function has been renamed to oneOf() for better clarity

    Migration Guide

    Update Import Statements

    Before:

    import { string, number, url, postgres, enums } from 'node-env-resolver/resolvers';

    After:

    import { string, number, url, postgres, oneOf } from 'node-env-resolver/validators';

    Update Function Calls

    Before:

    const config = {
      ENV: enums(['development', 'production', 'test']),
      API_URL: url(),
    };

    After:

    const config = {
      ENV: oneOf(['development', 'production', 'test']),
      API_URL: url(),
    };

    Benefits

    • Better Tree Shaking: Validators can be imported separately from resolvers
    • Clearer Separation: Resolvers (data sources) vs Validators (validation logic)
    • Improved Bundle Size: Only import the validators you need
    • Better Developer Experience: More intuitive function naming

    Resolver Functions Unchanged

    Resolver functions remain in 'node-env-resolver/resolvers':

    import { dotenv, processEnv, http, json } from 'node-env-resolver/resolvers';

Patch Changes

  • Updated dependencies [0678bb0]
    • node-env-resolver@6.0.0