npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

htf-viewer

v0.0.4

Published

a pretty viewer and file watcher for HTF tests from cabal projects

Downloads

104

Readme

htf-viewer

The goal of this project is to provide a pretty viewable view of HTF haskell tests, kind of like what karma does for javascript tests. A node server will listen for HTF test output changes, parse them, and do a push to a local angularUI for pretty display.

Installation

Check out the repo:

git clone https://github.com/devshorts/test-viewer

Pull back the dependent node modules

npm install

Use Case

Personally I write my haskell these days in sublime text, and while the console cabal test output is fine and dandy sometimes I wish I would see the results of all the tests, and not just the failed ones. HTF, I noticed, writes test results to a specific log file in a format like:

Test suite Ht1Tests: RUNNING...
[TEST] TestFixtures:targetMatches (src/tests/TestFixtures.hs:15)
+++ OK (0ms)

[TEST] TestFixtures:isBuyableFalse (src/tests/TestFixtures.hs:18)
assertEqual failed at src/tests/TestFixtures.hs:18
* expected: False
* but got: True
* diff:
F Fals
S Tru
C e<......>C
*** Failed! (81ms)

[TEST] TestFixtures:updateCart (src/tests/TestFixtures.hs:21)
+++ OK (0ms)

* Tests:    4
* Passed:   4
* Pending:  0
* Failures: 0
* Errors:   0

Total execution time: 90ms
Test suite Tutorial: PASS
Test suite logged to: dist/test/HTF-0.11.0.1-Tutorial.log

And I thought it'd be fun (and look nice) to be able to spin up a browser and have these files auto watched. This way I can get a clean overview of what all my tests did in a constantly ready UI.

Configuration

If you want, you can specify the project source and port in a hconfig.json file in your haskell directory. However, by default it will use port 3000 and use the local directory as the haskell project root. Your haskell projects should be a cabalized project using HTF.

{
    "projectSource": "/Users/devshorts/Projects/code/haskellProject",
    "port": 3000
}

Running

Load up the app with node app.js. After that, test-viewer will listen for HTF log file changes in the dist/test/*.log folder and re-parse any haskell test output files after they are detected to have been changed. Failed parsings are ignored.

Hitting the cabal test button does what it says it'll do. It'll run cabal test for the configured project source, which will trigger a re-parse of the output test files.

Screen Shots

Main page

Development

If you want to add the to the repo, you'll need the following installed

  • typescript
  • node
  • foundation
  • compass
  • ruby
  • haskell (with HTF) (optional, but why wouldn't you?)