Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ hs_err_pid*

.vscode
.idea
*.iml

target
build
lib
out
dependency-reduced-pom.xml

24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Context
# Twinkle

Context is a Java library for creating advanced user interfaces inside a console window
Twinkle is a Java library for creating advanced text-based user interfaces.

This is a very early proof of concept, nothing to see here (yet)

Expand All @@ -10,20 +10,24 @@ This is a very early proof of concept, nothing to see here (yet)
To build the project, run the following command:

```bash
mvn clean package
./mvnw clean package
```

## Running

To see a simple demo of panels being drawn randomly on the screen, run the following command:
To see a couple of very early demos, run the following commands:

```bash
java -cp target/context-1.0-SNAPSHOT.jar <example_class>
java -cp twinkle-chart/target/twinkle-chart-1.0-SNAPSHOT.jar:twinkle-core/target/twinkle-core-1.0-SNAPSHOT.jar:twinkle-ansi/target/twinkle-ansi-1.0-SNAPSHOT.jar:twinkle-chart/target/test-classes examples.BarDemo
java -cp twinkle-chart/target/twinkle-chart-1.0-SNAPSHOT.jar:twinkle-core/target/twinkle-core-1.0-SNAPSHOT.jar:twinkle-ansi/target/twinkle-ansi-1.0-SNAPSHOT.jar:twinkle-chart/target/test-classes examples.MathPlotDemo
```

Where `<example_class>` is one of the following:
An easier way to run the demos is using [JBang](https://www.jbang.dev/):

- examples.Boxes
- examples.FullPanel
- examples.InlinePanel
- examples.SimpleDom
```bash
./mvnw install -DskipTests
jbang run examples/BarDemo.java
jbang run examples/MathPlotDemo.java
```

These demos only show Twinkle's Ansi output capabilities. There is no interactivity being shown.
16 changes: 16 additions & 0 deletions app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: twinkle
description: Twinkle is a Java library for creating advanced text-based user interfaces.
authors:
- Tako Schotanus (tako@codejive.org)
links:
homepage: https://github.com/codejive/java-twinkle
repository: https://github.com/codejive/java-twinkle
documentation: https://github.com/codejive/java-twinkle/blob/main/README.md
java: 8
dependencies:
actions:
clean: ./mvnw clean
build: ./mvnw spotless:apply package -DskipTests
test: ./mvnw test
runbar: java -cp twinkle-chart/target/twinkle-chart-1.0-SNAPSHOT.jar:twinkle-core/target/twinkle-core-1.0-SNAPSHOT.jar:twinkle-ansi/target/twinkle-ansi-1.0-SNAPSHOT.jar:twinkle-chart/target/test-classes examples.BarDemo
runplot: java -cp twinkle-chart/target/twinkle-chart-1.0-SNAPSHOT.jar:twinkle-core/target/twinkle-core-1.0-SNAPSHOT.jar:twinkle-ansi/target/twinkle-ansi-1.0-SNAPSHOT.jar:twinkle-chart/target/test-classes examples.PlotDemo
16 changes: 16 additions & 0 deletions jbang-catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"aliases": {
"BarDemo": {
"script-ref": "twinkle-chart\\src\\test\\java\\examples\\BarDemo.java",
"dependencies": [
"org.codejive.twinkle:twinkle-chart:1.0-SNAPSHOT"
]
},
"MathPlotDemo": {
"script-ref": "twinkle-chart\\src\\test\\java\\examples\\MathPlotDemo.java",
"dependencies": [
"org.codejive.twinkle:twinkle-chart:1.0-SNAPSHOT"
]
}
}
}
69 changes: 69 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
project:
name: twinkle
description: Java TUI Library
longDescription: |
Twinkle is a Java library for creating advanced text-based user interfaces.
authors:
- Tako Schotanus
tags:
- java
- tui
- console
license: Apache-2.0
links:
homepage: https://github.com/codejive/java-twinkle
languages:
java:
groupId: org.codejive.twinkle
version: '8'
inceptionYear: '2025'
stereotype: NONE

assemble:
javaArchive:
twinkle:
active: ALWAYS
formats:
- ZIP
- TGZ
mainJar:
path: 'target/{{distributionName}}-{{projectVersion}}.jar'
jars:
- pattern: 'target/binary/lib/*.jar'
fileSets:
- input: '.'
includes:
- 'LICENSE'

deploy:
maven:
mavenCentral:
twinkle:
active: RELEASE
url: https://central.sonatype.com/api/v1/publisher
stagingRepositories:
- target/staging-deploy

release:
github:
owner: codejive
name: java-twinkle
overwrite: true
changelog:
formatted: ALWAYS
preset: conventional-commits
contributors:
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'

checksum:
individual: true

signing:
active: ALWAYS
armored: true

distributions:
twinkle:
artifacts:
- path: target/jreleaser/assemble/{{distributionName}}/java-archive/{{distributionName}}-{{projectVersion}}.zip
- path: target/jreleaser/assemble/{{distributionName}}/java-archive/{{distributionName}}-{{projectVersion}}.zip
87 changes: 43 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,49 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.codejive</groupId>
<artifactId>context</artifactId>
<groupId>org.codejive.twinkle</groupId>
<artifactId>twinkle</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.jline>3.30.3</version.jline>

<spotless.version>2.44.4</spotless.version>
<google-java-format.version>1.22.0</google-java-format.version>
<version.jspecify>1.0.0</version.jspecify>
<version.junit>6.0.1</version.junit>
<version.assertj>3.27.6</version.assertj>
</properties>

<modules>
<module>twinkle-core</module>
<module>twinkle-ansi</module>
<module>twinkle-chart</module>
<!-- module>twinkle-tui</module -->
</modules>

<dependencies>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal</artifactId>
<version>${version.jline}</version>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>${version.jspecify}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jansi</artifactId>
<version>${version.jline}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
</dependencies>

</dependencies>
<build>
<plugins>
<plugin>
Expand All @@ -43,7 +58,6 @@
<format>
<includes>
<include>**/*.md</include>
<include>**/*.txt</include>
<include>.gitignore</include>
</includes>
<trimTrailingWhitespace/>
Expand Down Expand Up @@ -73,50 +87,35 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>examples.Boxes</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<testSource>11</testSource>
<testTarget>11</testTarget> </configuration>
</plugin>
</plugins>
<pluginManagement>
<!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<version>3.4.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<version>3.14.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<version>3.5.4</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<version>3.5.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
Expand All @@ -126,7 +125,6 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.4</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.21.0</version>
Expand All @@ -137,13 +135,14 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
<version>3.9.0</version>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
5 changes: 0 additions & 5 deletions src/main/java/org/codejive/context/events/Event.java

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/java/org/codejive/context/events/EventTarget.java

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/java/org/codejive/context/terminal/Rectangular.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/main/java/org/codejive/context/terminal/Size.java

This file was deleted.

Loading
Loading