redweb 0.13.5 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +20 -3
  2. package/README.md +289 -288
  3. package/contract.d.ts +11 -3
  4. package/docs/APPLICATION.md +98 -0
  5. package/docs/CLI.md +1 -1
  6. package/docs/CLIENT_DEVELOPMENT.md +9 -5
  7. package/docs/COVERAGE_SCOPE_AUDIT.md +7 -0
  8. package/docs/DEFINE_APP_VERIFICATION.md +101 -0
  9. package/docs/DEVELOPMENT.md +1 -1
  10. package/docs/GETTING_STARTED.md +1 -1
  11. package/docs/LIVE_HTML.md +2 -2
  12. package/docs/MIGRATION.md +1 -1
  13. package/docs/MULTIPLAYER_OPERATIONS.md +6 -0
  14. package/docs/RELEASE_TRUST.md +29 -6
  15. package/docs/RUNTIME_DIAGNOSTICS.md +1 -1
  16. package/docs/SOCKET_CONTRACTS.md +6 -3
  17. package/docs/SOCKET_PAGES.md +99 -0
  18. package/docs/SOCKET_PAGE_RELEASE_PREPARATION.md +120 -0
  19. package/docs/SOCKET_PAGE_VERIFICATION.md +85 -0
  20. package/docs/STARTER_LIFECYCLE_VERIFICATION.md +9 -0
  21. package/docs/generated.json +2217 -2154
  22. package/docs/guides/http-websocket.md +4 -4
  23. package/docs/guides/jsx-without-react.md +1 -1
  24. package/docs/reference.json +40 -1
  25. package/docs/releases/0.14.0.json +2208 -0
  26. package/docs/releases/0.15.0.json +2217 -0
  27. package/docs/topics.json +3 -1
  28. package/examples/live-html/cards.js +87 -86
  29. package/examples/live-html/cards.ts +3 -2
  30. package/examples/live-html/chatroom.js +210 -207
  31. package/examples/live-html/chatroom.tsx +6 -2
  32. package/examples/live-html/components.js +103 -102
  33. package/examples/live-html/components.ts +3 -2
  34. package/examples/live-html/counter.js +74 -73
  35. package/examples/live-html/counter.ts +3 -2
  36. package/examples/live-html/jsx-page.js +2 -1
  37. package/examples/live-html/jsx-page.tsx +3 -2
  38. package/index.d.ts +59 -7
  39. package/index.js +3 -0
  40. package/package.json +8 -5
  41. package/recipes/chat/app.test.cjs +3 -1
  42. package/recipes/chat/app.tsx +4 -7
  43. package/recipes/dashboard/app.test.cjs +10 -10
  44. package/recipes/dashboard/app.tsx +29 -29
  45. package/recipes/http-ws/README.md +1 -1
  46. package/recipes/http-ws/app.test.cjs +8 -10
  47. package/recipes/http-ws/app.tsx +9 -20
  48. package/recipes/realtime/app.tsx +3 -6
  49. package/recipes/shared/README.md +10 -1
  50. package/recipes/shared/lifecycle.test.cjs +81 -0
  51. package/recipes/shared/network.cjs +10 -5
  52. package/recipes/site/app.tsx +3 -6
  53. package/recipes/socket/app.tsx +3 -10
  54. package/src/Application.js +239 -0
  55. package/src/StartupCleanup.js +24 -0
  56. package/src/cli/SourceInspector.js +5 -0
  57. package/src/cli/templates.js +6 -6
  58. package/src/htmx/Jsx.js +2 -2
  59. package/src/htmx/LiveHtmlServer.js +14 -5
  60. package/src/htmx/PageManager.js +13 -8
  61. package/src/htmx/PageSocketRoute.js +132 -0
  62. package/src/htmx/ReactiveRenderer.js +8 -2
  63. package/src/htmx/SocketAction.js +19 -0
  64. package/src/htmx/metadata.js +6 -2
  65. package/src/ws/BaseHandler.js +6 -4
  66. package/src/ws/BaseSocketServer.js +13 -13
  67. package/src/ws/HandlerGuard.js +4 -0
  68. package/src/ws/SocketAction.js +16 -0
  69. package/src/ws/SocketContract.js +3 -2
  70. package/src/ws/SocketRoute.js +9 -4
  71. package/recipes/shared/run-app.test.cjs +0 -158
  72. package/recipes/shared/run-app.ts +0 -50
