Skip to content

Commit

Permalink
Refactor under clj-commons and simplify (#92)
Browse files Browse the repository at this point in the history
* Remove clipboard support, Leiningen plugin, component overrides

* Rename namespaces to be under clj-commons

* Remove the ansi color functions and constants, rely on compose

* Strip out the documentation

* Update versions of GitHub action steps

* Don't reference deleted :dev alias

* Remove dependency on tools.logging

* Ensure compatible with Clojure 1.10

* Extend rules for identifying REPL input frames

* Add easy :repl alias, for use with :1.8 alias

* Update example formatted exception image

* Record updated benchmark

* Start to optimize compose function

* Optimizations

* Optimizations

* Optimizations, remove format.columns

* Remove tracking of width

* Cleanups

* Allow compose to handle padding columns

* Switch from meta-data to a map at head of vector

* Fix some doc formatting
  • Loading branch information
hlship committed Jun 22, 2023
1 parent 0e5e53a commit 692826c
Show file tree
Hide file tree
Showing 38 changed files with 1,389 additions and 2,648 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v3.5.3

- name: Setup Java
uses: actions/setup-java@v3.11.0
Expand All @@ -24,7 +24,7 @@ jobs:
distribution: 'corretto'

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@10.2
uses: DeLaGuardo/setup-clojure@11.0
with:
cli: 1.11.1.1257

Expand All @@ -38,8 +38,11 @@ jobs:
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('deps.edn') }}

- name: Run JVM tests
run: clojure -X:dev:test
- name: Run tests (current, Clojure 1.11)
run: clojure -X:test

- name: Run tests (Clojure 1.10)
run: clojure -X:1.10:test



Expand Down
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 2.0 -- UNRELEASED

This release moves the library to clj-commons, and changes the root namespace from
`io.aviso` to `clj-commons`. It strips down the library to its essentials, removing
the `columns`, `component`, and `logging` namespaces entirely.

- Stripped out a lot of redundant documentation
- Reworked the `ansi` namespace to primarily expose the `compose` function and not the dozens of constants and functions
- `ansi` determines whether to enable or disable at execution time
- `ansi` now honors the `NO_COLOR` environment variable
- Stripped out code for accessing the clipboard from the `repl` namespace
- Some refactoring inside `exceptions` namespace, including changes to the `*fonts*` var
- Removed the `logging` namespace and dependency on `org.clojure/tools.logging`
- Removed the `component` namespace, but the example is still present in the documentation
- Ensure compatible with Clojure 1.10 and above (now tested in GitHub action)

## 1.4.4 -- 20 Jun 2023

- Fixed: Incorrectly named font terms with `compose`
Expand Down
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
[![Clojars](https://img.shields.io/clojars/v/io.aviso/pretty.svg)](http://clojars.org/io.aviso/pretty)
[![CI](https://github.com/AvisoNovate/pretty/actions/workflows/clojure.yml/badge.svg)](https://github.com/AvisoNovate/pretty/actions/workflows/clojure.yml)

[Full Documentation](http://ioavisopretty.readthedocs.org/en/latest/)

[API](http://avisonovate.github.io/docs/pretty/)

*Sometimes, neatness counts.*
*Sometimes, neatness counts*

If you are trying to puzzle out a stack trace,
pick a critical line of text out of a long stream of console output,
or compare two streams of binary data, a little bit of formatting can go a long way.

That's what _io.aviso/pretty_ is for. It adds support for pretty output where it counts:
That's what `clj-commons/pretty` is for. It adds support for pretty output where it counts:

* Readable output for exceptions
* ANSI font and background color support
Expand All @@ -21,16 +17,8 @@ That's what _io.aviso/pretty_ is for. It adds support for pretty output where i

![Example](docs/images/formatted-exception.png)

[Full Documentation](http://ioavisopretty.readthedocs.org/en/latest/)

Pretty is also incorporated into the [ultra](https://github.com/venantius/ultra/) plugin,
and is packaged as part of [Boot](https://github.com/boot-clj/boot).
Pretty is compatible with Clojure 1.10 and above.


Parts of Pretty can be used with [Babashka](https://book.babashka.org/#introduction), such as the `io.aviso.ansi` namespace; however,
Babashka runs in an interpreter and its approach to exceptions is
Parts of Pretty can be used with [Babashka](https://book.babashka.org/#introduction), such as the `clj-commons.ansi`
namespace; however, Babashka runs in an interpreter and its approach to exceptions is
incompatible with JVM exceptions.

----

io.aviso/pretty is released under the terms of the Apache Software License 2.0.
34 changes: 17 additions & 17 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}

:net.lewisship.build/scm
{:url "https://github.com/avisoNovate/pretty"}

:aliases
{:dev
{:test
;; clj -X:test
{:extra-paths ["test"]
:extra-deps {com.stuartsierra/component {:mvn/version "1.1.0"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
criterium/criterium {:mvn/version "0.4.6"}
com.walmartlabs/test-reporting {:mvn/version "1.2"}
:extra-deps {criterium/criterium {:mvn/version "0.4.6"}
org.clojure/core.async {:mvn/version "1.6.673"}
leiningen/leiningen {:mvn/version "2.10.0"}}}

;; clj -X:dev:test
:test
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
:git/sha "dfb30dd"}}
:jvm-opts ["-Dio.aviso.ansi.enable=true"]
:jvm-opts ["-Dclj-commons.ansi.enabled=true"]
:exec-fn cognitect.test-runner.api/test}

;; clj -T:build <command>
Expand All @@ -28,11 +19,20 @@
:ns-default build}

:main
{:main-opts ["-m" "io.aviso.repl"]}
{:main-opts ["-m" "clj-commons.pretty.repl"]}

:1.10
{:override-deps {org.clojure/clojure {:mvn/version "1.10.0"}}}

;; clj -M:dev:demo
;; clj -M:test:demo
:demo
{:main-opts ["-m" "demo"]}}
{:main-opts ["-m" "demo"]}

:repl
{:main-opts ["-m" "clj-commons.pretty.repl"]}}

:net.lewisship.build/scm
{:url "https://github.com/AvisoNovate/pretty"}

:codox/config
{:description "Clojure library to help print things, prettily"
Expand Down
1 change: 0 additions & 1 deletion docs/.gitignore

This file was deleted.

208 changes: 0 additions & 208 deletions docs/Makefile

This file was deleted.

0 comments on commit 692826c

Please sign in to comment.