зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 16:05:50 +03:00
chore: rename crate to tui-textarea-2 and update metadata/docs links (#2)
* chore: rename crate to tui-textarea-2 and update metadata/docs links * chore: prepare v0.7.1 publish for tui-textarea-2 * ci(release): automate publish, tag, and release after merge to main
Этот коммит содержится в:
103
.github/workflows/release-after-merge.yml
поставляемый
Обычный файл
103
.github/workflows/release-after-merge.yml
поставляемый
Обычный файл
@@ -0,0 +1,103 @@
|
|||||||
|
name: Release After Merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- Cargo.toml
|
||||||
|
- CHANGELOG.md
|
||||||
|
- bench/Cargo.toml
|
||||||
|
- .github/workflows/release-after-merge.yml
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-main
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment: release
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Read version and tag
|
||||||
|
id: meta
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)"
|
||||||
|
if [[ -z "$version" ]]; then
|
||||||
|
echo "Unable to parse version from Cargo.toml"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "tag=v$version" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Check whether tag already exists
|
||||||
|
id: tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if git rev-parse -q --verify "refs/tags/${{ steps.meta.outputs.tag }}" >/dev/null; then
|
||||||
|
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||||
|
elif git ls-remote --exit-code --tags origin "refs/tags/${{ steps.meta.outputs.tag }}" >/dev/null 2>&1; then
|
||||||
|
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Skip when already released
|
||||||
|
if: steps.tag.outputs.exists == 'true'
|
||||||
|
run: echo "Tag ${{ steps.meta.outputs.tag }} already exists. Nothing to release."
|
||||||
|
|
||||||
|
- name: Verify package
|
||||||
|
if: steps.tag.outputs.exists == 'false'
|
||||||
|
run: |
|
||||||
|
cargo package
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
- name: Authenticate to crates.io (trusted publishing)
|
||||||
|
if: steps.tag.outputs.exists == 'false' && secrets.CARGO_REGISTRY_TOKEN == ''
|
||||||
|
id: crates_auth
|
||||||
|
uses: rust-lang/crates-io-auth-action@v1
|
||||||
|
|
||||||
|
- name: Publish with static token
|
||||||
|
if: steps.tag.outputs.exists == 'false' && secrets.CARGO_REGISTRY_TOKEN != ''
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
|
run: cargo publish --locked --token "$CARGO_REGISTRY_TOKEN"
|
||||||
|
|
||||||
|
- name: Publish with trusted publishing token
|
||||||
|
if: steps.tag.outputs.exists == 'false' && secrets.CARGO_REGISTRY_TOKEN == ''
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ steps.crates_auth.outputs.token }}
|
||||||
|
run: cargo publish --locked --token "$CARGO_REGISTRY_TOKEN"
|
||||||
|
|
||||||
|
- name: Create and push tag
|
||||||
|
if: steps.tag.outputs.exists == 'false'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git tag -a "${{ steps.meta.outputs.tag }}" -m "${{ steps.meta.outputs.tag }}"
|
||||||
|
git push origin "${{ steps.meta.outputs.tag }}"
|
||||||
|
|
||||||
|
- name: Create GitHub release
|
||||||
|
if: steps.tag.outputs.exists == 'false'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh release create "${{ steps.meta.outputs.tag }}" \
|
||||||
|
--repo "${{ github.repository }}" \
|
||||||
|
--verify-tag \
|
||||||
|
--generate-notes
|
||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,13 @@
|
|||||||
|
<a id="v0.7.1"></a>
|
||||||
|
# [v0.7.1](https://github.com/srothgan/tui-textarea/releases/tag/v0.7.1) - 2026-02-18
|
||||||
|
|
||||||
|
- Update compatibility for [ratatui](https://ratatui.rs/) v0.30.0.
|
||||||
|
- Publish maintained fork under `srothgan/tui-textarea`.
|
||||||
|
- Rename published crate to `tui-textarea-2`.
|
||||||
|
- Add CI/collaboration baseline (workflows, templates, contributing guide).
|
||||||
|
|
||||||
|
[Changes][v0.7.1]
|
||||||
|
|
||||||
<a id="v0.7.0"></a>
|
<a id="v0.7.0"></a>
|
||||||
# [v0.7.0](https://github.com/rhysd/tui-textarea/releases/tag/v0.7.0) - 2024-10-22
|
# [v0.7.0](https://github.com/rhysd/tui-textarea/releases/tag/v0.7.0) - 2024-10-22
|
||||||
|
|
||||||
@@ -439,7 +449,7 @@ First release :tada:
|
|||||||
|
|
||||||
[Changes][v0.1.0]
|
[Changes][v0.1.0]
|
||||||
|
|
||||||
|
[v0.7.1]: https://github.com/srothgan/tui-textarea/compare/v0.7.0...v0.7.1
|
||||||
[v0.7.0]: https://github.com/rhysd/tui-textarea/compare/v0.6.1...v0.7.0
|
[v0.7.0]: https://github.com/rhysd/tui-textarea/compare/v0.6.1...v0.7.0
|
||||||
[v0.6.1]: https://github.com/rhysd/tui-textarea/compare/v0.6.0...v0.6.1
|
[v0.6.1]: https://github.com/rhysd/tui-textarea/compare/v0.6.0...v0.6.1
|
||||||
[v0.6.0]: https://github.com/rhysd/tui-textarea/compare/v0.5.3...v0.6.0
|
[v0.6.0]: https://github.com/rhysd/tui-textarea/compare/v0.5.3...v0.6.0
|
||||||
|
|||||||
14
Cargo.toml
14
Cargo.toml
@@ -1,21 +1,25 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tui-textarea"
|
name = "tui-textarea-2"
|
||||||
version = "0.7.0"
|
homepage = "https://github.com/srothgan/tui-textarea#readme"
|
||||||
|
repository = "https://github.com/srothgan/tui-textarea"
|
||||||
|
documentation = "https://docs.rs/tui-textarea-2/latest/tui_textarea/"
|
||||||
|
version = "0.7.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.56.1" # for `tui` crate support
|
rust-version = "1.56.1" # for `tui` crate support
|
||||||
authors = ["rhysd <lin90162@yahoo.co.jp>"]
|
authors = ["Simon Peter Rothgang <simonrothgang@icloud.com>", "rhysd <lin90162@yahoo.co.jp>"]
|
||||||
description = """
|
description = """
|
||||||
tui-textarea is a simple yet powerful text editor widget for ratatui and tui-rs. Multi-line
|
tui-textarea is a simple yet powerful text editor widget for ratatui and tui-rs. Multi-line
|
||||||
text editor can be easily put as part of your TUI application.
|
text editor can be easily put as part of your TUI application.
|
||||||
"""
|
"""
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
homepage = "https://github.com/rhysd/tui-textarea#readme"
|
|
||||||
repository = "https://github.com/rhysd/tui-textarea"
|
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
categories = ["text-editors", "text-processing"]
|
categories = ["text-editors", "text-processing"]
|
||||||
keywords = ["tui", "textarea", "editor", "input", "ratatui"]
|
keywords = ["tui", "textarea", "editor", "input", "ratatui"]
|
||||||
include = ["/src", "/examples", "/tests", "/README.md", "/LICENSE.txt"]
|
include = ["/src", "/examples", "/tests", "/README.md", "/LICENSE.txt"]
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "tui_textarea"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["crossterm"]
|
default = ["crossterm"]
|
||||||
# Features to use ratatui
|
# Features to use ratatui
|
||||||
|
|||||||
51
README.md
51
README.md
@@ -1,13 +1,15 @@
|
|||||||
tui-textarea
|
tui-textarea-2
|
||||||
============
|
============
|
||||||
[![crate][crates-io-badge]][crate]
|
[![crate][crates-io-badge]][crate]
|
||||||
[![docs][doc-badge]][doc]
|
[![docs][doc-badge]][doc]
|
||||||
[![CI][ci-badge]][ci]
|
[![CI][ci-badge]][ci]
|
||||||
[![coverage][codecov-badge]][codecov]
|
[![coverage][codecov-badge]][codecov]
|
||||||
|
|
||||||
[tui-textarea][crate] is a simple yet powerful text editor widget like `<textarea>` in HTML for [ratatui][] and [tui-rs][].
|
[tui-textarea-2][crate] is a simple yet powerful text editor widget like <textarea> in HTML for [ratatui][] and [tui-rs][].
|
||||||
Multi-line text editor can be easily put as part of your TUI application.
|
Multi-line text editor can be easily put as part of your TUI application.
|
||||||
|
|
||||||
|
> Maintained fork notice: this repository is maintained under `srothgan/tui-textarea` to keep compatibility updates moving (including ratatui 0.30+ support and maintenance fixes).
|
||||||
|
|
||||||
**Features:**
|
**Features:**
|
||||||
|
|
||||||
- Multi-line text editor widget with basic operations (insert/delete characters, auto scrolling, ...)
|
- Multi-line text editor widget with basic operations (insert/delete characters, auto scrolling, ...)
|
||||||
@@ -146,7 +148,7 @@ Add `tui-textarea` crate to dependencies in your `Cargo.toml`. This enables cros
|
|||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ratatui = "*"
|
ratatui = "*"
|
||||||
tui-textarea = "*"
|
tui-textarea = { package = "tui-textarea-2", version = "*" }
|
||||||
```
|
```
|
||||||
|
|
||||||
If you need text search with regular expressions, enable `search` feature. It adds [regex crate][regex] as dependency.
|
If you need text search with regular expressions, enable `search` feature. It adds [regex crate][regex] as dependency.
|
||||||
@@ -154,7 +156,7 @@ If you need text search with regular expressions, enable `search` feature. It ad
|
|||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ratatui = "*"
|
ratatui = "*"
|
||||||
tui-textarea = { version = "*", features = ["search"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", features = ["search"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're using ratatui with [termion][] or [termwiz][], enable the `termion` or `termwiz` feature instead of
|
If you're using ratatui with [termion][] or [termwiz][], enable the `termion` or `termwiz` feature instead of
|
||||||
@@ -165,11 +167,11 @@ If you're using ratatui with [termion][] or [termwiz][], enable the `termion` or
|
|||||||
|
|
||||||
# For termion
|
# For termion
|
||||||
ratatui = { version = "*", default-features = false, features = ["termion"] }
|
ratatui = { version = "*", default-features = false, features = ["termion"] }
|
||||||
tui-textarea = { version = "*", default-features = false, features = ["termion"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", default-features = false, features = ["termion"] }
|
||||||
|
|
||||||
# For termwiz
|
# For termwiz
|
||||||
ratatui = { version = "*", default-features = false, features = ["termwiz"] }
|
ratatui = { version = "*", default-features = false, features = ["termwiz"] }
|
||||||
tui-textarea = { version = "*", default-features = false, features = ["termwiz"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", default-features = false, features = ["termwiz"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're using [tui-rs][] instead of [ratatui][], you need to enable features for using tui-rs crate and to disable
|
If you're using [tui-rs][] instead of [ratatui][], you need to enable features for using tui-rs crate and to disable
|
||||||
@@ -185,7 +187,7 @@ For example, when you want to use the combination of [tui-rs][] and [crossterm][
|
|||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tui = "*"
|
tui = "*"
|
||||||
tui-textarea = { version = "*", features = ["tuirs-crossterm"], default-features = false }
|
tui-textarea = { package = "tui-textarea-2", version = "*", features = ["tuirs-crossterm"], default-features = false }
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that [ratatui][] support and [tui-rs][] support are exclusive. When you use [tui-rs][] support, you must disable
|
Note that [ratatui][] support and [tui-rs][] support are exclusive. When you use [tui-rs][] support, you must disable
|
||||||
@@ -432,7 +434,7 @@ To use text search, `search` feature needs to be enabled in your `Cargo.toml`. I
|
|||||||
depending on `regex` crate until it is necessary.
|
depending on `regex` crate until it is necessary.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
tui-textarea = { version = "*", features = ["search"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", features = ["search"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Advanced Usage
|
## Advanced Usage
|
||||||
@@ -540,9 +542,9 @@ tui-textarea supports it as well. Please use `no-backend` feature for [ratatui][
|
|||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# For ratatui
|
# For ratatui
|
||||||
tui-textarea = { version = "*", default-features = false, features = ["no-backend"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", default-features = false, features = ["no-backend"] }
|
||||||
# For tui-rs
|
# For tui-rs
|
||||||
tui-textarea = { version = "*", default-features = false, features = ["tuirs-no-backend"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", default-features = false, features = ["tuirs-no-backend"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
`tui_textarea::Input` is a type for backend-agnostic key input. What you need to do is converting key event in your own
|
`tui_textarea::Input` is a type for backend-agnostic key input. What you need to do is converting key event in your own
|
||||||
@@ -649,7 +651,7 @@ This crate optionally supports [serde][] crate by enabling `serde` feature.
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tui-textarea = { version = "*", features = ["serde"] }
|
tui-textarea = { package = "tui-textarea-2", version = "*", features = ["serde"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
Values of the following types can be serialized/deserialized:
|
Values of the following types can be serialized/deserialized:
|
||||||
@@ -696,7 +698,7 @@ as follows:
|
|||||||
- Minor: Bump on breaking change
|
- Minor: Bump on breaking change
|
||||||
- Patch: Bump on new feature or bug fix
|
- Patch: Bump on new feature or bug fix
|
||||||
|
|
||||||
## Contributing to tui-textarea
|
## Contributing to tui-textarea-2
|
||||||
|
|
||||||
This project is developed [on GitHub][repo].
|
This project is developed [on GitHub][repo].
|
||||||
|
|
||||||
@@ -707,26 +709,25 @@ Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before reporting an issue or ma
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
tui-textarea is distributed under [The MIT License](./LICENSE.txt).
|
tui-textarea-2 is distributed under [The MIT License](./LICENSE.txt).
|
||||||
|
|
||||||
[crates-io-badge]: https://img.shields.io/crates/v/tui-textarea.svg
|
[crates-io-badge]: https://img.shields.io/crates/v/tui-textarea-2.svg
|
||||||
[crate]: https://crates.io/crates/tui-textarea
|
[crate]: https://crates.io/crates/tui-textarea-2
|
||||||
[doc-badge]: https://docs.rs/tui-textarea/badge.svg
|
[doc-badge]: https://docs.rs/tui-textarea-2/badge.svg
|
||||||
[doc]: https://docs.rs/tui-textarea/latest/tui_textarea/
|
[doc]: https://docs.rs/tui-textarea-2/latest/tui_textarea/
|
||||||
[ci-badge]: https://github.com/rhysd/tui-textarea/actions/workflows/ci.yml/badge.svg?event=push
|
[ci-badge]: https://github.com/srothgan/tui-textarea/actions/workflows/ci.yml/badge.svg?event=push
|
||||||
[ci]: https://github.com/rhysd/tui-textarea/actions/workflows/ci.yml
|
[ci]: https://github.com/srothgan/tui-textarea/actions/workflows/ci.yml
|
||||||
[codecov-badge]: https://codecov.io/gh/rhysd/tui-textarea/graph/badge.svg?token=YAA3EVRXAY
|
[codecov-badge]: https://codecov.io/gh/srothgan/tui-textarea/graph/badge.svg
|
||||||
[codecov]: https://codecov.io/gh/rhysd/tui-textarea
|
[codecov]: https://codecov.io/gh/srothgan/tui-textarea
|
||||||
[tui-rs]: https://github.com/fdehau/tui-rs
|
[tui-rs]: https://github.com/fdehau/tui-rs
|
||||||
[ratatui]: https://github.com/ratatui/ratatui
|
[ratatui]: https://github.com/ratatui/ratatui
|
||||||
[crossterm]: https://docs.rs/crossterm/latest/crossterm/
|
[crossterm]: https://docs.rs/crossterm/latest/crossterm/
|
||||||
[termion]: https://docs.rs/termion/latest/termion/
|
[termion]: https://docs.rs/termion/latest/termion/
|
||||||
[termwiz]: https://docs.rs/termwiz/latest/termwiz/
|
[termwiz]: https://docs.rs/termwiz/latest/termwiz/
|
||||||
[ratatui-backend]: https://docs.rs/ratatui/latest/ratatui/backend/trait.Backend.html
|
[ratatui-backend]: https://docs.rs/ratatui/latest/ratatui/backend/trait.Backend.html
|
||||||
[repo]: https://github.com/rhysd/tui-textarea
|
[repo]: https://github.com/srothgan/tui-textarea
|
||||||
[new-issue]: https://github.com/rhysd/tui-textarea/issues/new
|
[new-issue]: https://github.com/srothgan/tui-textarea/issues/new
|
||||||
[pulls]: https://github.com/rhysd/tui-textarea/pulls
|
[pulls]: https://github.com/srothgan/tui-textarea/pulls
|
||||||
[regex]: https://docs.rs/regex/latest/regex/
|
[regex]: https://docs.rs/regex/latest/regex/
|
||||||
[serde]: https://crates.io/crates/serde
|
[serde]: https://crates.io/crates/serde
|
||||||
[serde_json]: https://crates.io/crates/serde_json
|
[serde_json]: https://crates.io/crates/serde_json
|
||||||
> Maintained fork notice: this repository is maintained under `srothgan/tui-textarea` to keep compatibility updates moving (including ratatui 0.30+ support and maintenance fixes).
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ license = "MIT"
|
|||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tui-textarea = { path = "..", features = ["no-backend", "search"] }
|
tui-textarea = { package = "tui-textarea-2", path = "..", features = ["no-backend", "search"] }
|
||||||
ratatui = { version = "0.30.0", default-features = false }
|
ratatui = { version = "0.30.0", default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user