Skip to content

Commit bea15da

Browse files
committed
Expose the v1 API as default in default.nix with a warning
This tells users that they are using the unversioned API. This is fine but they should migrate to the versioned API soon. This also adds a warning for the v2 users as their API might still change and we should be upfront about that.
1 parent 3283c59 commit bea15da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

default.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ let
1515
};
1616
v1 = separatePublicAndInternalAPI v1_internal;
1717
v2 = separatePublicAndInternalAPI v2_internal;
18-
withWarning = f: lib.warn "[npmlock2nix] Using deprecated legacy accessors. Will be removed afer 2022-12-31. Please specify the v1 or v2 npm lockfile format you want to use through the top-level v1 and v2 attrsets." f;
1918
in
2019
{
21-
inherit v1 v2;
20+
inherit v1;
21+
v2 = lib.mapAttrs (_: lib.warn "[npmlock2nix] You are using the new v2 beta api. The interface isn't stable yet. Please report any issues at https://github.com/nix-community/npmlock2nix/issues") v2;
2222
tests = pkgs.callPackage ./tests { };
23-
} // (lib.mapAttrs (_: withWarning) v1)
23+
} // (lib.mapAttrs
24+
(lib.warn "[npmlock2nix] You are using the unversion prefix for builders. This is fine for now. In the future we will move to a versioned interface (old versions remain as they are). The currently used functions are availabe as `npmlock2nix.v1` for example `npmlock2nix.v1.build`.")
25+
v1)

0 commit comments

Comments
 (0)