Skip to content

Commit

Permalink
Update for publishing to package (#70)
Browse files Browse the repository at this point in the history
* update bounds and add .cabal

* update readme

* update version

* update description

* update cabal version
  • Loading branch information
arsalan0c authored Dec 22, 2022
1 parent f946d70 commit 19f5a30
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 34 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ result
result-*

# haskell
*.cabal
dist
dist-newstyle
cabal-dev
Expand All @@ -26,4 +25,4 @@ cabal.sandbox.config
.stack-work/
cabal.project.local
.HTF/
.ghc.environment.*
.ghc.environment.*
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ whileTrue f act = do
else pure [a]
```

More examples can be found in `examples`.

## Generating the CDP library

```
Expand All @@ -75,13 +77,9 @@ cabal run cdp-gen
[Project board](https://github.com/users/arsalan0c/projects/1)

Commands and events for all non-deprecated domains are supported.
The following session functionalities are supported:
- creating a session: obtain a session id by using the `pTargetAttachToTarget` function to send a `Target.attachToTarget` command, passing `True` for the flatten argument
- send a command for a particular session: use the `sendCommandForSession` function with a session id
- subscribe to events for a particular session:
1. register a handler with a session id
2. send the command to enable events for the domain, with the same session id

Sessions can also be created with a target (such as a tab), which can be used to restrict the scope of commands and events for the target.
See `examples/sessions.hs` for example usage.
## Contributing

PRs are welcome! If you would like to discuss changes or have any feedback, feel free to open an [issue](https://github.com/arsalan0c/cdp-hs/issues).
Expand Down
322 changes: 322 additions & 0 deletions cdp.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,322 @@
cabal-version: 3.0

-- This file has been generated from package.yaml by hpack version 0.34.6.
--
-- see: https://github.com/sol/hpack

name: cdp
version: 0.0.1.1
synopsis: A library for the Chrome Devtools Protocol
description: A library for the Chrome Devtools Protocol (CDP). It provides access to Chrome, enabling tasks such as printing a page or opening a tab.

Chrome Devtools Protocol: <https://chromedevtools.github.io/devtools-protocol/>

README: <https://github.com/arsalan0c/cdp-hs>

Examples: <https://github.com/arsalan0c/cdp-hs/examples>
category: Package.Category
homepage: https://github.com/arsalan0c/cdp-hs#readme
bug-reports: https://github.com/arsalan0c/cdp-hs/issues
author: Arsalan Cheema
maintainer: Arsalan Cheema
license: BSD-3-Clause
build-type: Simple
extra-doc-files:
README.md

source-repository head
type: git
location: https://github.com/arsalan0c/cdp-hs

library
exposed-modules:
CDP
CDP.Domains
CDP.Domains.Accessibility
CDP.Domains.Animation
CDP.Domains.Audits
CDP.Domains.BackgroundService
CDP.Domains.BrowserTarget
CDP.Domains.CacheStorage
CDP.Domains.Cast
CDP.Domains.CSS
CDP.Domains.Database
CDP.Domains.Debugger
CDP.Domains.DeviceOrientation
CDP.Domains.DOMDebugger
CDP.Domains.DOMPageNetworkEmulationSecurity
CDP.Domains.DOMSnapshot
CDP.Domains.DOMStorage
CDP.Domains.EventBreakpoints
CDP.Domains.Fetch
CDP.Domains.HeadlessExperimental
CDP.Domains.HeapProfiler
CDP.Domains.IndexedDB
CDP.Domains.Input
CDP.Domains.Inspector
CDP.Domains.IO
CDP.Domains.LayerTree
CDP.Domains.Log
CDP.Domains.Media
CDP.Domains.Memory
CDP.Domains.Overlay
CDP.Domains.Performance
CDP.Domains.PerformanceTimeline
CDP.Domains.Profiler
CDP.Domains.Runtime
CDP.Domains.ServiceWorker
CDP.Domains.Storage
CDP.Domains.SystemInfo
CDP.Domains.Tethering
CDP.Domains.Tracing
CDP.Domains.WebAudio
CDP.Domains.WebAuthn
CDP.Endpoints
CDP.Internal.Utils
CDP.Runtime
CDP.Definition
CDP.Gen.Deprecated
CDP.Gen.Program
CDP.Gen.Snippets
Main
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
src
gen
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, bytestring >=0.10.12 && <0.11
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

executable cdp-example-endpoints
main-is: endpoints.hs
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
examples
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, blaze-html >=0.9.1 && <0.10
, blaze-markup >=0.8.2 && <0.9
, bytestring >=0.10.12 && <0.11
, cdp
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, utf8-string >=1.0.2 && <1.1
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

executable cdp-example-open-twitter
main-is: open-twitter.hs
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
examples
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, bytestring >=0.10.12 && <0.11
, cdp
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

executable cdp-example-print-page
main-is: print-page.hs
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
examples
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, base64-bytestring >=1.1.0 && <1.2
, bytestring >=0.10.12 && <0.11
, cdp
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

executable cdp-example-sessions
main-is: sessions.hs
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
examples
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, bytestring >=0.10.12 && <0.11
, cdp
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

executable cdp-example-subscribe
main-is: subscribe.hs
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
examples
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, bytestring >=0.10.12 && <0.11
, cdp
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

executable cdp-gen
main-is: Main.hs
other-modules:
CDP.Definition
CDP.Gen.Deprecated
CDP.Gen.Program
CDP.Gen.Snippets
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
gen
default-extensions:
Strict
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, bytestring >=0.10.12 && <0.11
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010

test-suite cdp-test
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
Paths_cdp
autogen-modules:
Paths_cdp
hs-source-dirs:
test
ghc-options: -Wall -threaded
build-depends:
aeson >=1.5.6 && <1.6
, base >=4.14.3 && <4.15
, bytestring >=0.10.12 && <0.11
, cdp
, containers >=0.6.5 && <0.7
, data-default >=0.7.1 && <0.8
, directory >=1.3.6 && <1.4
, extra >=1.7.9 && <1.8
, filepath >=1.4.2 && <1.5
, hspec
, http-conduit >=2.3.8 && <2.4
, monad-loops >=0.4.3 && <0.5
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.4 && <2.7
, process >=1.6.13 && <1.7
, random >=1.2.0 && <1.3
, text >=1.2.4 && <1.3
, vector >=0.12.3 && <0.13
, websockets >=0.12.7 && <0.13
default-language: Haskell2010
Loading

0 comments on commit 19f5a30

Please sign in to comment.