Skip to content

Commit 692826c

Browse files
authored
Refactor under clj-commons and simplify (#92)
* 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
1 parent 0e5e53a commit 692826c

38 files changed

+1389
-2648
lines changed

.github/workflows/clojure.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/[email protected].0
18+
uses: actions/[email protected].3
1919

2020
- name: Setup Java
2121
uses: actions/[email protected]
@@ -24,7 +24,7 @@ jobs:
2424
distribution: 'corretto'
2525

2626
- name: Install clojure tools
27-
uses: DeLaGuardo/setup-clojure@10.2
27+
uses: DeLaGuardo/setup-clojure@11.0
2828
with:
2929
cli: 1.11.1.1257
3030

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

41-
- name: Run JVM tests
42-
run: clojure -X:dev:test
41+
- name: Run tests (current, Clojure 1.11)
42+
run: clojure -X:test
43+
44+
- name: Run tests (Clojure 1.10)
45+
run: clojure -X:1.10:test
4346

4447

4548

CHANGES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 2.0 -- UNRELEASED
2+
3+
This release moves the library to clj-commons, and changes the root namespace from
4+
`io.aviso` to `clj-commons`. It strips down the library to its essentials, removing
5+
the `columns`, `component`, and `logging` namespaces entirely.
6+
7+
- Stripped out a lot of redundant documentation
8+
- Reworked the `ansi` namespace to primarily expose the `compose` function and not the dozens of constants and functions
9+
- `ansi` determines whether to enable or disable at execution time
10+
- `ansi` now honors the `NO_COLOR` environment variable
11+
- Stripped out code for accessing the clipboard from the `repl` namespace
12+
- Some refactoring inside `exceptions` namespace, including changes to the `*fonts*` var
13+
- Removed the `logging` namespace and dependency on `org.clojure/tools.logging`
14+
- Removed the `component` namespace, but the example is still present in the documentation
15+
- Ensure compatible with Clojure 1.10 and above (now tested in GitHub action)
16+
117
## 1.4.4 -- 20 Jun 2023
218

319
- Fixed: Incorrectly named font terms with `compose`

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
[![Clojars](https://img.shields.io/clojars/v/io.aviso/pretty.svg)](http://clojars.org/io.aviso/pretty)
22
[![CI](https://github.com/AvisoNovate/pretty/actions/workflows/clojure.yml/badge.svg)](https://github.com/AvisoNovate/pretty/actions/workflows/clojure.yml)
33

4-
[Full Documentation](http://ioavisopretty.readthedocs.org/en/latest/)
5-
6-
[API](http://avisonovate.github.io/docs/pretty/)
7-
8-
*Sometimes, neatness counts.*
4+
*Sometimes, neatness counts*
95

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

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

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

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

24-
[Full Documentation](http://ioavisopretty.readthedocs.org/en/latest/)
25-
26-
Pretty is also incorporated into the [ultra](https://github.com/venantius/ultra/) plugin,
27-
and is packaged as part of [Boot](https://github.com/boot-clj/boot).
20+
Pretty is compatible with Clojure 1.10 and above.
2821

29-
30-
Parts of Pretty can be used with [Babashka](https://book.babashka.org/#introduction), such as the `io.aviso.ansi` namespace; however,
31-
Babashka runs in an interpreter and its approach to exceptions is
22+
Parts of Pretty can be used with [Babashka](https://book.babashka.org/#introduction), such as the `clj-commons.ansi`
23+
namespace; however, Babashka runs in an interpreter and its approach to exceptions is
3224
incompatible with JVM exceptions.
33-
34-
----
35-
36-
io.aviso/pretty is released under the terms of the Apache Software License 2.0.

deps.edn

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
{:paths ["src"]
22
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
33

4-
:net.lewisship.build/scm
5-
{:url "https://github.com/avisoNovate/pretty"}
6-
74
:aliases
8-
{:dev
5+
{:test
6+
;; clj -X:test
97
{:extra-paths ["test"]
10-
:extra-deps {com.stuartsierra/component {:mvn/version "1.1.0"}
11-
org.clojure/tools.logging {:mvn/version "1.2.4"}
12-
criterium/criterium {:mvn/version "0.4.6"}
13-
com.walmartlabs/test-reporting {:mvn/version "1.2"}
8+
:extra-deps {criterium/criterium {:mvn/version "0.4.6"}
149
org.clojure/core.async {:mvn/version "1.6.673"}
15-
leiningen/leiningen {:mvn/version "2.10.0"}}}
16-
17-
;; clj -X:dev:test
18-
:test
19-
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
10+
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
2011
:git/sha "dfb30dd"}}
21-
:jvm-opts ["-Dio.aviso.ansi.enable=true"]
12+
:jvm-opts ["-Dclj-commons.ansi.enabled=true"]
2213
:exec-fn cognitect.test-runner.api/test}
2314

2415
;; clj -T:build <command>
@@ -28,11 +19,20 @@
2819
:ns-default build}
2920

3021
:main
31-
{:main-opts ["-m" "io.aviso.repl"]}
22+
{:main-opts ["-m" "clj-commons.pretty.repl"]}
23+
24+
:1.10
25+
{:override-deps {org.clojure/clojure {:mvn/version "1.10.0"}}}
3226

33-
;; clj -M:dev:demo
27+
;; clj -M:test:demo
3428
:demo
35-
{:main-opts ["-m" "demo"]}}
29+
{:main-opts ["-m" "demo"]}
30+
31+
:repl
32+
{:main-opts ["-m" "clj-commons.pretty.repl"]}}
33+
34+
:net.lewisship.build/scm
35+
{:url "https://github.com/AvisoNovate/pretty"}
3636

3737
:codox/config
3838
{:description "Clojure library to help print things, prettily"

docs/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/Makefile

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
 (0)