Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6e2169d
Rewrite the Windows plan around C#, QuickJS and Win2D
everettjf Nov 17, 2026
f0eda8f
Check text out with LF on every platform
everettjf Nov 17, 2026
c460e7e
Add the Windows runtime foundation: QuickJS host, shared JavaScript, …
everettjf Nov 17, 2026
88eb1ba
Add the desktop window layer, tray icon, action rules and Windows CI
everettjf Nov 17, 2026
b3dbec1
Port the Android package layer to the Windows core
everettjf Nov 17, 2026
897d439
Port the Android widget renderer to C# and Win2D
everettjf Nov 17, 2026
7ddb40f
Port fetch, Data Source Plugins and $weather to the Windows runtime
everettjf Nov 17, 2026
d553def
Add the Windows desktop host, management window, command line and pac…
everettjf Nov 17, 2026
68cccac
Map manifest size names, log actions, and fix the solution platforms
everettjf Nov 17, 2026
747d688
Run the shared code editor in embedded mode and add window captures
everettjf Nov 17, 2026
4c54589
Make text layout work under native AOT, name the client in requests, …
everettjf Nov 17, 2026
4e6273d
Document the Windows preview and fix what the packaged run found
everettjf Nov 17, 2026
103843a
Place widgets directly above the desktop window, not at the bottom
everettjf Nov 17, 2026
a32aedd
Keep credentials with their origin on redirects; note the Windows pre…
everettjf Nov 17, 2026
a8f19dd
Add pictures of the Windows management window to its README
everettjf Nov 17, 2026
a037b19
Record the final test count in the Windows test notes
everettjf Nov 17, 2026
69d818a
Verify the desktop host without the screen and fix what that found
everettjf Nov 17, 2026
06cfaf7
Handle Show Desktop the way Windows 11 24H2 does it, with a self-test
everettjf Nov 17, 2026
0e7abad
Run the desktop check in CI and check the Chinese interface
everettjf Nov 17, 2026
6595d8d
Record the CI desktop check in the Windows test notes
everettjf Nov 17, 2026
d80aa2e
Build, test and run the desktop check on an ARM64 Windows runner
everettjf Nov 17, 2026
21039be
Check the menu actions and run ARM64 for real
everettjf Nov 17, 2026
95a9824
Record the real Explorer restart in the Windows test notes
everettjf Nov 17, 2026
0e2f952
Add a hand-started CI job that runs the Android core device tests on …
everettjf Nov 17, 2026
9db7550
Generate the parity corpus before the emulator device tests
everettjf Nov 17, 2026
8be3b82
Record the Android JVM and emulator runs after the shared-JavaScript …
everettjf Nov 17, 2026
ab1723d
Run the Android app device tests on the CI emulator too
everettjf Nov 17, 2026
24c4002
Keep animations on in the emulator job: the widget animation tests ne…
everettjf Nov 17, 2026
ecbf947
Record the Android app suite on the CI emulator
everettjf Nov 17, 2026
9ce7878
Record a real sleep and resume in the Windows test notes
everettjf Nov 17, 2026
f863775
Fix Show Desktop on the real desktop and network access of bundled te…
everettjf Nov 17, 2026
b8f81cc
Open a template before using it, and move the examples to their own page
everettjf Nov 17, 2026
45ff8ae
Put Components and APIs in the sidebar; show the APIs as a list
everettjf Nov 17, 2026
74b5866
Make APIs a reference and Components small tiles
everettjf Nov 17, 2026
7f699ab
Index the unplated taskbar images so the icon has no accent-colored edge
everettjf Nov 17, 2026
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
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Text is stored and checked out with LF on every platform. The shared
# JavaScript build scripts match line ends with "\n", and the parity trees are
# compared byte for byte, so a CRLF checkout on Windows breaks both.
* text=auto eol=lf

