Skip to content

Commit 72acfbf

Browse files
committed
chore(release): prepare v1.0.0-ALPHA1
0 parents  commit 72acfbf

33 files changed

+2739
-0
lines changed

.ddev/config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test-boxer
2+
type: php
3+
docroot: .
4+
php_version: "8.2"
5+
webserver_type: nginx-fpm
6+
xdebug_enabled: false
7+
additional_hostnames: []
8+
additional_fqdns: []
9+
use_dns_when_possible: true
10+
composer_version: "2"
11+
web_environment: []
12+
corepack_enable: false
13+
omit_containers: [db, ddev-ssh-agent]
14+
15+
upload_dirs:
16+
- var
17+
- coverage
18+
- tests/_output

.ddev/docker-compose.test-app.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
web:
3+
volumes:
4+
- "./:/var/composer-packages/biesior/boxer"
5+
ports:
6+
- "127.0.0.1:${DDEV_HOST_HTTP_PORT}:80"
7+
- "127.0.0.1:${DDEV_HOST_HTTPS_PORT}:443"
8+
environment:
9+
- HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80
10+
- HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80

.ddev/homeadditions/.bash_aliases

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
alias ..='cd ../ '
2+
alias ...='cd ../../ '
3+
4+
alias h='history '
5+
alias watch='watch '
6+
7+
alias l='ls -laG '
8+
alias ll="ls -lhA"
9+
10+
alias gs='git status'
11+
alias gb='git branch'
12+
alias gd='git diff'
13+
alias gc='git commit'
14+
15+
alias hardclear='echo -e "\033[3J"; clear'
16+

