Skip to content

Commit

Permalink
Input module Rewrite (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonPost authored Nov 18, 2019
1 parent bf51821 commit f597cfd
Show file tree
Hide file tree
Showing 46 changed files with 2,976 additions and 3,031 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/crossterm_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,23 @@ jobs:
- name: Test all features
run: cargo test --all-features --no-default-features -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test cursor Feature
- name: Test cursor feature
run: cargo test --features cursor --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test style Feature
- name: Test style feature
run: cargo test --features style --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test terminal Feature
- name: Test terminal feature
run: cargo test --features terminal --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test screen Feature
- name: Test screen feature
run: cargo test --features screen --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test input Feature
run: cargo test --features input --no-default-features --lib -- --nocapture --test-threads 1
- name: Test event feature
run: cargo test --features event --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test async-event feature
run: cargo test --features event-stream --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test Packaging
if: matrix.rust == 'stable'
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ script:
- cargo test --features style --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features terminal --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features screen --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features input --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features event --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features event-stream --no-default-features --lib -- --nocapture --test-threads 1
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Version Master

- `queue!` & `execute!` macros allow trailing comma

- Replace the `input` module with brand new `event` module
- It's **highly recommended** to read the
[Upgrade from 0.13 to 0.14](https://github.com/crossterm-rs/crossterm/wiki/Upgrade-from-0.13-to-0.14)
documentation
* Replace `docs/UPGRADE.md` with the [Upgrade Paths](https://github.com/crossterm-rs/crossterm/wiki#upgrade-paths)
documentation

# Version 0.13.3

- Remove thread from AsyncReader on Windows.
Expand Down
28 changes: 21 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,40 @@ readme = "README.md"
edition = "2018"
categories = ["command-line-interface", "command-line-utilities"]

[lib]
name = "crossterm"
path = "src/lib.rs"

[package.metadata.docs.rs]
all-features = true

[features]
default = ["cursor", "style", "terminal", "screen", "input"]
cursor = ["lazy_static", "input", "winapi/wincon", "winapi/winnt", "winapi/minwindef"]
default = ["cursor", "style", "terminal", "screen", "event"]
cursor = ["lazy_static", "event", "winapi/wincon", "winapi/winnt", "winapi/minwindef"]
style = ["lazy_static", "winapi/wincon"]
terminal = ["cursor"]
screen = ["lazy_static", "winapi/wincon", "winapi/minwindef"]
input = ["mio", "lazy_static", "screen", "winapi/winnt", "winapi/winuser"]
event = ["bitflags", "mio", "lazy_static", "parking_lot", "screen", "terminal", "winapi/winnt", "winapi/winuser", "winapi/wincon", "winapi/synchapi", "winapi/namedpipeapi", "winapi/impl-default"]
event-stream = ["event", "futures"]

[dependencies]
bitflags = { version = "1.2", optional = true }
lazy_static = { version = "1.4", optional = true }
parking_lot = { version = "0.9", optional = true }
serde = { version = "1.0.0", features = ["derive"], optional = true }
futures = {version = "0.3", optional = true }

[target.'cfg(windows)'.dependencies]
winapi = "0.3.8"
crossterm_winapi = "0.4.0"
crossterm_winapi = { git = "https://github.com/crossterm-rs/crossterm-winapi", branch = "input_rewrite_changes" }

[target.'cfg(unix)'.dependencies]
libc = "0.2.51"
mio = { version = "0.6.19", optional = true }
signal-hook = { version = "0.1.11", features=["mio-support"]}

[lib]
name = "crossterm"
path = "src/lib.rs"
[dev-dependencies]
tokio = "0.2.0-alpha.6"
futures = "0.3"
futures-timer = "2"
async-std = "1"
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ see [Tested Terminals](#tested-terminals) for more info).

## Note on Migration

You may have noticed that Crossterm has been [changing](https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md) very quickly with the latest versions.
We have done a lot of API-breaking changes by renaming functions, commands, changing the exports, improving the encapsulation, etc..
However, all of this happens to improve the library and make it better and ready for a possible [1.0 release](#287).
We want to stick to the [Command API](https://docs.rs/crossterm/#command-api) and remove all other ways to use crossterm.
You may have noticed that Crossterm has been
[changing](https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md) very quickly with the latest versions.
We have done a lot of API-breaking changes by renaming functions, commands, changing the exports,
improving the encapsulation, etc. However, all of this happens to improve the library and make it better
and ready for a possible [1.0 release](#287). We want to stick to the
[Command API](https://docs.rs/crossterm/#command-api) and remove all other ways to use crossterm.
Try to use this API and change your code accordingly.
This way you will survive or overcome major migration problems ;).

We hope you can understand this, feel free to ask around in [discord](https://discord.gg/K4nyTDB) if you have questions. For up-to-date examples, have a look at the [examples](https://github.com/crossterm-rs/examples/tree/master) repository. Sorry for the inconvenience.
We hope you can understand this, feel free to ask around in [discord](https://discord.gg/K4nyTDB) if you have
questions. For up-to-date examples, have a look at the [examples](https://github.com/crossterm-rs/examples/tree/master)
repository. Sorry for the inconvenience.

> It's highly recommended to read the
> [Upgrade from 0.13 to 0.14](https://github.com/crossterm-rs/crossterm/wiki/Upgrade-from-0.13-to-0.14)
> documentation, which explains everything you need to know.
## Table of Contents

Expand Down
Loading

0 comments on commit f597cfd

Please sign in to comment.