Skip to content

Commit

Permalink
feat: initial implement
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Jan 8, 2024
1 parent 8dec3a9 commit 697b763
Show file tree
Hide file tree
Showing 98 changed files with 8,211 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
pull_request:
types: [opened, synchronize]

env:
CARGO_TERM_COLOR: always

jobs:
build_and_test:
name: Build And Test
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
rustup update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
rustup component add clippy
rustup component add rustfmt
- run: cargo build --verbose
- run: cargo test --verbose
- run: cargo clippy --verbose
- run: cargo fmt --all --check
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- main
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.GH_RELEASER_APP_ID }}
private-key: ${{ secrets.GH_RELEASER_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Setup
run: |
rustup update stable
rustup default stable
- uses: MarcoIeni/release-plz-action@ee94617706bd1bf1c6760be56f71c26b9185cac8 # v0.5.34
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
69 changes: 69 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
### OSX ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk
Expand Down
Empty file added CHANGELOG.md
Empty file.
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Contributing

We are always welcoming your contribution :clap:

---

<p align="center">
<strong><a href="#requirements">Requirements</a></strong>
|
<strong><a href="#setup">Setup</a></strong>
|
<strong><a href="#running-lintingtests">Running linting/tests</a></strong>
</p>

---

## Developing

### Requirements

- [rust-clippy](https://github.com/rust-lang/rust-clippy)
- [cargo-insta](https://crates.io/crates/cargo-insta)

### Setup

Fork the `promptuity` repository to your GitHub Account.

Then, run:

```bash
$ git clone https://github.com/<your-github-username>/promptuity
$ cd promptuity
```

### Running linting/tests

You can run test via:

```bash
$ cargo test
```

When new snapshots are generated by `insta`, a review is conducted.

```bash
$ cargo insta review
```

<details>
<summary>Test Workflow</summary>

```bash
$ cargo test; cargo insta review
```
</details>

You can run lint via:

```bash
$ cargo clippy
```
24 changes: 24 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "promptuity"
version = "0.0.1"
description = "Promptuity is a library that provides interactive prompts."
edition = "2021"
license = "MIT"
readme = "README.md"
authors = ["wadackel <[email protected]>"]
keywords = ["cli", "ask", "prompt", "interactive", "console", "cui"]
categories = ["command-line-interface", "command-line-utilities"]
repository = "https://github.com/wadackel/promptuity"
homepage = "https://github.com/wadackel/promptuity"
documentation = "https://docs.rs/promptuity"

[dependencies]
crossterm = "0.27.0"
thiserror = "1.0.50"
unicode-width = "0.1.11"

[dev-dependencies]
fuzzy-matcher = "0.3.7"
indicatif = "0.17.7"
insta = "1.34.0"
pretty_assertions = "1.4.0"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 wadackel.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 697b763

Please sign in to comment.