.ddev/homeadditions/.bashrc

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
clear
2+
3+
# you can export it in your rc file depending on used shell, i.e. `.bashrc` `.zshrc` etc.
4+
export BOXER_DUMPER=1
5+
6+
# Colors
7+
green='\e[0;32m'
8+
gray='\e[0;90m'
9+
red='\e[0;31m'
10+
cyan='\e[0;36m'
11+
reset='\e[0m'
12+
13+
# Container name fallback
14+
container_name=${DDEV_SITENAME:-unknown}
15+
16+
git_ref=$(git symbolic-ref --quiet --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
17+
18+
function print_git_version {
19+
if command -v git >/dev/null 2>&1; then
20+
echo -e "GIT: ${cyan}$(git --version)${reset}"
21+
else
22+
echo -e "${red}No GIT detected${reset}"
23+
fi
24+
}
25+
26+
function git_dirty {
27+
local ref="$1"
28+
if [[ $(git status --porcelain 2>/dev/null) != "" ]]; then
29+
echo -e "${gray}${ref}${red}*${reset}"
30+
else
31+
echo -e "${green}${ref}${reset}"
32+
fi
33+
}
34+
35+
function parse_git_branch {
36+
if [ -n "$git_ref" ]; then
37+
echo -e " [$(git_dirty "$git_ref")]"
38+
fi
39+
}
40+
41+
# Short prompt with branch
42+
export PS1="${gray}[DDEV:${cyan}${container_name}${gray}]${reset} \W\$(parse_git_branch) \$ "
43+
44+
# Banner
45+
welcome_txt='Logged into DDEV container!'
46+
banner_width=60
47+
padding=$((banner_width - 4 - ${#welcome_txt}))
48+
49+
# Build banner line with spacing
50+
pad_spaces=$(printf '%*s' "$padding")
51+
line=$(printf "%s %s%s %s" "${green}" "$welcome_txt" "$pad_spaces" "${reset}")
52+
53+
# Top and bottom frame
54+
border_line_top="${green}$(printf '─%.0s' {1..58})${reset}"
55+
border_line_bottom="${green}$(printf '─%.0s' {1..58})${reset}"
56+
57+
# Show banner
58+
59+
echo
60+
echo -e "$border_line_top"
61+
echo -e "$line"
62+
echo -e "$border_line_bottom"
63+
echo -e " 👤 Logged in container as: ${cyan}$(whoami)${reset}"
64+
echo -e " 📂 Your current directory is: ${cyan}$(pwd)${reset}"
65+
66+
67+
# Git status line
68+
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
69+
if [[ -n "$git_ref" ]]; then
70+
if [[ $(git status --porcelain 2>/dev/null) != "" ]]; then
71+
echo -e " 🌱 Current GIT branch: ${cyan}${git_ref}${reset} ${red}(contains uncommitted changes)${reset}"
72+
else
73+
echo -e " 🌱 Current GIT branch: ${cyan}${git_ref}${reset} ${green}(clean)${reset}"
74+
fi
75+
fi
76+
else
77+
echo -e " ❌ Not a GIT repository"
78+
fi
79+
80+
echo
81+
php -v
82+
echo
83+
composer -V
84+
echo
85+
print_git_version
86+
echo
87+
echo -e "🚀 Get familiar with Boxer in the ${green}examples/${reset} folder, i.e. by running the command:"
88+
echo -e " ${cyan}php examples/boxer-style.php${reset}"
89+
echo
90+
91+
92+
# --- Source user .bash_aliases if it exists ---
93+
[ -f ~/.bash_aliases ] && . ~/.bash_aliases

.github/workflows/tests.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php-version: [8.2, 8.3]
15+
phpunit-version: [11.0, 12.0]
16+
17+
name: PHP ${{ matrix.php-version }} + PHPUnit ${{ matrix.phpunit-version }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
coverage: none
27+
28+
- name: Install dependencies
29+
run: |
30+
composer require --dev phpunit/phpunit:^${{ matrix.phpunit-version }} --no-update
31+
composer update --prefer-dist --no-interaction
32+
33+
- name: Run tests
34+
run: ./vendor/bin/phpunit

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# === Composer artifacts ===
2+
/vendor/
3+
/composer.lock
4+
5+
# === PHPUnit ===
6+
/phpunit.xml
7+
/phpunit.xml.dist
8+
/.phpunit.result.cache
9+
10+
# === IDEs and editors ===
11+
/.idea/
12+
/.vscode/
13+
*.sublime-workspace
14+
*.sublime-project
15+
16+
# === OS generated ===
17+
.DS_Store
18+
Thumbs.db
19+
20+
# === Logs and temp ===
21+
/*.log
22+
/.cache/
23+
/.cache/
24+
/tmp/
25+
26+
# === Coverage ===
27+
/coverage/
28+
29+
# === Tests artifacts ===
30+
/tests/output/
31+
/test-output/
32+
/build/
33+
/*.phpt

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2025 Marcus `biesior` Biesioroff and contributors.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Boxer
2+
**A retro-flavored CLI styling toolbox for the modern terminal artisan.**
3+
4+
![PHP Version](https://img.shields.io/badge/php-%5E8.2-blue)
5+
![Symfony Console](https://img.shields.io/badge/symfony%2Fconsole-%5E6.1%20%7C%7C%20%5E7.0-green)
6+
![symfony/var-dumper](https://img.shields.io/badge/symfony%2Fvar--dumper-%5E6.0%20%7C%7C%20%5E7.0-green)
7+
![symfony/yaml](https://img.shields.io/badge/symfony%2Fyaml-%5E6.0%20%7C%7C%20%5E7.0-green)
8+
![License](https://img.shields.io/github/license/biesior/boxer)
9+
10+
Boxer is a Symfony Console-compatible helper package that adds stylistic and interactive output methods. It provides drop-in enhancements over Symfony Style and Formatter helper classes, allowing CLI applications to display consistently styled banners, block messages, and boxed outputs.
11+
12+
## Features
13+
14+
- Colored and styled output blocks (`box`, `slider`, `banner`)
15+
- Seamless integration with `Symfony\Component\Console\Style\SymfonyStyle`
16+
- Drop-in replacement with fallback to default Symfony behavior i.e., by `--boxless` option
17+
- Minimal configuration
18+
- Sample usage file included
19+
20+
## Why Boxer?
21+
22+
Symfony’s Console component is powerful but lacks modern, styled outputs by default. Boxer enhances CLI UX without complicating your codebase.
23+
24+
## Requirements
25+
26+
- [Composer](https://getcomposer.org/) installed globally, or use [DDEV](https://ddev.com/) where Composer is pre-installed
27+
- `PHP 8.2` or higher (can optionally be run via DDEV with pre-installed one)
28+
- `symfony/console` `^6.1 || ^7.0`
29+
- `symfony/var-dumper` `^6.0 || ^7.0`
30+
31+
## Installation
32+
33+
### Fastest, via Composer
34+
35+
```bash
36+
composer require biesior/boxer
37+
```
38+
39+
## Usage Example
40+
41+
A sample usage file is available at `examples/boxer-style.php`. You can run it with:
42+
43+
```bash
44+
php examples/boxer-style.php
45+
```
46+
47+
This example demonstrates:
48+
49+
- Block output with various styles
50+
- Interactive questions
51+
- Banners and progress bars
52+
53+
## Quick Start with DDEV (optional)
54+
55+
For quick experimentation, the package includes a minimal `.ddev/` config. If you have [DDEV](https://ddev.com/) installed:
56+
57+
```bash
58+
ddev start
59+
ddev php examples/boxer-style.php
60+
```
61+
62+
No need to configure PHP or Composer locally — it's ready to run in seconds.
63+
64+
### Contributors Welcome!
65+
66+
### This project is `contributor-friendly`!
67+
68+
Boxer is currently in **ALPHA** stage. Your feedback and contributions are valuable before the first stable release.
69+
70+
If you're a:
71+
72+
- Developer
73+
- CLI tools maintainer
74+
- UX-minded engineer
75+
- Tester
76+
- Technical writer
77+
- Visionary
78+
79+
...we’d love to hear from you. Pull requests, issues, and suggestions are all welcome!
80+
81+
## License
82+
83+
This package is open-sourced under the MIT license.
84+
See the [LICENSE](LICENSE) file for details.
85+
86+
© Copyright 2025 Marcus `biesior` Biesioroff and contributors.

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "biesior/boxer",
3+
"description": "Simple package to draw boxes especially in the CLI commands. Extends symfony/console.",
4+
"authors": [
5+
{
6+
"name": "Marcus `biesior` Biesioroff",
7+
"email": "biesior@gmail.com"
8+
}
9+
],
10+
"license": "MIT",
11+
"type": "library",
12+
"require": {
13+
"php": "^8.2",
14+
"symfony/console": "^6.1 || ^7.0",
15+
"symfony/var-dumper": "^6.0 || ^7.0",
16+
"symfony/yaml": "^6.0 || ^7.0"
17+
},
18+
"require-dev": {
19+
"phpunit/phpunit": "^11.0 || ^12.0"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"Biesior\\Boxer\\": "src/"
24+
},
25+
"files": [
26+
"functions/boxer-dumper-functions.php"
27+
]
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Biesior\\Boxer\\Tests\\": "tests/"
32+
}
33+
},
34+
"scripts": {
35+
"test": "phpunit"
36+
}
37+
}

config/boxer_style.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
boxer_style:
2+
3+
# int: default
4+
max_width: 118
5+
6+
# bool: if true will try to draw box to the nd of current TTY
7+
full_width: false
8+
9+
# if true
10+
boxless: false

0 commit comments

Comments
 (0)