Skip to content

Commit 4aceb1f

Browse files
authored
Merge branch 'v3-alpha' into fix-SaveFileDialog-panic
2 parents 9084320 + 568aa66 commit 4aceb1f

File tree

223 files changed

+13229
-1408
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+13229
-1408
lines changed

.github/workflows/build-and-test-v3.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
types: [opened, synchronize, reopened, ready_for_review]
66
branches:
77
- v3-alpha
8+
paths:
9+
- 'v3/**'
810
pull_request_review:
911
types: [submitted]
1012
branches:

.github/workflows/semgrep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ name: Semgrep
1515
jobs:
1616
semgrep:
1717
name: semgrep/ci
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-24.04
1919
env:
2020
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
2121
container:
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: Test Nightly Releases (Dry Run)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dry_run:
7+
description: 'Run in dry-run mode (no actual releases)'
8+
required: false
9+
default: true
10+
type: boolean
11+
test_branch:
12+
description: 'Branch to test against'
13+
required: false
14+
default: 'master'
15+
type: string
16+
17+
env:
18+
GO_VERSION: '1.24'
19+
20+
jobs:
21+
test-permissions:
22+
name: Test Release Permissions
23+
runs-on: ubuntu-latest
24+
outputs:
25+
authorized: ${{ steps.check.outputs.authorized }}
26+
steps:
27+
- name: Check if user is authorized
28+
id: check
29+
run: |
30+
# Test authorization logic
31+
AUTHORIZED_USERS="leaanthony"
32+
33+
if [[ "$AUTHORIZED_USERS" == *"${{ github.actor }}"* ]]; then
34+
echo "✅ User ${{ github.actor }} is authorized"
35+
echo "authorized=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "❌ User ${{ github.actor }} is not authorized"
38+
echo "authorized=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
test-changelog-extraction:
42+
name: Test Changelog Extraction
43+
runs-on: ubuntu-latest
44+
needs: test-permissions
45+
if: needs.test-permissions.outputs.authorized == 'true'
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
with:
50+
ref: ${{ github.event.inputs.test_branch }}
51+
fetch-depth: 0
52+
53+
- name: Test v2 changelog extraction
54+
run: |
55+
echo "🧪 Testing v2 changelog extraction..."
56+
CHANGELOG_FILE="website/src/pages/changelog.mdx"
57+
58+
if [ ! -f "$CHANGELOG_FILE" ]; then
59+
echo "❌ v2 changelog file not found"
60+
exit 1
61+
fi
62+
63+
# Extract unreleased section
64+
awk '
65+
/^## \[Unreleased\]/ { found=1; next }
66+
found && /^## / { exit }
67+
found && !/^$/ { print }
68+
' $CHANGELOG_FILE > v2_release_notes.md
69+
70+
echo "📝 v2 changelog content (first 10 lines):"
71+
head -10 v2_release_notes.md || echo "No content found"
72+
echo "Total lines: $(wc -l < v2_release_notes.md)"
73+
74+
- name: Test v3 changelog extraction (if accessible)
75+
run: |
76+
echo "🧪 Testing v3 changelog extraction..."
77+
78+
if git show v3-alpha:docs/src/content/docs/changelog.mdx > /dev/null 2>&1; then
79+
echo "✅ v3 changelog accessible"
80+
81+
git show v3-alpha:docs/src/content/docs/changelog.mdx | awk '
82+
/^## \[Unreleased\]/ { found=1; next }
83+
found && /^## / { exit }
84+
found && !/^$/ { print }
85+
' > v3_release_notes.md
86+
87+
echo "📝 v3 changelog content (first 10 lines):"
88+
head -10 v3_release_notes.md || echo "No content found"
89+
echo "Total lines: $(wc -l < v3_release_notes.md)"
90+
else
91+
echo "⚠️ v3 changelog not accessible from current context"
92+
fi
93+
94+
test-version-detection:
95+
name: Test Version Detection
96+
runs-on: ubuntu-latest
97+
needs: test-permissions
98+
if: needs.test-permissions.outputs.authorized == 'true'
99+
outputs:
100+
v2_current_version: ${{ steps.versions.outputs.v2_current }}
101+
v2_next_patch: ${{ steps.versions.outputs.v2_next_patch }}
102+
v2_next_minor: ${{ steps.versions.outputs.v2_next_minor }}
103+
v2_next_major: ${{ steps.versions.outputs.v2_next_major }}
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v4
107+
with:
108+
fetch-depth: 0
109+
110+
- name: Test version detection logic
111+
id: versions
112+
run: |
113+
echo "🧪 Testing version detection..."
114+
115+
# Test v2 version parsing
116+
if [ -f "v2/cmd/wails/internal/version.txt" ]; then
117+
CURRENT_V2=$(cat v2/cmd/wails/internal/version.txt | sed 's/^v//')
118+
echo "Current v2 version: v$CURRENT_V2"
119+
echo "v2_current=v$CURRENT_V2" >> $GITHUB_OUTPUT
120+
121+
# Parse and increment
122+
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_V2"
123+
MAJOR=${VERSION_PARTS[0]}
124+
MINOR=${VERSION_PARTS[1]}
125+
PATCH=${VERSION_PARTS[2]}
126+
127+
PATCH_VERSION="v$MAJOR.$MINOR.$((PATCH + 1))"
128+
MINOR_VERSION="v$MAJOR.$((MINOR + 1)).0"
129+
MAJOR_VERSION="v$((MAJOR + 1)).0.0"
130+
131+
echo "v2_next_patch=$PATCH_VERSION" >> $GITHUB_OUTPUT
132+
echo "v2_next_minor=$MINOR_VERSION" >> $GITHUB_OUTPUT
133+
echo "v2_next_major=$MAJOR_VERSION" >> $GITHUB_OUTPUT
134+
135+
echo "✅ Patch: v$CURRENT_V2 → $PATCH_VERSION"
136+
echo "✅ Minor: v$CURRENT_V2 → $MINOR_VERSION"
137+
echo "✅ Major: v$CURRENT_V2 → $MAJOR_VERSION"
138+
else
139+
echo "❌ v2 version file not found"
140+
fi
141+
142+
test-commit-analysis:
143+
name: Test Commit Analysis
144+
runs-on: ubuntu-latest
145+
needs: test-permissions
146+
if: needs.test-permissions.outputs.authorized == 'true'
147+
steps:
148+
- name: Checkout code
149+
uses: actions/checkout@v4
150+
with:
151+
fetch-depth: 0
152+
153+
- name: Test commit analysis
154+
run: |
155+
echo "🧪 Testing commit analysis..."
156+
157+
# Get recent commits for testing
158+
echo "Recent commits:"
159+
git log --oneline -10
160+
161+
# Test conventional commit detection
162+
RECENT_COMMITS=$(git log --oneline --since="7 days ago")
163+
echo "Commits from last 7 days:"
164+
echo "$RECENT_COMMITS"
165+
166+
# Analyze for release type
167+
RELEASE_TYPE="patch"
168+
if echo "$RECENT_COMMITS" | grep -q "feat!\|fix!\|BREAKING CHANGE:"; then
169+
RELEASE_TYPE="major"
170+
elif echo "$RECENT_COMMITS" | grep -q "feat\|BREAKING CHANGE"; then
171+
RELEASE_TYPE="minor"
172+
fi
173+
174+
echo "✅ Detected release type: $RELEASE_TYPE"
175+
176+
test-summary:
177+
name: Test Summary
178+
runs-on: ubuntu-latest
179+
needs: [test-permissions, test-changelog-extraction, test-version-detection, test-commit-analysis]
180+
if: always()
181+
steps:
182+
- name: Print test results
183+
run: |
184+
echo "# 🧪 Nightly Release Workflow Test Results" >> $GITHUB_STEP_SUMMARY
185+
echo "" >> $GITHUB_STEP_SUMMARY
186+
187+
if [ "${{ needs.test-permissions.result }}" == "success" ]; then
188+
echo "✅ **Permissions Test**: Passed" >> $GITHUB_STEP_SUMMARY
189+
else
190+
echo "❌ **Permissions Test**: Failed" >> $GITHUB_STEP_SUMMARY
191+
fi
192+
193+
if [ "${{ needs.test-changelog-extraction.result }}" == "success" ]; then
194+
echo "✅ **Changelog Extraction**: Passed" >> $GITHUB_STEP_SUMMARY
195+
else
196+
echo "❌ **Changelog Extraction**: Failed" >> $GITHUB_STEP_SUMMARY
197+
fi
198+
199+
if [ "${{ needs.test-version-detection.result }}" == "success" ]; then
200+
echo "✅ **Version Detection**: Passed" >> $GITHUB_STEP_SUMMARY
201+
echo " - Current v2: ${{ needs.test-version-detection.outputs.v2_current_version }}" >> $GITHUB_STEP_SUMMARY
202+
echo " - Next patch: ${{ needs.test-version-detection.outputs.v2_next_patch }}" >> $GITHUB_STEP_SUMMARY
203+
echo " - Next minor: ${{ needs.test-version-detection.outputs.v2_next_minor }}" >> $GITHUB_STEP_SUMMARY
204+
echo " - Next major: ${{ needs.test-version-detection.outputs.v2_next_major }}" >> $GITHUB_STEP_SUMMARY
205+
else
206+
echo "❌ **Version Detection**: Failed" >> $GITHUB_STEP_SUMMARY
207+
fi
208+
209+
if [ "${{ needs.test-commit-analysis.result }}" == "success" ]; then
210+
echo "✅ **Commit Analysis**: Passed" >> $GITHUB_STEP_SUMMARY
211+
else
212+
echo "❌ **Commit Analysis**: Failed" >> $GITHUB_STEP_SUMMARY
213+
fi
214+
215+
echo "" >> $GITHUB_STEP_SUMMARY
216+
echo "**Note**: This was a dry-run test. No actual releases were created." >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,55 @@ v2/cmd/wails/internal/commands/initialise/templates/testtemplates/
3737
/websitev3/site/
3838
/v3/examples/plugins/bin/testapp
3939

