You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: default.nix
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,11 @@ let
15
15
};
16
16
v1=separatePublicAndInternalAPIv1_internal;
17
17
v2=separatePublicAndInternalAPIv2_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;
19
18
in
20
19
{
21
-
inheritv1v2;
20
+
inheritv1;
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;
22
22
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`.")
0 commit comments