1 Commits

Author SHA1 Message Date
dependabot[bot]
a1af79ba27 deps: bump org.junit:junit-bom from 5.10.0 to 6.0.3
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 5.10.0 to 6.0.3.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r5.10.0...r6.0.3)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-13 19:32:29 +00:00
17 changed files with 61 additions and 288 deletions

View File

@@ -1,20 +0,0 @@
{
"name": "terminal-ui",
"image": "mcr.microsoft.com/devcontainers/java:1-21-bookworm",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "21",
"installGradle": "true",
"installMaven": "false"
}
},
"postCreateCommand": "java -version && ./gradlew --version",
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"vscjava.vscode-gradle"
]
}
}
}

View File

@@ -1,20 +0,0 @@
# EditorConfig: consistent style across editors
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{java,kts}]
indent_style = space
indent_size = 4
[*.{yml,yaml,md,json}]
indent_size = 2
[*.bat]
end_of_line = crlf

9
.gitattributes vendored
View File

@@ -1,9 +0,0 @@
# Normalize line endings
* text=auto eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
# GitHub linguist: don't count these as language
gradle/wrapper/gradle-wrapper.jar binary
*.jar binary
*.zip binary

View File

@@ -1,27 +0,0 @@
# Config for release-drafter v6: categorizes PRs in draft release notes
# https://github.com/release-drafter/release-drafter
template: |
## What's Changed
$CHANGES
**Full Changelog**: https://github.com/jakubbbdev/terminal-ui/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels: [feature, enhancement]
- title: '🐛 Bug Fixes'
labels: [bug, fix]
- title: '📚 Documentation'
labels: [documentation]
- title: '⬆️ Dependencies'
labels: [dependencies]
- title: 'Other'
labels: ['*']
exclude-labels:
- skip-changelog

View File

@@ -6,6 +6,7 @@ on:
pull_request:
branches: [ main, master ]
# Alte Läufe abbrechen, wenn ein neuer Push kommt (spart Zeit)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -19,7 +20,7 @@ jobs:
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
@@ -44,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
@@ -58,7 +59,7 @@ jobs:
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

35
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
# CodeQL: static security analysis (free for public repos).
name: CodeQL
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 6 * * 1'
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java
- name: Build (for CodeQL)
run: |
chmod +x gradlew
./gradlew compileJava --no-daemon
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

View File