40+
# V3 Example binaries - ignore executables that match directory names
41+
/v3/examples/badge-custom/badge-custom
42+
/v3/examples/badge/badge
43+
/v3/examples/binding/binding
44+
/v3/examples/cancel-async/cancel-async
45+
/v3/examples/cancel-chaining/cancel-chaining
46+
/v3/examples/clipboard/clipboard
47+
/v3/examples/contextmenus/contextmenus
48+
/v3/examples/dev/dev
49+
/v3/examples/dialogs-basic/dialogs-basic
50+
/v3/examples/dialogs/dialogs
51+
/v3/examples/drag-n-drop/drag-n-drop
52+
/v3/examples/environment/environment
53+
/v3/examples/events-bug/events-bug
54+
/v3/examples/events/events
55+
/v3/examples/file-association/file-association
56+
/v3/examples/frameless/frameless
57+
/v3/examples/gin-example/gin-example
58+
/v3/examples/gin-routing/gin-routing
59+
/v3/examples/gin-service/gin-service
60+
/v3/examples/hide-window/hide-window
61+
/v3/examples/html-dnd-api/html-dnd-api
62+
/v3/examples/ignore-mouse/ignore-mouse
63+
/v3/examples/keybindings/keybindings
64+
/v3/examples/menu/menu
65+
/v3/examples/notifications/notifications
66+
/v3/examples/panic-handling/panic-handling
67+
/v3/examples/plain/plain
68+
/v3/examples/raw-message/raw-message
69+
/v3/examples/screen/screen
70+
/v3/examples/services/services
71+
/v3/examples/show-macos-toolbar/show-macos-toolbar
72+
/v3/examples/single-instance/single-instance
73+
/v3/examples/systray-basic/systray-basic
74+
/v3/examples/systray-custom/systray-custom
75+
/v3/examples/systray-menu/systray-menu
76+
/v3/examples/video/video
77+
/v3/examples/window-api/window-api
78+
/v3/examples/window-call/window-call
79+
/v3/examples/window-menu/window-menu
80+
/v3/examples/window/window
81+
/v3/examples/wml/wml
82+
83+
# Common binary names in examples
84+
/v3/examples/*/main
85+
/v3/examples/*/app
86+
/v3/examples/*/changeme
87+
/v3/examples/*/testbuild-*
88+
4089
# Temporary called mkdocs, should be renamed to more standard -website or similar
4190
/docs/site
4291
.aider*

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@types/react-dom": "19.0.2",
1818
"astro": "4.16.17",
1919
"framer-motion": "11.14.4",
20+
"mermaid": "^10.9.3",
2021
"motion": "11.14.4",
2122
"react": "19.0.0",
2223
"react-dom": "19.0.0",

