diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml index 25a8778..964ea00 100644 --- a/.devcontainer/compose.yaml +++ b/.devcontainer/compose.yaml @@ -1,15 +1,21 @@ { "services": { "devcontainer": { - "command": "sh -exc 'while sleep 1m; do :; done'", - "image": "public.ecr.aws/acilearning/haskell:9.6.2", + "command": "sleep infinity", + "image": "public.ecr.aws/acilearning/haskell:9.8.1", "init": true, "volumes": [ "..:/workspace", - "./volumes/cabal/cache:/home/vscode/.cache/cabal", - "./volumes/cabal/state:/home/vscode/.local/state/cabal", + "cabal-cache:/home/vscode/.cache/cabal", + "cabal-state:/home/vscode/.local/state/cabal", ], "working_dir": "/workspace" } + }, + "volumes": { + "cabal-cache": null, + "cabal-state": { + "external": true + } } } diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4edb76d..64ce71c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,6 +11,7 @@ } }, "dockerComposeFile": "compose.yaml", + "initializeCommand": "docker volume create cabal-state", "postCreateCommand": "cabal update", "postStartCommand": "git config --global --add safe.directory \"$PWD\"", "service": "devcontainer", diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 01c8e8f..6b39793 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,7 +10,7 @@ "uses": "actions/checkout@v4" }, { - "uses": "superfly/flyctl-actions/setup-flyctl@v1" + "uses": "superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be" }, { "env": { diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 167782e..412dc51 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -10,24 +10,16 @@ { "run": "mkdir artifact" }, - { - "id": "artifact", - "run": "echo directory=artifact/${{ matrix.platform }} >> $GITHUB_OUTPUT", - "shell": "bash" - }, - { - "run": "mkdir ${{ steps.artifact.outputs.directory }}" - }, { "id": "haskell", "uses": "haskell-actions/setup@v2", "with": { - "cabal-version": "3.10.1.0", - "ghc-version": "9.6.2" + "cabal-version": "3.10.2.1", + "ghc-version": "9.8.1" } }, { - "run": "cabal sdist --output-dir ${{ steps.artifact.outputs.directory }}" + "run": "cabal sdist --output-dir artifact" }, { "run": "cabal configure --enable-optimization=2 --enable-tests --flags pedantic --jobs" @@ -36,7 +28,7 @@ "run": "cat cabal.project.local" }, { - "run": "cp cabal.project.local ${{ steps.artifact.outputs.directory }}" + "run": "cp cabal.project.local artifact" }, { "run": "cabal freeze" @@ -45,13 +37,13 @@ "run": "cat cabal.project.freeze" }, { - "run": "cp cabal.project.freeze ${{ steps.artifact.outputs.directory }}" + "run": "cp cabal.project.freeze artifact" }, { "run": "cabal outdated --v2-freeze-file cabal.project.freeze" }, { - "uses": "actions/cache@v3", + "uses": "actions/cache@v4", "with": { "key": "${{ matrix.platform }}/${{ hashFiles('cabal.project.freeze') }}", "path": "${{ steps.haskell.outputs.cabal-store }}", @@ -68,18 +60,18 @@ "run": "cabal build" }, { - "run": "cp $( cabal list-bin monadoc ) ${{ steps.artifact.outputs.directory }}" + "run": "cp $( cabal list-bin monadoc ) artifact" }, { "uses": "svenstaro/upx-action@v2", "with": { - "file": "${{ steps.artifact.outputs.directory }}/monadoc${{ matrix.extension }}" + "files": "artifact/monadoc${{ matrix.extension }}" } }, { - "uses": "actions/upload-artifact@v3", + "uses": "actions/upload-artifact@v4", "with": { - "name": "monadoc-${{ github.sha }}", + "name": "monadoc-${{ matrix.platform }}-${{ github.sha }}", "path": "artifact" } }, @@ -139,17 +131,17 @@ "uses": "actions/checkout@v4" }, { - "uses": "actions/download-artifact@v3", + "uses": "actions/download-artifact@v4", "with": { - "name": "monadoc-${{ github.sha }}", + "name": "monadoc-ubuntu-${{ github.sha }}", "path": "artifact" } }, { - "run": "cd artifact/ubuntu && tar xf monadoc-*.tar.gz" + "run": "cd artifact && tar xf monadoc-*.tar.gz" }, { - "run": "mv artifact/ubuntu/monadoc-*/data artifact/ubuntu/monadoc docker" + "run": "mv artifact/monadoc-*/data artifact/monadoc docker" }, { "run": "chmod +x docker/monadoc" @@ -191,7 +183,7 @@ "uses": "actions/checkout@v4" }, { - "uses": "superfly/flyctl-actions/setup-flyctl@v1" + "uses": "superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be" }, { "env": { @@ -212,7 +204,7 @@ { "uses": "haskell-actions/hlint-setup@v2", "with": { - "version": 3.6.1 + "version": 3.8 } }, { @@ -231,7 +223,10 @@ "uses": "actions/checkout@v4" }, { - "uses": "haskell-actions/run-ormolu@v14" + "uses": "haskell-actions/run-ormolu@v14", + "with": { + "version": "0.7.3.0" + } } ] } diff --git a/.gitignore b/.gitignore index ab7f26b..f8954b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -/.devcontainer/volumes/ /.vscode/ /cabal.project.* /dist-newstyle/ diff --git a/monadoc.cabal b/monadoc.cabal index b9af926..49f9c2a 100644 --- a/monadoc.cabal +++ b/monadoc.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: monadoc -version: 0.2024.1.4 +version: 0.2024.1.25 build-type: Simple category: Documentation data-dir: data @@ -30,14 +30,15 @@ flag pedantic manual: True common library - build-depends: base ^>=4.18.0.0 + build-depends: base ^>=4.19.0.0 default-language: Haskell2010 ghc-options: -Weverything -Wno-all-missed-specialisations -Wno-implicit-prelude -Wno-missed-specialisations -Wno-missing-deriving-strategies -Wno-missing-export-lists -Wno-missing-exported-signatures - -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode - -Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe + -Wno-missing-kind-signatures -Wno-missing-role-annotations + -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module + -Wno-safe -Wno-unsafe if flag(pedantic) ghc-options: -Werror @@ -53,20 +54,20 @@ library build-depends: , aeson ^>=2.2.1.0 , async ^>=2.2.5 - , bytestring ^>=0.11.4.0 - , Cabal-syntax ^>=3.10.1.0 + , bytestring ^>=0.12.0.2 + , Cabal-syntax ^>=3.10.2.0 , case-insensitive ^>=1.2.1.0 - , containers ^>=0.6.7 + , containers ^>=0.6.8 , crypton ^>=0.31 - , direct-sqlite ^>=2.3.28 + , direct-sqlite ^>=2.3.29 , directory ^>=1.3.8.1 , exceptions ^>=0.10.7 - , filepath ^>=1.4.100.1 + , filepath ^>=1.4.100.4 , formatting ^>=7.2.0 , haddock-library ^>=1.11.0 , hashable ^>=1.4.3.0 , hspec ^>=2.11.7 - , http-client ^>=0.7.15 + , http-client ^>=0.7.16 , http-client-tls ^>=0.3.6.3 , http-types ^>=0.12.4 , lucid2 ^>=0.0.20230706 @@ -74,26 +75,26 @@ library , monad-control ^>=1.0.3.1 , monad-loops ^>=0.4.3 , network-uri ^>=2.6.4.2 - , patrol ^>=1.0.0.6 + , patrol ^>=1.0.0.7 , QuickCheck ^>=2.14.3 , random ^>=1.2.1.1 , resource-pool ^>=0.4.0.0 , saturn:{saturn, spec} ^>=1.0.0.3 , say ^>=0.1.0.1 - , sqlite-simple ^>=0.4.18.2 - , stm ^>=2.5.1.0 + , sqlite-simple ^>=0.4.19.0 + , stm ^>=2.5.2.1 , tar ^>=0.6.0.0 , temporary ^>=1.3 - , text ^>=2.0.2 + , text ^>=2.1 , time ^>=1.12.2 , transformers ^>=0.6.1.0 , uuid ^>=1.3.15 , vault ^>=0.3.1.5 , wai ^>=3.2.4 - , wai-extra ^>=3.1.13.0 + , wai-extra ^>=3.1.14 , wai-middleware-static ^>=0.9.2 - , warp ^>=3.3.31 - , witch ^>=1.2.0.3 + , warp ^>=3.4.0 + , witch ^>=1.2.0.4 , zlib ^>=0.6.3.0 default-extensions: diff --git a/source/library/Monadoc/Model/Blob.hs b/source/library/Monadoc/Model/Blob.hs index 44aa7b0..56e3ac6 100644 --- a/source/library/Monadoc/Model/Blob.hs +++ b/source/library/Monadoc/Model/Blob.hs @@ -49,9 +49,9 @@ migrations = ] new :: ByteString.ByteString -> Blob -new contents = +new c = Blob - { contents = contents, - hash = Hash.new contents, - size = ByteString.length contents + { contents = c, + hash = Hash.new c, + size = ByteString.length c } diff --git a/source/library/Monadoc/Type/ComponentId.hs b/source/library/Monadoc/Type/ComponentId.hs index df8298c..e3d3b5a 100644 --- a/source/library/Monadoc/Type/ComponentId.hs +++ b/source/library/Monadoc/Type/ComponentId.hs @@ -16,9 +16,9 @@ data ComponentId = ComponentId instance Witch.TryFrom String ComponentId where tryFrom = Witch.maybeTryFrom $ \string -> do let (before, after) = break ((==) ':') string - type_ <- Either.hush $ Witch.tryFrom before - name <- Either.hush . Witch.tryFrom $ drop 1 after - pure ComponentId {type_ = type_, name = name} + t <- Either.hush $ Witch.tryFrom before + n <- Either.hush . Witch.tryFrom $ drop 1 after + pure ComponentId {type_ = t, name = n} instance Witch.TryFrom Text.Text ComponentId where tryFrom = Witch.eitherTryFrom $ Witch.tryFrom . Witch.into @String