Skip to content

Commit

Permalink
Merge branch 'master' into trh/compilers-in-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashoneyman authored Oct 25, 2024
2 parents d7d5e49 + fc203a9 commit 7d74da3
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 36 deletions.
19 changes: 9 additions & 10 deletions lib/src/Manifest.purs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import Registry.Range (Range)
import Registry.Range as Range
import Registry.Version (Version)
import Registry.Version as Version
import Type.Proxy (Proxy(..))

-- | The manifest for a package version, which records critical information for
-- | the registry, pursuit, and package managers to use.
Expand Down Expand Up @@ -73,13 +72,13 @@ instance Ord Manifest where
-- | record sugar.
codec :: CJ.Codec Manifest
codec = Profunctor.wrapIso Manifest $ CJ.named "Manifest" $ CJ.object
$ CJ.recordProp (Proxy :: _ "name") PackageName.codec
$ CJ.recordProp (Proxy :: _ "version") Version.codec
$ CJ.recordProp (Proxy :: _ "license") License.codec
$ CJ.recordPropOptional (Proxy :: _ "description") (Internal.Codec.limitedString 300)
$ CJ.recordProp (Proxy :: _ "location") Location.codec
$ CJ.recordPropOptional (Proxy :: _ "owners") (CJ.Common.nonEmptyArray Owner.codec)
$ CJ.recordPropOptional (Proxy :: _ "includeFiles") (CJ.Common.nonEmptyArray CJ.Common.nonEmptyString)
$ CJ.recordPropOptional (Proxy :: _ "excludeFiles") (CJ.Common.nonEmptyArray CJ.Common.nonEmptyString)
$ CJ.recordProp (Proxy :: _ "dependencies") (Internal.Codec.packageMap Range.codec)
$ CJ.recordProp @"name" PackageName.codec
$ CJ.recordProp @"version" Version.codec
$ CJ.recordProp @"license" License.codec
$ CJ.recordPropOptional @"description" (Internal.Codec.limitedString 300)
$ CJ.recordProp @"location" Location.codec
$ CJ.recordPropOptional @"owners" (CJ.Common.nonEmptyArray Owner.codec)
$ CJ.recordPropOptional @"includeFiles" (CJ.Common.nonEmptyArray CJ.Common.nonEmptyString)
$ CJ.recordPropOptional @"excludeFiles" (CJ.Common.nonEmptyArray CJ.Common.nonEmptyString)
$ CJ.recordProp @"dependencies" (Internal.Codec.packageMap Range.codec)
$ CJ.record
9 changes: 4 additions & 5 deletions lib/src/Metadata.purs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import Registry.Sha256 (Sha256)
import Registry.Sha256 as Sha256
import Registry.Version (Version)
import Registry.Version as Version
import Type.Proxy (Proxy(..))

-- | A record of all published and unpublished versions of a package, along with
-- | the last-used location and any owners (public keys) authorized to take
Expand All @@ -62,10 +61,10 @@ derive instance Eq Metadata
-- | as a JSON object. Keys are explicitly ordered.
codec :: CJ.Codec Metadata
codec = Profunctor.wrapIso Metadata $ CJ.named "Metadata" $ CJ.object
$ CJ.recordProp (Proxy :: _ "location") Location.codec
$ CJ.recordPropOptional (Proxy :: _ "owners") (CJ.Common.nonEmptyArray Owner.codec)
$ CJ.recordProp (Proxy :: _ "published") (Internal.Codec.versionMap publishedMetadataCodec)
$ CJ.recordProp (Proxy :: _ "unpublished") (Internal.Codec.versionMap unpublishedMetadataCodec)
$ CJ.recordProp @"location" Location.codec
$ CJ.recordPropOptional @"owners" (CJ.Common.nonEmptyArray Owner.codec)
$ CJ.recordProp @"published" (Internal.Codec.versionMap publishedMetadataCodec)
$ CJ.recordProp @"unpublished" (Internal.Codec.versionMap unpublishedMetadataCodec)
$ CJ.record

-- | Metadata about a published package version.
Expand Down
9 changes: 4 additions & 5 deletions lib/src/PackageSet.purs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import Registry.Internal.Codec as Internal.Codec
import Registry.PackageName (PackageName)
import Registry.Version (Version)
import Registry.Version as Version
import Type.Proxy (Proxy(..))

