Skip to content
Merged

Next #34

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:

- uses: oven-sh/setup-bun@v2.0.2

- run: make install

- run: make build

- run: npx semantic-release
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:

- uses: oven-sh/setup-bun@v2.0.2

- run: make install
- run: make lint
- run: make test

- uses: codacy/codacy-coverage-reporter-action@v1.3.0
Expand Down
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Node dependencies
node_modules
coverage
dist

.DS_Store
# System files
.DS_Store

# Environment files
.env
.env.local
.env.*.local

# Editor/IDE settings
.idea
.vscode

# Logs and build info
*.log

# Test and cache outputs
coverage
5 changes: 4 additions & 1 deletion .husky/commit-msg
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
npx --no -- commitlint --edit $1
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
4 changes: 3 additions & 1 deletion .husky/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
make lint
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

make test
10 changes: 0 additions & 10 deletions .markdownlintrc

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"singleQuote": true,
"printWidth": 140
"printWidth": 140,
"overrides": [{ "files": ".*rc", "options": { "parser": "json" } }]
}
9 changes: 9 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"branches": ["main"],
"plugins": [
["@semantic-release/commit-analyzer", { "preset": "conventionalcommits" }],
["@semantic-release/release-notes-generator", { "preset": "conventionalcommits" }],
"@semantic-release/git",
"@semantic-release/github"
]
}
41 changes: 0 additions & 41 deletions .releaserc.cjs

This file was deleted.

30 changes: 30 additions & 0 deletions .scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# Fail on any error, unset variable, or failed pipe
set -euo pipefail

# Fetch and prune remote-tracking branches
git fetch --prune

# Collect local branches whose upstream is gone
git branch -vv | awk '/: gone]/{print $1}' > .git/branches-to-delete || true

if [ -s .git/branches-to-delete ]; then
current_branch="$(git rev-parse --abbrev-ref HEAD)"
while read -r b; do
if [ "${b}" != "${current_branch}" ]; then
git branch -D "${b}" || true
else
echo "Skipping current branch: ${b}"
fi
done < .git/branches-to-delete
else
echo "No local branches to delete"
fi

rm -rf .git/branches-to-delete || true

# Cleanup build artifacts and deps
rm -rf dist node_modules coverage || true

exit 0
31 changes: 31 additions & 0 deletions .scripts/drawio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

# Fail on any error, unset variable, or failed pipe
set -euo pipefail

# Locate draw.io / diagrams.net executable if DRAWIO_CMD not set
if [ -z "${DRAWIO_CMD:-}" ]; then
if [ -x "/mnt/c/Program Files/draw.io/draw.io.exe" ]; then
DRAWIO_CMD="/mnt/c/Program Files/draw.io/draw.io.exe"
elif [ -x "/Applications/draw.io.app/Contents/MacOS/draw.io" ]; then
DRAWIO_CMD="/Applications/draw.io.app/Contents/MacOS/draw.io"
elif [ -x "/Applications/diagrams.net.app/Contents/MacOS/diagrams.net" ]; then
DRAWIO_CMD="/Applications/diagrams.net.app/Contents/MacOS/diagrams.net"
elif command -v draw.io >/dev/null 2>&1; then
DRAWIO_CMD="$(command -v draw.io)"
elif command -v diagrams.net >/dev/null 2>&1; then
DRAWIO_CMD="$(command -v diagrams.net)"
else
DRAWIO_CMD=""
fi
fi

if [ -z "${DRAWIO_CMD}" ]; then
echo "draw.io/diagrams.net not found. Install it or set DRAWIO_CMD environment variable."
exit 1
fi

# Export all .drawio files to PNG in docs/assets
"${DRAWIO_CMD}" -x -o docs/assets --transparent -f png docs/assets/drawio/*.drawio

exit 0
39 changes: 7 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ DEFAULT_GOAL := build

install:
bun install --no-audit --no-fund

lint:
npx eslint . --fix
npx markdownlint --fix "**/*.md" -i node_modules

lint: install
npx eslint . --ext .js,.ts,.json,.md --fix
npx prettier --write "**/*.md" "**/*.json" "**/*.ts" --log-level warn
npx tsc --noEmit

Expand All @@ -22,33 +21,9 @@ update:
bun install --no-audit --no-fund

drawio:
@if [ -z "$(DRAWIO_CMD)" ]; then \
if [ -x "/mnt/c/Program Files/draw.io/draw.io.exe" ]; then DRAWIO_CMD="/mnt/c/Program Files/draw.io/draw.io.exe"; \
elif [ -x "/Applications/draw.io.app/Contents/MacOS/draw.io" ]; then DRAWIO_CMD="/Applications/draw.io.app/Contents/MacOS/draw.io"; \
elif [ -x "/Applications/diagrams.net.app/Contents/MacOS/diagrams.net" ]; then DRAWIO_CMD="/Applications/diagrams.net.app/Contents/MacOS/diagrams.net"; \
elif command -v draw.io >/dev/null 2>&1; then DRAWIO_CMD="$$(command -v draw.io)"; \
elif command -v diagrams.net >/dev/null 2>&1; then DRAWIO_CMD="$$(command -v diagrams.net)"; \
else DRAWIO_CMD=""; fi; \
fi; \
if [ -z "$$DRAWIO_CMD" ]; then \
echo "draw.io/diagrams.net not found. Install it or set DRAWIO_CMD environment variable."; \
exit 1; \
fi; \
"$$DRAWIO_CMD" -x -o docs/assets --transparent -f png docs/assets/drawio/*.drawio
@chmod +x .scripts/drawio.sh || true
@.scripts/drawio.sh

clean:
@git fetch --prune
@git branch -vv | awk '/: gone]/{print $$1}' > .git/branches-to-delete || true
@if [ -s .git/branches-to-delete ]; then \
while read b; do \
if [ "$$b" != "$(shell git rev-parse --abbrev-ref HEAD)" ]; then \
git branch -D $$b || true; \
else \
echo "Skipping current branch: $$b"; \
fi; \
done < .git/branches-to-delete; \
else \
echo "No local branches to delete"; \
fi;
@rm -Rf .git/branches-to-delete || true
@rm -Rf dist node_modules coverage || true
@chmod +x .scripts/clean.sh || true
@.scripts/clean.sh
Loading