Skip to content

Commit

Permalink
Merge pull request #7 from salvo-rs/main
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
fankaiLiu authored Nov 10, 2023
2 parents c9f0a0a + 4140702 commit 9d7b514
Show file tree
Hide file tree
Showing 11 changed files with 284 additions and 95 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-rust:
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index
- name: Cache cargo build
uses: actions/cache@v1
with:
path: rust/target
key: ${{ runner.os }}-cargo-build-target
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Check code format
run: cargo fmt -- --check
- name: Check the package for errors
run: cargo check --all
- name: Lint rust sources
run: cargo clippy --all-targets --all-features --tests --benches -- -D warnings
- name: Run tests
run: RUST_BACKTRACE=1 cargo test --all-features -- --test-threads=1 --nocapture
- name: Generate docs
run: cargo doc --all-features --no-deps
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "salvo-cli"
version = "0.1.11"
version = "0.1.19"
edition = "2021"
authors = ["Fankai Liu [email protected]"]
keywords = ["salvo", "cli","template"]
Expand Down
95 changes: 83 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<div align="center">
<img alt="Savlo" width="132" src="https://p.sda1.dev/13/9268fb110f27611fa143c7aafbac61ab/monkeybread4352_a_technology_software_logo_for_windseabird_with_8fb4a0df-e233-414e-80a3-cf144ef44209.png" />
</div>
<div align="center">
<a href="https://github.com/salvo-rs/salvo-cli/actions">
<img alt="build status" src="https://github.com/salvo-rs/salvo-cli/actions/workflows/rust.yml/badge.svg?branch=main" />
</a>
<a href="https://crates.io/crates/salvo-cli">
<img alt="crates.io" src="https://img.shields.io/crates/v/salvo-cli" />
</a>
<a href="https://crates.io/crates/salvo-cli">
<img alt="Download" src="https://img.shields.io/crates/d/salvo-cli.svg" />
</a>
<img alt="License" src="https://img.shields.io/crates/l/salvo-cli.svg" />
</div>

# Salvo CLI
## Introduction

Salvo CLI is a command-line interface tool for the [Salvo](https://github.com/salvo-rs/salvo) web framework. It helps streamline the process of setting up a new Salvo project by generating a template structure.

Expand All @@ -8,32 +23,88 @@ Salvo CLI is a command-line interface tool for the [Salvo](https://github.com/sa
```bash
cargo install salvo-cli
```

## Usage

To create a new Salvo project, use the new command followed by the name of your project:

```bash
//use the local language
salvo-cli new project_name

// Use English
salvo-cli new project_name --lang=en

// 使用简体中文
salvo-cli new project_name --lang=zh

// 使用繁體中文
salvo-cli new project_name --lang=zh_TW

// Utilisez le français
salvo-cli new project_name --lang=fr

// 日本語を使用する
salvo-cli new project_name --lang=ja

// Usa el español
salvo-cli new project_name --lang=es

// Verwenden Sie Deutsch
salvo-cli new project_name --lang=de

// Используйте русский
salvo-cli new project_name --lang=ru

// Usa l `italiano
salvo-cli new project_name --lang=it
// Use o português
salvo-cli new project_name --lang=pt
// 한국어를 사용하십시오
salvo-cli new project_name --lang=ko
// Bruk norsk
salvo-cli new project_name --lang=no
// Notaðu íslensku
salvo-cli new project_name --lang=is
// Використовуйте українську
salvo-cli new project_name --lang=uk
// ใช้ภาษาไทย
salvo-cli new project_name --lang=th
// Χρησιμοποιήστε την ελληνική
salvo-cli new project_name --lang=el
// Brug dansk
salvo-cli new project_name --lang=da
```

## Update

```bashs
cargo install --force salvo-cli
```

### Feature Development Plan

| Status |Plan |
|:---:|:---:|
|| web api template |
|| web site with template |
||with sqlx template|
||basic midware |
||suport sqlite,pgsql,mysql|
||with seaorm template|
|| better web site |
|| with diesel template|
|| with Rbatis template|
| Status | Plan |
| :----: | :--------------------------------------------------------------------------------: |
|| web api template |
|| web site template |
|| Template with SQLx, SeaORM, Diesel, Rbatis (support for SQLite, PostgreSQL, MySQL) |
|| Basic middleware |
|| More middleware |
|| Support for MongoDB |

## License

This project is licensed under the MIT OR Apache-2.0 License.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
20 changes: 19 additions & 1 deletion locales/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,22 @@ select_db_type:
uk: виберіть тип бази даних
th: เลือกประเภทฐานข้อมูล
el: επιλέξτε τύπο βάσης δεδομένων
da: vælg databasetype
da: vælg databasetype
access_instructions:
en: After running it, you can access /login with the default username:zhangsan and password:123
zh_CN: 运行之后,您可以使用默认用户名:zhangsan和密码:123访问/login
zh_TW: 運行之後,您可以使用預設的使用者名稱:zhangsan和密碼:123來訪問/login
fr: Après l'avoir exécuté, vous pouvez accéder à /login avec le nom d'utilisateur par défaut:zhangsan et le mot de passe:123
ja: 実行した後、デフォルトのユーザー名:zhangsanとパスワード:123で/loginにアクセスできます
es: Después de ejecutarlo, puedes acceder a /login con el nombre de usuario predeterminado:zhangsan y la contraseña:123
de: Nach dem Ausführen können Sie sich mit dem Standard-Benutzernamen:zhangsan und Passwort:123 bei /login anmelden
ru: После запуска вы можете войти в /login с использованием стандартного имени пользователя:zhangsan и пароля:123
it: Dopo averlo eseguito, è possibile accedere a /login con il nome utente predefinito:zhangsan e la password:123
pt: Depois de executá-lo, você pode acessar /login com o nome de usuário padrão:zhangsan e a senha:123
ko: 실행한 후 기본 사용자 이름:zhangsan 및 비밀번호:123으로 /login에 접속할 수 있습니다
no: Etter at du har kjørt det, kan du få tilgang til /login med standard brukernavn:zhangsan og passord:123
is: Eftir að hafa keyrt það, getur þú notað /login með sjálfgefna notendanafnið:zhangsan og lykilorðið:123
uk: Після його запуску Ви можете отримати доступ до /login за допомогою стандартного імені користувача:zhangsan та пароля:123
th: หลังจากทำการรันแล้ว คุณสามารถเข้าถึง /login ด้วยชื่อผู้ใช้งานเริ่มต้น:zhangsan และรหัสผ่าน:123
el: Αφού το τρέξετε, μπορείτε να προσπελάσετε το /login με το προεπιλεγμένο όνομα χρήστη:zhangsan και τον κωδικό πρόσβασης:123
da: Efter du har kørt det, kan du få adgang til /login med standard brugernavn:zhangsan og adgangskode:123
Loading

0 comments on commit 9d7b514

Please sign in to comment.