From 0908847026b4a2ca91d04941b8c4a0d4ade9d5d4 Mon Sep 17 00:00:00 2001 From: "Max P." Date: Sun, 12 Oct 2025 14:37:23 +0200 Subject: [PATCH] chore: add basic project --- .gitea/workflows/ci.yml | 46 +++++++++++++ .gitea/workflows/release.yml | 18 +++++ .gitignore | 2 + .vscode/settings.json | 6 ++ cliff.toml | 123 +++++++++++++++++++++++++++++++++++ deno.jsonc | 68 +++++++++++++++++++ deno.lock | 68 +++++++++++++++++++ 7 files changed, 331 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 cliff.toml create mode 100644 deno.jsonc create mode 100644 deno.lock diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..e067cfc --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: + - "*" + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: denoland/setup-deno@v1 + with: + deno-version: v2.x + + - name: Format + id: format + continue-on-error: true + run: deno task make fmt + + - name: Lint + id: lint + continue-on-error: true + run: deno task make lint + + - name: Test + id: test + continue-on-error: true + run: deno task make test + + - name: Fail if any step failed + if: | + steps.format.outcome != 'success' || + steps.lint.outcome != 'success' || + steps.test.outcome != 'success' + run: | + echo "::error::One or more steps failed" + exit 1 diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..8a3cac8 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,18 @@ +name: Auto Changelog & (Release) + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Release + uses: https://git.0xmax42.io/actions/auto-changelog-release-action@v1 + with: + token: ${{ secrets.RELEASE_PUBLISH_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d4d68c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.deno-make.json +.coverage/**/* diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1c39d41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "exportall.config.folderListener": [ + "/src/btrfs/interfaces", + "/src/btrfs/utils" + ] +} \ No newline at end of file diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..091e98e --- /dev/null +++ b/cliff.toml @@ -0,0 +1,123 @@ +# CLIFF_VERSION=2.10.1 +# 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. +[remote.gitea] +owner = "maxp" +repo = "docker-vbtrfs-plugin" + +[changelog] +# postprocessors +postprocessors = [ + { pattern = '', replace = "https://git.0xmax42.io" }, # replace gitea url +] + +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" + +body = """ +{%- macro remote_url() -%} + /{{ remote.gitea.owner }}/{{ remote.gitea.repo }} +{%- endmacro -%} + +{%- macro indent(text, prefix=" ") -%} + {%- set lines = text | split(pat="\n") -%} + {%- for l in lines -%} + {{ prefix ~ l }}{% if not loop.last %}{{ "\n" }}{% endif %} + {%- endfor -%} +{%- endmacro -%} + +{% if version %}\ + {% if previous.version %}\ + ## [{{ version | trim_start_matches(pat="v") }}]\ + ({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} + {% else %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + {% endif %}\ +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }}\n + {% for commit in commits %}\ + {% if commit.merge_commit %}\ + - ๐Ÿ”€ **{{ commit.message | upper_first }}** - \ + ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.body %}\n{{ self::indent(text=commit.body, prefix=" ") }}{% endif %}\ + {% if commit.extra and commit.extra.children %}\ + {% for child in commit.extra.children %} + {{ " " | safe }}- {% if child.extra.mismatch_type %}**{{ child.extra.mismatch_type }}**:{% endif %}{% if child.scope %}*({{ child.scope }})* {% endif %}\ + {% if child.breaking %}[**breaking**] {% endif %}\ + {{ child.message | upper_first }} - \ + ([{{ child.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ child.id }}))\ + {% endfor %}\ + {% endif %}\ + {% else %}\ + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | upper_first }} - \ + ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% endif %} + {% endfor %}\ +{% endfor %}\n +""" +footer = """ + +""" + +# remove the leading and trailing s +trim = true + +# render body even when there are no releases to process +# render_always = true +# output file path +# output = "test.md" + +[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 = [ + # Replace issue numbers + #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, + # Check spelling of the commit with https://github.com/crate-ci/typos + # If the spelling is incorrect, it will be automatically fixed. + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, +] +# 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\\(changelog\\)", skip = true }, + { message = "^chore\\(version\\)", skip = true }, + { 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" }, + { message = ".*", group = "๐Ÿ’ผ Other" }, +] +# Regex to select git tags that represent releases. +tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+" +# filter out the commits that are not matched by commit parsers +filter_commits = false +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "newest" diff --git a/deno.jsonc b/deno.jsonc new file mode 100644 index 0000000..537340e --- /dev/null +++ b/deno.jsonc @@ -0,0 +1,68 @@ +{ + "tasks": { + "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno https://git.0xmax42.io/maxp/deno_make/raw/branch/main/mod.ts $0" + }, + "+tasks": { + "start": { + "task": "deno run src/mod.ts", + "deno": { + "run": { + "permissions": { + "all": true + } + } + } + }, + "test": { + "task": "deno test **/__tests__/*.test.ts", + "deno": { + "test": { + "permissions": { + "all": true + }, + "coverage": "./.coverage" + } + } + }, + "fmt": { + "task": "deno fmt", + "deno": { + "fmt": { + "check": true + } + } + }, + "lint": { + "task": "deno lint", + "deno": { + "lint": { } + } + }, + "ci": { + "task": "deno task make fmt && deno task make lint && deno task make test", + "description": "For local CI checks" + } + }, + "compilerOptions": { }, + "fmt": { + "useTabs": false, + "lineWidth": 80, + "indentWidth": 4, + "semiColons": true, + "singleQuote": true, + "proseWrap": "preserve", + "include": [ + "src/", + "mod.ts" + ] + }, + "exclude": [ ], + "imports": { + "@logtape/logtape": "jsr:@logtape/logtape@^1.1.1", + "@logtape/pretty": "jsr:@logtape/pretty@^1.1.1", + "@std/assert": "jsr:@std/assert@1.0.15", + "@std/testing": "jsr:@std/testing@1.0.16", + "@std/path": "jsr:@std/path@1.1.2", + "HttpKernel/": "https://git.0xmax42.io/maxp/HttpKernel/raw/tag/v0.2.0/src/" + } +} \ No newline at end of file diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..d2c0e5f --- /dev/null +++ b/deno.lock @@ -0,0 +1,68 @@ +{ + "version": "5", + "specifiers": { + "jsr:@logtape/logtape@^1.1.1": "1.1.1", + "jsr:@logtape/pretty@^1.1.1": "1.1.1", + "jsr:@std/assert@1.0.15": "1.0.15", + "jsr:@std/assert@^1.0.15": "1.0.15", + "jsr:@std/internal@^1.0.10": "1.0.12", + "jsr:@std/internal@^1.0.12": "1.0.12", + "jsr:@std/path@1.1.2": "1.1.2", + "jsr:@std/testing@1.0.16": "1.0.16", + "npm:@types/node@24.0.7": "24.0.7" + }, + "jsr": { + "@logtape/logtape@1.1.1": { + "integrity": "65ebc4ae58238f7404d96b52112293279b1d256c578621a750e793c36e34c3d2" + }, + "@logtape/pretty@1.1.1": { + "integrity": "250029d3d86e7d4a1824b40c21f3f8712823596ca23bf82b6c800db25c7b2e88", + "dependencies": [ + "jsr:@logtape/logtape", + "npm:@types/node" + ] + }, + "@std/assert@1.0.15": { + "integrity": "d64018e951dbdfab9777335ecdb000c0b4e3df036984083be219ce5941e4703b", + "dependencies": [ + "jsr:@std/internal@^1.0.12" + ] + }, + "@std/internal@1.0.12": { + "integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027" + }, + "@std/path@1.1.2": { + "integrity": "c0b13b97dfe06546d5e16bf3966b1cadf92e1cc83e56ba5476ad8b498d9e3038", + "dependencies": [ + "jsr:@std/internal@^1.0.10" + ] + }, + "@std/testing@1.0.16": { + "integrity": "a917ffdeb5924c9be436dc78bc32e511760e14d3a96e49c607fc5ecca86d0092", + "dependencies": [ + "jsr:@std/assert@^1.0.15", + "jsr:@std/internal@^1.0.12" + ] + } + }, + "npm": { + "@types/node@24.0.7": { + "integrity": "sha512-YIEUUr4yf8q8oQoXPpSlnvKNVKDQlPMWrmOcgzoduo7kvA2UF0/BwJ/eMKFTiTtkNL17I0M6Xe2tvwFU7be6iw==", + "dependencies": [ + "undici-types" + ] + }, + "undici-types@7.8.0": { + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@logtape/logtape@^1.1.1", + "jsr:@logtape/pretty@^1.1.1", + "jsr:@std/assert@1.0.15", + "jsr:@std/path@1.1.2", + "jsr:@std/testing@1.0.16" + ] + } +}