Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bar #1

Closed
wants to merge 144 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
2782ae1
feat(*): add empty common::stream
topheman Aug 30, 2023
b333877
feat(cli): begin cli implementation with clap
topheman Aug 30, 2023
3cb5a20
feat(snake): snake implementation from rsnake
topheman Sep 1, 2023
6034a22
feat(terminal): basic terminal key binding
topheman Sep 10, 2023
6bef31b
feat(terminal): basic serialization without event loop
topheman Sep 10, 2023
7b6f5bd
feat(*): serialize gamestate to json with serde
topheman Sep 12, 2023
81b7068
feat(*): accept initOptions from cli and serialize them on the very f…
topheman Sep 12, 2023
49f932e
feat(*): take --frame-duration in account
topheman Sep 19, 2023
1ccfdad
feat(*): take --width and --height in account
topheman Sep 19, 2023
9a7efbc
feat(*): read stdin from render command
topheman Sep 20, 2023
7b716a1
feat(*): stream::parse_gamestate()
topheman Sep 20, 2023
41da97a
feat(*): handle errors in stream::parse_gamestate()
topheman Sep 21, 2023
2fa21bc
fix(*): missing public fields
topheman Sep 21, 2023
a46a91e
chore(*): ignore render.out - temp working file
topheman Sep 21, 2023
0ac898c
feat(*): Raise error message - only for first parsed line - other lin…
topheman Sep 21, 2023
573226a
feat(*): setup throttle
topheman Sep 23, 2023
7154818
feat(*): serialize throttle's output
topheman Sep 30, 2023
e78665a
feat(*): basic render
topheman Oct 31, 2023
9518ba4
feat(*): render_frame
topheman Nov 17, 2023
575cb14
feat(*): better handle render in terminal
topheman Jan 21, 2024
d8b3cf5
feat(*): correct handling of cursor position
topheman Jan 21, 2024
4b5e905
feat(*): show cursor back on ctrl+c
topheman Jan 27, 2024
5a0db66
feat(*): dont leave rendered on ctrlc
topheman Jan 29, 2024
5325da4
feat(*): draw level limits
topheman Jan 29, 2024
de483f1
feat(*): default value of frame_duration at 120ms
topheman Jan 29, 2024
ed2af65
feat(*): stop print when GameState is Over/Paused + use enum GameState
topheman Jan 29, 2024
287313f
feat(*): display score
topheman Jan 29, 2024
ba1ced4
feat(*): fix passing different width / height
topheman Jan 30, 2024
ce2bb05
refactor(*): remove unused import
topheman Jan 31, 2024
ed90e21
feat(*): fix direction in gamestate
topheman Feb 1, 2024
b463a2d
feat(*): gix position and direction in gamestate
topheman Feb 1, 2024
a689dc4
feat(*): add state message
topheman Feb 1, 2024
5343750
feat(*): add --snake-length option
topheman Feb 1, 2024
cefeea7
feat(*): remove logging InitOptions at render startup
topheman Feb 1, 2024
949a349
feat(*): add restart capability
topheman Feb 2, 2024
2a498dd
refactor(*): cleanup
topheman Feb 2, 2024
64f6f5c
refactor(*): skip snake_length at serialization
topheman Feb 2, 2024
1fb8b03
docs(*): add README
topheman Feb 2, 2024
3f558dd
fix(#1): dont respond to ctrl+c on the render command, let the stdin …
topheman Feb 2, 2024
0fc042d
fix(#1): throttle and render now correctly exit and cleanup terminal …
topheman Feb 3, 2024
a1f0fb6
feat(*): exit with code 130 on ctrl+c on gamestate command
topheman Feb 3, 2024
39a5a7a
docs(*): add video
topheman Feb 3, 2024
d722977
docs(*): add RECORDING_NOTES.md
topheman Feb 3, 2024
8713997
feat(#2): print error when using unsupport --fit-terminal option
topheman Feb 3, 2024
bf81b00
feat(#2): support --fit-terminal option
topheman Feb 3, 2024
834bbb4
refactor(*): remove unused exitcode crate
topheman Feb 3, 2024
6af8f4d
refactor(*): rename bin from snake to snakepipe to avoid collisions
topheman Feb 5, 2024
5a67b6d
refactor(#6): remove workspaces
topheman Feb 11, 2024
6ca289f
feat(#6): add some metadata to Cargo.toml
topheman Feb 11, 2024
5a3ca7b
feat(#6): add #[doc(hidden)] on private modules
topheman Feb 12, 2024
ac2ca5c
chore(*): add missing metadata fields
topheman Feb 12, 2024
e171a1d
docs(*): fix docs in stream.rs
topheman Feb 12, 2024
893aeea
feat(#5): pass version through commands via stream
topheman Feb 12, 2024
ac5eb31
feat(#5): format version
topheman Feb 13, 2024
0d9cc47
docs(#5): update documentation
topheman Feb 13, 2024
df326f7
feat(#5): render versions
topheman Feb 13, 2024
29d41cd
docs(#8): update README.md
topheman Feb 14, 2024
fdcf760
docs(#8): add docs about lib
topheman Feb 14, 2024
c3f8196
Update demo video in README.md
topheman Feb 14, 2024
6f4572f
bump to version 0.2.0
topheman Feb 14, 2024
e49a020
fix(#10): removed .unwrap from Stream::new - now cargo test is green …
topheman Feb 15, 2024
e65a3c7
chore(#14): setup github actions
topheman Feb 15, 2024
2a52e26
chore(*): update name of github workflow
topheman Feb 15, 2024
985a9a9
docs(*): add CI badge
topheman Feb 15, 2024
be9af81
bump to version 1.0.0
topheman Feb 15, 2024
ad87bf8
docs(*): add link to how to install rust
topheman Feb 16, 2024
9bd3409
feat(#17): render controls hints in one line
topheman Feb 17, 2024
4b3f862
feat(#17): add metadatas field
topheman Feb 17, 2024
b796976
feat(#17): prepare render of metadatas
topheman Feb 17, 2024
57afe61
feat(#17): render metadatas
topheman Feb 17, 2024
a12e30e
feat(#19): add --loop-infinite flag to throttle command
topheman Feb 17, 2024
bbba1a5
bump version to 1.1.0
topheman Feb 17, 2024
d44f5f4
docs(*): update README.md
topheman Feb 17, 2024
a152165
docs(*): update README.md with infos about mirroring
topheman Feb 21, 2024
e92df93
docs(*): add reference to snake-pipe-node
topheman Feb 25, 2024
0406e4b
refactor(#22): rename mod stream to input
topheman Feb 21, 2024
115886d
docs(#26): add reference to snake-pipe-node
topheman Feb 25, 2024
6f6679d
feat(#26): prepare render_browser module
topheman Feb 19, 2024
027f35c
feat(#26): setup basic actix-web on render-browser command
topheman Feb 19, 2024
babe9ff
feat(#26): bundle /static into binary and serve it
topheman Feb 19, 2024
96767cc
feat(#26): pass stdin before launch_server
topheman Feb 21, 2024
706eb8b
feat(#26): connect server sent events
topheman Feb 21, 2024
0c76a2a
feat(#26): prepare the JavaScript par of sse
topheman Feb 22, 2024
106cbef
feat(#26): better and simplier handle of ctrl+c shutdown
topheman Feb 22, 2024
9ba2c7a
feat(#26): basic js renderer on sse
topheman Feb 22, 2024
758030d
feat(#26): multiple js renderers possible thanks to abstraction
topheman Feb 23, 2024
7704385
fix(#26): correctly prepare buffer with width and height
topheman Feb 23, 2024
a80240d
feat(#26): add some css
topheman Feb 23, 2024
9900011
fix(#26): no more overflow on x,y
topheman Feb 23, 2024
b4e67be
feat(#26): render version/score on sse
topheman Feb 23, 2024
a1ffe46
feat(#25): minimal reproducible code
topheman Feb 25, 2024
96a7697
feat(#26): take port in account to launch the sse server
topheman Feb 25, 2024
a279d4f
feat(#26): add sse server location on render
topheman Feb 25, 2024
73924d8
docs(#26): add docs for snakepipe render-browser
topheman Feb 25, 2024
1fdccb0
feat(#28): setup base for stream-sse command
topheman Feb 26, 2024
79c9523
chore(#28): install reqwest and reqwest-eventsource
topheman Feb 26, 2024
14ec4e6
feat(#28): stream-sse implementation not awaited
topheman Feb 26, 2024
d36c45c
feat(#28): stream-sse working - fixed /init-options endpoint which wa…
topheman Feb 27, 2024
7e6c645
feat(*): listen on 0.0.0.0 instead on 127.0.0.1 to be available on th…
topheman Feb 27, 2024
8c03efd
docs(#28): documentation for stream-sse command
topheman Feb 27, 2024
174e4f2
feat(#28): pr feedback
topheman Feb 27, 2024
c58efa8
feat(#29): better descriptions on cli commands
topheman Feb 27, 2024
b5a8f61
feat(#32): pipeline command
topheman Feb 28, 2024
45cd1d3
feat(#32): pipeline --list
topheman Feb 28, 2024
b10d907
feat(#32): format output of pipilines with owo-colors
topheman Feb 29, 2024
754fa9d
feat(#32): cleanup
topheman Feb 29, 2024
2337be3
docs(*): add motivation section
topheman Feb 29, 2024
a3dd410
docs(#32): Update README about the pipeline command
topheman Feb 29, 2024
dc3626c
feat(#31): resolve local-ip and pass it to stdout
topheman Feb 29, 2024
4fcb698
feat(#31): add qrcode on render-browser
topheman Feb 29, 2024
6ac4205
docs(*): README.md for next version
topheman Mar 2, 2024
f9e0746
feat(#38): init node part
topheman Mar 1, 2024
db564c4
feat(#38): setup build step for node-helpers
topheman Mar 1, 2024
4ba122d
feat(#38): prepare asyncGenerator for node-helpers
topheman Mar 1, 2024
ea97ecc
chore(#38): install fastify
topheman Mar 1, 2024
1f860e5
refactor(#38)
topheman Mar 1, 2024
3597bef
feat(#38): plug fastify and sse
topheman Mar 1, 2024
daf2a0d
feat(#38): fix multiple subscribers to a generator
topheman Mar 1, 2024
f1c3549
refactor
topheman Mar 1, 2024
384fd1f
chore(#38): install last version of snakepipe (node)
topheman Mar 1, 2024
8826c93
docs(#38): add CONTRIBUTING.md
topheman Mar 2, 2024
c1c3310
feat(#38): support localIp for dev-server-sse + switch to type=module
topheman Mar 2, 2024
1bb2b85
feat(#38): mix EventEmitter with AsyncGenerator to accept multiple co…
topheman Mar 2, 2024
2e68d21
docs(#38): update CONTRIBUTING.md
topheman Mar 2, 2024
d060e43
feat(#38): feedback PR
topheman Mar 2, 2024
b08319a
feat(#36): add a zoom slider
topheman Mar 3, 2024
fa1f797
feat(#36): better style for the qrcode part
topheman Mar 3, 2024
f5b514f
feat(#46): check if port is available before launching render-browser
topheman Mar 3, 2024
86726e9
feat(#18): generate QrCode from location.origin or renderBrowerHost
topheman Mar 6, 2024
c4a7b81
refactor(*): feedback review from @Mouvedia
topheman Mar 2, 2024
4c2bb58
fix(*): correct docs - unix socket are not yet supported
topheman Mar 2, 2024
9004d35
docs(*): update contributing section of README.md
topheman Mar 2, 2024
db78e00
chore(#50): prepare MacOS intel/arm compilation
topheman Mar 3, 2024
ccb5537
docs: remove mention of next version
topheman Mar 8, 2024
7ed882a
bump to v2.0.0
topheman Mar 8, 2024
9c9c8a7
refactor: feedback review 2 from @Mouvedia
topheman Mar 9, 2024
fbfe821
chore(#50): create workflow inspired of https://github.com/Timmmm/rus…
topheman Mar 4, 2024
73fa0c6
chore(#50): adapt workflow
topheman Mar 4, 2024
1a47689
chore(#50): compress artefacts in .tar.gz and upload them
topheman Mar 8, 2024
b807d5f
chore(#50): add target x86_64-unknown-linux-gnu on github actions
topheman Mar 8, 2024
58b0714
refactor(#50): rename cross-compile-macos.yml into cross-compile.yml
topheman Mar 9, 2024
7164f45
feat(#50): calculate sha256
topheman Mar 9, 2024
d939f2b
docs(#50): update PUBLISHING.md
topheman Mar 10, 2024
8141986
docs(#50): update README.md
topheman Mar 10, 2024
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
53 changes: 53 additions & 0 deletions .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# inspired by https://github.com/Timmmm/rust_cross_compile_demo/blob/master/.github/workflows/build.yaml
name: Cross-Compile

on: [push]

env:
CARGO_TERM_COLOR: always

jobs:
build:
if: github.actor == 'topheman' && contains(github.event.head_commit.message, 'cross-compile-all')
runs-on: ubuntu-latest

steps:

- name: Set up MacOS Cross Compiler
uses: Timmmm/setup-osxcross@v2
with:
osx-version: "12.3"

- name: Install Rustup targets
run: rustup target add x86_64-unknown-linux-gnu x86_64-apple-darwin aarch64-apple-darwin

- name: Check out source code
uses: actions/checkout@v3

- name: Check
run: cargo check

- name: Build
run: cargo build --release --target x86_64-unknown-linux-gnu --target x86_64-apple-darwin --target aarch64-apple-darwin

- name: Compress
run: |
(cd target/x86_64-unknown-linux-gnu/release && tar -cvf snakepipe-x86_64-unknown-linux-gnu.tar.gz snakepipe && mv snakepipe-x86_64-unknown-linux-gnu.tar.gz ../../..)
(cd target/x86_64-apple-darwin/release && tar -cvf snakepipe-x86_64-apple-darwin.tar.gz snakepipe && mv snakepipe-x86_64-apple-darwin.tar.gz ../../..)
(cd target/aarch64-apple-darwin/release && tar -cvf snakepipe-aarch64-apple-darwin.tar.gz snakepipe && mv snakepipe-aarch64-apple-darwin.tar.gz ../../..)

- name: Calculate sha256
run: |
shasum -a 256 snakepipe-x86_64-unknown-linux-gnu.tar.gz >> sha256.txt
shasum -a 256 snakepipe-x86_64-apple-darwin.tar.gz >> sha256.txt
shasum -a 256 snakepipe-aarch64-apple-darwin.tar.gz >> sha256.txt

- name: Upload Binaries
uses: actions/upload-artifact@v3
with:
name: binaries
path: |
snakepipe-x86_64-unknown-linux-gnu.tar.gz
snakepipe-x86_64-apple-darwin.tar.gz
snakepipe-aarch64-apple-darwin.tar.gz
sha256.txt
18 changes: 18 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# rust
/target
render.out

# nodejs
node_modules
dist
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"skellock.just"
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing

This is a rust project, but you can contribute as a rust developer as much as a JavaScript developer.

## Rust

You will find your way in the the source code: [`./src`](./src/).

To build the project:

```sh
cargo build
```

To run:

```sh
./target/debug/snakepipe # will show the help - you can use it is explained in the README
```

## JavaScript

The [`snakepipe render-browser`](./README.md#-you-can-mirror-your-playing-terminal-into-another-one-through-http) command launches a rust http server that serves some JavaScript code that connects to server-sent events and renders the game inside the browser.

The source code for the renderers is available at [`static/renderers`](static/renderers).

**You don't need rust to work on this part**. I made a nodejs development server that acts as the `snakepipe render-browser` command (that way, you also don't have to re-build the rust part each time you modify the frontend).

### Install

```sh
npm install
```

### Setup

Build the packages and retrieve a recorded party.

```sh
npm run build && npm run setup
```

### Run

```sh
npm run dev-server-sse
```

Go to [http://localhost:8080](http://localhost:8080).
Loading