@@ -1,53 +0,0 @@
# Deploy docs to GitHub Pages (optional)
# Enable in repo: Settings → Pages → Source: GitHub Actions
# Site will be at https://jakubbbdev.github.io/terminal-ui/
name: Pages
on:
push:
branches: [master, main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
environment: github-pages
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build site
run: |
mkdir -p _site
cp -r docs _site/
cat > _site/index.html << 'EOF'
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>terminal-ui</title></head>
<body style="font-family:sans-serif;max-width:600px;margin:2rem auto;padding:0 1rem">
<h1>terminal-ui</h1>
<p>Java library for terminal UIs: tables, prompts, menus, and more.</p>
<ul>
<li><a href="https://github.com/jakubbbdev/terminal-ui">GitHub repo</a></li>
<li><a href="https://github.com/jakubbbdev/terminal-ui#install">Install (README)</a></li>
<li><a href="https://github.com/jakubbbdev/terminal-ui/releases">Releases</a></li>
<li><a href="https://github.com/jakubbbdev/terminal-ui/tree/master/docs">Docs (markdown)</a></li>
</ul>
</body></html>
EOF
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -1,22 +0,0 @@
# Drafts release notes from merged PRs when you create a release.
# Install: add a Release Drafter config (see below), then create a release on GitHub;
# this workflow will update the draft with categorized PRs.
name: Release Drafter
on:
push:
branches: [main, master]
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Draft Release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,4 +1,4 @@
# On push of a version tag (e.g. v1.0.0): build, publish to GitHub Packages, create Release, upload JARs.
# On push of a version tag (e.g. v1.0.0): build, create GitHub Release, upload JARs.
name: Release
on:
@@ -8,36 +8,22 @@ on:
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Strip v from version
run: echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
- name: Build
run: chmod +x gradlew && ./gradlew build --no-daemon
- name: Publish to GitHub Packages
run: ./gradlew publish --no-daemon
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
# 409 = version already exists; use a new tag (e.g. v1.0.2) next time
- run: chmod +x gradlew && ./gradlew build --no-daemon
- name: Create Release
uses: softprops/action-gh-release@v2

3
.idea/misc.xml generated
View File

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="corretto-21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="corretto-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -1,17 +0,0 @@
# Code of Conduct
## Our Pledge
We are committed to providing a welcoming and harassment-free experience for everyone. Be respectful, inclusive, and constructive when contributing or discussing this project.
## Unacceptable Behavior
Harassment, trolling, insulting comments, personal or political attacks, and other conduct that could make others feel unsafe are not acceptable.
## Enforcement
Maintainers may remove or edit content that violates this code. Repeated or serious violations may result in being blocked from the repository.
## Contact
If you have concerns, open an issue or contact the maintainers privately if preferred.

View File

@@ -1,5 +0,0 @@
# Optional: Uncomment to show "Sponsor" button on the repo
# github: [jakubbbdev]
# patreon: your-username
# ko_fi: your-username
# custom: ['https://your-link.com']

View File

@@ -3,57 +3,6 @@
Java library for terminal UI: tables, rules, colors, prompts, menus, SelectList, pager, and more. Fluent API, ANSI support, testable.
[![CI](https://github.com/jakubbbdev/terminal-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/jakubbbdev/terminal-ui/actions/workflows/ci.yml)
[![Java 21](https://img.shields.io/badge/Java-21-ED8B00?logo=openjdk)](https://openjdk.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Latest release](https://img.shields.io/github/v/release/jakubbbdev/terminal-ui)](https://github.com/jakubbbdev/terminal-ui/releases)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/jakubbbdev/terminal-ui)
**First time here?** → [NEXT_STEPS.md](NEXT_STEPS.md) has a short checklist (Pages, topics, release).
## Install
Published to [GitHub Packages](https://github.com/jakubbbdev/terminal-ui/packages). Replace `VERSION` with a [release](https://github.com/jakubbbdev/terminal-ui/releases) tag (e.g. `1.0.0`).
**Gradle (Kotlin DSL):**
```kotlin
repositories {
mavenCentral()
maven { url = uri("https://maven.pkg.github.com/jakubbbdev/terminal-ui") }
}
dependencies {
implementation("dev.jakub.terminal:terminal-ui:VERSION")
}
```
**Gradle (Groovy):**
```groovy
repositories {
mavenCentral()
maven { url "https://maven.pkg.github.com/jakubbbdev/terminal-ui" }
}
dependencies {
implementation "dev.jakub.terminal:terminal-ui:VERSION"
}
```
**Maven:**
```xml
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/jakubbbdev/terminal-ui</url>
</repository>
<dependency>
<groupId>dev.jakub.terminal</groupId>
<artifactId>terminal-ui</artifactId>
<version>VERSION</version>
</dependency>
```
For public packages, read access usually works without credentials. If your tool asks for auth, use a [GitHub PAT](https://github.com/settings/tokens) with `read:packages` as username and the token as password.
## Requirements
@@ -72,6 +21,18 @@ Run tests:
./gradlew test
```
Demo (non-interactive):
```bash
./gradlew run
```
Interactive demo (best run in a real terminal):
```bash
./gradlew runDemo2
```
## Usage (excerpt)
```java
@@ -98,12 +59,6 @@ String choice = Terminal.menu()
.select();
```
## Docs & links
- **In-repo docs:** [docs/](docs/) Home, Install, Components, Examples.
- **GitHub Pages:** Enable in **Settings → Pages → Source: GitHub Actions** (uses workflow `pages.yml`). Site: `https://jakubbbdev.github.io/terminal-ui/`.
- **Wiki:** **Settings → Features** → enable **Wiki**; copy content from `docs/` if you like.
## License
See [LICENSE](LICENSE).

View File

@@ -1,11 +0,0 @@
# Security
## Reporting a vulnerability
If you find a security issue, please report it responsibly:
1. **Do not** open a public issue.
2. Email the maintainers or report via [GitHub Security Advisories](https://github.com/jakubbbdev/terminal-ui/security/advisories/new) (if enabled).
3. Give a clear description and steps to reproduce; well respond as soon as we can.
Thank you for helping keep this project safe.

View File

@@ -2,15 +2,15 @@ plugins {
id("java")
id("java-library")
id("application")
id("maven-publish")
}
tasks.named<JavaExec>("run") {
jvmArgs("-Ddev.jakub.terminal.ansi=true", "-Dfile.encoding=UTF-8")
}
group = "dev.jakub.terminal"
version = System.getenv("RELEASE_VERSION") ?: "1.0-SNAPSHOT"
version = "1.0-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_21
@@ -22,32 +22,11 @@ repositories {
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation(platform("org.junit:junit-bom:6.0.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.test {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = "terminal-ui"
version = project.version.toString()
from(components["java"])
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jakubbbdev/terminal-ui")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user")?.toString()
password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.token")?.toString()
}
}
}
}

View File

@@ -72,7 +72,7 @@ public final class Confirm {
}
/**
* Uses the given scanner for one line. Use when sharing one scanner (e.g. interactive app).
* Uses the given scanner for one line. Use when sharing one scanner (e.g. demo).
*/
public boolean ask(Scanner sharedScanner) {
if (sharedScanner == null) return ask();

View File

@@ -64,7 +64,7 @@ public final class Prompt {
/**
* Prompts and returns the next line from the given scanner. Use this when
* sharing one scanner (e.g. in an interactive app) so input blocks correctly.
* sharing one scanner (e.g. in a demo) so input blocks correctly.
*/
public String ask(Scanner sharedScanner) {
if (sharedScanner == null) return ask();