Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,656 changes: 907 additions & 749 deletions products/maka/cli/notices.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions products/maka/workbench/app/chrome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
// The window around the workbench on a graphical desktop: the headers along
// the top edge are its title bar, and the application menu holds the
// workbench's commands. Terminals keep their own title and menus.
import { effect } from 'nsh';
import { platform } from 'nsh';
import { effect, platform } from 'nsh';
import { isAvailable, Menu, titleBar, Window } from 'nsh/desktop';
import { tr } from './locale';

export const ownTitleBar = isAvailable && platform.idiom === 'desktop' && !platform.isTerminal;
export const ownTitleBar = isAvailable && platform.desktop;
/** The headers' height, which the system's window controls are centered in. */
export const TITLE_BAR_HEIGHT = 48;

Expand Down
5 changes: 2 additions & 3 deletions products/maka/workbench/app/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// The desktop window's notifications: a conversation in the list that stops
// working, or starts waiting for the user, while the window is in the
// background. Choosing one shows that conversation. Terminals have none.
import { cleanup, effect, host as shell, untracked } from 'nsh';
import { effect, host as shell, untracked } from 'nsh';
import type { BrowserSession } from './browsing';
import { ownTitleBar } from './chrome';
import { tr } from './locale';
Expand Down Expand Up @@ -58,8 +58,7 @@ export function watchNotifications(props: {
.catch(() => undefined);
}
});
const opened = shell.on('notification.open', (data: { tag?: unknown }) => {
shell.on('notification.open', (data: { tag?: unknown }) => {
if (typeof data?.tag === 'string') props.open(data.tag);
});
cleanup(() => opened.remove());
}
23 changes: 1 addition & 22 deletions third-party/nsh/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
with:
targets: wasm32-unknown-unknown

# QuickJS's WebAssembly build needs upstream LLVM: Apple's clang
# The web runtime's C code (zstd) needs upstream LLVM: Apple's clang
# does not target wasm32. Check the C tools before building runtimes.
- name: Set up WebAssembly C tools
run: |
Expand Down Expand Up @@ -185,27 +185,6 @@ jobs:
restore-keys: |
${{ runner.os }}-release-cargo-

# Compile the actual WASI headers before the native runtimes: a bare
# clang probe does not exercise quickjs-jit-sys's vendored include path.
- name: Check the Windows web runtime
if: runner.os == 'Windows'
run: |
cargo metadata --locked --format-version 1 --filter-platform wasm32-unknown-unknown > "$RUNNER_TEMP/wasm-metadata.json"
python - "$RUNNER_TEMP/wasm-metadata.json" <<'PYTHON'
import json
import pathlib
import sys
packages = json.loads(pathlib.Path(sys.argv[1]).read_text(encoding="utf-8"))["packages"]
package = next(p for p in packages if p["name"] == "quickjs-jit-sys")
include = pathlib.Path(package["manifest_path"]).parent / "vendor/wasi-libc/include"
for name in ("stdlib.h", "bits/alltypes.h"):
header = include / name
if not header.is_file():
sys.exit(f"Missing vendored WASI header: {header}")
print(f"Verified WASI header: {header}")
PYTHON
cargo build --profile web -p nsh-platform-web --target wasm32-unknown-unknown --features bytecode-only

- name: Build the distribution
run: cargo xtask dist -v

Expand Down
8 changes: 6 additions & 2 deletions third-party/nsh/.github/workflows/rust-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ jobs:
run: |
mkdir -p "$RUNNER_TEMP/nsh-test-tmp"
echo "TMPDIR=$RUNNER_TEMP/nsh-test-tmp" >> "$GITHUB_ENV"
# QuickJS is C: bindgen needs libclang, its WebAssembly build clang
# and llvm-ar. The describe program links the gallery's crate,
# QuickJS is C: bindgen needs libclang for the CLI; the web runtime's
# C code (zstd) clang and llvm-ar. The describe program links the gallery's crate,
# whose native entry (`cargo run`) uses GTK 4 on Linux.
- name: Install clang, LLVM and GTK 4
run: sudo apt-get update && sudo apt-get install -y clang llvm libclang-dev libgtk-4-dev
Expand Down Expand Up @@ -178,6 +178,10 @@ jobs:
for app in counter gallery rust-exports; do
./target/debug/nsh test "examples/$app"
done
# NSH's generated declarations type-check themselves: apps skip
# checking them (`skipLibCheck`), which would hide a broken one.
- name: Type-check the generated declarations
run: ./target/debug/nsh check examples/counter -- --skipLibCheck false
# The same tests in the runner's Chrome, headless, with the browser's
# trusted input (`nsh test --target web`): those a real platform runs
# (real time).
Expand Down
25 changes: 22 additions & 3 deletions third-party/nsh/.github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Website

# Builds the documentation site with its live demos (the WebAssembly runtime,
# `cargo xtask web`) and publishes it to GitHub Pages at nsh.dev
# (`website/public/CNAME`).
# (`website/public/CNAME`). App Stories (/apps) come from the reviewed
# catalog in longbridge/nsh-showcases, whose own workflow dispatches this one
# after each merge and its weekly star refresh.

on:
push:
Expand Down Expand Up @@ -51,8 +53,8 @@ jobs:
steps:
- uses: actions/checkout@v4

# QuickJS is C: clang compiles it for wasm32 (llvm-ar archives it), and
# bindgen needs libclang for the host build of the nsh CLI.
# The web runtime's C code (zstd): clang compiles it for wasm32 (llvm-ar
# archives it); bindgen needs libclang for the host build of the nsh CLI.
- name: Install clang and LLVM
run: sudo apt-get update && sudo apt-get install -y clang llvm libclang-dev

Expand Down Expand Up @@ -95,6 +97,19 @@ jobs:
CHROME=$("$RUNNER_TEMP/nsh-browser-tests/bin/python" -c 'from playwright.sync_api import sync_playwright; p=sync_playwright().start(); print(p.chromium.executable_path); p.stop()')
"$RUNNER_TEMP/nsh-browser-tests/bin/python" crates/nsh-platform-web/web/browser/browser-check.py --chrome "$CHROME" --wasm target/wasm32-unknown-unknown/web/nsh_platform_web.wasm

# The published site requires the catalog (NSH_REQUIRE_SHOWCASES).
- name: Check out the App Stories catalog
uses: actions/checkout@v4
with:
repository: longbridge/nsh-showcases
ref: main
path: .showcases
persist-credentials: false

- name: Install the catalog's dependencies
working-directory: .showcases
run: bun install --frozen-lockfile

- name: Install website dependencies
working-directory: website
run: bun install
Expand All @@ -106,11 +121,15 @@ jobs:
working-directory: website
env:
NSH_REQUIRE_PLAY: "1"
NSH_REQUIRE_SHOWCASES: "1"
SHOWCASES_DIR: ${{ github.workspace }}/.showcases
AR_wasm32_unknown_unknown: llvm-ar
run: bun run build

- name: Test website
working-directory: website
env:
SHOWCASES_DIR: ${{ github.workspace }}/.showcases
run: bun run test

- name: Check standalone Gallery code size
Expand Down
Loading
Loading