Skip to content

Releases: plainbrew/next-utils

@plainbrew/next-typed-href@0.3.0

30 Apr 03:34
2c5d400

Choose a tag to compare

Minor Changes

  • #58 34f31df Thanks @amotarao! - feat(nuqs): add requiredSearchParams option to defineTypedHrefWithNuqs

    Breaking change

    defineTypedHrefWithNuqs is now a 3-level curried function. An options call has been inserted as the second level:

    // before
    defineTypedHrefWithNuqs<Routes, RouteParamsMap>()(nuqsMap);
    
    // after
    defineTypedHrefWithNuqs<Routes, RouteParamsMap>()()(nuqsMap);

    New feature

    Pass { requiredSearchParams: true } in the second call to enforce that searchParams is provided for routes with nuqs parsers defined.

    Fields without .withDefault() become required; fields with .withDefault() remain optional.

    const { $href } = defineTypedHrefWithNuqs<Routes, RouteParamsMap>()({
      requiredSearchParams: true,
    })({
      "/search": {
        q: parseAsString, // required
        page: parseAsInteger.withDefault(1), // optional
      },
    });
    
    $href({ route: "/search", searchParams: { q: "hello" } }); // OK
    $href({ route: "/search", searchParams: { q: "hello", page: 2 } }); // OK
    $href({ route: "/search" }); // Type error
    $href({ route: "/search", searchParams: { page: 2 } }); // Type error

@plainbrew/vercel-basic-auth@0.2.1

28 Apr 01:21
75a2f81

Choose a tag to compare

Patch Changes

@plainbrew/next-typed-href@0.2.1

28 Apr 01:21
75a2f81

Choose a tag to compare

Patch Changes

@plainbrew/next-typed-href@0.2.0

21 Apr 03:31
d368011

Choose a tag to compare

Minor Changes

  • #28 4b54edb Thanks @amotarao! - feat: Add defineTypedHrefWithNuqs for type-safe searchParams with nuqs parsers

  • #46 eaeb183 Thanks @amotarao! - fix: Support withDefault parsers in defineTypedHrefWithNuqs; null is now a type error for non-nullable params, and values equal to the default are omitted from the URL

Patch Changes

  • #27 100e61f Thanks @amotarao! - chore: Extract path generation logic into a shared helper with no changes to public interface

  • #47 b70eee1 Thanks @amotarao! - refactor: move RouteHasParams/SearchParamsFor/PathOptionsFor types inside defineTypedHrefWithNuqs closure

@plainbrew/next-typed-href@0.1.0

06 Apr 05:44
9493bb1

Choose a tag to compare

Minor Changes

@plainbrew/vercel-basic-auth@0.2.0

26 Mar 02:55
c7a6d22

Choose a tag to compare

Minor Changes

  • #19 42585e3 Thanks @amotarao! - feat: allow username/password to be undefined and throw an error when they are empty or undefined while basic auth is applied

Patch Changes

  • #18 99399ee Thanks @amotarao! - fix: improve Authorization header parsing to validate Basic scheme and handle colons in passwords correctly.

  • #20 55233ba Thanks @amotarao! - test: add tests

@plainbrew/vercel-basic-auth@0.1.2

25 Mar 23:38
bf05712

Choose a tag to compare

Patch Changes

@plainbrew/vercel-basic-auth@0.1.1

25 Mar 23:28
a6a1066

Choose a tag to compare

Patch Changes