maint(nix): update `nixpkgs` input
[haskell/literate-web.git] / literate-web.cabal
index be3cf8dfa89ae6d406140e700a6c03d71176037d..0cda8bfc7434b4badb80f17a67b17c18bbbb6880 100644 (file)
@@ -11,12 +11,12 @@ license-file:       LICENSES/AGPL-3.0-or-later.txt
 --             PVP: +-+------- breaking API changes
 --                  | | +----- non-breaking API additions
 --                  | | | +--- code changes with no API change
-version:            0.0.0.20221117
+version:            0.0.0.20240908
 stability:          experimental
 category:           Web
 synopsis:           Haskell-website compiler
 description:
-  Exploring the design space of compile-time website generator
+  Exploring the design space of static, live and dynamic website generators
   by using a domain-specific language (DSL)
   embedded into the Haskell language.
   .
@@ -25,13 +25,16 @@ description:
   * <https://hackage.haskell.org/package/ema ema>
 
 build-type:         Simple
-tested-with:        GHC ==9.2.4
+tested-with:        GHC ==9.6.7
 extra-doc-files:    ChangeLog.md
 extra-source-files:
   .envrc
   cabal.project
   flake.lock
   flake.nix
+  www/live-error.html
+  www/live-indicator.html
+  www/live-shim.js
 
 extra-tmp-files:
 
@@ -39,13 +42,14 @@ source-repository head
   type:     git
   location: git://git.sourcephile.fr/haskell/literate-web.git
 
-common boilerplate
+common haskell-variant
   default-language:   Haskell2010
   default-extensions:
     BlockArguments
     DataKinds
     DefaultSignatures
     DeriveDataTypeable
+    DeriveFunctor
     DeriveGeneric
     DerivingVia
     FlexibleContexts
@@ -64,21 +68,13 @@ common boilerplate
     TypeApplications
     TypeFamilies
     TypeOperators
+    ViewPatterns
 
   ghc-options:
     -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns
     -Wmonomorphism-restriction -Wpartial-fields
     -fprint-potential-instances
 
--- -dshow-passes
--- -ddump-to-file
--- -ddump-simpl
--- -dsuppress-coercions
--- -dsuppress-module-prefixes
--- -dsuppress-type-applications
--- -O0
--- -fmax-simplifier-iterations=0
-
 common library-deps
   build-depends:
     , async                  >=2.2
@@ -86,20 +82,21 @@ common library-deps
     , bytestring             >=0.10
     , containers             >=0.5
     , directory              >=1.3
+    , file-embed
     , filepath               >=1.4
     , filepattern            >=0.1
     , ghc-prim
     , hashable
     , http-client            >=0.6
     , http-media             >=0.7
+    , http-types
     , monad-classes
-    -- , mvc
-    -- , mvc-updates
     , peano
-    , reflection
+    , stm
     , symantic-base          >=0.5
     , template-haskell
     , text
+    , text-short
     , transformers           >=0.5
     , unicode-transforms     >=0.2
     , unordered-containers
@@ -110,16 +107,25 @@ common library-deps
     , warp
     , websockets             >=0.12
 
+-- , reflection
+-- , mvc
+-- , mvc-updates
 -- , pipes
 -- , pipes-concurrency
 -- , pipes-group
 -- , pipes-parse
 -- , pipes-safe
+
 library
-  import:          boilerplate, library-deps
+  import:          haskell-variant, library-deps
   hs-source-dirs:  src
   exposed-modules:
     Literate.Web
+    Literate.Web.Live
+    Literate.Web.Live.Asset
+    Literate.Web.Live.Common
+    Literate.Web.Live.HTTP
+    Literate.Web.Live.WebSocket
     Literate.Web.Semantics.Addresser
     Literate.Web.Semantics.Compiler
     Literate.Web.Syntaxes
@@ -133,27 +139,27 @@ library
 --Literate.Web.Generator
 --Literate.Web.MIME
 