# Windows-only scripts that need CRLF.
*.bat text eol=crlf
*.cmd text eol=crlf
42 changes: 42 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,45 @@ jobs:
working-directory: Android
# Device tests (QuickJS parity with JavaScriptCore, rendering, native APIs)
# need a device or emulator: run Android/scripts/device-test.sh locally.
# The core instrumented suite (QuickJS parity with JavaScriptCore, rendering, native APIs) on an
# emulator. Started by hand only: Actions > Android > Run workflow. An emulator is not a phone;
# the suites on a real device are still run with Android/scripts/device-test.sh.
device:
name: Device tests on an emulator
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: {node-version: 24}
- uses: actions/setup-java@v5
with: {distribution: temurin, java-version: 21}
- name: Install the bundler used for the shared renderer
run: npm ci
working-directory: Web/studio
- name: Shared JavaScript and the parity corpus the device tests read
run: node Android/scripts/build-shared-js.mjs
- name: Let the runner use KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
arch: x86_64
target: google_apis
disable-animations: false
script: |
sh Android/scripts/device-test.sh core | tee device-test.log
FLAVOR=foss sh Android/scripts/device-test.sh app | tee app-device-test.log
grep -q "^OK (" device-test.log && grep -q "^OK (" app-device-test.log
- uses: actions/upload-artifact@v7
if: always()
with:
name: android-core-device-test
path: |
device-test.log
app-device-test.log
if-no-files-found: ignore
128 changes: 128 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Windows
on:
pull_request:
paths: ['Windows/**', 'Web/preview-engine/**', 'Android/core/src/main/js/**', 'Android/core/src/main/cpp/quickjs/**', 'Scripts/lib/shared-js.mjs', 'Shared/ScriptWidgetRuntime/Widget/Resource/support.bundle/**', '.github/workflows/windows.yml']
push:
branches: [main]
paths: ['Windows/**', 'Web/preview-engine/**', 'Android/core/src/main/js/**', 'Android/core/src/main/cpp/quickjs/**', 'Scripts/lib/shared-js.mjs', 'Shared/ScriptWidgetRuntime/Widget/Resource/support.bundle/**', '.github/workflows/windows.yml']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: windows-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build and test (x64)
runs-on: windows-2025
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: {node-version: 24}
- uses: actions/setup-dotnet@v5
with: {dotnet-version: '10.0.x'}
- name: Preview engine tests on Windows
working-directory: Web/preview-engine
run: npm test
- name: Install esbuild for the shared JavaScript bundle
working-directory: Web/studio
run: npm ci --no-audit --no-fund
- name: Shared JavaScript
run: node Windows/scripts/build-shared-js.mjs
- name: swcore (QuickJS)
shell: pwsh
run: ./Windows/scripts/build-native.ps1 -Arch x64
- name: Build
working-directory: Windows
run: dotnet build ScriptWidget.slnx -c Release -p:Platform=x64 --nologo
- name: Test
working-directory: Windows
run: dotnet test tests/ScriptWidget.Core.Tests -c Release --nologo --logger "console;verbosity=normal" --logger "trx;LogFileName=tests.trx"
# The engine binding (swcore.c) under AddressSanitizer. The rest of the suite is not run this
# way: compiling packages with Babel inside a sanitized QuickJS hosted by .NET does not finish.
- name: Engine binding tests with AddressSanitizer in swcore
shell: pwsh
run: |
./Windows/scripts/build-native.ps1 -Arch x64 -Asan
cd Windows
dotnet test tests/ScriptWidget.Core.Tests -c Release --nologo -p:SwNativeSuffix=-asan --filter "FullyQualifiedName~QuickJs" --logger "console;verbosity=minimal"
# The desktop host on the build agent's desktop: window content, window order, drag, clicks,
# system events and the show-desktop self-test. Pictures of the widget windows are uploaded.
- name: Desktop check
shell: pwsh
run: |
$hostPath = Get-ChildItem Windows/src/ScriptWidget.App/bin -Recurse -Filter ScriptWidget.exe | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName
powershell -NoProfile -ExecutionPolicy Bypass -File Windows/scripts/desktop-check.ps1 -HostPath $hostPath -Output "$env:RUNNER_TEMP\desktop-check"
- uses: actions/upload-artifact@v7
if: always()
with:
name: windows-desktop-check
path: |
${{ runner.temp }}/desktop-check/*.png
${{ runner.temp }}/desktop-check/*.log
${{ runner.temp }}/desktop-check/data/host.log
if-no-files-found: ignore
- uses: actions/upload-artifact@v7
if: always()
with:
name: windows-test-results
path: Windows/tests/ScriptWidget.Core.Tests/TestResults
if-no-files-found: ignore
arm64:
name: Build (ARM64, cross-compiled on x64)
runs-on: windows-2025
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: {node-version: 24}
- uses: actions/setup-dotnet@v5
with: {dotnet-version: '10.0.x'}
- name: Install esbuild for the shared JavaScript bundle
working-directory: Web/studio
run: npm ci --no-audit --no-fund
- run: node Windows/scripts/build-shared-js.mjs
- name: swcore (QuickJS) for ARM64
shell: pwsh
run: ./Windows/scripts/build-native.ps1 -Arch arm64
- name: Build
working-directory: Windows
run: dotnet build ScriptWidget.slnx -c Release -p:Platform=ARM64 --nologo
arm64-run:
name: Build and test (ARM64)
runs-on: windows-11-arm
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: {node-version: 24}
- uses: actions/setup-dotnet@v5
with: {dotnet-version: '10.0.x'}
- name: Install esbuild for the shared JavaScript bundle
working-directory: Web/studio
run: npm ci --no-audit --no-fund
- run: node Windows/scripts/build-shared-js.mjs
- name: swcore (QuickJS) for ARM64
shell: pwsh
run: ./Windows/scripts/build-native.ps1 -Arch arm64
- name: Build
working-directory: Windows
run: dotnet build ScriptWidget.slnx -c Release -p:Platform=ARM64 --nologo
- name: Test
working-directory: Windows
run: dotnet test tests/ScriptWidget.Core.Tests -c Release -p:Platform=ARM64 --nologo --logger "console;verbosity=normal"
- name: Desktop check
shell: pwsh
run: |
$hostPath = Get-ChildItem Windows/src/ScriptWidget.App/bin -Recurse -Filter ScriptWidget.exe | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName
powershell -NoProfile -ExecutionPolicy Bypass -File Windows/scripts/desktop-check.ps1 -HostPath $hostPath -Output "$env:RUNNER_TEMP\desktop-check"
- uses: actions/upload-artifact@v7
if: always()
with:
name: windows-arm64-desktop-check
path: |
${{ runner.temp }}/desktop-check/*.png
${{ runner.temp }}/desktop-check/*.log
${{ runner.temp }}/desktop-check/data/host.log
if-no-files-found: ignore
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ScriptWidget lets users author native widgets with JavaScript and JSX: WidgetKit
- `macOS/ScriptWidgetMac`, `ScriptWidgetMacWidget`: Studio app and macOS widget extension. Studio features live in `Editor/`, `AIGenerate/`, `Skills/`, `Plugin/`, and `Onboarding/`.
- `Editor/editorfe/`: Vite frontend with CodeMirror 6. Built files are copied into both platform `StudioEditor.bundle` directories.
- `Web/preview-engine/`: browser preview engine (plain JavaScript with `.d.ts` types); `Web/studio/`: Web Studio, a React + strict TypeScript + shadcn/ui app published to GitHub Pages. Its `kernel.js` and `renderer.js` are also the Android runtime, so a change there affects the browser preview and Android together.
- `Windows/`: the Windows 11 desktop app (preview). `native` builds `swcore.dll` from the QuickJS-NG sources under `Android/core/src/main/cpp/quickjs`; `src/ScriptWidget.Core` is a C# port of `Android/core` (engine wrapper, compiler, executor, packages, APIs, plugins, Win2D renderer); `src/ScriptWidget.App` is the always-running desktop host; `src/ScriptWidget.Studio` is the WinUI 3 management window; `src/ScriptWidget.Cli` is `swcli`. It runs the same shared JavaScript as Android, built by `Scripts/lib/shared-js.mjs`. `Windows/assets`, `Windows/native/out` and `Windows/artifacts` are generated; do not edit or commit them.
- `Android/core`: QuickJS-NG with its JNI layer, the Kotlin host and native APIs, Canvas renderer, package store, Gallery, Skills, plugins and AI client. `Android/app`: Compose app, widget providers, tiles, shortcuts, Live Updates and push. `Android/core/src/main/assets/scriptwidget` is generated; do not edit it. `Android/app/src/main/assets/Script.android` holds the templates for what only Android has: the scrolling `<list>`, the `material.<role>` colors and the automation entry point, all described under "Only on Android" in `docs/android/README.md`. `Android/play`: Google Play listing kit.
- `Tests/ScriptWidgetRuntimeTests/`: shared runtime, execution, performance, package/cache, iCloud-state, Gallery, AI, and security tests.
- `Gallery/`: curated Gallery 1.0 index, JSON Schema, widget seeds, and Skill seeds.
Expand All @@ -33,6 +34,8 @@ Widget packages live under `Scripts/<PackageName>/`. Package 2.0 uses `widget.js
- Metadata-only release checks: `node Scripts/validate-release.mjs` and `node Scripts/validate-doc-links.mjs`.
- Android (not covered by `release-readiness.sh`): `node Android/scripts/build-shared-js.mjs` after changing `Web/preview-engine/src`, the support bundle or `Android/core/src/main/js`; `cd Android && ./gradlew :core:testDebugUnitTest :app:assembleDebug`; `sh Android/scripts/device-test.sh core` and `app` on a connected device or emulator; `./gradlew :app:bundlePlayRelease` for the Play bundle and `:app:assembleFossRelease` for the APK published on GitHub Releases. The app has two flavors: `play` contains Firebase Cloud Messaging, `foss` must contain no Google or other proprietary library.

- Windows (not covered by `release-readiness.sh`; needs Windows 11, Visual Studio with the C++ workload, the .NET 10 SDK and Node): `node Windows/scripts/build-shared-js.mjs` after changing `Web/preview-engine/src`, the support bundle or `Android/core/src/main/js`; `powershell -File Windows/scripts/build-native.ps1 -Arch x64`; `cd Windows && dotnet test tests/ScriptWidget.Core.Tests`; `powershell -File Windows/scripts/desktop-check.ps1` after touching the desktop host; `powershell -File Windows/scripts/package.ps1` for the MSIX (add `-FrameworkDependent` and the Partner Center identity for the Store). Record what ran, on which machine, in `docs/windows/testing.md`, and keep `docs/windows/TODO.md` current.

The app uses `iCloud.ScriptWidget` and `group.everettjf.scriptwidget`. Signed real-container tests require a trusted, signed-in device; deterministic cache/iCloud-state tests do not.

The Android application ID is `com.atomsprout.scriptwidget`; the Kotlin namespace stays `com.everettjf.scriptwidget`. Take the package name from `context.packageName` and class names from the class, never from a literal. `Android/keystore.properties`, `Android/firebase.properties`, `google-services.json` and keystores are git-ignored and must stay out of the repository; a build without `firebase.properties` has push turned off.
Expand Down
4 changes: 3 additions & 1 deletion Android/core/src/main/assets/scriptwidget/android-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ __swRegisterAPIs(function (apis, helpers, bridge) {
"use strict";
const { nativePromise } = helpers;
const supported = new Set(bridge.job.supportedAPIs ?? []);
const message = (name) => `[unsupported_platform] ${name} is not supported on Android in this release`;
// The host names itself; the Android host does not pass a name.
const platform = typeof bridge.job.platformName === "string" ? bridge.job.platformName : "Android";
const message = (name) => `[unsupported_platform] ${name} is not supported on ${platform} in this release`;
const rejecting = (name) => () => nativePromise((resolve, reject) => reject(message(name)));

const groups = {
Expand Down
4 changes: 3 additions & 1 deletion Android/core/src/main/js/android-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ __swRegisterAPIs(function (apis, helpers, bridge) {
"use strict";
const { nativePromise } = helpers;
const supported = new Set(bridge.job.supportedAPIs ?? []);
const message = (name) => `[unsupported_platform] ${name} is not supported on Android in this release`;
// The host names itself; the Android host does not pass a name.
const platform = typeof bridge.job.platformName === "string" ? bridge.job.platformName : "Android";
const message = (name) => `[unsupported_platform] ${name} is not supported on ${platform} in this release`;
const rejecting = (name) => () => nativePromise((resolve, reject) => reject(message(name)));

const groups = {
Expand Down
Loading
Loading