[package]
name = "nanopub"
description = """
A cross-platform Rust library to sign Nanopublications, with bindings to Python and JS (wasm)
"""
repository = "https://github.com/vemonet/nanopub-rs/tree/main/lib"
version.workspace = true
authors.workspace = true
edition.workspace = true
readme.workspace = true
license-file.workspace = true
keywords.workspace = true
homepage.workspace = true
categories.workspace = true
# rust-version = "1.74"

[package.metadata.docs.rs]
all-features = true

[dependencies]
base64 = "0.22"
oxjsonld = "0.2"
oxrdf = { version = "0.3", features = ["serde"] }
oxttl = "0.2"
rsa = { version = "0.9.10", default-features = false, features = ["pem", "sha2"] }
regex = "1.10"
serde = { version = "1.0", features = ["derive"] }
chrono = "0.4.35"
reqwest = { version = "0.12", default-features = false }
rand = { version = "0.8", features = ["std", "std_rng"], default-features = false }
getrandom = { version = "0.2", features = ["js"] }
# openssl-probe = "0.1"

# reqwest = { version = "0.11", features = ["rustls-tls"], default-features = false }
# rand = { version = "0.8", features = ["std_rng"], default-features = false }
# log = { version = "0.0.2", features = ["std"] }
# futures = "0.3"
# sophia = { version = "0.8.0-alpha.3", git = "https://github.com/pchampin/sophia_rs.git", rev = "ec13628", features = ["jsonld"] }

[dev-dependencies]
wasm-pack = "0.13"
tokio = { version = "1.36", features = ["full"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
futures = "0.3"
# The JSON-LD parser uses futures::block_on which creates conflict when running in tokio runtime

# Do not use rustls-tls on Windows aarch64 due to Ring dependency https://github.com/briansmith/ring/issues/1167
[target.'cfg(all(windows, target_arch = "aarch64"))'.dependencies.reqwest]
version = "0.12"
default-features = false
features = ["native-tls"]

[target.'cfg(not(all(windows, target_arch = "aarch64")))'.dependencies.reqwest]
version = "0.12"
default-features = false
features = ["rustls-tls"]


[package.metadata.release]
pre-release-hook = ["git-cliff", "-o", "../CHANGELOG.md", "--tag", "{{version}}", "--workdir", "../"]

[package.metadata.git-cliff.git]
# NOTE: Add an exclamation mark in your commit message prefix to indicate a BREAKING change
# e.g. `feat!: changed things` or `feat(python)!: changed things`
# More details about the standard at https://www.conventionalcommits.org
commit_parsers = [
  { message = "^feat", group = "⛰️ Features" },
  { message = "^fix", group = "🐛 Bug Fixes" },
  { message = "^doc", group = "📚 Documentation" },
  { message = "^perf|DataOriented", group = "⚡ Performance" },
  { message = "^refactor", group = "🚜 Refactor" },
  { message = "^style|Formatting", group = "🎨 Styling" },
  { message = "^test", group = "🧪 Testing" },
  { message = "^ci", group = "⚙️ Continuous Integration" },
  { message = "^chore\\(release\\): prepare for", skip = true },
  { message = "^chore\\(deps\\)", skip = true },
  { message = "^chore\\(pr\\)", skip = true },
  { message = "^chore\\(pull\\)", skip = true },
  { message = "^chore", group = "🛠️ Miscellaneous Tasks" },
  { body = ".*security", group = "🛡️ Security" },
  { message = "^revert", group = "◀️ Revert" },
]
conventional_commits = true
filter_unconventional = false
split_commits = false
# Protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
filter_commits = false
tag_pattern = "v?[0-9].*"

# Sort the tags topologically
topo_order = false
sort_commits = "oldest"

# skip_tags = "0.1.0-beta.1"    # regex for skipping tags
# ignore_tags = ""  # regex for ignoring tags
# limit_commits = 42    # limit the number of commits included in the changelog.
# regex for preprocessing the commit messages:
# commit_preprocessors = [
#   # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers
# ]

[package.metadata.git-cliff.changelog]
header = """
# 📜 Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# Template for the changelog: https://keats.github.io/tera/docs
body = """
{% if version %}\
    {% if previous.version %}\
        ## [{{ version | trim_start_matches(pat="v") }}](<REPO>/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
    {% else %}\
        ## [{{ version | trim_start_matches(pat="v") }}](<REPO>/tree/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
    {% endif %}\
{% 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 | trim }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))\
    {% endfor %}
{% endfor %}\n
"""
trim = true
footer = """
<!-- generated by git-cliff -->
"""
postprocessors = [
  { pattern = '<REPO>', replace = "https://github.com/vemonet/nanopub-rs" },
]