-- | A Registry package set, which contains a set of packages at specific
-- | versions known to compile together with the given compiler version.
Expand All @@ -42,8 +41,8 @@ derive newtype instance Eq PackageSet
-- | implementation.
codec :: CJ.Codec PackageSet
codec = Profunctor.wrapIso PackageSet $ CJ.named "PackageSet" $ CJ.object
$ CJ.recordProp (Proxy :: _ "version") Version.codec
$ CJ.recordProp (Proxy :: _ "compiler") Version.codec
$ CJ.recordProp (Proxy :: _ "published") Internal.Codec.iso8601Date
$ CJ.recordProp (Proxy :: _ "packages") (Internal.Codec.packageMap Version.codec)
$ CJ.recordProp @"version" Version.codec
$ CJ.recordProp @"compiler" Version.codec
$ CJ.recordProp @"published" Internal.Codec.iso8601Date
$ CJ.recordProp @"packages" (Internal.Codec.packageMap Version.codec)
$ CJ.record
28 changes: 14 additions & 14 deletions spago.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,8 @@ workspace:
- variant
test_dependencies: []
package_set:
registry: 50.10.0
registry: 59.0.0
extra_packages:
codec-json: 1.2.0
dodo-printer:
repo: https://github.com/natefaubion/purescript-dodo-printer.git
version: v2.2.1
Expand Down Expand Up @@ -407,8 +406,8 @@ packages:
- profunctor
codec-json:
type: registry
version: 1.2.0
integrity: sha256-59+uYYe/5uTFa/Q6EqF8ekvP/Y4SOjUNfwIqIYtNiGI=
version: 2.0.0
integrity: sha256-NLm5BmDZKKexQwtnoZ/NI4yI16srsqIe0M7NdlqB96U=
dependencies:
- codec
- foreign-object
Expand Down Expand Up @@ -594,8 +593,8 @@ packages:
- unfoldable
exceptions:
type: registry
version: 6.0.0
integrity: sha256-y/xTAEIZIARCE+50/u1di0ncebJ+CIwNOLswyOWzMTw=
version: 6.1.0
integrity: sha256-K0T89IHtF3vBY7eSAO7eDOqSb2J9kZGAcDN5+IKsF8E=
dependencies:
- effect
- either
Expand Down Expand Up @@ -940,8 +939,8 @@ packages:
- maybe
json:
type: registry
version: 1.0.0
integrity: sha256-UCHdePAoOD19UyCPLU97oZjcdxLlQZQneWFsfoUNNpE=
version: 1.1.0
integrity: sha256-LuN8PyX/gvRR4/7X7M9P+zL7BKbv34NcUE/7MILXQSA=
dependencies:
- either
- foldable-traversable
Expand Down Expand Up @@ -1159,8 +1158,8 @@ packages:
- unsafe-reference
node-fs:
type: registry
version: 9.1.0
integrity: sha256-TzhvGdrwcM0bazDvrWSqh+M/H8GKYf1Na6aGm2Qg4+c=
version: 9.2.0
integrity: sha256-Sg0vkXycEzkEerX6hLccz21Ygd9w1+QSk1thotRZPGI=
dependencies:
- datetime
- effect
Expand Down Expand Up @@ -1619,8 +1618,8 @@ packages:
- unsafe-coerce
spec:
type: registry
version: 7.6.0
integrity: sha256-+merGdQbL9zWONbnt8S8J9afGJ59MQqGtS0qSd3yu4I=
version: 8.0.0
integrity: sha256-Yn7MhDai1YULlQF45+9FTOTf2rcjoda1Jf2IrEFCoeg=
dependencies:
- aff
- ansi
Expand Down Expand Up @@ -1705,8 +1704,8 @@ packages:
- tuples
transformers:
type: registry
version: 6.0.0
integrity: sha256-Pzw40HjthX77tdPAYzjx43LK3X5Bb7ZspYAp27wksFA=
version: 6.1.0
integrity: sha256-3Bm+Z6tsC/paG888XkywDngJ2JMos+JfOhRlkVfb7gI=
dependencies:
- control
- distributive
Expand All @@ -1719,6 +1718,7 @@ packages:
- maybe
- newtype
- prelude
- st
- tailrec
- tuples
- unfoldable
Expand Down
3 changes: 1 addition & 2 deletions spago.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
workspace:
lock: true
package_set:
registry: 50.10.0
registry: 59.0.0
extra_packages:
codec-json: 1.2.0
dodo-printer:
repo: https://github.com/natefaubion/purescript-dodo-printer.git
version: v2.2.1
Expand Down

0 comments on commit 7d74da3

Please sign in to comment.