Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/zino-rs/zino
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Aug 23, 2024
2 parents a884aec + 26c516c commit e5de66b
Show file tree
Hide file tree
Showing 11 changed files with 618 additions and 515 deletions.
2 changes: 2 additions & 0 deletions zino-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ name = "zli"
path = "src/main.rs"

[dependencies]
env_logger = "0.11.5"
git2 = "0.19.0"
include_dir = "0.7.4"
log = "0.4.22"
taplo = "0.13.0"
toml_edit = "0.22.20"
regex = "1.10.6"
walkdir = "2.5.0"

[dependencies.axum]
Expand Down
29 changes: 29 additions & 0 deletions zino-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,32 @@
CLI tools for [`zino`].

[`zino`]: https://github.com/zino-rs/zino

## Features
- **Project Initialization**: Quickly set up new `zino` projects.
- **Dependency Management**: Manage your project dependencies with ease.

## Installation
```sh
cargo install zino-cli
```

## Usage

### Create a new project
```sh
zli new <project_name>
```
options:
- `--template <template_url>`: Use a custom template for the project.

### Init project in current directory
```sh
zli init
```
options:
- `--template <template_url>`: Use a custom template for the project.
- `--project-name <project_name>`: Name of the project (current_dir by default).

### Manage dependencies
run `zli serve` and access http://localhost:6080/zino-config.html in your browser.
17 changes: 15 additions & 2 deletions zino-cli/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,35 @@
font-family: Arial, sans-serif;
text-align: center;
padding-top: 50px;
background-color: #f8f9fa;
color: #343a40;
}
h1 {
font-size: 3em;
margin-bottom: 20px;
}
.message {
margin: 20px;
font-size: 1.2em;
}
a {
color: #007BFF;
text-decoration: none;
padding: 10px 20px;
border: 1px solid #007BFF;
border-radius: 5px;
transition: background-color 0.3s, color 0.3s;
}
a:hover {
text-decoration: underline;
background-color: #007BFF;
color: #fff;
text-decoration: none;
}
</style>
</head>
<body>
<h1>404 Page Not Found</h1>
<p class="message">Sorry, the page you are looking for is not found.</p>
<p class="message">Access <a href="/zino-config.html">this page</a> to set the configuration for your project.</p>
<p class="message">Access <a href="/zino-config.html">zino-config page</a> to set the configuration for your project.</p>
</body>
</html>
184 changes: 184 additions & 0 deletions zino-cli/public/zino-config.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
body, html {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
}

.top-bar {
background-color: #007bff;
color: white;
padding: 20px;
text-align: center;
height: 18%;
}

.top-bar h1 {
margin-top: 1%;
font-size: 32px;
}

.main-content {
display: flex;
flex: 1;
overflow: hidden;
}

input[type="text"] {
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 4px;
width: 61.8%;
box-sizing: border-box;
font-size: 18px;
}

input[type="text"]:focus {
border-color: #007bff;
outline: none;
}

.cargoTomlBlock {
display: flex;
flex-direction: column;
width: 30.9%;
}

.cargoTomlDescription {
display: flex;
align-items: center;
justify-content: center;
height: 10%;
background-color: #f0f0f0;
color: #333;
font-size: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}

.textarea-container {
display: flex;
height: 100%;
width: 100%;
position: relative;
overflow: hidden;
}

.textarea-container .lineNumber {
white-space: pre;
display: flex;
flex-direction: column;
position: absolute;
left: 0;
width: 20px;
height: 100%;
padding: 2px;
text-align: center;
color: #007bff;
font-family: monospace;
font-size: 14px;
line-height: 1.5;
pointer-events: none;
}

.cargoTomlTextArea {
height: 100%;
width: 100%;
font-family: Consolas, monospace;
white-space: pre;
background-color: #f3f4f6;
color: #333;
padding-left: 30px;
line-height: 1.5;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border: none;
border-radius: 8px;
box-sizing: border-box;
overflow-x: auto;
overflow-y: scroll;
font-size: 14px;
}

#config-form-block {
display: flex;
flex-direction: column;
padding: 20px;
width: 38.2%;
height: auto;
overflow-y: auto;
}

.config-form {
display: flex;
flex-direction: column;
padding: 20px;
border-top: #007bff 2px solid;
}

.config-form form {
display: flex;
flex-direction: column;
gap: 10px;
}

.config-form .form-description {
font-size: 32px;
color: #007bff;
margin-bottom: 20px;
}

.config-form button:hover {
background-color: #0056b3;
}

.closet {
margin-bottom: 10px;
}

.closet .option-title {
font-size: 24px;
color: black;
margin-bottom: 8px;
}

.option-group {
font-size: 24px;
color: #8d8f91;
border-color: #0056b3;
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-left: 15%;
}

.option-group div {
cursor: pointer;
border-bottom: 2px solid grey;
}

.option-group div.checked {
font-size: 25px;
color: #14161a;
border-color: #0056b3;
border-bottom: 2px solid #007bff;
}

#save-config {
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
cursor: pointer;
width: 61.8%;
margin-left: 19.1%;
}

.hidden {
display: none;
}
Loading

0 comments on commit e5de66b

Please sign in to comment.