packages feed

neuron-0.6.0.0: neuron.cabal

cabal-version: 2.4
name: neuron
-- This version must be in sync with what's in Default.dhall
version: 0.6.0.0
license: AGPL-3.0-only
copyright: 2020 Sridhar Ratnakumar
maintainer: srid@srid.ca
author: Sridhar Ratnakumar
category: Web
homepage: https://neuron.zettel.page
bug-reports: https://github.com/srid/neuron/issues
synopsis:
  Future-proof system for plain-text notes.
description:
  neuron is a future-proof system for managing your plain-text Zettelkasten notes.
data-files:
  src-js/search.js
  src-bash/neuron-search

source-repository head
    type: git
    location: https://github.com/srid/neuron

flag ghcid
    default: False
    manual: True

common ghc-common
  ghc-options:
    -Wall
    -Wincomplete-record-updates
    -Wincomplete-uni-patterns

common library-common
  import: ghc-common
  default-language: Haskell2010
  build-depends:
    base >=4.12 && < 4.14,
    aeson,
    mtl,
    text,
    time,
    relude,
    filepath,
    algebraic-graphs >= 0.5,
    parser-combinators,
    containers,
    filepattern,
    megaparsec,
    commonmark ^>= 0.1.0.0,
    commonmark-extensions ^>= 0.1.0.0,
    commonmark-pandoc ^>= 0.1.0.0,
    pandoc-types,
    parsec,
    modern-uri,
    HsYAML,
    aeson-gadt-th,
    dependent-sum,
    dependent-sum-template,
    dependent-sum-aeson-orphans,
    data-default,
    reflex,
    reflex-dom-core,
    reflex-dom-pandoc >= 0.2.0.0,
    clay,
    tagged

library
  import: library-common
  hs-source-dirs: src/lib
  exposed-modules:
    Neuron.Config.Type
    Neuron.Reader.Markdown
    Neuron.Reader.Type
    Neuron.Zettelkasten.ID
    Neuron.Zettelkasten.Zettel
    Neuron.Zettelkasten.Zettel.Meta
    Neuron.Zettelkasten.Zettel.Parser
    Neuron.Zettelkasten.Connection
    Neuron.Zettelkasten.Query
    Neuron.Zettelkasten.Query.Graph
    Neuron.Zettelkasten.Query.Error
    Neuron.Zettelkasten.Query.Eval
    Neuron.Zettelkasten.Query.Parser
    Neuron.Zettelkasten.Query.Theme
    Neuron.Zettelkasten.Graph
    Neuron.Zettelkasten.Graph.Type
    Neuron.Zettelkasten.Graph.Build
    Neuron.Web.Route
    Neuron.Web.Manifest
    Neuron.Web.Common
    Neuron.Web.Widget
    Neuron.Web.Widget.AutoScroll
    Neuron.Web.Widget.InvertedTree
    Neuron.Web.Query.View
    Neuron.Web.Zettel.View
    Neuron.Web.Zettel.CSS
    Neuron.Web.ZIndex
    Neuron.Web.Theme
    Neuron.Orphans
    Text.Megaparsec.Simple
    Text.Pandoc.Util
    Text.URI.Util
    Data.TagTree
    Data.PathTree
    Data.Graph.Labelled
    Data.Graph.Labelled.Type
    Data.Graph.Labelled.Algorithm
    Data.Graph.Labelled.Build

-- A trick to make ghcid reload if library dependencies change
-- https://haskell.zettel.page/2012605.html
common app-common
  import: library-common
  hs-source-dirs: src/app src/lib
  default-language: Haskell2010
  build-depends:
    base >=4.12 && < 4.14,
    aeson,
    clay -any,
    mtl,
    containers,
    directory,
    exceptions,
    file-embed,
    optparse-applicative,
    pandoc,
    skylighting-core,
    relude,
    iso8601-time,
    rib >=0.12,
    shake -any,
    time,
    text,
    modern-uri,
    foldl,
    filepath,
    dhall >= 1.30,
    which,
    unix,
    megaparsec >= 8.0,
    dependent-sum,
    dependent-sum-template,
    data-default,
    uuid,
    shake,
    with-utf8,
    shower,
    either
  if (!flag(ghcid))
    autogen-modules:
      Paths_neuron
    other-modules:
      Data.Graph.Labelled
      Data.Graph.Labelled.Algorithm
      Data.Graph.Labelled.Build
      Data.Graph.Labelled.Type
      Data.PathTree
      Data.Structured.Breadcrumb
      Data.TagTree
      Neuron.CLI
      Neuron.CLI.New
      Neuron.CLI.Rib
      Neuron.CLI.Search
      Neuron.CLI.Types
      Neuron.Config
      Neuron.Config.Alias
      Neuron.Config.Orphans
      Neuron.Version
      Neuron.Web.Generate
      Neuron.Web.Generate.Route
      Neuron.Web.View
      Neuron.Web.StructuredData
      Neuron.Reader
      Neuron.Reader.Org
      Neuron.Zettelkasten.ID.Scheme
      Paths_neuron
      Text.Megaparsec.Simple

test-suite neuron-test
  import: app-common
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Spec.hs
  build-depends:
    base >=4.12 && < 4.14,
    relude,
    hspec,
    QuickCheck,
    time
  default-language:    Haskell2010
  if (!flag(ghcid))
    other-modules:
      Data.PathTreeSpec
      Data.TagTreeSpec
      Neuron.Config.AliasSpec
      Neuron.VersionSpec
      Neuron.Zettelkasten.ID.SchemeSpec
      Neuron.Zettelkasten.IDSpec
      Neuron.Zettelkasten.Query.ParserSpec
      Neuron.Zettelkasten.ZettelSpec

-- The executable stanza should always be at the end. The other project will
-- strip it to avoid non-core dependencies.
-- To profile: ghc-options: -fexternal-interpreter -prof -fprof-auto -rtsopts
executable neuron
  import: app-common
  main-is: Main.hs
  ghc-options: -threaded -rtsopts -with-rtsopts=-N