-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure git-cliff, release-plz, dependabot, and mergify
- Loading branch information
1 parent
37f304b
commit 260188d
Showing
12 changed files
with
289 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for Cargo | ||
- package-ecosystem: cargo | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pull_request_rules: | ||
- name: Automatic merge for Dependabot pull requests | ||
conditions: | ||
- author=dependabot[bot] | ||
actions: | ||
merge: | ||
method: squash | ||
|
||
- name: Automatic update to the main branch for pull requests | ||
conditions: | ||
- -conflict # skip PRs with conflicts | ||
- -draft # skip GH draft PRs | ||
- -author=dependabot[bot] # skip dependabot PRs | ||
actions: | ||
update: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Continuous Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-plz: | ||
name: Release-plz | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.RELEASE_PLZ_TOKEN }} | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Run release-plz | ||
uses: MarcoIeni/release-plz-action@v0.5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,90 @@ | ||
# leptos_form | ||
# leptos_form: Derive leptos forms from rust structs | ||
|
||
<div align="center"> | ||
<!-- CI --> | ||
<img src="https://github.com/tlowerison/leptos_form/CI/badge.svg" /> | ||
<!-- codecov --> | ||
<img src="https://codecov.io/gh/tlowerison/leptos_form/branch/main/graph/badge.svg" /> | ||
<!-- Crates version --> | ||
<a href="https://crates.io/crates/leptos_form"> | ||
<img src="https://img.shields.io/crates/v/leptos_form.svg?style=flat-square" | ||
alt="Crates.io version" /> | ||
</a> | ||
<!-- Downloads --> | ||
<a href="https://crates.io/crates/leptos_form"> | ||
<img src="https://img.shields.io/crates/d/leptos_form.svg?style=flat-square" | ||
alt="Download" /> | ||
</a> | ||
<!-- docs.rs docs --> | ||
<a href="https://docs.rs/leptos_form"> | ||
<img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" | ||
alt="docs.rs docs" /> | ||
</a> | ||
<a href="https://github.com/rust-secure-code/safety-dance/"> | ||
<img src="https://img.shields.io/badge/unsafe-forbidden-success.svg?style=flat-square" | ||
alt="Unsafe Rust forbidden" /> | ||
</a> | ||
</div> | ||
|
||
## Documentation | ||
|
||
* [Docs](https://docs.rs/leptos_form) | ||
* [GitHub repository](https://github.com/tlowerison/leptos_form) | ||
* [Cargo package](https://crates.io/crates/leptos_form) | ||
|
||
## Features | ||
|
||
* Automatic form parsing -- focus on how your data is represented and not on how to get it in and out of html | ||
* Easy specification of label and input classes, great for Tailwind integration | ||
* Labels are derived from struct fields and can be given form-wide casing | ||
* DOM layout customization through attributes | ||
* Integration with popular crates | ||
|
||
## Crate features | ||
|
||
This crate offers the following features, all of which are not activated by default: | ||
|
||
- `bigdecimal`: Provides impls for [`BigDecimal`](https://docs.rs/bigdecimal/latest/bigdecimal/struct.BigDecimal.html) | ||
- `chrono`: Provides impls for [`DateTime`](https://docs.rs/chrono/latest/chrono/struct.DateTime.html), [`NaiveDate`](https://docs.rs/chrono/latest/chrono/naive/struct.NaiveDate.html), [`NaiveDateTime`](https://docs.rs/chrono/latest/chrono/naive/struct.NaiveDateTime.html) | ||
- `num-bigint`: Provides impls for [`BigInt`](https://docs.rs/num-bigint/latest/num_bigint/struct.BigInt.html) and [`BigUint`](https://docs.rs/num-bigint/latest/num_bigint/struct.BigUint.html) | ||
- `uuid`: Provides impls for [`Uuid`](https://docs.rs/uuid/latest/uuid/struct.Uuid.html) | ||
|
||
## Example | ||
|
||
```rust | ||
mod my_crate { | ||
use leptos::*; | ||
use leptos_form::prelude::*; | ||
use serde::*; | ||
|
||
#[derive(Clone, Debug, Default, Deserialize, Form, Serialize)] | ||
#[form( | ||
component( | ||
action = create_my_data(my_data), | ||
submit = view!(<input type="button" value="Submit" />), | ||
on_success = |DbMyData { id, .. }, _| view!(<div>{format!("Created {id}")}</div>), | ||
reset_on_success, | ||
), | ||
label(wrap(class = "my-class", rename_all = "Title Case")), | ||
)] | ||
pub struct MyData { | ||
pub my_name: String, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct DbMyData { | ||
pub id: i32, | ||
pub name: String, | ||
} | ||
|
||
#[component] | ||
pub fn MyComponent() -> impl IntoView { | ||
view!(<MyData initial={MyData::default()} />) | ||
} | ||
|
||
#[server] | ||
async fn create_my_data(my_data: MyData) -> Result<DbMyData, ServerFnError> { | ||
todo!() | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# git-cliff ~ default configuration file | ||
# https://git-cliff.org/docs/configuration | ||
# | ||
# Lines starting with "#" are comments. | ||
# Configuration options are organized into tables and keys. | ||
# See documentation for more information on available options. | ||
|
||
[changelog] | ||
# changelog header | ||
header = """ | ||
# Changelog\n | ||
All notable changes to this project will be documented in this file.\n | ||
""" | ||
# template for the changelog body | ||
# https://keats.github.io/tera/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
# remove the leading and trailing whitespace from the template | ||
trim = true | ||
# changelog footer | ||
footer = """ | ||
<!-- generated by git-cliff --> | ||
""" | ||
# postprocessors | ||
postprocessors = [ | ||
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL | ||
] | ||
[git] | ||
# parse the commits based on https://www.conventionalcommits.org | ||
conventional_commits = true | ||
# filter out the commits that are not conventional | ||
filter_unconventional = true | ||
# process each line of a commit as an individual commit | ||
split_commits = false | ||
# regex for preprocessing the commit messages | ||
commit_preprocessors = [ | ||
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers | ||
] | ||
# regex for parsing and grouping commits | ||
commit_parsers = [ | ||
{ message = "^feat", group = "Features" }, | ||
{ message = "^fix", group = "Bug Fixes" }, | ||
{ message = "^doc", group = "Documentation" }, | ||
{ message = "^perf", group = "Performance" }, | ||
{ message = "^refactor", group = "Refactor" }, | ||
{ message = "^style", group = "Styling" }, | ||
{ message = "^test", group = "Testing" }, | ||
{ message = "^chore\\(release\\): prepare for", skip = true }, | ||
{ message = "^chore\\(deps\\)", skip = true }, | ||
{ message = "^chore\\(pr\\)", skip = true }, | ||
{ message = "^chore\\(pull\\)", skip = true }, | ||
{ message = "^chore|ci", group = "Miscellaneous Tasks" }, | ||
{ body = ".*security", group = "Security" }, | ||
{ message = "^revert", group = "Revert" }, | ||
] | ||
# protect breaking changes from being skipped due to matching a skipping commit_parser | ||
protect_breaking_commits = false | ||
# filter out the commits that are not matched by commit parsers | ||
filter_commits = false | ||
# regex for matching git tags | ||
tag_pattern = "v[0-9].*" | ||
|
||
# regex for skipping tags | ||
skip_tags = "v0.1.0-beta.1" | ||
# regex for ignoring tags | ||
ignore_tags = "" | ||
# sort the tags topologically | ||
topo_order = false | ||
# sort the commits inside sections by oldest/newest order | ||
sort_commits = "oldest" | ||
# limit the number of commits included in the changelog. | ||
# limit_commits = 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
Oops, something went wrong.