docs/src/components/Mermaid.astro

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
export interface Props {
3+
title?: string;
4+
}
5+
6+
const { title = "" } = Astro.props;
7+
---
8+
9+
<script>
10+
import mermaid from "mermaid";
11+
12+
// Postpone mermaid initialization
13+
mermaid.initialize({ startOnLoad: false });
14+
15+
function extractMermaidCode() {
16+
// Find all mermaid components
17+
const mermaidElements = document.querySelectorAll("figure.expandable-diagram");
18+
19+
mermaidElements.forEach((element) => {
20+
// Find the code content in the details section
21+
const codeElement = element.querySelector("details pre code");
22+
23+
if (!codeElement) return;
24+
25+
// Extract the text content
26+
let code = codeElement.textContent || "";
27+
28+
// Clean up the code
29+
code = code.trim();
30+
31+
// Construct the `pre` element for the diagram code
32+
const preElement = document.createElement("pre");
33+
preElement.className = "mermaid not-prose";
34+
preElement.innerHTML = code;
35+
36+
// Find the diagram content container and override its content
37+
const diagramContainer = element.querySelector(".diagram-content");
38+
if (diagramContainer) {
39+
diagramContainer.innerHTML = "";
40+
diagramContainer.appendChild(preElement);
41+
}
42+
});
43+
}
44+
45+
// Wait for the DOM to be fully loaded
46+
document.addEventListener("DOMContentLoaded", async () => {
47+
extractMermaidCode();
48+
mermaid.initialize({ startOnLoad: true });
49+
});
50+
</script>
51+
52+
<figure class="expandable-diagram">
53+
<figcaption>{title}</figcaption>
54+
<div class="diagram-content">Loading diagram...</div>
55+
<details>
56+
<summary>Source</summary>
57+
<pre><code><slot /></code></pre>
58+
</details>
59+
</figure>

0 commit comments

Comments
 (0)