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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ We follow the **C++ Core Guidelines** to ensure conformance with modern C++23 ge

We use **Doxygen** syntax for code documentation. Follow these guidelines:

API documentation is optional: configure with `-DENABLE_DOXYGEN=ON`, then run
`cmake --build <build-directory> --target doxygen-docs` (the previous
`doc_doxygen` target remains available). CMake generates the configuration from
the public headers and the project version; Graphviz is optional. The default
build needs neither tool. Current build/test commands are in [AGENTS.md](../AGENTS.md),
and developer-environment publication is described in
[PUBLISHING.md](../js/developer/tools/PUBLISHING.md).

- **File-level documentation:** Use `@brief` only, no `@file` or `@author` tags.
- **Class documentation:** Include `@brief` with detailed description and usage examples.
- **Method documentation:**
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:
inputs:
repeat_desktop_tests:
description: 'Also run the desktop matrix, repeating each CTest case three times'
description: 'Also run the desktop matrix, repeating the complete CTest suite three times'
type: boolean
default: false

Expand Down Expand Up @@ -131,9 +131,9 @@ jobs:
# Only Linux trusted fixtures need the sandbox opt-out on hosted runners.
env: ${{ matrix.test_env }}
run: >-
ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure --no-tests=error --parallel 4
--repeat until-fail:${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests && '3' || '1' }}
--output-junit "${{ github.workspace }}/build/test-results.xml"
cmake -DBUILD_DIR=${{ github.workspace }}/build -DCONFIG=${{ matrix.build_type }}
-DREPEAT=${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests && '3' || '1' }}
-P test/cmake/RunTestSuite.cmake
- name: Collect coverage
if: runner.os == 'Linux'
working-directory: build
Expand All @@ -142,14 +142,30 @@ jobs:
lcov --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage.info
lcov --ignore-errors inconsistent,inconsistent --remove coverage.info '/usr/*' '*/examples/*' --output-file coverage.info
lcov --list coverage.info
- name: Collect macOS browser crash diagnostics
if: failure() && runner.os == 'macOS'
timeout-minutes: 1
shell: bash
run: |
mkdir -p build/diagnostics
/usr/bin/log show --last 15m --style compact \
--predicate 'process CONTAINS "WebKit" OR process == "developer_integration"' \
> build/diagnostics/webkit.log 2>&1 || true
shopt -s nullglob
for directory in "$HOME/Library/Logs/DiagnosticReports" /Library/Logs/DiagnosticReports; do
for report in "$directory"/*WebKit* "$directory"/*WebContent* "$directory"/*developer_integration*; do
if [ -f "$report" ]; then cp "$report" build/diagnostics/; fi
done
done
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-${{ runner.os }}
path: |
build/test-results.xml
build/test-results-*.xml
build/Testing/Temporary/LastTest.log
build/diagnostics/
if-no-files-found: ignore

sanitizers:
Expand Down
10 changes: 4 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ The README introduces WebFront through the Game of Life walkthrough, demonstrati
- `include/webfront/system/`: layered virtual filesystems and the embedded web resources, a closed list guarded by the `MinimalCoreAssets` CTest case (normative list and 150 KiB decoded budget in ADR-016; changing it means amending the ADR and `test/cmake/CheckMinimalCoreAssets.cmake` together).
- `include/webfront/frontend/`: system-browser, CEF, optional Windows WebView2 and macOS WKWebView frontend adapters.
- `examples/`: only Hello World (`hello-world/`) and Game of Life (`life/`, with console, developer and embedded stages).
- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment (its terminal and `wf`), the wf scripts that build it (`scripts/`), build and vendoring tools. The repository is itself a `wf` project (`js/developer/webfront.project.json` and its lock, selected with `--manifest-dir js/developer`): the environment builds itself, and its pure JavaScript specs (`test/developer/`) run with `wf test`. `docs/NODE_TOOLS_MIGRATION.md` records where each former Node.js tool went. Production C++ remains header-only in `include/webfront/`.
- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment (its terminal and `wf`), the wf scripts that build it (`scripts/`), build and vendoring tools. The repository is itself a `wf` project (`js/developer/webfront.project.json` and its lock, selected with `--manifest-dir js/developer`): the environment builds itself, and its pure JavaScript specs (`test/developer/`) run with `wf test`. Production C++ remains header-only in `include/webfront/`.
- `test/fixtures/`, `test/web/fixtures/`: retained regression fixtures, not public example applications.
- `test/unit/`: Catch2 unit tests; `test/web/`: real-browser integration (`suite/` is the WebFront project of the Jasmine specs, run by `webtest` through `wf test`); `test/driver/`: `webfront-wf`, the non-interactive `wf` driver for tests; `test/fuzz/`, `test/fixtures/`; `test/cmake/`: CMake test scripts and sub-projects. The `RepositoryLayout` CTest case pins the tracked root.
- `cmake/`: build modules (frontends, CEF, CPM, compiler options); `.github/`: workflows, `.github/CONTRIBUTING.md`.
- `docs/`: documentation, `docs/CHANGELOG.md`, `docs/Doxyfile.in`.
- `docs/`: current reference guides, architecture decisions and `docs/CHANGELOG.md`.
- `docs/PROJECT_STATUS.md`: evidence-based status snapshot and known limitations.
- `docs/adr/README.md`: architecture decision index, Git history, tradeoffs and implementation rules; read the relevant ADRs before changing their contracts.
- `docs/DEVELOPER_ENVIRONMENT.md`: the reference of the developer environment (`wf` commands, manifest and lock, TypeScript and `wf check`, tests, limits, distribution); `docs/EMBEDDED_ASSETS.md`: the core's embedded resources and their regeneration; `docs/NODE_TOOLS_MIGRATION.md`: where each former Node.js tool went (historical record).
- `docs/UI_COMPONENTS.md`: what replaced the removed terminal component and `wf` tool manager, with the migration to `webfront::Commands`.
- `docs/ISSUE_AUDIT.md`: recommendations for the GitHub backlog (dated audit; the epic #303 reshaped the scope afterwards).
- `docs/DEVELOPER_ENVIRONMENT.md`: the reference of the developer environment (`wf` commands, manifest and lock, TypeScript and `wf check`, tests, limits, distribution); `docs/EMBEDDED_ASSETS.md`: the core's embedded resources and their regeneration.

The historical `webfront/` prototype and the former top-level `webtest/` are gone: use `test/unit/` for current C++ tests and `test/web/` for browser tests. Do not revive legacy code without a specific issue and regression coverage.

Expand Down Expand Up @@ -115,7 +113,7 @@ Exception: a purely C++ change that reuses an existing encoding, introduces no n
- Every bug fix needs a failing regression test at the lowest useful level. Bridge changes also need the browser integration test.
- Tests must not require user input, a fixed pre-existing browser session, or public network access after dependencies are configured.

Before declaring work complete, run the CEF-off build and CTest suite. Run the CEF/Xvfb test when changing the bridge, browser lifecycle, module serving, Jasmine assets, or CEF frontend. These PRs must also dispatch `BuildAndTest.yml` on the PR head branch before merging (`gh workflow run BuildAndTest.yml --ref <pr-branch>`), then wait for both GCC and Clang CEF jobs to pass. Manual dispatch runs the extended CEF/sanitizer checks without repeating the desktop matrix by default. To also repeat every desktop CTest case three times for stability validation, dispatch with `-f repeat_desktop_tests=true`. It is the required per-PR CEF validation for these changes; the weekly run is a backstop, not a substitute. Update README/status documentation when commands, public behavior, or limitations change. The `NewcomerDocsMatchExamples` CTest case fails when the README quick-start commands or snippets drift from the examples, CMake targets, or CI commands, and `AddSubdirectoryConsumer` builds a minimal parent project linking `WebFront::WebFront`.
Before declaring work complete, run the CEF-off build and CTest suite. Run the CEF/Xvfb test when changing the bridge, browser lifecycle, module serving, Jasmine assets, or CEF frontend. These PRs must also dispatch `BuildAndTest.yml` on the PR head branch before merging (`gh workflow run BuildAndTest.yml --ref <pr-branch>`), then wait for both GCC and Clang CEF jobs to pass. Manual dispatch runs the extended CEF/sanitizer checks without repeating the desktop matrix by default. To also run the complete desktop CTest suite three times, resetting its fixtures on each pass, dispatch with `-f repeat_desktop_tests=true`. It is the required per-PR CEF validation for these changes; the weekly run is a backstop, not a substitute. Update README/status documentation when commands, public behavior, or limitations change. The `NewcomerDocsMatchExamples` CTest case fails when the README quick-start commands or snippets drift from the examples, CMake targets, or CI commands, and `AddSubdirectoryConsumer` builds a minimal parent project linking `WebFront::WebFront`.

## Git and workspace safety

Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if(MSVC AND NOT WEBFRONT_USE_MDDLOG AND WEBFRONT_IS_TOP_LEVEL)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake ${CMAKE_CURRENT_LIST_DIR}/js/core ${CMAKE_CURRENT_LIST_DIR}/docs ${CMAKE_CURRENT_LIST_DIR}/test/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake ${CMAKE_CURRENT_LIST_DIR}/js/core ${CMAKE_CURRENT_LIST_DIR}/test/cmake)
if(WEBFRONT_IS_TOP_LEVEL)
include(StandardProjectSettings)
include(PreventInSourceBuilds)
Expand Down Expand Up @@ -83,7 +83,6 @@ include(Sanitizers)
enable_sanitizers(WebFront_options)

if(WEBFRONT_IS_TOP_LEVEL)
configure_file(docs/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile)
include(Doxygen)
enable_doxygen()

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,4 @@ CI runs one combined C++ / native-browser job per desktop platform on each code
- Development project access is explicit and intended for trusted local code. Downloaded tools run with the application's bridge authority, and script permissions frame only the `context` API: neither is a sandbox. Only packages that run in a browser are supported; installation scripts and native add-ons are not executed. Builds transform TypeScript without type checking; `wf check` type-checks with the compiler the project locks.
- Packaging, accessibility and native-engine deployment still need application-specific work. General DOM abstractions remain future work. See [project status](docs/PROJECT_STATUS.md) for known limitations.

[Developer environment reference](docs/DEVELOPER_ENVIRONMENT.md) · [UI components](docs/UI_COMPONENTS.md) · [architecture decisions](docs/adr/README.md) · [contributing](.github/CONTRIBUTING.md)
[Developer environment reference](docs/DEVELOPER_ENVIRONMENT.md) · [architecture decisions](docs/adr/README.md) · [contributing](.github/CONTRIBUTING.md)
15 changes: 15 additions & 0 deletions cmake/Doxygen.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function(enable_doxygen)
option(ENABLE_DOXYGEN "Enable doxygen doc builds of source" OFF)
if(ENABLE_DOXYGEN)
set(DOXYGEN_CALLER_GRAPH YES)
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_EXTRACT_ALL YES)
find_package(Doxygen REQUIRED OPTIONAL_COMPONENTS dot)
set(DOXYGEN_GENERATE_LATEX NO)
set(DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION}")
doxygen_add_docs(doxygen-docs "${PROJECT_SOURCE_DIR}/include" ALL
COMMENT "Generating API documentation with Doxygen")
# Keep the previous target as an alias; FindDoxygen owns the generated configuration.
add_custom_target(doc_doxygen DEPENDS doxygen-docs)
endif()
endfunction()
29 changes: 26 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

## Unreleased

- HTTP status-line buffers belong to each response until its asynchronous send ends (#376).
Ordinary responses announce `Connection: close`, matching the existing one-request-per-socket
server behavior; WebSocket upgrades remain open. Unit and real-browser regressions cover
pending response independence, closure headers and concurrent success/error responses.
- Developer specs report each started spec to the native driver; self-build watchdogs expire
before CTest so a stalled page leaves useful output and a nonzero status (#376).
- CI stability runs repeat the complete CTest fixture graph three times, retaining
a separate JUnit report per pass and stopping on the first failure (#376).
Reruns remove old numbered reports before starting, and optional spec-progress
diagnostics cannot fail specs when the driver callback is absent or disconnected.
Repeating each stateful journey step in isolation tried to initialize an already
initialized project; an offline CMake regression demonstrates the failure and
checks whole-suite repetition and failure propagation.
- Isolate the GET/HEAD gzip failure tests from the one-job admission limit (#376):
receiving a response does not imply that its server-side lease has been released.
Browser integration reports its current phase, and failed macOS CI jobs retain WebKit
system logs and crash reports alongside CTest diagnostics.
- Remove completed migration/audit notes and obsolete timing narratives, update their
references, and retain historical migration links at their original Git revision (#376).
Replace the unused 2,698-line Doxyfile template with CMake's generated configuration;
both documentation targets generate the public headers with the project version,
and Graphviz is optional. Active build, test and publication scripts remain in use.

## 0.5.0 - 2026-10-26

- Gzip identity fallback reuses a bounded validated-representation cache for GET and HEAD (#281).
Expand Down Expand Up @@ -111,7 +134,7 @@
v1.3), with a Catch2 scenario that decodes each of them. `NoNodeDependency` audits every file and
`NoNodeDependencyRejectsInjections` proves the guard. The Node.js tools, `vendor/package*.json` and the comparison job
of *Developer packages* are deleted; every CI job removes the JavaScript runtimes from the runner first. The record of
each former tool and test is `docs/NODE_TOOLS_MIGRATION.md`.
each former tool and test is [migration record](https://github.com/ambroise-leclerc/WebFront/blob/c9f5770273999ead7cff5e61f1d2a22a9ffbce89/docs/NODE_TOOLS_MIGRATION.md).

- The developer environment builds itself (#315, distribution 0.6.1, published as `developer-v0.6.1` and pinned by `DeveloperReleaseData.hpp`, and by the bootstrap of the tests): the
repository is a `wf` project (`webfront.project.json`, `webfront-packages.lock.json`) and the scripts of
Expand All @@ -122,7 +145,7 @@
are those of the Node.js build, twice in a row (CTest `SelfBuild*`, job `wf-package` of *Developer packages*). The
publication runs without Node.js (`pages.sh`, `archive-release.sh`, a shell tag check); `-DWEBFRONT_REQUIRE_NODE=OFF`
configures a test build without it. The inventory of the Node.js tools and their destination is
`docs/NODE_TOOLS_MIGRATION.md`; the maintainer procedure is `js/developer/tools/PUBLISHING.md`.
[migration record](https://github.com/ambroise-leclerc/WebFront/blob/c9f5770273999ead7cff5e61f1d2a22a9ffbce89/docs/NODE_TOOLS_MIGRATION.md); the maintainer procedure is `js/developer/tools/PUBLISHING.md`.

- `webfront-wf` test driver and bootstrap provisioning (#321, developer distribution 0.6.0 published as `developer-v0.6.0`, pinned by `DeveloperReleaseData.hpp` and by the bootstrap): runs one `wf` command without interaction on a project
and exits with its status (64 usage, 70 bootstrap failure, 71 time limit, 72 no result), with an optional JSON report.
Expand Down Expand Up @@ -200,7 +223,7 @@
- **Breaking:** the terminal component and the `wf` tool manager (#313): `webfront::Terminal`, `terminal::Shell`,
`webfront::ToolManager`, `fs::TerminalFS`, `fs::ToolManagerFS`, `fs::ToolStore`, `fs::PackageFS`, their embedded
modules, the embedded xterm.js copy, `third_party/xterm` and `cmake/UpdateXterm.cmake`. The developer environment's
terminal and `webfront::Commands` replace them; `docs/UI_COMPONENTS.md` describes the migration. xterm.js is a
terminal and `webfront::Commands` replace them; [migration record](https://github.com/ambroise-leclerc/WebFront/blob/c9f5770273999ead7cff5e61f1d2a22a9ffbce89/docs/UI_COMPONENTS.md) describes the migration. xterm.js is a
locked dependency of the environment archive. `fs::tools::safeRelativePath` becomes `fs::safeRelativePath`
(`<webfront/system/SafePath.hpp>`).

Expand Down
3 changes: 1 addition & 2 deletions docs/DEVELOPER_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ open, Enter starts a new session. No system shell is exposed.
- **Output streams** while a command runs, for `wf` and C++ commands alike, without a size limit: C++ output is
sent in pieces below the 65,535-byte limit of bridge strings.

An application adds its own commands with `webfront::Commands` (`<webfront/Commands.hpp>`), which replaces
`terminal::Shell` of the removed terminal component ([migration](UI_COMPONENTS.md)). A command is a coroutine:
An application adds its own commands with `webfront::Commands` (`<webfront/Commands.hpp>`). A command is a coroutine:

```cpp
#include <webfront/Commands.hpp>
Expand Down
Loading
Loading