-library relactive
-  import:          boilerplate, library-deps
-  hs-source-dirs:  src
-  build-depends:
-    , async
-    , contravariant  >=1.5
-    , monad-classes
-    , stm
-
-  exposed-modules:
-    Control.Reactive
-    Control.Reactive.IORef
-    Control.Reactive.MVar
-    Control.Reactive.Relation
-    Control.Reactive.STRef
-    Control.Reactive.TVar
-    Control.Reactive.Value
+-- library relactive
+--   import:          haskell-variant, library-deps
+--   hs-source-dirs:  src
+--   build-depends:
+--     , async
+--     , contravariant  >=1.5
+--     , monad-classes
+--     , stm
+-- 
+--   exposed-modules:
+--     Control.Reactive
+--     Control.Reactive.IORef
+--     Control.Reactive.MVar
+--     Control.Reactive.Relation
+--     Control.Reactive.STRef
+--     Control.Reactive.TVar
+--     Control.Reactive.Value
 
 test-suite literate-web-tests
   -- library-deps is only to have ghcid reloaded on changes in src
-  import:          boilerplate, library-deps
+  import:          haskell-variant, library-deps
   type:            exitcode-stdio-1.0
   hs-source-dirs:  tests
   main-is:         Main.hs
@@ -182,65 +188,65 @@ test-suite literate-web-tests
     , transformers   >=0.5
 
 -- , relude         >=1    && <2
-benchmark time
-  import:         boilerplate, library-deps
-  type:           exitcode-stdio-1.0
-  hs-source-dirs: benchmarks/time
-  main-is:        Main.hs
-  build-depends:
-    , base         >=4.6 && <5
-    , relactive
-    , tasty
-    , tasty-bench
-
-  -- , relude >= 1
-  -- Set a larger allocation area (nursery)
-  -- to remove some noisiness of the garbage collection.
-  ghc-options:    -with-rtsopts=-A32m
-
-benchmark weigh
-  import:         boilerplate, library-deps
-  type:           exitcode-stdio-1.0
-  hs-source-dirs: benchmarks/weigh src
-  build-depends:
-    , async
-    , contravariant  >=1.5
-    , stm
-
-  main-is:        Main.hs
-  build-depends:
-    , base    >=4.6 && <5
-    , relude  >=1
-    , weigh
-
-executable async
-  import:         boilerplate, library-deps
-  hs-source-dirs: executables/async
-  main-is:        Main.hs
-  build-depends:
-    , async
-    , base           >=4.6 && <5
-    , relactive
-    , relude
-    , symantic-base
-    , tasty
-    , tasty-bench
-
--- , relude >= 1
-
-executable fsnotify
-  import:         boilerplate, library-deps
-  hs-source-dirs: executables/fsnotify
-  main-is:        Main.hs
-  build-depends:
-    , async
-    , base           >=4.6 && <5
-    , directory
-    , filepath
-    , fsnotify
-    , relactive
-    , relude         >=1
-    , symantic-base
-    , tasty
-    , tasty-bench
-    , time
+-- benchmark time
+--   import:         haskell-variant, library-deps
+--   type:           exitcode-stdio-1.0
+--   hs-source-dirs: benchmarks/time
+--   main-is:        Main.hs
+--   build-depends:
+--     , base         >=4.6 && <5
+--     --, relactive
+--     , tasty
+--     , tasty-bench
+-- 
+--   -- , relude >= 1
+--   -- Set a larger allocation area (nursery)
+--   -- to remove some noisiness of the garbage collection.
+--   ghc-options:    -with-rtsopts=-A32m
+-- 
+-- benchmark weigh
+--   import:         haskell-variant, library-deps
+--   type:           exitcode-stdio-1.0
+--   hs-source-dirs: benchmarks/weigh src
+--   build-depends:
+--     , async
+--     , contravariant  >=1.5
+--     , stm
+-- 
+--   main-is:        Main.hs
+--   build-depends:
+--     , base    >=4.6 && <5
+--     , relude  >=1
+--     , weigh
+-- 
+-- executable async
+--   import:         haskell-variant, library-deps
+--   hs-source-dirs: executables/async
+--   main-is:        Main.hs
+--   build-depends:
+--     , async
+--     , base           >=4.6 && <5
+--     --, relactive
+--     , relude
+--     , symantic-base
+--     , tasty
+--     , tasty-bench
+-- 
+-- -- , relude >= 1
+-- 
+-- executable fsnotify
+--   import:         haskell-variant, library-deps
+--   hs-source-dirs: executables/fsnotify
+--   main-is:        Main.hs
+--   build-depends:
+--     , async
+--     , base           >=4.6 && <5
+--     , directory
+--     , filepath
+--     , fsnotify
+--     --, relactive
+--     , relude         >=1
+--     , symantic-base
+--     , tasty
+--     , tasty-bench
+--     , time