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
15 changes: 13 additions & 2 deletions .github/workflows/DeveloperDistribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,25 @@ jobs:
- name: Install pinned maintenance dependencies
run: npm ci --prefix js/developer/vendor --ignore-scripts
- name: Build and verify the environment and starter packages
env:
PUBLISHING: ${{ startsWith(github.ref, 'refs/tags/developer-v') || (github.event_name == 'workflow_dispatch' && inputs.publish) }}
run: |
node js/developer/tools/build.mjs build-distribution
node js/developer/tools/build.mjs build-distribution-repeat
cmp build-distribution/environment.tgz build-distribution-repeat/environment.tgz
cmp build-distribution/pi-starter.tgz build-distribution-repeat/pi-starter.tgz
cmp build-distribution/life-starter.tgz build-distribution-repeat/life-starter.tgz
cmp include/webfront/system/DeveloperReleaseData.hpp build-distribution/DeveloperReleaseData.hpp
node --test js/developer/tools/check.mjs js/developer/tools/distribution-check.mjs
# The pin names the last published version. Sources at that version must rebuild it; sources ahead of it
# leave the header pinning the published archive, which is checked against the deployed file.
pinned=$(sed -n 's/.*version{"\([^"]*\)"}.*/\1/p' include/webfront/system/DeveloperReleaseData.hpp)
building=$(node -p "require('./js/developer/tools/distribution.json').version")
if [ "$pinned" = "$building" ] || [ "$PUBLISHING" = true ]; then
cmp include/webfront/system/DeveloperReleaseData.hpp build-distribution/DeveloperReleaseData.hpp
else
echo "::notice::Sources build $building; DeveloperReleaseData.hpp still pins the published $pinned."
node js/developer/tools/pin-check.mjs
fi
node --test js/developer/tools/check.mjs js/developer/tools/distribution-check.mjs js/developer/tools/manifest-check.mjs
- name: Check the dedicated release tag
if: startsWith(github.ref, 'refs/tags/developer-v')
env:
Expand Down
13 changes: 13 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## Unreleased

### Added

- Project manifest `webfront.project.json` (format 1: `name`, `version`, `dependencies`, `registry`, `scripts`,
`entries`, `providers`, `test`, `permissions`), strictly validated; `wf init`, `wf install [--update]` and
manifest-driven `wf preview`/`wf embed` in developer distribution 0.5.0 (not published yet; the pin in
`DeveloperReleaseData.hpp` stays on 0.4.1 until 0.5.0 is published and verified). The lock records the digest of
the manifest dependencies and reports a desynchronized state. `developer::Store::commitGroup` publishes
manifest and lock through a synced intent journal with crash recovery and a concurrent-install precondition.
New bridge callbacks `webfront.developer.state` and `webfront.developer.commitGroup`. Starters ship a manifest;
`wf install` now needs `wf init` first, which adopts the roots of an existing lock so a project locked before 0.5.0
keeps its locked graph. A committed publication that cannot be completed does not prevent opening the project:
it is reported (`developer::IncompletePublication`) and completed by the next command.

### Changed

- **Breaking:** library headers moved to `include/webfront/`; include them as `<webfront/WebFront.hpp>`,
Expand Down
69 changes: 66 additions & 3 deletions docs/DEVELOPER_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ native tests from empty working directories, with developer callbacks absent. Pa
HTTP 200, CORS `*` and the pinned archive bytes. These checks supplement offline CTest fixtures.

The default configuration is generated in `include/webfront/system/DeveloperReleaseData.hpp` and targets
`https://ambroise-leclerc.github.io/WebFront/developer/0.4.1/environment.tgz`. This version, published and archived as `developer-v0.4.1`, generates providers that include `<webfront/system/FileSystem.hpp>`. Published 0.4.0 stays immutable but targets the former include layout. The configuration pins one version and
`https://ambroise-leclerc.github.io/WebFront/developer/0.4.1/environment.tgz`. This version, published and archived as `developer-v0.4.1`, generates providers that include `<webfront/system/FileSystem.hpp>`. Published 0.4.0 stays immutable but targets the former include layout. The sources are ahead of that pin: `distribution.json` names 0.5.0 (the project manifest), which is not pinned until it has been published and verified (see `js/developer/tools/PUBLISHING.md`). The configuration pins one version and
its SHA-512 rather than resolving a mutable `latest` channel. An explicit
`DeveloperBootstrapOptions{.environment = url, .integrity = trustedHash}` still selects a different
HTTPS/CORS repository or a same-origin test fixture. Users install neither npm nor Node.js.
Expand Down Expand Up @@ -139,6 +139,69 @@ The PI starter remains available through `wf create pi` for existing projects an
coverage. Its sources are maintained under `js/developer/tools/starters/pi/`; the public C++
examples are limited to Hello World and Life. Existing embedded React/Babel providers remain supported.

