Compare commits
12 Commits
v0.0.2
...
703da324fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
703da324fa
|
|||
|
1dae472253
|
|||
|
09fdfb88cd
|
|||
|
04b63cc7e2
|
|||
|
cb6a35606d
|
|||
|
9c9f3ba3b7
|
|||
|
08dda2b2cb
|
|||
|
059129a738
|
|||
|
437c9f4a25
|
|||
|
48bf447ce1
|
|||
|
548fa4f0a1
|
|||
|
|
642cca30ad |
@@ -13,16 +13,12 @@
|
|||||||
"markdown": {},
|
"markdown": {},
|
||||||
"toml": {},
|
"toml": {},
|
||||||
"dockerfile": {},
|
"dockerfile": {},
|
||||||
"ruff": {},
|
|
||||||
"jupyter": {},
|
|
||||||
"malva": {},
|
|
||||||
"markup": {
|
"markup": {
|
||||||
// https://dprint.dev/plugins/markup_fmt/config/
|
// https://dprint.dev/plugins/markup_fmt/config/
|
||||||
"scriptIndent": true,
|
"scriptIndent": true,
|
||||||
"styleIndent": true,
|
"styleIndent": true,
|
||||||
},
|
},
|
||||||
"yaml": {},
|
"yaml": {},
|
||||||
"graphql": {},
|
|
||||||
"exec": {
|
"exec": {
|
||||||
"cwd": "${configDir}",
|
"cwd": "${configDir}",
|
||||||
"commands": [
|
"commands": [
|
||||||
@@ -53,13 +49,8 @@
|
|||||||
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
|
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
|
||||||
"https://plugins.dprint.dev/toml-0.7.0.wasm",
|
"https://plugins.dprint.dev/toml-0.7.0.wasm",
|
||||||
"https://plugins.dprint.dev/dockerfile-0.3.3.wasm",
|
"https://plugins.dprint.dev/dockerfile-0.3.3.wasm",
|
||||||
"https://plugins.dprint.dev/ruff-0.6.11.wasm",
|
|
||||||
"https://plugins.dprint.dev/jupyter-0.2.1.wasm",
|
|
||||||
"https://plugins.dprint.dev/g-plane/malva-v0.15.1.wasm",
|
|
||||||
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.25.3.wasm",
|
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.25.3.wasm",
|
||||||
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
|
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
|
||||||
"https://plugins.dprint.dev/g-plane/pretty_graphql-v0.2.3.wasm",
|
|
||||||
"https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364",
|
"https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364",
|
||||||
"https://plugins.dprint.dev/biome-0.11.10.wasm",
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
28
.gitea/scripts/build.sh
Executable file
28
.gitea/scripts/build.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
mkdir -p app/static
|
||||||
|
|
||||||
|
cp CHANGELOG.md app/static/CHANGELOG.md
|
||||||
|
|
||||||
|
cat >app/static/git.json <<EOF
|
||||||
|
{
|
||||||
|
"ref": "${GITEA_REF:-}",
|
||||||
|
"ref_name": "${GITEA_REF_NAME:-}",
|
||||||
|
"ref_type": "${GITEA_REF_TYPE:-}",
|
||||||
|
"sha": "${GITEA_SHA:-}",
|
||||||
|
"run_number": "${GITEA_RUN_NUMBER:-}",
|
||||||
|
"server_url": "${GITEA_SERVER_URL:-}",
|
||||||
|
"event_name": "${GITEA_EVENT_NAME:-}",
|
||||||
|
"workflow": "${GITEA_WORKFLOW:-}",
|
||||||
|
"job": "${GITEA_JOB:-}",
|
||||||
|
"commit_message": "${GITEA_COMMIT_MESSAGE:-}",
|
||||||
|
"commit_timestamp": "${GITEA_COMMIT_TIMESTAMP:-}",
|
||||||
|
"branch": "${GITEA_HEAD_REF:-}",
|
||||||
|
"base_branch": "${GITEA_BASE_REF:-}"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
cp -R packages/ui/build app/build/ui
|
||||||
16
.gitea/scripts/ci-checks.sh
Executable file
16
.gitea/scripts/ci-checks.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
pnpm lint &
|
||||||
|
LINT_PID=$!
|
||||||
|
pnpm format:check &
|
||||||
|
FORMAT_PID=$!
|
||||||
|
pnpm check &
|
||||||
|
TYPE_PID=$!
|
||||||
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" pnpm test &
|
||||||
|
TEST_PID=$!
|
||||||
|
|
||||||
|
wait $LINT_PID
|
||||||
|
wait $FORMAT_PID
|
||||||
|
wait $TYPE_PID
|
||||||
|
wait $TEST_PID
|
||||||
@@ -33,7 +33,20 @@ find . -name package.json ! -path "*/node_modules/*" | while read file; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
# 3. Update CHANGELOG.md (prepend)
|
# 3. Generate commit list since last release
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Get the previous tag (fallback to empty if none)
|
||||||
|
LAST_TAG=$(git tag --sort=-creatordate | grep -v "^$TAG$" | head -n 1 || echo "")
|
||||||
|
|
||||||
|
if [ -n "$LAST_TAG" ]; then
|
||||||
|
COMMITS=$(git log "$LAST_TAG"..HEAD --pretty=format:'[%h](https://git.max-richter.dev/max/nodarium/commit/%H) %s')
|
||||||
|
else
|
||||||
|
COMMITS=$(git log HEAD --pretty=format:'[%h](https://git.max-richter.dev/max/nodarium/commit/%H) %s')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# 4. Update CHANGELOG.md (prepend)
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
tmp_changelog="CHANGELOG.tmp"
|
tmp_changelog="CHANGELOG.tmp"
|
||||||
@@ -42,6 +55,11 @@ tmp_changelog="CHANGELOG.tmp"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "$NOTES"
|
echo "$NOTES"
|
||||||
echo ""
|
echo ""
|
||||||
|
if [ -n "$COMMITS" ]; then
|
||||||
|
echo "All Commits:"
|
||||||
|
echo "$COMMITS"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
echo "---"
|
echo "---"
|
||||||
echo ""
|
echo ""
|
||||||
if [ -f CHANGELOG.md ]; then
|
if [ -f CHANGELOG.md ]; then
|
||||||
@@ -54,7 +72,7 @@ mv "$tmp_changelog" CHANGELOG.md
|
|||||||
pnpm exec dprint fmt CHANGELOG.md
|
pnpm exec dprint fmt CHANGELOG.md
|
||||||
|
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
# 4. Create release commit
|
# 5. Create release commit
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
git config user.name "release-bot"
|
git config user.name "release-bot"
|
||||||
@@ -71,7 +89,7 @@ fi
|
|||||||
git commit -m "chore(release): $TAG"
|
git commit -m "chore(release): $TAG"
|
||||||
|
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
# 5. Push changes
|
# 6. Push changes
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
git push origin main
|
git push origin main
|
||||||
|
|||||||
43
.gitea/scripts/deploy-files.sh
Executable file
43
.gitea/scripts/deploy-files.sh
Executable file
@@ -0,0 +1,43 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
echo "Configuring rclone"
|
||||||
|
|
||||||
|
KEY_FILE="$(mktemp)"
|
||||||
|
echo "${SSH_PRIVATE_KEY}" >"${KEY_FILE}"
|
||||||
|
chmod 600 "${KEY_FILE}"
|
||||||
|
|
||||||
|
mkdir -p ~/.config/rclone
|
||||||
|
cat >~/.config/rclone/rclone.conf <<EOF
|
||||||
|
[sftp-remote]
|
||||||
|
type = sftp
|
||||||
|
host = ${SSH_HOST}
|
||||||
|
user = ${SSH_USER}
|
||||||
|
port = ${SSH_PORT}
|
||||||
|
key_file = ${KEY_FILE}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [[ "${GITHUB_REF_TYPE:-}" == "tag" ]]; then
|
||||||
|
TARGET_DIR="${REMOTE_DIR}"
|
||||||
|
elif [[ "${GITHUB_EVENT_NAME:-}" == "pull_request" ]]; then
|
||||||
|
SAFE_PR_NAME="${GITHUB_HEAD_REF//\//-}"
|
||||||
|
TARGET_DIR="${REMOTE_DIR}_${SAFE_PR_NAME}"
|
||||||
|
elif [[ "${GITHUB_REF_NAME:-}" == "main" ]]; then
|
||||||
|
TARGET_DIR="${REMOTE_DIR}_main"
|
||||||
|
else
|
||||||
|
SAFE_REF="${GITHUB_REF_NAME//\//-}"
|
||||||
|
TARGET_DIR="${REMOTE_DIR}_${SAFE_REF}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Deploying to ${TARGET_DIR}"
|
||||||
|
|
||||||
|
rclone sync \
|
||||||
|
--update \
|
||||||
|
--verbose \
|
||||||
|
--progress \
|
||||||
|
--exclude _astro/** \
|
||||||
|
--stats 2s \
|
||||||
|
--stats-one-line \
|
||||||
|
--transfers 4 \
|
||||||
|
./app/build/ \
|
||||||
|
"sftp-remote:${TARGET_DIR}"
|
||||||
40
.gitea/workflows/build-ci-image.yaml
Normal file
40
.gitea/workflows/build-ci-image.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Build & Push CI Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "Dockerfile.ci"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Prepare Metadata
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed -e 's|https://||' -e 's|http://||')
|
||||||
|
|
||||||
|
REPO_POSTFIXED=$(echo "${{ gitea.repository }}-ci" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
echo "registry=$REGISTRY_HOST" >> $GITHUB_OUTPUT
|
||||||
|
echo "repo_path=$REPO_POSTFIXED" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ steps.meta.outputs.registry }}
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile.ci
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ steps.meta.outputs.registry }}/${{ steps.meta.outputs.repo_path }}:latest
|
||||||
|
${{ steps.meta.outputs.registry }}/${{ steps.meta.outputs.repo_path }}:${{ github.sha }}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: 🚀 Release
|
name: 🚀 Lint & Test & Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,6 +9,8 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
PNPM_CACHE_FOLDER: ~/.pnpm-store
|
PNPM_CACHE_FOLDER: ~/.pnpm-store
|
||||||
|
CARGO_HOME: ~/.cargo
|
||||||
|
CARGO_TARGET_DIR: target
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -20,7 +22,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
- name: 💾 Setup pnpm Cache
|
- name: 💾 Setup pnpm Cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -30,55 +32,45 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pnpm-
|
${{ runner.os }}-pnpm-
|
||||||
|
|
||||||
|
- name: 🦀 Cache Cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
- name: 📦 Install Dependencies
|
- name: 📦 Install Dependencies
|
||||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||||
|
|
||||||
- name: 🧹 Lint
|
- name: 🧹 Quality Control
|
||||||
run: pnpm lint
|
run: ./.gitea/scripts/ci-checks.sh
|
||||||
|
|
||||||
- name: 🎨 Format Check
|
|
||||||
run: pnpm format:check
|
|
||||||
|
|
||||||
- name: 🧬 Type Check
|
|
||||||
run: pnpm check
|
|
||||||
|
|
||||||
- name: 🛠️ Build
|
- name: 🛠️ Build
|
||||||
run: pnpm build:deploy
|
run: ./.gitea/scripts/build.sh
|
||||||
|
|
||||||
- name: 🔬 Tests
|
|
||||||
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" pnpm test
|
|
||||||
|
|
||||||
- name: 🚀 Create Release Commit
|
- name: 🚀 Create Release Commit
|
||||||
if: github.ref_type == 'tag'
|
if: gitea.ref_type == 'tag'
|
||||||
run: ./.gitea/scripts/create-release.sh
|
run: ./.gitea/scripts/create-release.sh
|
||||||
|
|
||||||
- name: 🏷️ Create Gitea Release
|
- name: 🏷️ Create Gitea Release
|
||||||
if: github.ref_type == 'tag'
|
if: gitea.ref_type == 'tag'
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ gitea.ref_name }}
|
||||||
release_name: Release ${{ github.ref_name }}
|
release_name: Release ${{ gitea.ref_name }}
|
||||||
body_path: CHANGELOG.md
|
body_path: CHANGELOG.md
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
- name: 🔑 Configure rclone
|
- name: 🚀 Deploy Changed Files via rclone
|
||||||
if: github.ref_type == 'tag'
|
run: ./.gitea/scripts/deploy-files.sh
|
||||||
run: |
|
|
||||||
echo "$SSH_PRIVATE_KEY" > /tmp/id_rsa
|
|
||||||
chmod 600 /tmp/id_rsa
|
|
||||||
mkdir -p ~/.config/rclone
|
|
||||||
echo -e "[sftp-remote]\ntype = sftp\nhost = ${SSH_HOST}\nuser = ${SSH_USER}\nport = ${SSH_PORT}\nkey_file = /tmp/id_rsa" > ~/.config/rclone/rclone.conf
|
|
||||||
env:
|
env:
|
||||||
|
REMOTE_DIR: ${{ vars.REMOTE_DIR }}
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
SSH_HOST: ${{ vars.SSH_HOST }}
|
SSH_HOST: ${{ vars.SSH_HOST }}
|
||||||
SSH_PORT: ${{ vars.SSH_PORT }}
|
SSH_PORT: ${{ vars.SSH_PORT }}
|
||||||
SSH_USER: ${{ vars.SSH_USER }}
|
SSH_USER: ${{ vars.SSH_USER }}
|
||||||
|
|
||||||
- name: 🚀 Deploy Changed Files via rclone
|
|
||||||
if: github.ref_type == 'tag'
|
|
||||||
run: |
|
|
||||||
echo "Uploading the rest"
|
|
||||||
rclone sync --update -v --progress --exclude _astro/** --stats 2s --stats-one-line ./app/build/ sftp-remote:${REMOTE_DIR} --transfers 4
|
|
||||||
env:
|
|
||||||
REMOTE_DIR: ${{ vars.REMOTE_DIR }}
|
|
||||||
|
|||||||
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,14 +1,8 @@
|
|||||||
## v0.0.2 (2026-02-03)
|
## v0.0.2 (2026-02-04)
|
||||||
|
|
||||||
fix(ci): actually deploy on tags
|
fix(ci): actually deploy on tags
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## v0.0.2 (2026-02-03)
|
|
||||||
|
|
||||||
fix(app): correctly handle false value in settings
|
fix(app): correctly handle false value in settings
|
||||||
|
-> This caused a bug where random seed could not be false.
|
||||||
This caused a bug where random seed could not be false.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
29
Dockerfile
29
Dockerfile
@@ -1,29 +0,0 @@
|
|||||||
# FROM jacoblincool/playwright:chromium-light
|
|
||||||
FROM jacoblincool/playwright:firefox
|
|
||||||
|
|
||||||
# RUN apk add --no-cache curl git jq g++ make
|
|
||||||
RUN apt update && apt install -y curl git jq g++ make \
|
|
||||||
libgl1-mesa-dri \
|
|
||||||
libglapi-mesa \
|
|
||||||
libosmesa6 \
|
|
||||||
mesa-utils \
|
|
||||||
xvfb \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Set Rust paths
|
|
||||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
|
||||||
CARGO_HOME=/usr/local/cargo \
|
|
||||||
PATH=/usr/local/cargo/bin:$PATH
|
|
||||||
|
|
||||||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
|
||||||
|
|
||||||
# Install Rust, wasm target, and pnpm
|
|
||||||
RUN curl --silent --show-error --location --fail --retry 3 \
|
|
||||||
--proto '=https' --tlsv1.2 \
|
|
||||||
--output /tmp/rustup-init.sh https://sh.rustup.rs \
|
|
||||||
&& sh /tmp/rustup-init.sh -y --no-modify-path --profile minimal \
|
|
||||||
&& rm /tmp/rustup-init.sh \
|
|
||||||
&& rustup target add wasm32-unknown-unknown \
|
|
||||||
&& rm -rf /usr/local/rustup/toolchains/*/share/doc \
|
|
||||||
&& npm i -g pnpm \
|
|
||||||
&& pnpx playwright install firefox
|
|
||||||
28
Dockerfile.ci
Normal file
28
Dockerfile.ci
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
FROM node:25-bookworm-slim
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
jq \
|
||||||
|
g++ \
|
||||||
|
make \
|
||||||
|
rclone \
|
||||||
|
libglapi-mesa \
|
||||||
|
libosmesa6 \
|
||||||
|
xvfb
|
||||||
|
|
||||||
|
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||||
|
CARGO_HOME=/usr/local/cargo \
|
||||||
|
PATH=/usr/local/cargo/bin:$PATH
|
||||||
|
|
||||||
|
RUN curl --silent --show-error --location --fail --retry 3 \
|
||||||
|
--proto '=https' --tlsv1.2 \
|
||||||
|
--output /tmp/rustup-init.sh https://sh.rustup.rs \
|
||||||
|
&& sh /tmp/rustup-init.sh -y --no-modify-path --profile minimal \
|
||||||
|
&& rm /tmp/rustup-init.sh \
|
||||||
|
&& rustup target add wasm32-unknown-unknown \
|
||||||
|
&& rm -rf /usr/local/rustup/toolchains/*/share/doc \
|
||||||
|
&& npm i -g pnpm \
|
||||||
|
&& pnpx playwright install-deps \
|
||||||
|
&& pnpx playwright install --with-deps firefox \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 42 KiB |
@@ -56,6 +56,10 @@
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(inputValue) && node.type === 'vec3') {
|
||||||
|
return inputValue;
|
||||||
|
}
|
||||||
|
|
||||||
// If the component is supplied with a default value use that
|
// If the component is supplied with a default value use that
|
||||||
if (inputValue !== undefined && typeof inputValue !== 'object') {
|
if (inputValue !== undefined && typeof inputValue !== 'object') {
|
||||||
return inputValue;
|
return inputValue;
|
||||||
|
|||||||
79
app/src/lib/sidebar/panels/Changelog.svelte
Normal file
79
app/src/lib/sidebar/panels/Changelog.svelte
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
type Change = { type: string; content: string };
|
||||||
|
|
||||||
|
async function fetchChangelog() {
|
||||||
|
const res = await fetch('/CHANGELOG.md');
|
||||||
|
return await res.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
const typeMap: Record<string, string> = {
|
||||||
|
fix: 'bg-layer-2 bg-red-800',
|
||||||
|
feat: 'bg-layer-2 bg-green-800',
|
||||||
|
chore: 'bg-layer-2 bg-gray-800',
|
||||||
|
docs: 'bg-layer-2 bg-blue-800',
|
||||||
|
refactor: 'bg-layer-2 bg-purple-800',
|
||||||
|
default: 'bg-layer-2 text-text'
|
||||||
|
};
|
||||||
|
|
||||||
|
function parseChangelog(md: string) {
|
||||||
|
const lines = md.split('\n');
|
||||||
|
const parsed: (string | Change)[] = [];
|
||||||
|
|
||||||
|
for (let line of lines) {
|
||||||
|
line = line.trim();
|
||||||
|
if (!line) continue;
|
||||||
|
|
||||||
|
if (line === '---') {
|
||||||
|
parsed.push({ type: 'hr', content: '' });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Headers
|
||||||
|
if (line.startsWith('## ')) {
|
||||||
|
parsed.push(line.replace('## ', ''));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit type
|
||||||
|
const match = line.match(/^(fix|feat|chore|docs|refactor)(\(|:)/i);
|
||||||
|
if (match) {
|
||||||
|
parsed.push({ type: match[1].toLowerCase(), content: line });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other lines
|
||||||
|
parsed.push({ type: 'default', content: line });
|
||||||
|
}
|
||||||
|
|
||||||
|
let lastLine = parsed.at(-1);
|
||||||
|
if (lastLine !== undefined && typeof lastLine !== 'string' && lastLine.type === 'hr') {
|
||||||
|
parsed.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return parsed;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="p-4 font-mono text-text">
|
||||||
|
{#await fetchChangelog()}
|
||||||
|
<p>Loading...</p>
|
||||||
|
{:then md}
|
||||||
|
{#each parseChangelog(md) as item (item)}
|
||||||
|
{#if typeof item === 'string'}
|
||||||
|
<h2 class="text-xl font-semibold mt-4 mb-4 text-layer-1">{item}</h2>
|
||||||
|
{:else if item.type === 'hr'}
|
||||||
|
<p></p>
|
||||||
|
{:else}
|
||||||
|
<p class="px-3 py-1 mb-1 leading-8 border-b-1 border-b-outline last:border-b-0">
|
||||||
|
{#if item.type !== 'default'}
|
||||||
|
<span class="p-1 rounded-sm font-semibold {typeMap[item.type]}">
|
||||||
|
{item.content.split(':')[0]}
|
||||||
|
</span> {item.content.split(':').slice(1).join(':').trim()}
|
||||||
|
{:else}
|
||||||
|
{item.content}
|
||||||
|
{/if}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
{/await}
|
||||||
|
</div>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
{
|
{
|
||||||
...g,
|
...g,
|
||||||
nodes: g.nodes.map((n: object) => ({ ...n, tmp: undefined }))
|
nodes: g.nodes.map((n: object) => ({ ...n, tmp: undefined, state: undefined }))
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
import Panel from '$lib/sidebar/Panel.svelte';
|
import Panel from '$lib/sidebar/Panel.svelte';
|
||||||
import ActiveNodeSettings from '$lib/sidebar/panels/ActiveNodeSettings.svelte';
|
import ActiveNodeSettings from '$lib/sidebar/panels/ActiveNodeSettings.svelte';
|
||||||
import BenchmarkPanel from '$lib/sidebar/panels/BenchmarkPanel.svelte';
|
import BenchmarkPanel from '$lib/sidebar/panels/BenchmarkPanel.svelte';
|
||||||
|
import Changelog from '$lib/sidebar/panels/Changelog.svelte';
|
||||||
import ExportSettings from '$lib/sidebar/panels/ExportSettings.svelte';
|
import ExportSettings from '$lib/sidebar/panels/ExportSettings.svelte';
|
||||||
import GraphSource from '$lib/sidebar/panels/GraphSource.svelte';
|
import GraphSource from '$lib/sidebar/panels/GraphSource.svelte';
|
||||||
import Keymap from '$lib/sidebar/panels/Keymap.svelte';
|
import Keymap from '$lib/sidebar/panels/Keymap.svelte';
|
||||||
@@ -249,6 +250,13 @@
|
|||||||
/>
|
/>
|
||||||
<ActiveNodeSettings {manager} bind:node={activeNode} />
|
<ActiveNodeSettings {manager} bind:node={activeNode} />
|
||||||
</Panel>
|
</Panel>
|
||||||
|
<Panel
|
||||||
|
id="changelog"
|
||||||
|
title="Changelog"
|
||||||
|
icon="i-[tabler--file-text-spark] bg-green-400"
|
||||||
|
>
|
||||||
|
<Changelog />
|
||||||
|
</Panel>
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
</Grid.Cell>
|
</Grid.Cell>
|
||||||
</Grid.Row>
|
</Grid.Row>
|
||||||
|
|||||||
1
app/static/.gitignore
vendored
1
app/static/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
nodes/
|
nodes/
|
||||||
|
CHANGELOG.md
|
||||||
|
|||||||
@@ -2,16 +2,14 @@
|
|||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "pnpm run -r --filter 'ui' build",
|
"postinstall": "pnpm run -r --filter 'ui' build",
|
||||||
"build": "pnpm build:nodes && pnpm build:app",
|
|
||||||
"lint": "pnpm run -r --parallel lint",
|
"lint": "pnpm run -r --parallel lint",
|
||||||
"format": "pnpm dprint fmt",
|
"format": "pnpm dprint fmt",
|
||||||
"format:check": "pnpm dprint check",
|
"format:check": "pnpm dprint check",
|
||||||
"test": "pnpm run -r test",
|
"test": "pnpm run -r test",
|
||||||
"check": "pnpm run -r check",
|
"check": "pnpm run -r check",
|
||||||
"build:story": "pnpm -r --filter 'ui' story:build",
|
"build": "pnpm build:nodes && pnpm build:app",
|
||||||
"build:app": "BASE_PATH=/ui pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build",
|
"build:app": "BASE_PATH=/ui pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build",
|
||||||
"build:nodes": "cargo build --workspace --target wasm32-unknown-unknown --release && rm -rf ./app/static/nodes/max/plantarium/ && mkdir -p ./app/static/nodes/max/plantarium/ && cp -R ./target/wasm32-unknown-unknown/release/*.wasm ./app/static/nodes/max/plantarium/",
|
"build:nodes": "cargo build --workspace --target wasm32-unknown-unknown --release && rm -rf ./app/static/nodes/max/plantarium/ && mkdir -p ./app/static/nodes/max/plantarium/ && cp -R ./target/wasm32-unknown-unknown/release/*.wasm ./app/static/nodes/max/plantarium/",
|
||||||
"build:deploy": "pnpm build && cp -R packages/ui/build app/build/ui",
|
|
||||||
"dev:nodes": "chokidar './nodes/**' --initial -i '/pkg/' -c 'pnpm build:nodes'",
|
"dev:nodes": "chokidar './nodes/**' --initial -i '/pkg/' -c 'pnpm build:nodes'",
|
||||||
"dev:app_ui": "pnpm -r --parallel --filter 'app' --filter './packages/ui' dev",
|
"dev:app_ui": "pnpm -r --parallel --filter 'app' --filter './packages/ui' dev",
|
||||||
"dev_ui": "pnpm -r --filter 'ui' dev:ui",
|
"dev_ui": "pnpm -r --filter 'ui' dev:ui",
|
||||||
|
|||||||
Reference in New Issue
Block a user