diff --git a/.gitattributes b/.gitattributes index 615e178f..fcdb4466 100644 --- a/.gitattributes +++ b/.gitattributes @@ -65,5 +65,5 @@ js/developer/tools/* text eol=lf # The wf project of the repository: its scripts, manifest and lock are hashed inputs of the self-build. js/developer/scripts/* text eol=lf -webfront.project.json text eol=lf -webfront-packages.lock.json text eol=lf +js/developer/webfront.project.json text eol=lf +js/developer/webfront-packages.lock.json text eol=lf diff --git a/.github/actions/wf-driver/action.yml b/.github/actions/wf-driver/action.yml index 8908985f..0911c62f 100644 --- a/.github/actions/wf-driver/action.yml +++ b/.github/actions/wf-driver/action.yml @@ -34,7 +34,7 @@ runs: #!/usr/bin/env bash # Messages.hpp prints its encoding trace to the standard output: it is not part of a command's result. export WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 - xvfb-run -a "$GITHUB_WORKSPACE/build-driver/test/web/webfront-wf" --project "$GITHUB_WORKSPACE" "\$@" 2>&1 \\ + xvfb-run -a "$GITHUB_WORKSPACE/build-driver/test/web/webfront-wf" --project "$GITHUB_WORKSPACE" --manifest-dir js/developer "\$@" 2>&1 \\ | grep --line-buffered -v -e '^-> encoded to string of size' -e '^bufferIndex = ' exit "\${PIPESTATUS[0]}" SCRIPT diff --git a/.github/workflows/DeveloperDistribution.yml b/.github/workflows/DeveloperDistribution.yml index e2425c3e..78c0e83d 100644 --- a/.github/workflows/DeveloperDistribution.yml +++ b/.github/workflows/DeveloperDistribution.yml @@ -10,8 +10,8 @@ on: - 'examples/life/ui/**' - 'js/developer/tools/**' - 'test/developer/**' - - 'webfront.project.json' - - 'webfront-packages.lock.json' + - 'js/developer/webfront.project.json' + - 'js/developer/webfront-packages.lock.json' - 'cmake/WebFrontBootstrap.cmake' - 'include/webfront/system/DeveloperReleaseData.hpp' - '.github/actions/wf-driver/**' @@ -26,8 +26,8 @@ on: - 'examples/life/ui/**' - 'js/developer/tools/**' - 'test/developer/**' - - 'webfront.project.json' - - 'webfront-packages.lock.json' + - 'js/developer/webfront.project.json' + - 'js/developer/webfront-packages.lock.json' - 'cmake/WebFrontBootstrap.cmake' - 'include/webfront/system/DeveloperReleaseData.hpp' - '.github/actions/wf-driver/**' @@ -131,7 +131,7 @@ jobs: run: | set -euo pipefail gh auth setup-git - # In the workspace, since the wf script writes inside the project (permissions.publish of webfront.project.json). + # In the workspace, since the wf script writes inside the project (permissions.publish of js/developer/webfront.project.json). site=build-site git init --initial-branch=gh-pages "$site" git -C "$site" remote add origin "https://github.com/$GITHUB_REPOSITORY.git" diff --git a/AGENTS.md b/AGENTS.md index 025f45a4..4207623e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ 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 (`webfront.project.json` and its lock at the root): 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`. `docs/NODE_TOOLS_MIGRATION.md` records where each former Node.js tool went. 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`. @@ -67,7 +67,7 @@ Build the developer environment with wf (the driver comes from any build with `E `js/developer/tools/PUBLISHING.md` describes: ```bash -wf() { build/test/web/webfront-wf --project "$PWD" -- "$@"; } +wf() { build/test/web/webfront-wf --project "$PWD" --manifest-dir js/developer -- "$@"; } wf restore && wf run build build-distribution ``` diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9a275996..999d763a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- The manifest and the lock of the repository move to `js/developer/` (#354): the driver and the CI select them with `--manifest-dir js/developer`, and the closed list of the root loses two entries (9 left). + - The test bootstrap environment is the published 0.6.2 (#354), which installs the archives of `@types` packages and honours a manifest directory; the README walkthrough no longer needs a local archive for `wf check`. - The manifest and the lock of a project may live in a directory of the project (#354): `DeveloperBootstrapOptions::manifestDirectory` (validated, passed in the bootstrap configuration only when set) and `webfront-wf --manifest-dir`; the environment derives `manifestPath` and `lockPath` from it, and a script still never writes them. Paths inside the manifest stay relative to the project root. Environment 0.6.2, not yet published; an earlier environment ignores the option. diff --git a/docs/DEVELOPER_ENVIRONMENT.md b/docs/DEVELOPER_ENVIRONMENT.md index 0cfe9db2..51e989a9 100644 --- a/docs/DEVELOPER_ENVIRONMENT.md +++ b/docs/DEVELOPER_ENVIRONMENT.md @@ -589,9 +589,9 @@ blocks the public network after the configure step. ## Environment distribution and offline tests (maintainers) -The environment builds itself (#315). The repository is a `wf` project: `webfront.project.json` declares the build +The environment builds itself (#315). The repository is a `wf` project, with its manifest and lock in `js/developer/` (the driver is given `--manifest-dir js/developer` and the project is the repository): `js/developer/webfront.project.json` declares the build dependencies (esbuild-wasm, semver, xterm and its fit addon, and the React versions the starters pin), the scripts -and the permissions (`files` it reads, `publish` where it writes), and `webfront-packages.lock.json` locks them by +and the permissions (`files` it reads, `publish` where it writes), and `js/developer/webfront-packages.lock.json` locks them by SHA-512. The scripts of `js/developer/scripts/` run in the pinned bootstrap environment with the driver `webfront-wf` (see [the test driver](#the-test-driver-webfront-wf-and-the-bootstrap-environment)). They prepare a tarball that application developers can download. No command publishes anything to a registry automatically. diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index e940f554..7af0a5c3 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -53,8 +53,8 @@ case needs no prepared fixtures: configure downloads the registry's packages (#3 ## Self-hosted developer environment (#315, epic #303) -The repository is a `wf` project (`webfront.project.json`, `webfront-packages.lock.json` at the root, the only files added -to the closed root list). The pinned 0.6.2 bootstrap environment runs `js/developer/scripts/build.mjs` with `webfront-wf`: +The repository is a `wf` project (`js/developer/webfront.project.json` and `js/developer/webfront-packages.lock.json`, selected by the driver's +`--manifest-dir js/developer`, so that the root stays short). The pinned 0.6.2 bootstrap environment runs `js/developer/scripts/build.mjs` with `webfront-wf`: the locked esbuild-wasm bundles the environment in the script's Worker, and `environment.tgz`, the starters, `provision.json`, the pinned header and (with `--refresh-bootstrap`) the bootstrap bundles and their checksums come out the same twice in a row, and byte for byte as the 0.6.2 that is published (`sha512-SYnS6iRd...`). `site.mjs` stages the Pages diff --git a/docs/adr/ADR-016-bootstrap-comme-socle.md b/docs/adr/ADR-016-bootstrap-comme-socle.md index 1edfb52e..5634ec74 100644 --- a/docs/adr/ADR-016-bootstrap-comme-socle.md +++ b/docs/adr/ADR-016-bootstrap-comme-socle.md @@ -108,9 +108,9 @@ reconstruction (#315). Toute autre exception exige une révision de cette ADR. ### Auto-hébergement de l'environnement (#315) -Le dépôt est lui-même un projet `wf` : `webfront.project.json` (dépendances de construction exactes, scripts, permissions) et -`webfront-packages.lock.json` (intégrités SHA-512) sont à la racine, qui reste une liste fermée où ces deux fichiers -s'ajoutent. Les scripts `js/developer/scripts/` (`build.mjs`, `site.mjs`, `pin.mjs`) s'exécutent dans l'environnement +Le dépôt est lui-même un projet `wf` : `js/developer/webfront.project.json` (dépendances de construction exactes, scripts, permissions) et +`js/developer/webfront-packages.lock.json` (intégrités SHA-512) sont dans `js/developer/`, désignés par `--manifest-dir` +(#354) ; la racine reste une liste fermée. Les scripts `js/developer/scripts/` (`build.mjs`, `site.mjs`, `pin.mjs`) s'exécutent dans l'environnement d'amorçage épinglé (`cmake/WebFrontBootstrap.cmake`) par le pilote `webfront-wf`, avec l'esbuild-wasm verrouillé dans le Worker du script : ils lisent les sources du projet et les paquets verrouillés, n'écrivent que sous `permissions.publish` (répertoires `build-*` et sorties versionnées nommées) et n'ont ni shell ni API Node. Ils produisent `environment.tgz`, diff --git a/js/developer/environment/bundles.json b/js/developer/environment/bundles.json index 311c7b3b..90205a85 100644 --- a/js/developer/environment/bundles.json +++ b/js/developer/environment/bundles.json @@ -40,8 +40,8 @@ "js/developer/tools/distribution.json": "a40253717a5a0f2107ad9b96ada3d0487ee35b27a382e19b3b8a2d20388573af", "js/developer/tools/archive.mjs": "bfe9feeb5e4d4e1b7c44c4dec4dcbeab4ae59c2bf16a1d2b32cd6910a2b84e7b", "js/developer/tools/distribution.mjs": "1108b61bc659dd945ba1417aa84337bca03039842d342c95815b5463d87a136e", - "js/developer/scripts/build.mjs": "9d9f2342e86019d7f7452bdd494667fed740b26a34115311494e8a0d29853776", - "webfront.project.json": "24974ea48207b13fb5dac2e164fc433c6c348080f346605a1b132670438d802e", + "js/developer/scripts/build.mjs": "df91efbc9bb19559c36440f0be7ec2b2af406209146a0d8eb88d688803a74c68", + "js/developer/webfront.project.json": "691836184ab09fddf7248920473a0b89402dea1807747deb018c4597049455a8", "js/core/bootstrap/bootstrap.bundle.mjs": "536831257f0fc92e31911841750e1e59247f7c64e756b0fcb878efd9860a741f", "js/developer/environment/packages.bundle.mjs": "413e1dbf24d3993894d6bcbd9c01bd456e446170931f8daacfd06ce537cb2abc", "include/webfront/system/DeveloperReleaseData.hpp": "567a88fed2839a23c2abad2dd9c2b74afe9934b1e1bdf44ec1099d9332b35c90" diff --git a/js/developer/scripts/build.mjs b/js/developer/scripts/build.mjs index 522866e8..597959d3 100644 --- a/js/developer/scripts/build.mjs +++ b/js/developer/scripts/build.mjs @@ -13,7 +13,8 @@ import {packageRoot} from '../environment/paths.mjs'; import {tar} from '../tools/archive.mjs'; import {baseUrl, versionPath, bootstrapHeader, sriOf} from '../tools/distribution.mjs'; -const lockPath = 'webfront-packages.lock.json'; +const manifestPath = 'js/developer/webfront.project.json'; +const lockPath = 'js/developer/webfront-packages.lock.json'; const encoder = new TextEncoder(); const hexOf = bytes => Array.from(new Uint8Array(bytes), byte => byte.toString(16).padStart(2, '0')).join(''); @@ -60,7 +61,7 @@ export default async function (context) { const version = distribution.version; const publicBase = baseUrl(distribution.baseUrl); versionPath(version); - const dependencies = JSON.parse(await project.readText('webfront.project.json')).dependencies; + const dependencies = JSON.parse(await project.readText(manifestPath)).dependencies; const licenses = [ ['esbuild-wasm', lockedFile(lock, 'esbuild-wasm', 'LICENSE.md')], ['semver', lockedFile(lock, 'semver', 'LICENSE')], diff --git a/js/developer/tools/PUBLISHING.md b/js/developer/tools/PUBLISHING.md index 0c48f0a8..5025387f 100644 --- a/js/developer/tools/PUBLISHING.md +++ b/js/developer/tools/PUBLISHING.md @@ -6,7 +6,7 @@ hosts only WebFront's development environment, its pinned Life starter and provi The package names in their manifests are identifiers, not a requirement to own or publish npm scopes. The environment builds itself: the pinned bootstrap environment (`cmake/WebFrontBootstrap.cmake`) runs the scripts of -`js/developer/scripts/` on the sources of this repository, which is a `wf` project (`webfront.project.json` and its +`js/developer/scripts/` on the sources of this repository, which is a `wf` project (`js/developer/webfront.project.json` and its lock). Building, reviewing and publishing need a C++23 compiler, CMake, the engine of the driver's frontend and `gh` and `jq` for the host operations. @@ -19,7 +19,7 @@ works; WebKitGTK on Linux is the one CI uses. cmake -S . -B build-driver -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=ON \ -DWEBFRONT_EMBED_WEBKITGTK=ON -DWEBFRONT_WEBTEST_FRONTEND=WebKitGTK cmake --build build-driver --target webfront-wf -wf() { xvfb-run -a build-driver/test/web/webfront-wf --project "$PWD" -- "$@"; } +wf() { xvfb-run -a build-driver/test/web/webfront-wf --project "$PWD" --manifest-dir js/developer -- "$@"; } wf restore # the locked build dependencies, verified against their SHA-512 wf run build build-distribution # environment, starters, provision.json, pinned header @@ -32,7 +32,7 @@ cmp build-distribution/environment.tgz build-distribution-repeat/environment.tgz (`js/developer/environment/bundles.json`, over the inputs of `js/developer/tools/bundle-inputs.json`) and the pinned header. The core headers that embed the bootstrap bundle (`DeveloperIndexHtmlData.hpp`, `DeveloperBootstrapData.hpp`) are rendered from their sources by CMake, like the others: `cmake --build