## Project manifest (`webfront.project.json`)

Available from developer distribution 0.5.0, which is not published yet: the default configuration still pins 0.4.1, whose environment predates the manifest.
A project has one manifest, the equivalent of `package.json`, which every `wf` command reads:

```json
{
"format": 1,
"name": "life",
"version": "0.1.0",
"dependencies": {"react": "^19.3.1", "react-dom": "^19.3.1"},
"registry": "https://registry.npmjs.org/",
"scripts": {},
"entries": {"main": "ui/main.tsx"},
"providers": {"LifeUI": {"entry": "main", "output": "generated/LifeUI.hpp"}},
"test": {"specs": []},
"permissions": {}
}
```

Only `format`, `name` and `version` are required. Validation is strict: an unknown key, a format
newer than the environment reads, a path leaving the project, a non-HTTPS registry or origin and an
unknown permission are errors printed in the terminal, never silently ignored. `scripts`, `test` and
`permissions` are validated here and used by the later commands (#307, #310); permissions will only
frame the operations of the `context` API of authorized scripts, they are not a sandbox.

- `wf init [name]` writes `webfront.project.json` at the project root, the manifest every `wf` command
reads; it never replaces an existing one. When a lock already exists (a project installed before
0.5.0), the manifest takes its roots as dependencies (`^version`, or the range they were installed with).
- `wf install <package>[@range]` resolves, downloads and verifies into the cache, then publishes the
manifest (the requested range, or `^version` when none was given) and the lock in a single transaction.
- `wf install` without argument installs exactly the locked graph (like `npm ci`) when the lock agrees
with the manifest, resolves the manifest and creates the lock when there is none, and fails when they
disagree. `wf install --update` resolves the manifest again.
- `wf preview [entry]` and `wf embed <provider>` use `entries` and `providers`; an explicit path still works.
`wf embed <provider>` generates the C++ class `webfront::fs::<provider>`; with `--output <Provider.hpp>`,
the file name must be a C++ class name.
- A requested range is checked like the manifest that records it, before anything is resolved: a range or
tag the manifest cannot hold is refused instead of written. The manifest is rewritten with the keys it had,
plus the new dependencies.

The manifest holds the intent (roots and ranges), the lock the exact resolution. The lock records a
digest of the manifest's `dependencies` (`manifestDigest`). The project is **consistent** when they
match, **unlocked** without a lock (no installed graph) and **desynchronized** when the dependencies
changed since the lock was written; every command reports that state and none resolves implicitly.
A lock written before 0.5.0 has no digest: it is used as consistent when its roots satisfy the
dependencies (after `wf init`, they do), and `wf install` records the digest without resolving anything.

Both files are published by one all-or-nothing transaction (`developer::Store::commitGroup`): the
staged files are moved under `.webfront/developer/journal/`, a journal naming them is written and
synchronized to disk (the commit point), then each file replaces its target. Opening the project
completes a journal that reached its commit point and abandons the others, so a crash never leaves
a manifest and a lock that belong to different installations. A failure before the commit point returns
the staged files to their transactions. A committed publication whose replacement fails (a target turned
into a directory, a file locked by another program) is reported as committed but not applied yet; its
journal is kept, the project still opens, and every later command first completes it, failing with the
cause until it can. The publication carries a precondition,
the fingerprint of both files as read when the command began: if another browser or command changed
them meanwhile, it is refused with "The project changed since it was read; run the command again" and
nothing is lost. Recovery and group publications also hold an advisory lock on `.webfront/developer/journal/.lock`, so
several processes sharing a project (or several stores of one process) are serialized rather than abandoning one
another's publication; other project files stay unprotected against concurrent local modification. `wf restore` (#306) will fill the cache from a consistent lock without ever writing them.

## Dependencies, storage and limitations

- `wf install` accepts exact versions, registry tags and semver ranges, resolves ordinary
Expand All @@ -150,8 +213,8 @@ examples are limited to Hello World and Life. Existing embedded React/Babel prov
- Browser/production exports, ESM, CommonJS, TS/TSX, JSX, CSS and imported resource files are supported.
Private package exports, network imports and unavailable Node built-ins fail. Package-specific
build pipelines and automatic polyfills are not supplied.
- `webfront-packages.lock.json` records exact package versions, dependency edges, source integrities
and requested roots. Commit it and the source TSX/CSS; the generated provider can also be committed.
- `webfront-packages.lock.json` records exact package versions, dependency edges, source integrities,
requested roots and the digest of the manifest dependencies it resolved. Commit it and the source TSX/CSS; the generated provider can also be committed.
Preview/embed consume the locked local files without resolving versions again.
- Unpacked packages are cached by name, version and integrity under `.webfront/developer/packages/`.
A failed install can leave unused cached packages, but the lock file remains unchanged. The tools
Expand Down
3 changes: 2 additions & 1 deletion docs/PROJECT_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ removed without redirect headers (see `docs/CHANGELOG.md`). Browser sources live
(bridge, fallback, bootstrap loader and embedding modules) and `js/developer/` (environment, terminal
components, build tools, vendoring tools); tests live in `test/{unit,web,fuzz,fixtures,cmake}`. The CTest
case `RepositoryLayout` enforces the root. The generated-provider include changed, so the developer
distribution is bumped to 0.4.1, published and archived as `developer-v0.4.1`.
distribution is bumped to 0.4.1, published and archived as `developer-v0.4.1`. Version 0.5.0 (project manifest, #305) is
built from the sources but not pinned: `DeveloperReleaseData.hpp` moves to it only after `developer-v0.5.0` is published and verified.

## CI test duration (#298, 2026-10-21)

Expand Down
2 changes: 1 addition & 1 deletion docs/adr/ADR-009-modules-et-assets-reproductibles.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| 1.5 | 2026-10-16 | Acceptée | Ambroise Leclerc | Contrôle des fins de ligne LF des sources et en-têtes embarqués. | [520ca23](https://github.com/ambroise-leclerc/WebFront/commit/520ca23fa694519d9f428ed3661e64dcfdf906a2) |
| 1.6 | 2026-10-19 | Acceptée | Ambroise Leclerc | Négociation gzip/identity, décodage validé et budget de sortie. | [4be7358](https://github.com/ambroise-leclerc/WebFront/commit/4be73581ee6b9f569cb6e50aced73e27562aa38c) |
| 2.0 | 2026-10-19 | Acceptée | Ambroise Leclerc | Génération gzip reproductible avec compresseur intégré ; distributions actualisées et runtime React ESM local. | [b031ab5](https://github.com/ambroise-leclerc/WebFront/commit/b031ab58ea9cc32290d701094c1333bab455e67f) |
| 2.1 | 2026-10-22 | Acceptée | Ambroise Leclerc | Assets embarqués limités à la liste normative de l'ADR-016 ; trajectoire de retrait de BabelFS, ReactFS, JasmineFS et des sources vendorisées. | À renseigner après fusion de l'issue #304. |
| 2.1 | 2026-10-22 | Acceptée | Ambroise Leclerc | Assets embarqués limités à la liste normative de l'ADR-016 ; trajectoire de retrait de BabelFS, ReactFS, JasmineFS et des sources vendorisées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) |

## État et chronologie

Expand Down
2 changes: 1 addition & 1 deletion docs/adr/ADR-010-composants-et-outils-optionnels.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| 1.3 | 2026-10-15 | Acceptée | Ambroise Leclerc | Recherche, installation et ouverture des outils via une extension navigateur. | [18d5bb4](https://github.com/ambroise-leclerc/WebFront/commit/18d5bb4c5db6e4dc5ecf4867378d451887b2c133) |
| 1.4 | 2026-10-15 | Acceptée | Ambroise Leclerc | Validation des outils avec un registre local factice. | [d53ffcc](https://github.com/ambroise-leclerc/WebFront/commit/d53ffcc40102c7405eb7060d7021aad366d6d7e9) |
| 1.5 | 2026-10-16 | Acceptée | Ambroise Leclerc | Interruption des commandes navigateur et transferts séquentiels par blocs de 256 KiB. | [c81f7f7](https://github.com/ambroise-leclerc/WebFront/commit/c81f7f74728ad24a53c16f907e016eb0fe1b8bce) |
| 1.6 | 2026-10-22 | Acceptée | Ambroise Leclerc | Trajectoire de retrait de Terminal.hpp, ToolManager.hpp, ToolStore et PackageFS au profit de l'environnement bootstrap (ADR-016). | À renseigner après fusion de l'issue #304. |
| 1.6 | 2026-10-22 | Acceptée | Ambroise Leclerc | Trajectoire de retrait de Terminal.hpp, ToolManager.hpp, ToolStore et PackageFS au profit de l'environnement bootstrap (ADR-016). | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) |

## État et chronologie

Expand Down
2 changes: 1 addition & 1 deletion docs/adr/ADR-013-bootstrap-developpeur-a-la-demande.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Version | Date | État | Auteur | Évolution | Commit |
| --- | --- | --- | --- | --- | --- |
| 0.1 | 2026-10-20 | Proposée | Ambroise Leclerc | Proposition et première implémentation du bootstrap développeur versionné. | À renseigner après intégration. |
| 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | À renseigner après fusion de l'issue #304. |
| 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) |

## Statut et date

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Version | Date | État | Auteur | Évolution | Commit |
| --- | --- | --- | --- | --- | --- |
| 0.1 | 2026-10-20 | Proposée | Ambroise Leclerc | Proposition et première implémentation du résolveur npm et du compilateur navigateur. | À renseigner après intégration. |
| 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | À renseigner après fusion de l'issue #304. |
| 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) |

## Statut et date

Expand Down
2 changes: 1 addition & 1 deletion docs/adr/ADR-015-ressources-generees-par-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Version | Date | État | Auteur | Évolution | Commit |
| --- | --- | --- | --- | --- | --- |
| 0.1 | 2026-10-20 | Proposée | Ambroise Leclerc | Proposition et première implémentation de wf embed et du parcours hors ligne. | À renseigner après intégration. |
| 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | À renseigner après fusion de l'issue #304. |
| 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) |

## Statut et date

Expand Down
2 changes: 1 addition & 1 deletion docs/adr/ADR-016-bootstrap-comme-socle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Version | Date | État | Auteur | Évolution | Commit |
| --- | --- | --- | --- | --- | --- |
| 1.0 | 2026-10-22 | Acceptée | Ambroise Leclerc | Décision initiale : environnement bootstrap comme architecture de base, liste normative du cœur, scripts autorisés, indépendance vis-à-vis de Node.js. | À renseigner après fusion de l'issue #304. |
| 1.0 | 2026-10-22 | Acceptée | Ambroise Leclerc | Décision initiale : environnement bootstrap comme architecture de base, liste normative du cœur, scripts autorisés, indépendance vis-à-vis de Node.js. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) |

## Statut et date

Expand Down
2 changes: 2 additions & 0 deletions include/webfront/DeveloperApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class BasicDeveloperApp : public BasicWF<NetProvider, fs::Multi<fs::DeveloperFS,
expose<&Store::write, void, std::string, std::string, std::uint64_t, Bytes>("webfront.developer.write");
expose<&Store::commit, void, std::string>("webfront.developer.commit");
expose<&Store::abort, void, std::string>("webfront.developer.abort");
expose<&Store::stateOfLines, std::string, std::string>("webfront.developer.state");
expose<&Store::commitGroupLines, void, std::string, std::string, std::string>("webfront.developer.commitGroup");
}

/// Registers a store operation as a bridge callback; the store stays alive as long as the callback.
Expand Down
Loading
Loading