@@ -22,6 +22,7 @@ import Data.Array as Array
2222import Data.Array.NonEmpty (NonEmptyArray )
2323import Data.Codec.JSON as CJ
2424import Data.Codec.JSON.Common as CJ.Common
25+ import Data.Codec.JSON.Strict as CJS
2526import Data.Map (Map )
2627import Data.Maybe (Maybe )
2728import Data.Newtype (class Newtype )
@@ -40,7 +41,6 @@ import Registry.Range (Range)
4041import Registry.Range as Range
4142import Registry.Version (Version )
4243import Registry.Version as Version
43- import Type.Proxy (Proxy (..))
4444
4545-- | The manifest for a package version, which records critical information for
4646-- | the registry, pursuit, and package managers to use.
@@ -72,14 +72,14 @@ instance Ord Manifest where
7272-- | JSON object. The implementation uses explicitly ordered keys instead of
7373-- | record sugar.
7474codec :: CJ.Codec Manifest
75- codec = Profunctor .wrapIso Manifest $ CJ .named " Manifest" $ CJ .object
76- $ CJ .recordProp ( Proxy :: _ " name" ) PackageName .codec
77- $ CJ .recordProp ( Proxy :: _ " version" ) Version .codec
78- $ CJ .recordProp ( Proxy :: _ " license" ) License .codec
79- $ CJ .recordPropOptional ( Proxy :: _ " description" ) (Internal.Codec .limitedString 300 )
80- $ CJ .recordProp ( Proxy :: _ " location" ) Location .codec
81- $ CJ .recordPropOptional ( Proxy :: _ " owners" ) (CJ.Common .nonEmptyArray Owner .codec)
82- $ CJ .recordPropOptional ( Proxy :: _ " includeFiles" ) (CJ.Common .nonEmptyArray CJ.Common .nonEmptyString)
83- $ CJ .recordPropOptional ( Proxy :: _ " excludeFiles" ) (CJ.Common .nonEmptyArray CJ.Common .nonEmptyString)
84- $ CJ .recordProp ( Proxy :: _ " dependencies" ) (Internal.Codec .packageMap Range .codec)
85- $ CJ .record
75+ codec = Profunctor .wrapIso Manifest $ CJ .named " Manifest" $ CJS .objectStrict
76+ $ CJS .recordProp @ " name" PackageName .codec
77+ $ CJS .recordProp @ " version" Version .codec
78+ $ CJS .recordProp @ " license" License .codec
79+ $ CJS .recordPropOptional @ " description" (Internal.Codec .limitedString 300 )
80+ $ CJS .recordProp @ " location" Location .codec
81+ $ CJS .recordPropOptional @ " owners" (CJ.Common .nonEmptyArray Owner .codec)
82+ $ CJS .recordPropOptional @ " includeFiles" (CJ.Common .nonEmptyArray CJ.Common .nonEmptyString)
83+ $ CJS .recordPropOptional @ " excludeFiles" (CJ.Common .nonEmptyArray CJ.Common .nonEmptyString)
84+ $ CJS .recordProp @ " dependencies" (Internal.Codec .packageMap Range .codec)
85+ $ CJS .record
0 commit comments