@@ -0,0 +1,120 @@
1
+ # Socket-page release preparation
2
+
3
+ Updated 2026-09-02. The maintainer published client 0.3.0; no core publication or
4
+ hosting deployment was performed during this preparation.
5
+
6
+ ## Client publication verified
7
+
8
+ `redweb-client@0.3.0` was published from the sibling client checkout on
9
+ `codex/socket-page-actions`, commit `3d2bcfec75db367b6e4924bcf430670f5569b1c7`.
10
+ Its package version and lockfile agree, release notes are included, and prepack
11
+ rebuilds the ESM/CommonJS bundles and declarations. Build logs use stderr so
12
+ `npm pack --json` remains machine-readable.
13
+
14
+ After npm's processing delay, the actual public registry returned version 0.3.0,
15
+ the same source commit, and the tested candidate integrity below. A fresh local
16
+ pack independently reproduced the publication's SHA-1
17
+ `def8dcc0bb205ccff68bf8fd1c7ea91b7d289547`, 14 files and 31,378 bytes.
18
+
19
+ ```text
20
+ sha512-hUBa40wdsvWKY5bqeyreDzUhMcaB0e0x0OX+YRyZw6ccri6BBSHnM6eEKMV0wOkprIF2cxDkGNILwAA5ELYkWw==
21
+ ```
22
+
23
+ Core's real dependency installation now resolves that registry artifact, not a
24
+ link. Its lockfile records the actual registry URL and integrity. This verifies
25
+ artifact identity, not a claim that client provenance was available.
26
+
27
+ ## Finish the dependent releases afterward
28
+
29
+ 1. Completed: verify client 0.3.0 registry metadata and install the actual artifact.
30
+ 2. Redweb **0.15.0** now has `redweb-client@^0.3.0`, its real npm lockfile,
31
+ versioned changelog and immutable 69-page 0.15.0 documentation snapshot.
32
+ The final gates below passed; core is ready for manual publication.
33
+ 3. After core publication, update site/tutorial exact dependency pins and locks,
34
+ synchronize the released catalogue, run the downloadable-archive/browser gates,
35
+ then hand off manual Firebase deployment.
36
+
37
+ No future registry URL, integrity value or already-published version was fabricated
38
+ in a lockfile. The site's development tutorial remains undeployable with its
39
+ previous published pins; its candidate-archive tests are not evidence that core
40
+ 0.15.0 is already published. Do not deploy it before step 3.
41
+
42
+ ## Verification completed
43
+
44
+ - Client `npm test`: build, declarations, unit tests, mock-free HTTP/WS integration,
45
+ and headed Chrome passed. Original-source coverage remains 800 statements,
46
+ 543 branches, 125 functions and 667 lines, all 100%. Report:
47
+ `coverage/client-source/af576edc-b382-424b-97a2-bd46ca163832/summary.json`.
48
+ - The actual client tarball installs in a fresh, unlinked application with released
49
+ Redweb 0.14.0. Both module formats and the optional live-html entry load; native
50
+ socket requests wait for terminal replies and preserve null payloads. Actual
51
+ nested HTTP form parsing and the installed Express/body-parser qs versions pass.
52
+ Run the opt-in regression with `REDWEB_VERIFY_CLIENT_RELEASE=1` and
53
+ `tests/integration/client-release.integration.test.js`; it rebuilds/packs the
54
+ sibling client and uses the existing owned-workspace/process helpers.
55
+ - After installing registry client 0.3.0, 308 core tests across 29 suites pass.
56
+ Every `src/htmx/*.js` module, `src/cli/templates.js`, and the socket
57
+ `BaseHandler`, `SocketContract`, `SocketAction` and `HandlerGuard` modules
58
+ reach 100% statements, branches, functions and lines. This is scoped coverage,
59
+ not whole-repository certification. Report: `coverage/socket-page-release`.
60
+ - Canonical examples, protocol declarations, all three TypeScript configurations,
61
+ generated documentation and the prepublication release check pass.
62
+ - The actual downloadable tutorial archive passes independent installation,
63
+ compilation, type tests, mock-free HTTP/WS/SQLite tests, all-four 100% coverage
64
+ of its game/schema modules, and headed Chrome acceptance. The explicit pair was
65
+ core 0.15.0 candidate plus a client 0.3.0 pack byte-identical to npm's artifact;
66
+ no developer links were used inside the extracted application. Its unchanged
67
+ old dependency pins still need replacement after core publication.
68
+ - Core's production audit reports zero vulnerabilities under its application-root
69
+ qs policy. The installed dependency signature audit verifies 428 registry
70
+ signatures and 31 attestations; this aggregate does not claim every package has
71
+ provenance.
72
+ - Fresh site/tutorial locked installs audit with zero reported vulnerabilities.
73
+ The site build, 438-page HTTP/link verification and its seven-module 100%
74
+ documentation coverage scope pass. After restoring npm links, the headed
75
+ three-player tutorial passes login, rejection/input retention, moves, reconnect,
76
+ disconnect presence, win and logout.
77
+ - The complete isolated core package gate passes against registry client 0.3.0
78
+ without a candidate-client override: headed counter/chat/cards/components/JSX,
79
+ private dashboard login and actions, reconnect/disconnect, all six generated
80
+ starters and source-free execution, executable documentation and static export.
81
+ Bundled Live HTML and browser-refresh coverage each remain all-four 100%.
82
+ Report: `coverage/packed-browser/2cc05d98-d6b7-4c54-b5ce-fef4cbb83053`.
83
+ The tested core archive SHA-256 was
84
+ `1fd3fe3b35fd8ec0f9e805df9c3ad6655af40f373e38b44ab0418db71660eb1a`;
85
+ the subsequent evidence-only update to this file changes the final archive hash,
86
+ not its runtime, recipes, declarations or versioned catalogue.
87
+ - The independent senior critic approved the release metadata, actual installed
88
+ client identity and catalogue consistency with no blocking findings. Core
89
+ publication dry run passes. No soak or long fixed-window tests were run.
90
+
91
+ ## Manual next step
92
+
93
+ Publish from the clean `codex/socket-page-actions` core checkout:
94
+
95
+ ```powershell
96
+ Set-Location C:\Users\arkam\Documents\redweb
97
+ $env:NODE_OPTIONS = '--use-system-ca'
98
+ npm publish
99
+ ```
100
+
101
+ The system-trust-store option preserves TLS verification. Do not disable TLS
102
+ checks. Do not publish the client again or deploy the site yet. After core is
103
+ available in npm, replace the site's/tutorial's old pins with verified registry
104
+ dependencies and synchronize the 0.15.0 catalogue before rebuilding and deploying.
105
+
106
+ ## Dependency mitigation, not a library-level promise
107
+
108
+ Core development, generated applications, the site and the tutorial now use an
109
+ application-root override scoped to the Express dependency subtree:
110
+ `{ "express": { "qs": "6.16.0" } }`. Their checked locks and the fresh packed-client
111
+ consumer audit report zero known vulnerabilities. Actual Express and body-parser
112
+ both resolve the patched qs version. The generator reuses the root policy rather
113
+ than maintaining a separate starter copy.
114
+
115
+ The override does not upgrade Express or affect unrelated dependency subtrees.
116
+ It also does **not** propagate from Redweb when another application installs it:
117
+ existing consumers must apply the documented root policy and verify their own
118
+ locks/tests. See [release trust](RELEASE_TRUST.md#temporary-express-4-dependency-mitigation)
119
+ for the maintainer advisories and npm's override rules. Ordinary installs without
120
+ the policy can remain affected until upstream dependency ranges are patched.
@@ -0,0 +1,85 @@
1
+ # Socket-bound TSX verification
2
+
3
+ Development verification on 2026-09-02, Windows, Node 22.21.0, headed Chrome 152.
4
+ This records feature acceptance, not an npm release or full-repository certification.
5
+
6
+ ## Implementation and review
7
+
8
+ Core/client branch: `codex/socket-page-actions`. Site branch:
9
+ `codex/server-tsx-tutorial` in the sibling landing-page checkout.
10
+
11
+ - Typed handler references and `.with(payload)` reuse contract validation, page
12
+ ownership, reactive rendering and the existing redweb-client runtime.
13
+ - The tutorial has no application browser module or bundling step. Its private
14
+ page, game rules, commands, room fan-out and seat recovery live on the server.
15
+ - Independent critic reviews covered core/client and the actual tutorial. Fixed
16
+ findings included attachment ordering, post-validation disconnect authorization,
17
+ duplicate-connection policy, intermediate reply correlation, obsolete render
18
+ cancellation and rejected forms incorrectly reporting success. Final review
19
+ reported no remaining blocking findings within that scope.
20
+
21
+ ## Passing gates
22
+
23
+ - 294 tests / 27 suites passed in the rendering regression selection below.
24
+ Every module in `src/htmx/*.js`, plus `BaseHandler`, `SocketContract`,
25
+ `SocketAction` and `HandlerGuard`, reached 100% statements, branches, functions
26
+ and lines. The changed explicit-false dispatch in `SocketRoute` is exercised by
27
+ real-network tests; this measurement does not claim all of `SocketRoute` or the
28
+ whole repository is covered by this selection.
29
+ - Client `npm test` passed linkage, build, declarations and the combined original
30
+ source gate: 800 statements, 543 branches, 125 functions and 667 lines, all 100%.
31
+ Report: `coverage/client-source/c819157b-6aaa-4020-99f4-152b8df473ed/summary.json`.
32
+ It runs plain and instrumented Node tests and headed Chrome on real HTTP/WS.
33
+ The existing instrumentation does not count every optional-chain/V8 branch.
34
+ - Core pretest checked canonical example output, protocol declarations, all
35
+ TypeScript configurations and 69 generated unreleased documentation pages.
36
+ The standalone contract entry also bundled for browsers without Node builtins.
37
+ - Site build and real HTTP verification passed: 438 pages, 11 examples, 30 API
38
+ articles, downloads and internal links. The seven-module documentation coverage
39
+ scope remains 100% lines, branches and functions.
40
+ - The actual tutorial archive was extracted to a fresh temporary directory,
41
+ installed with both explicitly packed development candidates (no links),
42
+ compiled, typechecked and tested with real HTTP, WebSockets and SQLite. Its
43
+ game-rule and message-schema modules remain all-four 100%; this is not a
44
+ whole-tutorial/authentication coverage claim.
45
+ - Headed Chrome passed both linked and extracted-package tutorial acceptance:
46
+ hello world, two-tab server counter, wrong/right login, two-player game,
47
+ third-player full-room rejection with retained input and reusable connection,
48
+ reconnect without move replay, disconnect presence, win and logout. Actual
49
+ outgoing game connections use `/match`; game commands are `join` and `move`.
50
+ - Headed static-site navigation passed both minimal homepage examples, six
51
+ highlighted chapters, next links and the project download.
52
+
53
+ New integration tests use actual transports, not mocks. Pure failure-boundary
54
+ units supplement them. No soak or long fixed-window workload was run.
55
+
56
+ ### Reproduce the scoped core coverage gate
57
+
58
+ ```sh
59
+ node node_modules/jest/bin/jest.js tests/htmx tests/ws tests/unit/socket-action.unit.test.js tests/unit/page-access.unit.test.js tests/unit/socket-contract.unit.test.js tests/unit/utilities.unit.test.js tests/unit/action-input.unit.test.js tests/unit/inspection.unit.test.js tests/unit/development-refresh.unit.test.js tests/unit/development-refresh-boundaries.unit.test.js tests/unit/development-refresh-cleanup.unit.test.js tests/unit/define-app.unit.test.js tests/integration/define-app.integration.test.js tests/integration/socket-page.integration.test.js tests/integration/socket-contract.integration.test.js tests/integration/live-html.integration.test.js tests/integration/page-access.integration.test.js tests/integration/action-input.integration.test.js tests/integration/inspection.integration.test.js --runInBand --silent --coverage --collectCoverageFrom=src/htmx/*.js --collectCoverageFrom=src/ws/BaseHandler.js --collectCoverageFrom=src/ws/SocketContract.js --collectCoverageFrom=src/ws/SocketAction.js --collectCoverageFrom=src/ws/HandlerGuard.js --coverageDirectory=coverage/socket-page-regression
60
+ ```
61
+
62
+ The site README documents the two candidate-tarball environment variables for
63
+ `npm test`. That gate includes headed browser acceptance inside the extracted
64
+ archive; Chrome and the tutorial's Node version are required.
65
+
66
+ ## Release boundaries and outstanding dependency audit
67
+
68
+ The follow-up [release preparation](SOCKET_PAGE_RELEASE_PREPARATION.md) prepares
69
+ client 0.3.0 and records the tested application-root qs mitigation. The initial
70
+ observations below remain historical; they do not override that later status.
71
+
72
+ The old published versions (Redweb 0.14.0/client 0.2.0) do not contain these APIs.
73
+ Local tarballs retaining those development metadata versions were verification
74
+ inputs, not artifacts to publish over existing releases. Release a new client,
75
+ align and release Redweb, then update the site's tutorial pins/lockfile and
76
+ catalogue before manual deployment. Existing immutable release snapshots were
77
+ not rewritten. Nothing was published or deployed during this task.
78
+
79
+ An additional `npm audit --omit=dev` check reports four moderate dependency-tree
80
+ entries in the existing site/tutorial locks, rooted in two `qs` advisories:
81
+ [bracket-key parsing](https://github.com/advisories/GHSA-x5fp-wj9c-mxmx) and
82
+ [attacker-controlled isBuffer](https://github.com/advisories/GHSA-4mjr-xmp4-gh2g).
83
+ The installed Express 4 dependency range does not select the published qs 6.16.0
84
+ fix. This feature work does not waive that audit or silently force an Express 5
85
+ migration. Resolve and verify the dependency policy before production release.
@@ -1,5 +1,14 @@
1
1
  # Lifecycle coverage must measure actual code
2
2
 
3
+ > Historical report, superseded by the `defineApp` migration. The generated
4
+ > `run-app` helper and `verify-starter-lifecycle.js` described below have been
5
+ > removed. The current `verify:starters:lifecycle:coverage` gate measures the
6
+ > shared `Application` and `StartupCleanup` implementation, while
7
+ > `verify:starters:source-coverage` measures all six original TypeScript starters.
8
+ > Generated applications also run real child-process lifecycle tests. The
9
+ > observations and paths below are retained as historical evidence, not current
10
+ > commands or release results.
11
+
3
12
  The lifecycle gate previously trusted c8's exit code. A real command with all four
4
13
  100% thresholds and an empty source match exits successfully with `{}` coverage:
5
14
  c8 compares a nonnumeric empty-map percentage against the thresholds.